OpenAPI 3.1.02026-08-203914235.9 MB
6a23760847c8
Users
Authorize an App
Completes the OAuth authorization step for the authenticated user: records their consent for the scopes an app asked for and mints the authorization code to hand back to it. Returns the grant, plus a redirect_url carrying that code — the one and only time it is returned. Exchange the code at POST /oauth/token with the verifier for code_challenge. Requires a user session, because consent has to come from the account holder: an API key or an OAuth token is refused, so an app can never authorize itself. Send an Idempotency-Key to make a retry safe — a replay returns the original redirect_url and its code rather than issuing a second one.
post/users/me/oauth_grants
Headers
Idempotency-Keystring
Example:d9105228-4a08-46b1-8b91-42fed586d383
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
Example request
{
"account_id": "biz_xxxxxxxxxxxxxx",
"client_id": "app_xxxxxxxxxxxxxx",
"code_challenge": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"code_challenge_method": "S256",
"consent_shown": true,
"nonce": "n-0S6_WzA2Mj",
"redirect_uri": "https://Booking.Shinetime.example:8443/oauth/Callback/",
"requested_scopes": [
"profile"
],
"response_type": "code",
"state": "opaque-client-state"
}Response
the app is authorized
Example response
{
"account_id": "biz_xxxxxxxxxxxxxx",
"app_id": "app_xxxxxxxxxxxxxx",
"authorized_at": "2026-01-01T12:00:00.000Z",
"created_at": "2026-01-01T12:00:00.000Z",
"id": "oag_xxxxxxxxxxxxxx",
"redirect_url": "https://Booking.Shinetime.example:8443/oauth/Callback/",
"revoked_at": "2026-01-01T12:00:00.000Z",
"scopes": [
"email"
]
}