Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant

POST /v1/token

Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant

application/x-www-form-urlencoded

Body

  • GrantType string Required

    Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token.

  • ClientId string Required

    A 34 character string that uniquely identifies this OAuth App.

  • ClientSecret string

    The credential for confidential OAuth App.

  • Code string

    JWT token related to the authorization code grant type.

  • RedirectUri string

    The redirect uri

  • Audience string

    The targeted audience uri

  • RefreshToken string

    JWT token related to refresh access token.

  • Scope string

    The scope of token

Responses

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • access_token string | null

      Token which carries the necessary information to access a Twilio resource directly.

    • refresh_token string | null

      Token which carries the information necessary to get a new access token.

    • id_token string | null

      Token which carries the information necessary of user profile.

    • token_type string | null

      Token type

    • expires_in integer(int64) | null
POST /v1/token
curl \
 --request POST 'https://oauth.twilio.com/v1/token' \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Code=&Scope=scope&Audience=&ClientId=OQ7cda1a615f05a95634e643aaaf7081d7&GrantType=client_credentials&RedirectUri=&ClientSecret=sUWblrQ4wx_aYkdAWjHXNvHinynkYOgBoiRyEQUeEntpgDEG47qnBFD98yoEzsTh&RefreshToken=refresh_token'
Request example
{"Code"=>"", "Scope"=>"scope", "Audience"=>"", "ClientId"=>"OQ7cda1a615f05a95634e643aaaf7081d7", "GrantType"=>"client_credentials", "RedirectUri"=>"", "ClientSecret"=>"sUWblrQ4wx_aYkdAWjHXNvHinynkYOgBoiRyEQUeEntpgDEG47qnBFD98yoEzsTh", "RefreshToken"=>"refresh_token"}
Response examples (201)
{
  "id_token": "eyJhbdGciOiIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "expires_in": 1438315200000,
  "token_type": "bearer",
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "refresh_token": "ghjbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}