API reference
OAuth 2.0
OAuth 2.0 authorization server endpoints (authorize, token, revoke, introspect, userinfo).
Token endpoint
/oauth/tokenExchanges an authorization grant for tokens. Supported `grant_type` values: - `authorization_code` (with `code`, `redirect_uri`, and `code_verifier` for PKCE) - `refresh_token` (with `refresh_token`; rotates the refresh token) - `client_credentials` (server-to-server; returns an access token only) Client authentication: HTTP Basic (`client_id`:`client_secret`) or form body `client_id`/`client_secret`.
Request bodyrequired
grant_typestringrequiredOne of
authorization_coderefresh_tokenclient_credentialscodestringauthorization_code grant.
redirect_uristring (uri)code_verifierstringPKCE verifier for the authorization_code grant.
refresh_tokenstringrefresh_token grant.
scopestringclient_credentials / down-scoping.
client_idstringclient_secretstring
Response 200Tokens issued.
access_tokenstringtoken_typestringexpires_inintegerscopestringrefresh_tokenstring
Errors
400OAuth error (invalid_request, invalid_grant, unsupported_grant_type, invalid_scope).401Client authentication failed (invalid_client).
curl -X POST "https://api.inaiy.com/oauth/token" \
-H "x-tenant-id: demo" \
-H "x-api-key: wp_live_xxxxxxxxxxxxxxxxxxxx"{
"grant_type": "authorization_code",
"code": "wp_ac_9f8e7d6c...",
"redirect_uri": "https://app.example.com/callback",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
"refresh_token": "wp_rt_k1l2m3n4...",
"scope": "contacts.read messages.write",
"client_id": "wp_client_a1b2c3d4",
"client_secret": "wp_secret_..."
}{
"access_token": "wp_at_a1b2c3d4e5f6g7h8i9j0...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "contacts.read messages.write",
"refresh_token": "wp_rt_k1l2m3n4o5p6q7r8s9t0..."
}Revocation endpoint (RFC 7009)
/oauth/revokeRevokes an access or refresh token. Always returns 200 even if the token was already invalid.
Request bodyrequired
tokenstringrequiredtoken_type_hintstringOne of
access_tokenrefresh_tokenclient_idstringclient_secretstring
curl -X POST "https://api.inaiy.com/oauth/revoke" \
-H "x-tenant-id: demo" \
-H "x-api-key: wp_live_xxxxxxxxxxxxxxxxxxxx"{
"token": "wp_at_a1b2c3d4...",
"token_type_hint": "access_token",
"client_id": "wp_client_a1b2c3d4",
"client_secret": "wp_secret_..."
}Introspection endpoint (RFC 7662)
/oauth/introspectReturns the active state and metadata for an access or refresh token. Requires client authentication.
Request bodyrequired
tokenstringrequiredtoken_type_hintstringOne of
access_tokenrefresh_tokenclient_idstringclient_secretstring
Response 200Introspection result.
activebooleanscopestringclient_idstringtoken_typestringexpintegeriatintegersubstring | nullinaiy_token_usestring
curl -X POST "https://api.inaiy.com/oauth/introspect" \
-H "x-tenant-id: demo" \
-H "x-api-key: wp_live_xxxxxxxxxxxxxxxxxxxx"{
"token": "wp_at_a1b2c3d4...",
"token_type_hint": "access_token",
"client_id": "wp_client_a1b2c3d4",
"client_secret": "wp_secret_..."
}{
"active": true,
"scope": "contacts.read messages.write",
"client_id": "wp_client_a1b2c3d4",
"token_type": "Bearer",
"exp": 1752316205,
"iat": 1752312605,
"sub": "6650a1b2c3d4e5f6a7b8c9d0",
"inaiy_token_use": "access"
}UserInfo endpoint
/oauth/userinfoReturns profile claims for the resource owner associated with the access token. Requires a valid `Authorization: Bearer` access token.
Response 200UserInfo claims.
substringscopestringclient_idstring
curl -X GET "https://api.inaiy.com/oauth/userinfo" \
-H "x-tenant-id: demo" \
-H "x-api-key: wp_live_xxxxxxxxxxxxxxxxxxxx"{
"sub": "6650a1b2c3d4e5f6a7b8c9d0",
"scope": "contacts.read messages.write",
"client_id": "wp_client_a1b2c3d4"
}