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.
{
"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 - startDatedate
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.
{
"id": "6ad6af5406411d53063f8a52",
"name": "Example",
"mode": "day_number_based",
"startDate": "2026-03-02"
}https://api.hubfit.com/v1/workflowsEvery 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.
curl https://api.hubfit.com/v1/workflows \
-H "Authorization: Bearer $HUBFIT_API_KEY"const response = await fetch("https://api.hubfit.com/v1/workflows", {
headers: {
Authorization: `Bearer ${process.env.HUBFIT_API_KEY}`,
},
});
const { data } = await response.json();import os
import requests
response = requests.get(
"https://api.hubfit.com/v1/workflows",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)
data = response.json()["data"]{
"data": [
{
"id": "6ad6af991ca5129a1ca6a597",
"name": "Example",
"mode": "day_number_based"
}
]
}https://api.hubfit.com/v1/clients/{clientId}/workflowsAdds 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
- Idempotency-Keystring
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
The client's
id.
Body parameters
- 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.
curl -X POST https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workflows \
-H "Authorization: Bearer $HUBFIT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"const response = await fetch("https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workflows", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HUBFIT_API_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
},
});
const { data } = await response.json();import os
import uuid
import requests
response = requests.post(
"https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workflows",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
)
data = response.json()["data"]{
"data": {
"id": "6ad6af5406411d53063f8a52",
"name": "Example",
"mode": "day_number_based",
"startDate": "2026-03-02"
}
}https://api.hubfit.com/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
The client's
id.A workflow
idfromGET /workflows.
Returns
The client is no longer in the workflow.
curl -X DELETE https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workflows/6ad6af991ca5129a1ca6a597 \
-H "Authorization: Bearer $HUBFIT_API_KEY"const response = await fetch("https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workflows/6ad6af991ca5129a1ca6a597", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.HUBFIT_API_KEY}`,
},
});
const { data } = await response.json();import os
import requests
response = requests.delete(
"https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workflows/6ad6af991ca5129a1ca6a597",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)
data = response.json()["data"]{
"data": {
"id": "6ad6af165d04c7155d033418",
"removed": true
}
}