auth-tokens

Create

POST
Creates a JWT corresponding to the requested token type for the authenticated user.

Request

This endpoint expects an object.
act_as
stringOptional
The unique ID of the Dev user or the service account to impersonate.
aud
list of stringsOptional
The expected audience values with respect to the token.
client_id
stringOptional

An identifier that represents the application which is requesting the token. If no client_id is present in the request to generate an application access token (AAT), DevRev will generate a client_id. This client_id is only associated with an AAT.

expires_in
integerOptional
The expected validity lifetime of the token in number of days. In practice, the value should be based on the usage of the token.
grant_type
enumOptional
Specifies the process of obtaining a token.
Allowed values: urn:devrev:params:oauth:grant-type:token-issueurn:ietf:params:oauth:grant-type:token-exchange
requested_token_type
enumOptional
The type of the requested token.
rev_info
objectOptional
Carries info corresponding to the Rev user to be provisioned and/or issue a Rev session token.
scope
stringOptional
The requested set of scopes associated with the issued token. A space-delimited list of values in which the order of values does not matter.
subject_token
stringOptional
Represents the entity that requests the token. Not required when requesting an application access token (AAT).
subject_token_type
enumOptional
The type of the subject token.
token_hint
stringOptional
A hint that identifies the token.

Response

This endpoint returns an object
access_token
string
The issued JSON Web Token (JWT) corresponding to the requested token type.
expires_in
integer
The validity lifetime of the token specified in seconds since Unix epoch.
token_type
"bearer"
The type of the issued token. Bearer is the only supported token type.
client_id
stringOptional
An identifier that represents the application which is requesting the token. Only present in a response corresponding to an application access token (AAT).
refresh_token
stringOptional
A token to refresh the issued token.
scope
stringOptional
The scopes associated with the issued token. A space-delimited list of values in which the order of values does not matter.
POST
1curl -X POST https://api.devrev.ai/auth-tokens.create \
2 -H "Authorization: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{}'
Response
1{
2 "access_token": "access_token",
3 "expires_in": 1,
4 "token_type": "bearer",
5 "client_id": "client_id",
6 "refresh_token": "refresh_token",
7 "scope": "scope"
8}