Auth tokens

Create Auth Token

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

POST
/auth-tokens.create
AuthorizationBearer <token>

All the DevRev APIs require a token to authenticate the user. Provide Authorization: Bearer <TOKEN> as a header to every API request. How do I find my token?

In: header

act_as?string

The unique ID of the Dev user or the service account to impersonate.

Formatid
aud?array<string>

The expected audience values with respect to the token.

client_id?string

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.

Formattext
expires_in?integer

The expected validity lifetime of the token in number of days. In practice, the value should be based on the usage of the token.

Range0 <= value <= 4294967295
grant_type?auth-token-grant-type

Specifies the process of obtaining a token.

Value in"urn:devrev:params:oauth:grant-type:token-issue" | "urn:ietf:params:oauth:grant-type:token-exchange"
requested_token_type?auth-token-requested-token-type

The type of the requested token.

Value in"urn:devrev:params:oauth:token-type:aat" | "urn:devrev:params:oauth:token-type:aat:act-as" | "urn:devrev:params:oauth:token-type:aat:public" | "urn:devrev:params:oauth:token-type:dev" | "urn:devrev:params:oauth:token-type:dev:connect" | "urn:devrev:params:oauth:token-type:gat" | "urn:devrev:params:oauth:token-type:pat" | "urn:devrev:params:oauth:token-type:pat:act-as" | "urn:devrev:params:oauth:token-type:rat" | "urn:devrev:params:oauth:token-type:rev" | "urn:devrev:params:oauth:token-type:session" | "urn:devrev:params:oauth:token-type:session:dev0" | "urn:devrev:params:oauth:token-type:session:onetime" | "urn:devrev:params:oauth:token-type:session:rev:act-as" | "urn:devrev:params:oauth:token-type:super" | "urn:devrev:params:oauth:token-type:sys" | "urn:ietf:params:oauth:token-type:jwt"
rev_info?auth-tokens-rev-info

Carries info corresponding to the Rev user to be provisioned and/or issue a Rev session token.

scope?string

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.

Formattext
subject_token?string

Represents the entity that requests the token. Not required when requesting an application access token (AAT).

Formattext
subject_token_type?auth-token-subject-token-type

The type of the subject token.

Value in"urn:devrev:params:oauth:token-type:jwt:auth0" | "urn:devrev:params:oauth:token-type:jwt:dev" | "urn:devrev:params:oauth:token-type:rat" | "urn:devrev:params:oauth:token-type:rev" | "urn:devrev:params:oauth:token-type:revinfo" | "urn:devrev:params:oauth:token-type:session" | "urn:devrev:params:oauth:token-type:sysu" | "urn:devrev:params:oauth:token-type:userinfo" | "urn:ietf:params:oauth:token-type:jwt"
token_hint?string

A hint that identifies the token.

Formattext

Response Body

curl -X POST "https://api.devrev.ai/auth-tokens.create" \  -H "Content-Type: application/json" \  -d '{}'
{
  "access_token": "string",
  "client_id": "string",
  "expires_in": 0,
  "refresh_token": "string",
  "scope": "string",
  "token_type": "bearer"
}
{
  "detail": "string",
  "message": "string",
  "type": "artifact_already_attached_to_a_parent",
  "existing_parent": "string",
  "is_same": true
}
{
  "detail": "string",
  "message": "string",
  "type": "unauthenticated"
}
{
  "detail": "string",
  "message": "string",
  "type": "forbidden"
}
{
  "detail": "string",
  "message": "string",
  "type": "conflict"
}
{
  "detail": "string",
  "message": "string",
  "type": "too_many_requests",
  "retry_after": 0
}
{
  "detail": "string",
  "message": "string",
  "type": "internal_error",
  "reference_id": "string"
}
{
  "detail": "string",
  "message": "string",
  "type": "service_unavailable"
}