Ranch.Bot
Skip to reference

Scheduled events API

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

GET /v1/farm/{farm_id}/scheduled-events

Get Scheduled Events

Current scheduled events HTTP operation. External credential scopes: read:records. 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"}
skipqueryNo{"type":"integer"}
takequeryNo{"type":"integer"}
statusqueryNo{"type":"string","enum":["APPROVED","COMPLETED","PENDING","REJECTED"]}
start_datequeryNo{"type":"string","format":"date-time"}
end_datequeryNo{"type":"string","format":"date-time"}

Request example

bash example
curl --fail-with-body -X GET \
  'https://api.ranch.bot/v1/farm/<farm_id>/scheduled-events' \
  -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
scheduledEventsarrayRequired
scheduledEvents[]objectRequired
scheduledEvents[].statusstringRequiredenum: ["COMPLETED","PENDING","APPROVED","REJECTED"]
scheduledEvents[].typestringRequiredenum: ["OTHER","FEED","GENETIC","HEALTH","MOVEMENT"]
scheduledEvents[].idstringRequired
scheduledEvents[].created_atstringRequiredformat: "date-time"
scheduledEvents[].updated_atstringRequiredformat: "date-time"
scheduledEvents[].namestringRequired
scheduledEvents[].is_activebooleanRequired
scheduledEvents[].farm_idstringRequired
scheduledEvents[].description (variant 1)nullRequired
scheduledEvents[].description (variant 2)stringRequired
scheduledEvents[].record_id (variant 1)nullRequired
scheduledEvents[].record_id (variant 2)stringRequired
scheduledEvents[].approved_by_user_id (variant 1)nullRequired
scheduledEvents[].approved_by_user_id (variant 2)stringRequired
scheduledEvents[].recurring_event_id (variant 1)nullRequired
scheduledEvents[].recurring_event_id (variant 2)stringRequired
scheduledEvents[].animal_idsJSONRequired
scheduledEvents[].approved_at (variant 1)nullRequired
scheduledEvents[].approved_at (variant 2)stringRequiredformat: "date-time"
scheduledEvents[].group_idsJSONRequired
scheduledEvents[].scheduled_atstringRequiredformat: "date-time"
totalnumberRequired
json example
{
  "scheduledEvents": [],
  "total": 1
}

POST /v1/farm/{farm_id}/scheduled-events

Create Scheduled Event

Current scheduled events HTTP operation. External credential scopes: write:records. 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"}

Request body (application/json)

FieldTypePresenceConstraints
animal_idsarrayRequired
animal_ids[]stringRequiredformat: "uuid"
descriptionstringOptional
group_idsarrayRequired
group_ids[]stringRequiredformat: "uuid"
namestringRequired
scheduled_atstringRequiredformat: "date-time"
typestringRequiredenum: ["FEED","GENETIC","HEALTH","MOVEMENT","OTHER"]
json example
{
  "animal_ids": [],
  "group_ids": [],
  "name": "Example",
  "scheduled_at": "2026-09-01T12:00:00.000Z",
  "type": "FEED"
}

Request example

bash example
curl --fail-with-body -X POST \
  'https://api.ranch.bot/v1/farm/<farm_id>/scheduled-events' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"animal_ids":[],"group_ids":[],"name":"Example","scheduled_at":"2026-09-01T12:00:00.000Z","type":"FEED"}'

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
statusstringRequiredenum: ["COMPLETED","PENDING","APPROVED","REJECTED"]
typestringRequiredenum: ["OTHER","FEED","GENETIC","HEALTH","MOVEMENT"]
idstringRequired
created_atstringRequiredformat: "date-time"
updated_atstringRequiredformat: "date-time"
namestringRequired
is_activebooleanRequired
farm_idstringRequired
description (variant 1)nullRequired
description (variant 2)stringRequired
record_id (variant 1)nullRequired
record_id (variant 2)stringRequired
approved_by_user_id (variant 1)nullRequired
approved_by_user_id (variant 2)stringRequired
recurring_event_id (variant 1)nullRequired
recurring_event_id (variant 2)stringRequired
animal_idsJSONRequired
approved_at (variant 1)nullRequired
approved_at (variant 2)stringRequiredformat: "date-time"
group_idsJSONRequired
scheduled_atstringRequiredformat: "date-time"
json example
{
  "status": "COMPLETED",
  "type": "OTHER",
  "id": "11111111-1111-4111-8111-111111111111",
  "created_at": "2026-09-01T12:00:00.000Z",
  "updated_at": "2026-09-01T12:00:00.000Z",
  "name": "Example",
  "is_active": true,
  "farm_id": "11111111-1111-4111-8111-111111111111",
  "description": null,
  "record_id": null,
  "approved_by_user_id": null,
  "recurring_event_id": null,
  "animal_ids": null,
  "approved_at": null,
  "group_ids": null,
  "scheduled_at": "2026-09-01T12:00:00.000Z"
}

