Skip to content
Day of Plenty Docs

API Reference

Base URL: https://app.dayofplenty.com/api/v1

Auth: Bearer token — generate from Settings → API Keys.

All requests require a Bearer token in the Authorization header:

Terminal window
curl -s -H "Authorization: Bearer pw_..." https://app.dayofplenty.com/api/v1/account

API keys are created in the app under Settings → API Keys. The token is shown once — save it immediately.

ResourceListCreateGetUpdateArchiveRestore
AccountGET /accountPATCH /account
ThingsGET /thingsPOST /thingsGET /things/:idPATCH /things/:idPATCH .../archivePATCH .../restore
Thing typesGET /things/typesPOST /things/typesGET /things/types/:idPATCH /things/types/:idPATCH .../archivePATCH .../restore
LabelsGET /labelsPOST /labelsGET /labels/:idPATCH /labels/:idPATCH .../archivePATCH .../restore
WorkflowsGET /workflowsPOST /workflowsGET /workflows/:idPATCH /workflows/:idPATCH .../archivePATCH .../restore
RequirementsGET /workflows/:id/requirementsPOST /workflows/:id/requirementsGET .../requirements/:idPATCH .../requirements/:idPATCH .../archivePATCH .../restore
UsersGET /usersPOST /usersGET /users/:idPATCH /users/:idPATCH .../archivePATCH .../restore
EventsGET /eventsGET /events/:id
Terminal window
BASE="https://app.dayofplenty.com/api/v1"
AUTH="Authorization: Bearer ***"
# Create a workflow
ASGN=$(curl -s -H "$AUTH" -H "Content-Type: application/json" \
-d '{"name":"Night Clean"}' $BASE/workflows)
ASGN_ID=$(echo $ASGN | jq -r '.id')
# Add a requirement to the workflow
curl -s -H "$AUTH" -H "Content-Type: application/json" \
-d '{"name":"Restroom Check","requirement_type":"select_option","config":{"choices":["8F","6F","4F"]}}' \
$BASE/workflows/$ASGN_ID/requirements
Terminal window
curl -s -H "$AUTH" "$BASE/events?type=submission&from=2026-07-01T00:00:00Z&limit=50"

Every thing belongs to exactly one thing type, an account-declared kind of thing — “Gate”, “Ingredient”, “Cement” — managed on the Things surface at /things/types. A type carries tracked_by (quantity or state); a quantity type also carries its unit, and a state type its declared states. Types archive rather than delete, because things, requirements and rule actions reference them.

Address a thing by its numeric id. The id is an integer — anything else returns 404.

POST /things fields:

FieldNotes
nameRequired.
thing_type_idRequired. Must be one of your account’s active types.
code_valueOptional; a value is generated when omitted.
detailsOptional object.
label_idsOptional array of label ids from your account.

PATCH /things/:id accepts name, details, label_ids, opening_quantity and opening_state. The thing’s type cannot be changed after creation.

Terminal window
curl -s -H "$AUTH" -H "Content-Type: application/json" \
-d '{"name":"North Gate","thing_type_id":7,"code_value":"GATE-001"}' $BASE/things

A thing response includes id, name, code_value, thing_type_id, thing_type (the type’s name), tracked_by, unit, details, labels, archived_at, created_at and updated_at. GET /things/:id and POST /things also return qr_code and verify_token.

Manage your account’s kinds of thing — including any type with no things yet:

EndpointDoes
GET /things/typesList the active types.
POST /things/typesCreate one. name and tracked_by are required, plus unit for quantity or states for state.
GET /things/types/:idFetch one.
PATCH /things/types/:idRename, or switch the axis. Switching tracked_by clears the field that no longer applies.
PATCH /things/types/:id/archiveArchive.
PATCH /things/types/:id/restoreRestore.

Rename a type to “Ingredients” — take the id from thing_type_id on any thing, or from the list:

Terminal window
curl -s -H "$AUTH" -H "Content-Type: application/json" \
-X PATCH -d '{"name":"Ingredients"}' $BASE/things/types/7

A type response includes id, name, tracked_by, unit, states, position, archived_at, created_at and updated_at.

There is no DELETE for a label — archive it. Attaching and detaching live on the thing.

EndpointDoes
GET /labelsList labels.
POST /labelsCreate one. name is required, color is optional.
GET /labels/:idFetch one.
PATCH /labels/:idRename or recolour (name, color).
PATCH /labels/:id/archiveArchive.
PATCH /labels/:id/restoreRestore.

Set a thing’s labels with label_ids; an empty array clears them:

Terminal window
curl -s -H "$AUTH" -H "Content-Type: application/json" \
-X PATCH -d '{"label_ids":[]}' $BASE/things/12
Terminal window
curl -s -H "$AUTH" -H "Content-Type: application/json" \
-d '{"name":"Naseer","phone":"0820000003","pin":"5678","role":"worker"}' $BASE/users

All endpoints return JSON. Errors follow a consistent format:

{"error": "not found"}

List endpoints return only active (non-archived) resources by default — GET /labels is the exception and returns archived labels too. Use archive/restore endpoints to manage lifecycle.

The canonical reference is the OpenAPI 3.0.3 spec:

  • Live spec: GET /docs/openapi on the app
  • Interactive docs: Scalar UI on the app

Import the spec into Postman, use with codegen tools, or feed to your AI agent.