Ranch.Bot
Skip to reference

Animal identifiers API

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

GET /v1/farm/{farm_id}/animals/{animal_id}/identifier

Get Animal Identifiers

Current animal identifiers HTTP operation. External credential scopes: read:animals. Minimum farm role: READER. Pagination accepts integer skip and take; set both explicitly. An omitted value passes through to the data query. Collection property names differ by resource; use the response schema. 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"}
animal_idpathYes{"type":"string","format":"uuid"}
skipqueryNo{"type":"integer"}
takequeryNo{"type":"integer"}

Request example

bash example
curl --fail-with-body -X GET \
  'https://api.ranch.bot/v1/farm/<farm_id>/animals/<animal_id>/identifier' \
  -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
totalnumberRequired
recordsarrayRequired
records[]objectRequired
records[].valuestringRequired
records[].typestringRequiredenum: ["BRAND","EID","MANAGEMENT_TAG","NAME","TATTOO"]
records[].idstringRequired
records[].created_atstringRequiredformat: "date-time"
records[].updated_atstringRequiredformat: "date-time"
records[].is_activebooleanRequired
records[].animal_idstringRequired
records[].is_primarybooleanRequired
json example
{
  "total": 0,
  "records": []
}

POST /v1/farm/{farm_id}/animals/{animal_id}/identifier

Create Animal Identifier

Current animal identifiers HTTP operation. External credential scopes: write:animals. Minimum farm role: EDITOR. 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"}
animal_idpathYes{"type":"string","format":"uuid"}

Request body (application/json)

FieldTypePresenceConstraints
typestringRequiredenum: ["BRAND","EID","MANAGEMENT_TAG","NAME","TATTOO"]
valuestringRequired
is_primarybooleanOptional
json example
{
  "type": "BRAND",
  "value": "EXAMPLE-001"
}

Request example

bash example
curl --fail-with-body -X POST \
  'https://api.ranch.bot/v1/farm/<farm_id>/animals/<animal_id>/identifier' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"type":"BRAND","value":"EXAMPLE-001"}'

Responses

StatusMeaningContent type
201Successapplication/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

201 response schema (application/json)

FieldTypePresenceConstraints
valuestringRequired
typestringRequiredenum: ["BRAND","EID","MANAGEMENT_TAG","NAME","TATTOO"]
idstringRequired
created_atstringRequiredformat: "date-time"
updated_atstringRequiredformat: "date-time"
is_activebooleanRequired
animal_idstringRequired
is_primarybooleanRequired
json example
{
  "value": "EXAMPLE-001",
  "type": "BRAND",
  "id": "11111111-1111-4111-8111-111111111111",
  "created_at": "2026-09-01T12:00:00.000Z",
  "updated_at": "2026-09-01T12:00:00.000Z",
  "is_active": true,
  "animal_id": "11111111-1111-4111-8111-111111111111",
  "is_primary": true
}

DELETE /v1/farm/{farm_id}/animals/{animal_id}/identifier/{animal_identifier_id}

Delete Animal Identifier

Current animal identifiers HTTP operation. External credential scopes: write:animals. Minimum farm role: OWNER. 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. Marks the stored entity inactive (soft deletion).

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

Request example

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

Responses

StatusMeaningContent type
204Completed; no response body.No body
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

GET /v1/farm/{farm_id}/animals/{animal_id}/identifier/{animal_identifier_id}

Get Animal Identifier

Current animal identifiers HTTP operation. External credential scopes: read:animals. 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. Current legacy behavior: returns the active parent animal, not an identifier. The identifier id is not used by this handler. Use the identifier collection to retrieve identifiers.

ParameterInRequiredSchema
farm_idpathYes{"type":"string","format":"uuid"}
animal_idpathYes{"type":"string","format":"uuid"}
animal_identifier_idpathYes{"type":"string"} Ignored and not validated by this legacy detail handler.

Request example

bash example
curl --fail-with-body -X GET \
  'https://api.ranch.bot/v1/farm/<farm_id>/animals/<animal_id>/identifier/<animal_identifier_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
created_atstringRequiredformat: "date-time"
updated_atstringRequiredformat: "date-time"
is_activebooleanRequired
farm_idstringRequired
metadataJSONRequired
json example
{
  "id": "11111111-1111-4111-8111-111111111111",
  "created_at": "2026-09-01T12:00:00.000Z",
  "updated_at": "2026-09-01T12:00:00.000Z",
  "is_active": true,
  "farm_id": "11111111-1111-4111-8111-111111111111",
  "metadata": null
}

PUT /v1/farm/{farm_id}/animals/{animal_id}/identifier/{animal_identifier_id}

Update Animal Identifier

Current animal identifiers HTTP operation. External credential scopes: write:animals. Minimum farm role: EDITOR. 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"}
animal_idpathYes{"type":"string","format":"uuid"}
animal_identifier_idpathYes{"type":"string","format":"uuid"}

Request body (application/json)

FieldTypePresenceConstraints
typestringOptionalenum: ["BRAND","EID","MANAGEMENT_TAG","NAME","TATTOO"]
valuestringOptional
is_primarybooleanOptional
json example
{}

Request example

bash example
curl --fail-with-body -X PUT \
  'https://api.ranch.bot/v1/farm/<farm_id>/animals/<animal_id>/identifier/<animal_identifier_id>' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{}'

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
valuestringRequired
typestringRequiredenum: ["BRAND","EID","MANAGEMENT_TAG","NAME","TATTOO"]
idstringRequired
created_atstringRequiredformat: "date-time"
updated_atstringRequiredformat: "date-time"
is_activebooleanRequired
animal_idstringRequired
is_primarybooleanRequired
json example
{
  "value": "EXAMPLE-001",
  "type": "BRAND",
  "id": "11111111-1111-4111-8111-111111111111",
  "created_at": "2026-09-01T12:00:00.000Z",
  "updated_at": "2026-09-01T12:00:00.000Z",
  "is_active": true,
  "animal_id": "11111111-1111-4111-8111-111111111111",
  "is_primary": true
}

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"
    }
  ]
}