POST/rest/auth/refreshCreates a new access token from a refresh token
Exchanges a refresh token for a fresh access token, so a long-running integration never has to send the user back through the authorize screen.
grant_type must be refresh_token. A token that has expired, been revoked or is unknown answers 401 — restart the authorization-code flow from the beginning.
client_id and client_secret are verified: a refresh token alone is not sufficient. A deleted or disabled application is refused.
Request body (required)
application/json · RefreshTokenRequest
| Field | Type | | Description |
|---|
client_id | string | required | Your application's client id. |
client_secret | string | required | Your application's client secret. Never expose it in a browser or mobile client. |
grant_type | string | optional | OAuth2 grant type. Must be refresh_token for this endpoint. Default: "refresh_token" |
refresh_token | string | required | The refresh token previously issued by POST /rest/auth/token. |
Responses
Example request
curl -s -X POST "https://dev-api.sheetgo.com/rest/auth/refresh" \
-H "Authorization: Bearer $SHEETGO_API_KEY" \
-H "Content-Type: application/json" \
-d @body.json
Latest version: https://dev-api.sheetgo.com/rest/reference/auth#post-rest-auth-refresh
POST/rest/auth/tokenExchange authentication code for a access token and a refresh token
Second leg of the OAuth2 authorization-code flow: trades the one-time code your redirect URI received for an access token and a refresh token.
The body is form-encoded (application/x-www-form-urlencoded), not JSON. grant_type must be authorization_code, and redirect_uri must match the one used to obtain the code.
Codes are single-use and short-lived. Bad credentials, a reused code or a mismatched redirect URI all answer 401.
Request body (required)
application/x-www-form-urlencoded · Body_auth_token_rest_auth_token_post
| Field | Type | | Description |
|---|
client_id | string | required | Your application's client id. |
client_secret | string | required | Your application's client secret. Never expose it in a browser or mobile client. |
code | string | required | The single-use authorization code returned to your redirect URI by the authorize step. |
grant_type | string | required | OAuth2 grant type. Must be authorization_code. |
redirect_uri | string | required | The same redirect URI that was used to obtain code. It must match your application's registered URI exactly. |
Responses
Example request
curl -s -X POST "https://dev-api.sheetgo.com/rest/auth/token" \
-H "Authorization: Bearer $SHEETGO_API_KEY" \
--data-urlencode "FIELD=VALUE"
Latest version: https://dev-api.sheetgo.com/rest/reference/auth#post-rest-auth-token