Exchange a single-use code for MCP access
POST /oauth/token
Public-client form request with S256 verifier and exact redirect/resource. Returns a qm. MCP-only token, never a workspace API credential. Expires within one hour or remaining session lifetime, whichever is earlier. No refresh token. Replaying a code revokes its grant.
Authentication
No authenticated session is required by this operation. Origin checks and request limits still apply.
[]
Parameters
[]
Request body
{
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"client_id": {
"type": "string"
},
"grant_type": {
"const": "authorization_code"
},
"code": {
"type": "string"
},
"code_verifier": {
"type": "string",
"minLength": 43,
"maxLength": 128
},
"redirect_uri": {
"type": "string"
},
"resource": {
"const": "https://qscan.dev/mcp"
}
},
"required": [
"client_id",
"grant_type",
"code",
"code_verifier",
"redirect_uri",
"resource"
]
}
}
}
}
Responses
{
"200": {
"description": "MCP-only bearer",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"token_type": {
"const": "Bearer"
},
"expires_in": {
"type": "integer"
},
"scope": {
"const": "mcp:tools"
}
},
"required": [
"access_token",
"token_type",
"expires_in",
"scope"
]
}
}
}
},
"400": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"401": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"403": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"413": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"415": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"429": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"503": {
"description": "OAuth error; tokens and request bodies must not be logged",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"error_description": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
}
}
References such as #/components/schemas/Asset resolve in shared schemas. Download the OpenAPI contract for client generation. This page is generated; it describes the implemented development API, not planned endpoints.