Pular para o conteúdo principal
POST
/
oauth
/
v1
/
token
Refresh an access token
curl --request POST \
  --url https://api.hubapi.com/oauth/v1/token \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'client_id=<string>' \
  --data 'client_secret=<string>' \
  --data 'code=<string>' \
  --data 'code_verifier=<string>' \
  --data grant_type=authorization_code \
  --data 'redirect_uri=<string>' \
  --data 'refresh_token=<string>' \
  --data 'scope=<string>'
{
  "accessToken": "<string>",
  "expiresIn": 123,
  "hubId": 123,
  "idToken": "<string>",
  "scopes": [
    "<string>"
  ],
  "tokenType": "<string>",
  "userId": 123
}
Produtos suportados
Requer um dos seguintes produtos ou superior.
Marketing HubMarketing HubGrátis
Sales HubSales HubGrátis
Service HubService HubGrátis
Content HubContent HubGrátis

Query Parameters

client_secret
string

A confidential credential known only to the application and the authorization server, used to authenticate the client's identity when making token requests.

refresh_token
string

A long-lived credential issued alongside an access token that can be exchanged for a new access token alongside client credentials when the current access_token expires, allowing continued API access without requiring the user to re-authenticate.

Body

application/x-www-form-urlencoded
client_id
string
client_secret
string
code
string
code_verifier
string
grant_type
enum<string>
Opções disponíveis:
authorization_code,
client_credentials,
refresh_token
redirect_uri
string
refresh_token
string
scope
string

Response

successful operation

accessToken
string

The access token used for authentication in API requests.

expiresIn
integer<int64>

The duration in seconds for which the access token is valid.

hubId
integer<int32>

The ID of the HubSpot account associated with the token.

idToken
string

The ID token that contains identity claims about the user.

scopes
string[]
tokenType
string

The type of token, typically indicating the authentication scheme. Typically bearer.

userId
integer<int32>

The ID of the hubspot user for whom the token was created.

Last modified on August 31, 2025