Renew the confirmation code of an agent registration
Open to any caller holding the claim token; the org comes from the org query parameter.
POST/api/v1/auth/oauth2/agent/identity/claim
- Sign-in
- None at the router: the operation is public, or checks its own proof (a signature, a token in the body, a signed link).
- Rate limit
- Up to 500 requests every 3 seconds per IP address; up to 1,000 requests a minute per API key (some requests are not counted); up to 30 requests a minute per IP address.
Open to any caller holding the claim token; the org comes from the org query parameter. Starts a fresh confirmation attempt for the same email address and denies the previous code, so only the newest code can complete the registration. Answers 410 claim_expired for an expired or unknown claim token and 400 invalid_login_hint when the email is not the one the registration was made for.
Request
Send the body as application/json or application/x-www-form-urlencoded. The body is optional.
Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
claim_token | string or number or boolean or null | No | at most 4096 characters | - |
email | string or number or boolean or null | No | at most 4096 characters | - |
login_hint | string or number or boolean or null | No | at most 4096 characters | - |
Example request
Replace each YOUR_... value with your own.
curl -X POST "https://api.console.buildbase.app/api/v1/auth/oauth2/agent/identity/claim" \
-H "Content-Type: application/json" \
-d '{
"claim_token": "string",
"email": "[email protected]",
"login_hint": "string"
}'const response = await fetch(
'https://api.console.buildbase.app/api/v1/auth/oauth2/agent/identity/claim',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
claim_token: 'string',
email: '[email protected]',
login_hint: 'string',
}),
}
);
if (!response.ok) {
throw new Error(`${response.status}: ${await response.text()}`);
}
const data = await response.json();import requests
response = requests.post(
"https://api.console.buildbase.app/api/v1/auth/oauth2/agent/identity/claim",
json={
"claim_token": "string",
"email": "[email protected]",
"login_hint": "string",
},
timeout=30,
)
response.raise_for_status()
data = response.json()Responses
200 OK
OK
{
"claim_attempt": {
"expires_in": 600,
"interval": 5,
"user_code": "[REDACTED]",
"verification_uri": "http://localhost:4103/v1/device?org=000000000000000000000001"
},
"expires_at": "2026-01-01T00:00:00.000Z",
"status": "initiated"
}Any other status
Any other answer the handler sends itself (its own refusals). Not described yet.
Errors
Each refusal, what it means, and what to do. The request changed nothing.
400 Bad Request
What it means: The request was refused in the OAuth 2.0 error shape (RFC 6749 section 5.2): error is a code such as invalid_request, invalid_grant, unsupported_grant_type or invalid_scope, and error_description says why in words. Branch on error, never on the description.
What to do: Fix the field the body names in path (or read message) and send the request again. Nothing was changed.
{
"error": "string",
"error_description": "string"
}429 Too Many Requests
What it means: A rate limit in x-rateLimit was reached. retryAfter and the Retry-After header say how many seconds until the window resets.
What to do: Wait the number of seconds in the Retry-After header (also retryAfter in the body), then retry. Slow down repeated calls.
{
"success": false,
"message": "string",
"reason": "rate_limited",
"retryAfter": 1
}Related
- OAuth 2.0 guide: how this part of BuildBase works
- All OAuth 2.0 operations
- API reference: every operation, by tag
- Sign-in and credentials for the HTTP API
- How the HTTP API reports errors
- Make your first call
- Error codes: every
codethe API returns - OpenAPI: operation
oauth2.agent.identity.claim.createin public-v1.json