Ranch.Bot
Skip to reference

Farm archives API

HTTP reference for farm archives. Read authentication and access before using these operations. All examples use made-up data and placeholder credentials.

GET /v1/farm/{farm_id}/exports

GET /v1/farm/{farm_id}/exports

Current farm archives HTTP operation. External credential scopes: read:exports. Minimum farm role: READER. Production rate limit: 100 requests per 15-minute window, per legacy key, otherwise per client IP. RateLimit headers report the current window; respect Retry-After on 429.

ParameterInRequiredSchema
farm_idpathYes{"type":"string","format":"uuid"}

Request example

bash example
curl --fail-with-body -X GET \
  'https://api.ranch.bot/v1/farm/<farm_id>/exports' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN"

Responses

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

200 response schema (application/json)

FieldTypePresenceConstraints
exportsarrayRequired
exports[]objectRequired
exports[].idstringRequired
exports[].farm_idstringRequired
exports[].statusstringRequired
exports[].sha256 (variant 1)nullRequired
exports[].sha256 (variant 2)stringRequired
exports[].bytes (variant 1)nullRequired
exports[].bytes (variant 2)stringRequired
exports[].error (variant 1)nullRequired
exports[].error (variant 2)stringRequired
exports[].created_atstringRequiredformat: "date-time"
exports[].expires_atstringRequiredformat: "date-time"
json example
{
  "exports": []
}

POST /v1/farm/{farm_id}/exports

POST /v1/farm/{farm_id}/exports

Current farm archives HTTP operation. External credential scopes: read:exports. Minimum farm role: READER. Direct requests execute without an app confirmation screen. Production rate limit: 100 requests per 15-minute window, per legacy key, otherwise per client IP. RateLimit headers report the current window; respect Retry-After on 429.

ParameterInRequiredSchema
farm_idpathYes{"type":"string","format":"uuid"}

Request example

bash example
curl --fail-with-body -X POST \
  'https://api.ranch.bot/v1/farm/<farm_id>/exports' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN"

Responses

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

202 response schema (application/json)

FieldTypePresenceConstraints
idstringRequired
farm_idstringRequired
statusstringRequired
sha256 (variant 1)nullRequired
sha256 (variant 2)stringRequired
bytes (variant 1)nullRequired
bytes (variant 2)stringRequired
error (variant 1)nullRequired
error (variant 2)stringRequired
created_atstringRequiredformat: "date-time"
expires_atstringRequiredformat: "date-time"
json example
{
  "id": "11111111-1111-4111-8111-111111111111",
  "farm_id": "11111111-1111-4111-8111-111111111111",
  "status": "example",
  "sha256": null,
  "bytes": null,
  "error": null,
  "created_at": "2026-09-01T12:00:00.000Z",
  "expires_at": "2026-09-01T12:00:00.000Z"
}

DELETE /v1/farm/{farm_id}/exports/{export_id}

DELETE /v1/farm/{farm_id}/exports/{export_id}

Current farm archives HTTP operation. External credential scopes: read:exports. Minimum farm role: READER. Direct requests execute without an app confirmation screen. Production rate limit: 100 requests per 15-minute window, per legacy key, otherwise per client IP. RateLimit headers report the current window; respect Retry-After on 429. Deletion behavior is described below; a successful status does not imply erasure from all retained history. Cancels the export job; this does not delete farm records.

ParameterInRequiredSchema
farm_idpathYes{"type":"string","format":"uuid"}
export_idpathYes{"type":"string","format":"uuid"}

Request example

bash example
curl --fail-with-body -X DELETE \
  'https://api.ranch.bot/v1/farm/<farm_id>/exports/<export_id>' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN"

Responses

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

200 response schema (application/json)

FieldTypePresenceConstraints
idstringRequired
farm_idstringRequired
statusstringRequired
sha256 (variant 1)nullRequired
sha256 (variant 2)stringRequired
bytes (variant 1)nullRequired
bytes (variant 2)stringRequired
error (variant 1)nullRequired
error (variant 2)stringRequired
created_atstringRequiredformat: "date-time"
expires_atstringRequiredformat: "date-time"
json example
{
  "id": "11111111-1111-4111-8111-111111111111",
  "farm_id": "11111111-1111-4111-8111-111111111111",
  "status": "example",
  "sha256": null,
  "bytes": null,
  "error": null,
  "created_at": "2026-09-01T12:00:00.000Z",
  "expires_at": "2026-09-01T12:00:00.000Z"
}

