API reference

Work schedules

The schedules that start Works for your agents: one-time or recurring (by cron expression or interval), each firing a Work on the agent's Work flow or on a flow of its own, or delegating one to a contact's agent. List them with what each will run as, and create, change, switch off or delete them. The Works they start count and are billed as any Work. 5 endpoints. Add your API key in the authentication panel to send test requests from this page.

List Work schedules

GET/api/external/v1/works/schedules

Every schedule of the workspace's agents, the next to fire first, as the Works page's Scheduled view shows them. Each: id, name, description, additionalDirectivePrompt (what the Work is told), origin (MANUAL, or AGENT_CREATED when an agent made it), enabled, agentId with agentName, flowId with flowName (the flow it fires against) and flowInheritedFromAgent (the agent's own Work flow, which may change), targetContactId (it delegates to a contact's agent), recurrenceType (ONE_TIME or RECURRING), runAt, cronExpression, intervalUnit, intervalValue, recurrenceStartAt, recurrenceEndAt, maxOccurrences, nextFireAt (null: it will not fire again), occurrenceCount, lastFiredAt, lastFireStatus, lastFireError. Times are the server's local time, as the schedule keeps them.

Errors: 403 FEATURE_NOT_ENABLED.

Responses

  • 200OK

Create a Work schedule

POST/api/external/v1/works/schedules

Creates a schedule for one of the workspace's agents, as its Schedules tab does. Body:

  • agentId (required): the agent whose Works it starts;
  • name (required), description, additionalDirectivePrompt (what each Work it starts is told);
  • enabled (default true);
  • targetFlowId: a Work-mode flow of the workspace to run (else the agent's own Work flow), or targetContactId: a contact of the agent's contacts book to delegate the Work to (their agent works it, billed at their price and only while they allow it) - not both;
  • recurrenceType: ONE_TIME (default; needs runAt) or RECURRING (needs cronExpression, or intervalUnit MINUTES, HOURS, DAYS, WEEKS or MONTHS with intervalValue);
  • recurrenceStartAt, recurrenceEndAt, maxOccurrences: bounds of a recurring schedule.

Times are ISO-8601 (an instant such as 2026-12-01T09:00:00Z, or a local date-time in the server's time zone, as the app sends it). A schedule made here is yours (origin MANUAL). Answers 201 with the schedule (nextFireAt computed).

Errors: 400 MISSING_FIELD, 400 INVALID_ID, 400 INVALID_FIELD, 400 INVALID_TIME, 400 INVALID_SCHEDULE (the schedule's own rules, in message), 400 NOT_A_WORK_FLOW, 404 AGENT_NOT_FOUND, 404 FLOW_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Request body application/json

  • agentIdstring
  • namestring
  • descriptionstring
  • additionalDirectivePromptstring
  • enabledboolean
  • targetFlowIdstring
  • targetContactIdstring
  • recurrenceTypestring
  • runAtstring
  • cronExpressionstring
  • intervalUnitstring
  • intervalValueinteger (int32)
  • recurrenceStartAtstring
  • recurrenceEndAtstring
  • maxOccurrencesinteger (int32)

Responses

  • 200OK

Change a Work schedule

PUT/api/external/v1/works/schedules/{scheduleId}

Replaces a schedule's settings, as saving it in its agent's Schedules tab does: send all of them, as for POST /works/schedules (agentId is ignored: a schedule stays with its agent; enabled left out keeps it as it is). Its next fire time is computed again. Answers 200 with the schedule.

Errors: 400 MISSING_FIELD, 400 INVALID_ID, 400 INVALID_FIELD, 400 INVALID_TIME, 400 INVALID_SCHEDULE, 400 NOT_A_WORK_FLOW, 404 SCHEDULE_NOT_FOUND, 404 FLOW_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • scheduleIdstring (uuid)pathRequired

Request body application/json

  • agentIdstring
  • namestring
  • descriptionstring
  • additionalDirectivePromptstring
  • enabledboolean
  • targetFlowIdstring
  • targetContactIdstring
  • recurrenceTypestring
  • runAtstring
  • cronExpressionstring
  • intervalUnitstring
  • intervalValueinteger (int32)
  • recurrenceStartAtstring
  • recurrenceEndAtstring
  • maxOccurrencesinteger (int32)

Responses

  • 200OK

Delete a Work schedule

DELETE/api/external/v1/works/schedules/{scheduleId}

Deletes a schedule; the Works it already started go on. Answers 204.

Errors: 404 SCHEDULE_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • scheduleIdstring (uuid)pathRequired

Responses

  • 200OK

Switch a Work schedule on or off

PUT/api/external/v1/works/schedules/{scheduleId}/enabled

Switches a schedule on or off without changing it, as its switch in the app does. Body: enabled (required). Answers 200 with the schedule.

Errors: 400 MISSING_FIELD, 404 SCHEDULE_NOT_FOUND, 403 FEATURE_NOT_ENABLED.

Parameters

  • scheduleIdstring (uuid)pathRequired

Request body application/json

  • enabledboolean

Responses

  • 200OK