Skip to main content

Business

Workflows

Your workflows, and adding a client to one or taking them out.

A workflow sends each client in it a coach's steps on a schedule, such as messages, notifications, questionnaires, resources, notes and tasks. In a day-number workflow each client starts on their own day 1; a date-based one runs on calendar dates, the same for everyone. Steps go out at their time in each client's timezone.

Attributes

  • idstring

    Its unique ID.

  • namestring
  • modeenum

    day_number_based: each client starts on their own day 1 and steps run on day numbers. date_based: steps run on calendar dates, the same for every client.

    Known valuesday_number_baseddate_based
Workflow object
{
  "id": "6ad6af991ca5129a1ca6a597",
  "name": "Example",
  "mode": "day_number_based"
}

Attributes

  • idstring

    Its unique ID.

  • namestring
  • modeenum

    day_number_based: each client starts on their own day 1 and steps run on day numbers. date_based: steps run on calendar dates, the same for every client.

    Known valuesday_number_baseddate_based
  • The client's day 1, in their own calendar: before today if they started past day 1. In a date-based workflow, the day they were added.

Client workflow object
{
  "id": "6ad6af5406411d53063f8a52",
  "name": "Example",
  "mode": "day_number_based",
  "startDate": "2026-03-02"
}

List workflows

GET/v1/workflows

Every workflow in the workspace, newest first, to pass one's id when adding a client. A workspace has no more than 25, so they all come in one response, without paging. Requires workflows:write.

This endpoint takes no parameters.

Returns

Every workflow in the workspace.

GET /v1/workflows
curl https://api.hubfit.com/v1/workflows \
  -H "Authorization: Bearer $HUBFIT_API_KEY"
Response200 OK
{
  "data": [
    {
      "id": "6ad6af991ca5129a1ca6a597",
      "name": "Example",
      "mode": "day_number_based"
    }
  ]
}
POST/v1/clients/{clientId}/workflows

Adds the client to the workflow, as adding them under Manage Access in the app does. They get every step from the start of today, including any due earlier today, and none from earlier days. In a day-number workflow they start today on startDay, or day 1 if you leave it out; a date-based workflow follows its own dates and takes no startDay. If they're already in it, nothing changes: that's a 200 instead of a 201, with the start they have, so a retry is safe. Requires workflows:write.

Headers

  • Any unique string, such as a UUID, up to 255 characters. Retrying with the same key within 24 hours returns the first response instead of repeating the write. See Idempotency.

Path parameters

Body parameters

  • workflowIdstringRequired
  • startDayinteger

    The day of a day-number workflow the client is on today, so they skip the days before it. Defaults to 1.

Returns

200: The client was already in the workflow, so nothing changed. 201: The client was added.

POST /v1/clients/{clientId}/workflows
curl -X POST https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workflows \
  -H "Authorization: Bearer $HUBFIT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Response201 Created
{
  "data": {
    "id": "6ad6af5406411d53063f8a52",
    "name": "Example",
    "mode": "day_number_based",
    "startDate": "2026-03-02"
  }
}
DELETE/v1/clients/{clientId}/workflows/{workflowId}

Removes the client from the workflow, as removing them under Manage Access in the app does. They get no more of its steps, and what they already got stays. Added back later, they start again. If they weren't in it, nothing changes. Requires workflows:write.

Path parameters

  • clientIdstringRequired

    The client's id.

  • workflowIdstringRequired

    A workflow id from GET /workflows.

Returns

The client is no longer in the workflow.

DELETE /v1/clients/{clientId}/workflows/{workflowId}
curl -X DELETE https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workflows/6ad6af991ca5129a1ca6a597 \
  -H "Authorization: Bearer $HUBFIT_API_KEY"
Response200 OK
{
  "data": {
    "id": "6ad6af165d04c7155d033418",
    "removed": true
  }
}