GET /v1/farm/{farm_id}/exports/{export_id}

GET /v1/farm/{farm_id}/exports/{export_id}

Current farm archives HTTP operation. External credential scopes: read:exports. Minimum farm role: READER. Production rate limit: 100 requests per 15-minute window, per legacy key, otherwise per client IP. RateLimit headers report the current window; respect Retry-After on 429.

ParameterInRequiredSchema
farm_idpathYes{"type":"string","format":"uuid"}
export_idpathYes{"type":"string","format":"uuid"}

Request example

bash example
curl --fail-with-body -X GET \
  'https://api.ranch.bot/v1/farm/<farm_id>/exports/<export_id>' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN"

Responses

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

200 response schema (application/json)

FieldTypePresenceConstraints
idstringRequired
farm_idstringRequired
statusstringRequired
sha256 (variant 1)nullRequired
sha256 (variant 2)stringRequired
bytes (variant 1)nullRequired
bytes (variant 2)stringRequired
error (variant 1)nullRequired
error (variant 2)stringRequired
created_atstringRequiredformat: "date-time"
expires_atstringRequiredformat: "date-time"
json example
{
  "id": "11111111-1111-4111-8111-111111111111",
  "farm_id": "11111111-1111-4111-8111-111111111111",
  "status": "example",
  "sha256": null,
  "bytes": null,
  "error": null,
  "created_at": "2026-09-01T12:00:00.000Z",
  "expires_at": "2026-09-01T12:00:00.000Z"
}

GET /v1/farm/{farm_id}/exports/{export_id}/download

GET /v1/farm/{farm_id}/exports/{export_id}/download

Current farm archives HTTP operation. External credential scopes: read:exports. Minimum farm role: READER. Production rate limit: 100 requests per 15-minute window, per legacy key, otherwise per client IP. RateLimit headers report the current window; respect Retry-After on 429. Downloads an available export for the requesting user. POST also accepts access_token in a form body when the Authorization header is absent.

ParameterInRequiredSchema
farm_idpathYes{"type":"string","format":"uuid"}
export_idpathYes{"type":"string","format":"uuid"}

Request example

bash example
curl --fail-with-body -X GET \
  'https://api.ranch.bot/v1/farm/<farm_id>/exports/<export_id>/download' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN"

Responses

StatusMeaningContent type
200ZIP archive stream.application/zip
400Request validation failed.application/json
401Missing/invalid authentication or insufficient farm role.application/json
403Missing required scope or credential type is disallowed.application/json
404Resource or active farm membership not found.application/json
429Rate limit exceeded. Retry after the indicated delay.application/json
500Unexpected server failure.application/json

200 response schema (application/zip)

FieldTypePresenceConstraints

POST /v1/farm/{farm_id}/exports/{export_id}/download

POST /v1/farm/{farm_id}/exports/{export_id}/download

Current farm archives HTTP operation. External credential scopes: read:exports. Minimum farm role: READER. Direct requests execute without an app confirmation screen. Production rate limit: 100 requests per 15-minute window, per legacy key, otherwise per client IP. RateLimit headers report the current window; respect Retry-After on 429. Downloads an available export for the requesting user. POST also accepts access_token in a form body when the Authorization header is absent.

ParameterInRequiredSchema
farm_idpathYes{"type":"string","format":"uuid"}
export_idpathYes{"type":"string","format":"uuid"}

Request example

bash example
curl --fail-with-body -X POST \
  'https://api.ranch.bot/v1/farm/<farm_id>/exports/<export_id>/download' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN"

Responses

StatusMeaningContent type
200ZIP archive stream.application/zip
400Request validation failed.application/json
401Missing/invalid authentication or insufficient farm role.application/json
403Missing required scope or credential type is disallowed.application/json
404Resource or active farm membership not found.application/json
429Rate limit exceeded. Retry after the indicated delay.application/json
500Unexpected server failure.application/json

200 response schema (application/zip)

FieldTypePresenceConstraints

Error body

Validation and authentication errors generally use this envelope. Rate-limit errors omit data; OAuth polling also has protocol-specific errors shown in its reference.

json example
{
  "success": false,
  "errors": [
    {
      "code": 400,
      "name": "ValidationError",
      "message": "Example validation failure"
    }
  ]
}