Skip to main content
Deepgram's Docs

Search documentation

Type to search this documentation.

Token-based Authentication

POST/v1/auth/grantToken-based Authentication

Generates a temporary JSON Web Token (JWT) with a 30-second (by default) TTL and usage::write permission for core voice APIs, requiring an API key with Member or higher authorization. Tokens created with this endpoint will not work with the Manage APIs.

Request body

Time to live settings

application/json
objectGrantV1Request

GrantV1Request

ttl_secondsnumber · double

Time to live in seconds for the token. Defaults to 30 seconds.

maximum 3600 · minimum 1

Example request
{
  "ttl_seconds": 0
}

Responses

200Grant responseapplication/json
objectGrantV1Response

GrantV1Response

access_tokenstringrequired

JSON Web Token (JWT)

expires_innumber · double

Time in seconds until the JWT expires

Example response
{
  "access_token": "",
  "expires_in": 0
}
400Invalid Requestapplication/json
valueErrorResponse

ErrorResponse

oneOf · 3 options
Option 1stringErrorResponseTextError

ErrorResponseTextError

Option 2objectErrorResponseLegacyError

ErrorResponseLegacyError

err_codestring

The error code

err_msgstring

The error message

request_idstring

The request ID

Option 3objectErrorResponseModernError

ErrorResponseModernError

categorystring

The category of the error

detailsstring

A description of the error

messagestring

A message about the error

request_idstring

The unique identifier of the request

Example response
{
  "err_code": "string",
  "err_msg": "string",
  "request_id": "string"
}
Documentation menu