GET /v1/farm/{farm_id}/scheduled-events/{scheduled_event_id}

Get Scheduled Event

Current scheduled events HTTP operation. External credential scopes: read:records. 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"}
scheduled_event_idpathYes{"type":"string","format":"uuid"}

Request example

bash example
curl --fail-with-body -X GET \
  'https://api.ranch.bot/v1/farm/<farm_id>/scheduled-events/<scheduled_event_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
statusstringRequiredenum: ["COMPLETED","PENDING","APPROVED","REJECTED"]
typestringRequiredenum: ["OTHER","FEED","GENETIC","HEALTH","MOVEMENT"]
idstringRequired
created_atstringRequiredformat: "date-time"
updated_atstringRequiredformat: "date-time"
namestringRequired
is_activebooleanRequired
farm_idstringRequired
description (variant 1)nullRequired
description (variant 2)stringRequired
record_id (variant 1)nullRequired
record_id (variant 2)stringRequired
approved_by_user_id (variant 1)nullRequired
approved_by_user_id (variant 2)stringRequired
recurring_event_id (variant 1)nullRequired
recurring_event_id (variant 2)stringRequired
animal_idsJSONRequired
approved_at (variant 1)nullRequired
approved_at (variant 2)stringRequiredformat: "date-time"
group_idsJSONRequired
scheduled_atstringRequiredformat: "date-time"
json example
{
  "status": "COMPLETED",
  "type": "OTHER",
  "id": "11111111-1111-4111-8111-111111111111",
  "created_at": "2026-09-01T12:00:00.000Z",
  "updated_at": "2026-09-01T12:00:00.000Z",
  "name": "Example",
  "is_active": true,
  "farm_id": "11111111-1111-4111-8111-111111111111",
  "description": null,
  "record_id": null,
  "approved_by_user_id": null,
  "recurring_event_id": null,
  "animal_ids": null,
  "approved_at": null,
  "group_ids": null,
  "scheduled_at": "2026-09-01T12:00:00.000Z"
}

POST /v1/farm/{farm_id}/scheduled-events/{scheduled_event_id}/approve

Approve Scheduled Event

Current scheduled events HTTP operation. External credential scopes: write:records. 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"}
scheduled_event_idpathYes{"type":"string","format":"uuid"}

Request example

bash example
curl --fail-with-body -X POST \
  'https://api.ranch.bot/v1/farm/<farm_id>/scheduled-events/<scheduled_event_id>/approve' \
  -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
recordobjectRequired
record.typestringRequiredenum: ["OTHER","FEED","GENETIC","HEALTH","MOVEMENT"]
record.idstringRequired
record.created_atstringRequiredformat: "date-time"
record.updated_atstringRequiredformat: "date-time"
record.namestringRequired
record.is_activebooleanRequired
record.description (variant 1)nullRequired
record.description (variant 2)stringRequired
record.applied_atstringRequiredformat: "date-time"
scheduledEventobjectRequired
scheduledEvent.statusstringRequiredenum: ["COMPLETED","PENDING","APPROVED","REJECTED"]
scheduledEvent.typestringRequiredenum: ["OTHER","FEED","GENETIC","HEALTH","MOVEMENT"]
scheduledEvent.idstringRequired
scheduledEvent.created_atstringRequiredformat: "date-time"
scheduledEvent.updated_atstringRequiredformat: "date-time"
scheduledEvent.namestringRequired
scheduledEvent.is_activebooleanRequired
scheduledEvent.farm_idstringRequired
scheduledEvent.description (variant 1)nullRequired
scheduledEvent.description (variant 2)stringRequired
scheduledEvent.record_id (variant 1)nullRequired
scheduledEvent.record_id (variant 2)stringRequired
scheduledEvent.approved_by_user_id (variant 1)nullRequired
scheduledEvent.approved_by_user_id (variant 2)stringRequired
scheduledEvent.recurring_event_id (variant 1)nullRequired
scheduledEvent.recurring_event_id (variant 2)stringRequired
scheduledEvent.animal_idsJSONRequired
scheduledEvent.approved_at (variant 1)nullRequired
scheduledEvent.approved_at (variant 2)stringRequiredformat: "date-time"
scheduledEvent.group_idsJSONRequired
scheduledEvent.scheduled_atstringRequiredformat: "date-time"
json example
{
  "record": {
    "type": "OTHER",
    "id": "11111111-1111-4111-8111-111111111111",
    "created_at": "2026-09-01T12:00:00.000Z",
    "updated_at": "2026-09-01T12:00:00.000Z",
    "name": "Example",
    "is_active": true,
    "description": null,
    "applied_at": "2026-09-01T12:00:00.000Z"
  },
  "scheduledEvent": {
    "status": "COMPLETED",
    "type": "OTHER",
    "id": "11111111-1111-4111-8111-111111111111",
    "created_at": "2026-09-01T12:00:00.000Z",
    "updated_at": "2026-09-01T12:00:00.000Z",
    "name": "Example",
    "is_active": true,
    "farm_id": "11111111-1111-4111-8111-111111111111",
    "description": null,
    "record_id": null,
    "approved_by_user_id": null,
    "recurring_event_id": null,
    "animal_ids": null,
    "approved_at": null,
    "group_ids": null,
    "scheduled_at": "2026-09-01T12:00:00.000Z"
  }
}

