The Spanish version is the authoritative reference. View in Spanish
POST /v1/oauth/token
Obtains a short-lived access_token from the organization's OAuth 2.0 credential pair in Docupath. The token is required for every other API endpoint.
Endpoint
https://api.docupathdev.app/v1/oauth/tokenhttps://api.docupath.app/v1/oauth/tokenMethod: POST
Credential generation
Credentials are obtained from the Docupath portal:
- Go to Settings → Destination Format & APIs
- Click "Generate API Credentials"
- Enter a descriptive name (e.g.
Gosocket-PRD) - Immediately copy the Client ID and the Client Secret — the Secret is shown only once
- Store them in a secrets manager (never in plain text or source code)
If the Client Secret is lost, the pair must be deleted and regenerated from scratch. There is no recovery mechanism.
Credentials are environment-specific. Ones generated in DEV don't work in PRD and vice versa.
Input parameters
| Field | Value |
|---|---|
Header Content-Type | application/x-www-form-urlencoded |
Header Authorization | Basic {base64(client_id:client_secret)} |
Body grant_type | client_credentials |
Building the Basic Auth header: Base64-encode the string client_id:client_secret (separated by a colon).
POST {base_url}/v1/oauth/token
Content-Type: application/x-www-form-urlencoded
Authorization: Basic <base64(CLIENT_ID:CLIENT_SECRET)>
grant_type=client_credentialsResponse fields
| Field | Description |
|---|---|
access_token | JWT to include on every subsequent request as Authorization: Bearer {access_token} |
token_type | Always "Bearer" |
expires_in | Duration in seconds (usually 3600 = 1 hour) |
refresh_token | Token to renew the access_token without re-authenticating |
Token renewal
When the access_token expires, it can be renewed with the refresh_token without re-authenticating with the Client ID and Secret:
POST {base_url}/v1/oauth/token
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {base64(client_id:client_secret)}
grant_type=refresh_token&refresh_token={saved_refresh_token}
Implement automatic renewal before the token expires to guarantee flow continuity.