A code or a refresh token for an access token
const url = 'https://beta-api.plune.ai/oauth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ grant_type: 'authorization_code', client_id: 'example', resource: 'example', code: 'example', redirect_uri: 'example', code_verifier: 'example', refresh_token: 'example' })};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/oauth/token \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data grant_type=authorization_code \ --data client_id=example \ --data resource=example \ --data code=example \ --data redirect_uri=example \ --data code_verifier=example \ --data refresh_token=exampleForm-encoded. grant_type=authorization_code with code, client_id, redirect_uri, code_verifier and resource; grant_type=refresh_token with refresh_token, client_id and resource. A code works once and for 60 seconds; the access token lives an hour and is good for the MCP endpoint only (/v1 does not take it); each refresh issues a new refresh token and ends the one presented. A code or a refresh token presented a second time revokes the connection. A connection nobody used for 90 days cannot be refreshed. Every such refusal is invalid_grant. Sent with Cache-Control: no-store. 300 requests in 15 minutes from one client address. Mounted only where the remote MCP server is switched on (MCP_PUBLIC_URL); elsewhere 404.
Request Body required
Section titled “Request Body required ”object
Responses
Section titled “ Responses ”The pair
object
Example
{ "access_token": "plune_oat_EXAMPLE", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "plune_ort_EXAMPLE", "scope": "read"}invalid_grant or unsupported_grant_type
object
Example
{ "error": "invalid_grant"}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over