Skip to content
On this page and tools

Engagements

Engagement types and stages

An engagement type is a named kind of client work in a Space, such as grooming, tutoring or repairs, with its own ordered stages. Managers set them up on the Engagements page, and an AI agent with its own key can read and manage them through the API.

Available

How a type works

Give an agent access

  1. Create an agent key. It starts in test mode.
  2. The agent asks for read:engagement-types and write:engagement-types with POST /dash/api/v1/agent/access-requests and a reason.
  3. The key owner, a manager or admin of the Space, approves each on the key page. If they stop being a manager or admin, the key switches off.
  4. To write for real, the owner moves the key to live. In test mode every write is a dry run.

The calls

All calls are under /dash/api/v1 and only see the key's own Space. A type from another Space answers 404.

CallWhat it does
GET /engagement-types, GET /engagement-types/{key}Read. The id of a type is its key.
POST /engagement-typesCreate. Body: key, label, stages, and optionally kind (service or formation), form_id (a frm_ id), booking_type_id, default_items, site (the key or id of one of the Space's sites, so the type shows only on that site's portal; leave it out for the whole Space). Honours Idempotency-Key.
PATCH /engagement-types/{key}Change label, kind, form_id, booking_type_id, site, stages, default_items or is_active. The key never changes. A stage that an engagement sits in cannot be removed.
DELETE /engagement-types/{key}Delete a type no engagement uses. Otherwise set is_active to false.
Create a typebash
curl -X POST -H "Authorization: Bearer $BYNEFIT_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: grooming-type-1" \
  -d '{"key": "grooming", "label": "Grooming", "stages": [
        {"key": "requested", "label": "Requested", "status_bucket": "submitted"},
        {"key": "booked", "label": "Booked", "status_bucket": "in_review"},
        {"key": "groomed", "label": "Groomed", "status_bucket": "filing"},
        {"key": "ready", "label": "Ready for pickup", "status_bucket": "filed"},
        {"key": "picked-up", "label": "Picked up", "status_bucket": "issued"}
      ], "default_items": [{"label": "Full groom", "kind": "service", "qty": 1, "unit_cents": 7500}]}' \
  https://bynefit.com/dash/api/v1/engagement-types

Limits and safety

Errors

StatuserrorWhat to do
403insufficient_scopeRequest the permission and have the owner approve it.
404not_foundThe type is not in this Space.
409key_taken, type_in_use, stage_in_use, type_limit_reachedPick another key, deactivate instead of deleting, move the engagements first, or delete a type.
422invalid_key, invalid_label, invalid_stages, invalid_stage_key, invalid_stage_label, invalid_status_bucket, stage_order, stage_unreachable, duplicate_stage_key, invalid_default_items, form_not_foundFix the field named in message.
429agent_write_budget_spent, agent_limits_unavailableWait for midnight, server time, or try again in a minute.

What exists and what does not