Revoke a sign-in
On develop, not live yet. This route is merged on the platform’s develop branch and is not on production. Until it ships, calls to it from outside Syntic will not reach the revoke handler.
POST https://app.syntic.ai/oauth/revokePOST https://app.syntic.ai/api/oauth/revoke is an alias and behaves the same way.
Ends a Sign in with Syntic session when the person signs out of Syntic Code, Desktop or Mobile. It follows RFC 7009 (OAuth 2.0 Token Revocation). You send the refresh token; the server ends the whole session it belongs to, so every refresh token from that sign-in stops working and access tokens minted from it are refused.
No Authorization header is needed. Registered apps are public clients, so the request is identified by client_id alone.
Body
Send the body as application/x-www-form-urlencoded (the RFC 7009 form) or as JSON. Any content type other than form-encoded is read as JSON. Bodies over 16 KB are refused.
| Field | Type | Required | Notes |
|---|---|---|---|
token | string | Yes | The refresh token to revoke. 1 to 4,096 characters. |
client_id | string | Yes | The registered app id, for example syntic-code-cli, syntic-desktop or syntic-mobile. |
token_type_hint | string | No | refresh_token or access_token. Only refresh tokens can be revoked here; see unsupported_token_type below. |
Response
200 OK:
{ "revoked": true }You get this same answer whether the token was active, already revoked, never existed, or was issued to a different app. In the last case nothing is changed: a token is only revoked when the client_id in the request matches the app it was issued to. Because the answer never changes, the endpoint cannot be used to find out whether a token exists.
Every response carries Cache-Control: no-store and Pragma: no-cache.
Errors
Errors are a flat JSON object such as {"error": "invalid_client"}.
| Status | error | When | Retry? |
|---|---|---|---|
| 400 | invalid_request | token is missing, empty or longer than 4,096 characters; the body is not valid JSON or form data; or it is over 16 KB. | No. Fix the request. |
| 400 | unsupported_token_type | token_type_hint is access_token and the value is not a known refresh token. Access tokens end with their session; revoke the refresh token instead. | No. |
| 401 | invalid_client | No client_id was sent, or it names an app Syntic has not registered. | No. |
| 405 | method_not_allowed | The method was not POST. The Allow header lists POST, OPTIONS. | No. |
| 503 | temporarily_unavailable | The session store could not be reached. | Yes, with back-off. |
| 500 | server_misconfigured | The server is missing its configuration. | Yes, later. |
Whatever the outcome, delete the stored access and refresh tokens on the device. A failed revoke must never leave the person signed in locally.
Examples
# Form-encoded (RFC 7009)
curl -sS -X POST https://app.syntic.ai/oauth/revoke \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "token=$SYNTIC_REFRESH_TOKEN" \
--data-urlencode "client_id=syntic-code-cli" \
--data-urlencode "token_type_hint=refresh_token"
# The same call as JSON
curl -sS -X POST https://app.syntic.ai/oauth/revoke \
-H "Content-Type: application/json" \
-d "{\"token\": \"$SYNTIC_REFRESH_TOKEN\", \"client_id\": \"syntic-code-cli\", \"token_type_hint\": \"refresh_token\"}"