Current oauth HTTP operation. No resource-scope middleware on this operation. Access is resolved for the authenticated user or by the endpoint-specific OAuth checks.
Request example
bash example
curl --fail-with-body -X GET \
'https://api.ranch.bot/oauth/.well-known/oauth-authorization-server'
Responses
Status
Meaning
Content type
200
Success
application/json
400
Request validation failed.
application/json
401
Missing/invalid authentication or insufficient farm role.
application/json
403
Missing required scope or credential type is disallowed.
Current oauth HTTP operation. No resource-scope middleware on this operation. Access is resolved for the authenticated user or by the endpoint-specific OAuth checks.
Parameter
In
Required
Schema
client_id
query
Yes
{"type":"string"}
redirect_uri
query
Yes
{"type":"string"}
response_type
query
Yes
{"type":"string","const":"code"}
scope
query
Yes
{"type":"string"}
state
query
No
{"type":"string"}
code_challenge
query
No
{"type":"string"}
code_challenge_method
query
No
{"type":"string"}
Replace PLACEHOLDER_CLIENT_ID with your registered client ID and https://your-app.example/oauth/callback with your registered callback URL, then URL-encode both values. The example requests read:animals.
Request example
bash example
curl --fail-with-body -X GET \
'https://api.ranch.bot/oauth/authorize?client_id=PLACEHOLDER_CLIENT_ID&redirect_uri=https%3A%2F%2Fyour-app.example%2Foauth%2Fcallback&response_type=code&scope=read%3Aanimals'
Responses
Status
Meaning
Content type
302
Redirect to the configured authentication or consent flow.
No body
400
Request validation failed.
application/json
401
Missing/invalid authentication or insufficient farm role.
application/json
403
Missing required scope or credential type is disallowed.
application/json
404
Resource or active farm membership not found.
application/json
500
Unexpected server failure.
application/json
POST /oauth/device
Device
Current oauth HTTP operation. No resource-scope middleware on this operation. Access is resolved for the authenticated user or by the endpoint-specific OAuth checks. Production rate limit: 30 requests per 15-minute window, per client IP. RateLimit headers report the current window; respect Retry-After on 429. Requires an active registered client and only that client’s allowed scopes. Codes expire after 900 seconds; poll no faster than every 5 seconds. The user approves in the browser. No public self-serve client registration is provided.
Current oauth HTTP operation. No resource-scope middleware on this operation. Access is resolved for the authenticated user or by the endpoint-specific OAuth checks. Production rate limit: 240 requests per 15-minute window, per client IP. RateLimit headers report the current window; respect Retry-After on 429. Poll with the returned device_code and original client_id. Pending authorization returns an OAuth 400 body. Malformed request bodies return the standard validation 400 envelope. Invalid, consumed, expired, mismatched-client, or disallowed-permission device codes return the standard 401 envelope.
{
"error": "authorization_pending",
"error_description": "The authorization request is still pending"
}
POST /oauth/revoke
Revoke
Current oauth HTTP operation. No resource-scope middleware on this operation. Access is resolved for the authenticated user or by the endpoint-specific OAuth checks. Production rate limit: 240 requests per 15-minute window, per client IP. RateLimit headers report the current window; respect Retry-After on 429.
Missing/invalid authentication or insufficient farm role.
application/json
403
Missing required scope or credential type is disallowed.
application/json
404
Resource or active farm membership not found.
application/json
429
Rate limit exceeded. Retry after the indicated delay.
application/json
500
Unexpected server failure.
application/json
200 response schema (application/json)
Field
Type
Presence
Constraints
revoked
boolean
Required
json example
{
"revoked": true
}
POST /oauth/token
Token
Current oauth HTTP operation. No resource-scope middleware on this operation. Access is resolved for the authenticated user or by the endpoint-specific OAuth checks. Production rate limit: 240 requests per 15-minute window, per client IP. RateLimit headers report the current window; respect Retry-After on 429. Authorization-code exchange requires code and redirect_uri. A refresh-token grant requires refresh_token. Use the configured client and its directed setup; do not infer a working public client from endpoint existence.
Validation and authentication errors generally use this envelope. Rate-limit errors omit data; OAuth polling also has protocol-specific errors shown in its reference.