Authentication and Application tokens
This document explains how to authenticate DocStudio API requests with application and temporary authorization tokens.
Choose a token type
Application token
Server-side integrations, backend services, automation, and long-running API access
Temporary authorization token
Testing, short-lived sessions, or requests that use user credentials
Authentication header
Use the same header format for both token types.
Authorization: Bearer {token}The token identifies the caller. Endpoint permissions still control access to a mailbox, account, envelope, template, dictionary, domain, or attachment.
Manage application tokens
Use application tokens without sending a user password in every request. Store them only in secure server-side storage.
Do not expose token values in client-side code, mobile applications, repositories, logs, screenshots, tickets, shared documents, or frontend environment variables.
Application token endpoints return an application token object.
List application tokens
GET
/api/v1/token
Response
Returns an array of application token objects.
Create application token
POST
/api/v1/token
Request body
name
string
Yes
Application token name
expireAt
date-time
Yes
Token expiration date and time
Response
Returns an application token object. Copy and store the returned token value securely.
Revoke application token
DELETE
/api/v1/token/{id}
Path parameters
id
UUID
Yes
Application token ID
Response
Returns 200 OK.
Configuration restriction
Application token methods can be disabled by configuration. The API then returns 405 Method disabled by configuration.
code
integer
Error code
message
string
Error message
messageLocalized
string
Localized error message
messageArgs
array
Dynamic arguments used to build the message
data
any
Additional error data
Temporary authorization tokens
Use /api/login to get a temporary authorization token with user credentials. The token expires after 3 hours.
Use application tokens for long-running integrations.
POST
/api/login
Request body
login
string
Yes
User login
password
string
Yes
User password
Response
token
string
Temporary authorization token
deviceId
string
Device ID returned with the login response
Use the returned token value in the Authorization header.
Resolve authentication and access errors
401 Not authorized
The request is not authenticated
Check the header, token value, and token expiration
403 Forbidden
The token cannot access the resource or action
Check access to the required account, mailbox, or requested object
90035 Not a token owner
The current user cannot access the application token
Use a token from the correct user and account
Checklist
Confirm that the
Authorizationheader uses theBearer {token}format.Confirm that the token value is valid and has not expired.
Confirm that the token and requested resource use the expected account and mailbox.
How to respond to an exposed token
Stop using the exposed token.
Create a new token and update the integration.
Revoke the exposed token and remove it from unsafe locations.
Related topics
Last updated
Was this helpful?
