Creating a Token
Sign In
Sign in to your Raydocs account at raydocs.com.
Create New Token
Click Create new token and enter a descriptive name (e.g.,
“Production Integration”).
Abilities
Abilities control what operations a token can perform:| Ability | Grants |
|---|---|
workspaces-read | List workspaces |
workspaces-write | Create, update or delete workspaces |
workspace-users-read | List members and invites |
workspace-users-write | Manage members and invites |
templates-read | List and view extraction templates |
templates-write | Create, update, or delete templates |
sessions-read | List sessions, documents, and results |
sessions-write | Create sessions, upload documents, run extractions |
Using the Token
Send the token in theAuthorization header with every API request:
Example
Revoking a Token
If a token is leaked or no longer needed:
Any API requests using a revoked token will receive
401 Unauthorized.
Best Practices
Secure Storage
Secure Storage
Store tokens in environment variables, secret managers (AWS Secrets
Manager, HashiCorp Vault), or CI/CD secrets. Never hardcode tokens in
source code.
bash # Good: Environment variable export RAYDOCS_API_TOKEN="rd_live_abc123..." # In your code token = os.environ.get("RAYDOCS_API_TOKEN") One Token Per Integration
One Token Per Integration
Create a dedicated token for each integration or service. This makes it
easy to revoke access for a single integration without affecting others.
Avoid Version Control
Avoid Version Control
Never commit tokens to Git or other version control systems. Add token
files to
.gitignore and use secret scanning tools. gitignore # .gitignore .env .env.local secrets.json Regular Rotation
Regular Rotation
Rotate tokens periodically, especially for production integrations.
Create a new token, update your integration, then revoke the old token.
Minimal Scope
Minimal Scope
Only grant the abilities your integration actually needs. A read-only
dashboard integration shouldn’t have write permissions.
Troubleshooting
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
Possible causes: - Token lacks required ability for the endpoint -
Attempting to access a resource in another workspace Solution: Check
that your token has the necessary abilities for the operation you’re
attempting.