POST /v1/farm/{farm_id}/scheduled-events/{scheduled_event_id}/reject

Reject Scheduled Event

Current scheduled events HTTP operation. External credential scopes: write:records. 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"}
scheduled_event_idpathYes{"type":"string","format":"uuid"}

Request example

bash example
curl --fail-with-body -X POST \
  'https://api.ranch.bot/v1/farm/<farm_id>/scheduled-events/<scheduled_event_id>/reject' \
  -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
scheduledEventobjectRequired
scheduledEvent.statusstringRequiredenum: ["COMPLETED","PENDING","APPROVED","REJECTED"]
scheduledEvent.typestringRequiredenum: ["OTHER","FEED","GENETIC","HEALTH","MOVEMENT"]
scheduledEvent.idstringRequired
scheduledEvent.created_atstringRequiredformat: "date-time"
scheduledEvent.updated_atstringRequiredformat: "date-time"
scheduledEvent.namestringRequired
scheduledEvent.is_activebooleanRequired
scheduledEvent.farm_idstringRequired
scheduledEvent.description (variant 1)nullRequired
scheduledEvent.description (variant 2)stringRequired
scheduledEvent.record_id (variant 1)nullRequired
scheduledEvent.record_id (variant 2)stringRequired
scheduledEvent.approved_by_user_id (variant 1)nullRequired
scheduledEvent.approved_by_user_id (variant 2)stringRequired
scheduledEvent.recurring_event_id (variant 1)nullRequired
scheduledEvent.recurring_event_id (variant 2)stringRequired
scheduledEvent.animal_idsJSONRequired
scheduledEvent.approved_at (variant 1)nullRequired
scheduledEvent.approved_at (variant 2)stringRequiredformat: "date-time"
scheduledEvent.group_idsJSONRequired
scheduledEvent.scheduled_atstringRequiredformat: "date-time"
json example
{
  "scheduledEvent": {
    "status": "COMPLETED",
    "type": "OTHER",
    "id": "11111111-1111-4111-8111-111111111111",
    "created_at": "2026-09-01T12:00:00.000Z",
    "updated_at": "2026-09-01T12:00:00.000Z",
    "name": "Example",
    "is_active": true,
    "farm_id": "11111111-1111-4111-8111-111111111111",
    "description": null,
    "record_id": null,
    "approved_by_user_id": null,
    "recurring_event_id": null,
    "animal_ids": null,
    "approved_at": null,
    "group_ids": null,
    "scheduled_at": "2026-09-01T12:00:00.000Z"
  }
}

GET /v1/farm/{farm_id}/scheduled-events/pending/approval

Get Pending Events For Approval

Current scheduled events HTTP operation. External credential scopes: read:records. 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>/scheduled-events/pending/approval' \
  -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
[]objectRequired
[].statusstringRequiredenum: ["COMPLETED","PENDING","APPROVED","REJECTED"]
[].typestringRequiredenum: ["OTHER","FEED","GENETIC","HEALTH","MOVEMENT"]
[].idstringRequired
[].created_atstringRequiredformat: "date-time"
[].updated_atstringRequiredformat: "date-time"
[].namestringRequired
[].is_activebooleanRequired
[].farm_idstringRequired
[].description (variant 1)nullRequired
[].description (variant 2)stringRequired
[].record_id (variant 1)nullRequired
[].record_id (variant 2)stringRequired
[].approved_by_user_id (variant 1)nullRequired
[].approved_by_user_id (variant 2)stringRequired
[].recurring_event_id (variant 1)nullRequired
[].recurring_event_id (variant 2)stringRequired
[].animal_idsJSONRequired
[].approved_at (variant 1)nullRequired
[].approved_at (variant 2)stringRequiredformat: "date-time"
[].group_idsJSONRequired
[].scheduled_atstringRequiredformat: "date-time"
json example
[]

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