Client Credentials Flow

How to use the client credentials flow with your OAuth application

The client credentials flow requires a client_id and client_secret issued to you by Carta. The client credentials flow provides access to data about your company and does not require explicit permission from a Carta user prior to accessing that data.

  1. Your app submits your client_id and client_secret to Carta's /access_token/ endpoint
  2. Carta returns an OAuth access token
  3. Your app uses the token to access Carta's data endpoints

 

1. Request an OAuth token

Your application makes a backend request for an official OAuth token. Calling this endpoint will return the OAuth token:

POST https://login.app.carta.com/o/access_token/

Request Headers

Header NameValue
AuthorizationRequired. String containing the text "Basic {BASE64_ENCODED_CLIENT_INFO}" where {BASE64_ENCODED_CLIENT_INFO} is the string "{client_id}:{client_secret}" base64-encoded.
Content-TypeRequired. String containing the text "application/x-www-form-urlencoded"

Request Body

ParameterTypeDescription
scopestringRequired. Scopes delimited with a space (" ").
grant_typestringRequired. String containing the text "CLIENT_CREDENTIALS".

Response

{
  "access_token" : {ACCESS TOKEN},
  "expires_in" : {Lifetime in seconds},
  "scope": {SCOPES REQUESTED},
  "token_type" : 'Bearer',
}

Response Body

ParameterTypeDescription
access_tokenstringToken you use to make requests.
expires_instringSeconds until access_token expires.
scopestringScopes, delimited with a space (" ").
token_typestringString containing the text "Bearer".

 

2. Use the access token to access the API

The access token allows you to make a request to the API and is valid for one hour. Important: Never store the access token within a user-agent (e.g., do not store it in a cookie).

Authorization: Bearer <ACCESS TOKEN>
GET https://api.carta.com/<api>

 

Revoke Token Flow

The revoke token flow lets you revoke an active access token.

Make a request to revoke a token

POST https://login.app.carta.com/o/revoke_token/

Headers

Header NameValue
AuthorizationRequired. String containing the text "Basic {BASE64_ENCODED_CLIENT_INFO}" where {BASE64_ENCODED_CLIENT_INFO} is the string "{client_id}:{client_secret}" base64-encoded.
Content-TypeRequired. String containing the text "application/x-www-form-urlencoded"

Request Body

ParameterTypeDescription
tokenstringRequired. The token you want to revoke.
token_type_hintstringRequired. String containing the text "access_token"