Approve or deny an OAuth client
const url = 'https://example.com/api/v1/auth/oauth-clients/example:authorize';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"approved":true,"code_challenge":"example","code_challenge_method":"S256","redirect_uri":"example","resource":"example","roles":["example"],"state":"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://example.com/api/v1/auth/oauth-clients/example:authorize \ --header 'Content-Type: application/json' \ --data '{ "approved": true, "code_challenge": "example", "code_challenge_method": "S256", "redirect_uri": "example", "resource": "example", "roles": [ "example" ], "state": "example" }'Answers an OAuth client’s authorization request as you. Approved, it issues a one-time code (good for five minutes) the client exchanges for an agent token accepted on the MCP channel only and holding only the roles you chose, each one whose capabilities you hold (else 403); denied, it sends the client back with access_denied. Returns where to send the browser back to. Requires authentication; an agent token or an impersonated session cannot answer.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The client id, from the authorization request
The client id, from the authorization request
Request Bodyrequired
Section titled “ Request Bodyrequired ”object
A URL to the JSON Schema for this object.
Whether you approve the client; false sends it back with access_denied
The PKCE challenge from the authorization request
The PKCE method; S256 only
The redirect URI from the authorization request; one the client registered
The resource the token is for: this server’s MCP endpoint
The roles to approve; each must be one whose capabilities you hold. Required when approved
The client’s state, echoed back
Responses
Section titled “ Responses ”OK
object
A URL to the JSON Schema for this object.
Where to send the browser back to: the client’s redirect with a code, or with access_denied
Example
{ "$schema": "/api/v1/schemas/AuthorizeOAuthClientOutputBody.json"}Forbidden
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "$schema": "/api/v1/schemas/ErrorModel.json", "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}Not Found
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "$schema": "/api/v1/schemas/ErrorModel.json", "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}Unprocessable Entity
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "$schema": "/api/v1/schemas/ErrorModel.json", "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}Internal Server Error
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "$schema": "/api/v1/schemas/ErrorModel.json", "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}