Ranch.Bot
Skip to reference

Farm tasks API

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

GET /v1/farm/{farm_id}/farm-tasks

List farm follow-up tasks

List linked birth tasks. Undated TODO tasks remain visible and sort before dated tasks. External credential scopes: read:records. Minimum farm role: READER.

ParameterInRequiredSchema
farm_idpathYes{"type":"string","format":"uuid"}
skipqueryNo{"type":"integer","minimum":0,"default":0}
takequeryNo{"type":"integer","minimum":1,"maximum":200,"default":50}
statusqueryNo{"type":"string","enum":["TODO","DONE","CANCELLED"]}

Request example

bash example
curl --fail-with-body -X GET \
  'https://api.ranch.bot/v1/farm/<farm_id>/farm-tasks' \
  -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
totalintegerRequiredminimum: 0
recordsarrayRequired
records[]objectRequired
records[].idstringRequiredformat: "uuid"
records[].farm_idstringRequiredformat: "uuid"
records[].birth_event_idstringRequiredformat: "uuid"
records[].namestringRequired
records[].statusstringRequiredenum: ["TODO","DONE","CANCELLED"]
records[].due_datestring or nullRequiredformat: "date-time"
records[].created_atstringRequiredformat: "date-time"
records[].updated_atstringRequiredformat: "date-time"
records[].animalsarrayOptional
records[].animals[]objectRequired
records[].animals[].idstringRequiredformat: "uuid"

PUT /v1/farm/{farm_id}/farm-tasks/{task_id}

Update a farm follow-up task

Set status and optionally the due date. Omitting due_date preserves it; null clears it. A provided date must be a real calendar date. External credential scopes: write:records. Minimum farm role: EDITOR.

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

Request body (application/json)

FieldTypePresenceConstraints
statusstringRequiredenum: ["TODO","DONE","CANCELLED"]
due_datestring or nullOptionalformat: "date"

Create request.json with a JSON body matching the request schema above before running this example.

Request example

bash example
curl --fail-with-body -X PUT \
  'https://api.ranch.bot/v1/farm/<farm_id>/farm-tasks/<task_id>' \
  -H "Authorization: Bearer $RANCHBOT_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

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
409The approved preview is stale, the request ID is already used, or the protocol version has different steps.application/json
429Rate limit exceeded. Retry after the indicated delay.application/json
500Unexpected server failure.application/json

200 response schema (application/json)

FieldTypePresenceConstraints
idstringRequiredformat: "uuid"
farm_idstringRequiredformat: "uuid"
birth_event_idstringRequiredformat: "uuid"
namestringRequired
statusstringRequiredenum: ["TODO","DONE","CANCELLED"]
due_datestring or nullRequiredformat: "date-time"
created_atstringRequiredformat: "date-time"
updated_atstringRequiredformat: "date-time"
animalsarrayOptional
animals[]objectRequired
animals[].idstringRequiredformat: "uuid"

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