---
title: "Device"
method: POST
path: "/oauth/device"
tags: ["oauth"]
---

# Device

`POST /oauth/device`

## Request

- Base URL: `https://api.ranch.bot`
- URL: `https://api.ranch.bot/oauth/device`
- Auth: none required

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.

## Request body

- object
  - `client_id` string, required
  - `scope` string

## Response `200`

Success

- object
  - `device_code` string, required
  - `user_code` string, required
  - `verification_uri` string, required
  - `verification_uri_complete` string, required
  - `expires_in` number, required
  - `interval` number, required

## Other responses

- `400`: Request validation failed.
- `401`: Missing/invalid authentication or insufficient farm role.
- `403`: Missing required scope or credential type is disallowed.
- `404`: Resource or active farm membership not found.
- `429`: Rate limit exceeded. Retry after the indicated delay.
- `500`: Unexpected server failure.

---

[API](https://skmtc.dev/ranch/apis/ranch-bot-http-api.md) · [All operations](https://skmtc.dev/ranch/apis/ranch-bot-http-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ranch/apis/ranch-bot-http-api/revisions/24109d33fa02?raw)
