Business
On-demand
Your workout studios, recipe books and resource collections, and which clients can open them.
What a coach puts up for clients to use any time, in three kinds that work alike, each up to 100 per workspace. Workout studios hold workouts, recipe books hold recipes, and resource collections hold resources. A client sees one in their app once you grant them access.
Endpoints
- GET
/v1/workout-studios - POST
/v1/clients/{clientId}/workout-studios - DEL
/v1/clients/{clientId}/workout-studios/{workoutStudioId} - GET
/v1/recipe-books - POST
/v1/clients/{clientId}/recipe-books - DEL
/v1/clients/{clientId}/recipe-books/{recipeBookId} - GET
/v1/resource-collections - POST
/v1/clients/{clientId}/resource-collections - DEL
/v1/clients/{clientId}/resource-collections/{resourceCollectionId}
{
"id": "6ad6af358bfd50368bfee337",
"name": "Home workouts"
}{
"id": "6ad6af48098ec0490990534a",
"name": "High-protein meals"
}{
"id": "6ad6af06142ae30514295008",
"name": "Getting started"
}https://api.hubfit.com/v1/workout-studiosEvery workout studio in the workspace, newest first, to pass one's id when granting a client access. A workspace has no more than 100, so they all come in one response, without paging. Requires on-demand:write.
This endpoint takes no parameters.
Returns
Every workout studio in the workspace.
curl https://api.hubfit.com/v1/workout-studios \
-H "Authorization: Bearer $HUBFIT_API_KEY"const response = await fetch("https://api.hubfit.com/v1/workout-studios", {
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/workout-studios",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)
data = response.json()["data"]{
"data": [
{
"id": "6ad6af358bfd50368bfee337",
"name": "Home workouts"
}
]
}https://api.hubfit.com/v1/clients/{clientId}/workout-studiosGrants the client access to the workout studio, as adding them under Manage Access in the app does: it shows in their app and they get a notification. Workout Studio appears in their app if it wasn't there. If they already have access, nothing changes and nothing is sent: that's a 200 instead of a 201, so a retry is safe. Requires on-demand: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
Returns
200: The client already had access, so nothing changed. 201: Access granted.
curl -X POST https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workout-studios \
-H "Authorization: Bearer $HUBFIT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"workoutStudioId": "6ad6af358bfd50368bfee337"
}'const response = await fetch("https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workout-studios", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HUBFIT_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
workoutStudioId: "6ad6af358bfd50368bfee337",
}),
});
const { data } = await response.json();import os
import uuid
import requests
response = requests.post(
"https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workout-studios",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
json={
"workoutStudioId": "6ad6af358bfd50368bfee337",
},
)
data = response.json()["data"]{
"data": {
"id": "6ad6af358bfd50368bfee337",
"name": "Home workouts"
}
}https://api.hubfit.com/v1/clients/{clientId}/workout-studios/{workoutStudioId}Revokes the client's access to the workout studio, as removing them under Manage Access in the app does. It disappears from their app, and Workout Studio with it once they have no workout studios left. If they didn't have access, nothing changes. Requires on-demand:write.
Path parameters
The client's
id.A workout studio
idfromGET /workout-studios.
Returns
The client no longer has access.
curl -X DELETE https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workout-studios/6ad6af358bfd50368bfee337 \
-H "Authorization: Bearer $HUBFIT_API_KEY"const response = await fetch("https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/workout-studios/6ad6af358bfd50368bfee337", {
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/workout-studios/6ad6af358bfd50368bfee337",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)
data = response.json()["data"]{
"data": {
"id": "6ad6af165d04c7155d033418",
"revoked": true
}
}https://api.hubfit.com/v1/recipe-booksEvery recipe book in the workspace, newest first, to pass one's id when granting a client access. A workspace has no more than 100, so they all come in one response, without paging. Requires on-demand:write.
This endpoint takes no parameters.
Returns
Every recipe book in the workspace.
curl https://api.hubfit.com/v1/recipe-books \
-H "Authorization: Bearer $HUBFIT_API_KEY"const response = await fetch("https://api.hubfit.com/v1/recipe-books", {
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/recipe-books",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)
data = response.json()["data"]{
"data": [
{
"id": "6ad6af48098ec0490990534a",
"name": "High-protein meals"
}
]
}https://api.hubfit.com/v1/clients/{clientId}/recipe-booksGrants the client access to the recipe book, as adding them under Manage Access in the app does: it shows in their app and they get a notification. Recipe Books appears in their app if it wasn't there. If they already have access, nothing changes and nothing is sent: that's a 200 instead of a 201, so a retry is safe. Requires on-demand: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
Returns
200: The client already had access, so nothing changed. 201: Access granted.
curl -X POST https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/recipe-books \
-H "Authorization: Bearer $HUBFIT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"recipeBookId": "6ad6af48098ec0490990534a"
}'const response = await fetch("https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/recipe-books", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HUBFIT_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
recipeBookId: "6ad6af48098ec0490990534a",
}),
});
const { data } = await response.json();import os
import uuid
import requests
response = requests.post(
"https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/recipe-books",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
json={
"recipeBookId": "6ad6af48098ec0490990534a",
},
)
data = response.json()["data"]{
"data": {
"id": "6ad6af48098ec0490990534a",
"name": "High-protein meals"
}
}https://api.hubfit.com/v1/clients/{clientId}/recipe-books/{recipeBookId}Revokes the client's access to the recipe book, as removing them under Manage Access in the app does. It disappears from their app, and Recipe Books with it once they have no recipe books left. If they didn't have access, nothing changes. Requires on-demand:write.
Path parameters
The client's
id.A recipe book
idfromGET /recipe-books.
Returns
The client no longer has access.
curl -X DELETE https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/recipe-books/6ad6af48098ec0490990534a \
-H "Authorization: Bearer $HUBFIT_API_KEY"const response = await fetch("https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/recipe-books/6ad6af48098ec0490990534a", {
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/recipe-books/6ad6af48098ec0490990534a",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)
data = response.json()["data"]{
"data": {
"id": "6ad6af165d04c7155d033418",
"revoked": true
}
}https://api.hubfit.com/v1/resource-collectionsEvery resource collection in the workspace, newest first, to pass one's id when granting a client access. A workspace has no more than 100, so they all come in one response, without paging. Requires on-demand:write.
This endpoint takes no parameters.
Returns
Every resource collection in the workspace.
curl https://api.hubfit.com/v1/resource-collections \
-H "Authorization: Bearer $HUBFIT_API_KEY"const response = await fetch("https://api.hubfit.com/v1/resource-collections", {
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/resource-collections",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)
data = response.json()["data"]{
"data": [
{
"id": "6ad6af06142ae30514295008",
"name": "Getting started"
}
]
}https://api.hubfit.com/v1/clients/{clientId}/resource-collectionsGrants the client access to the resource collection, as adding them under Manage Access in the app does: it shows in their app and they get a notification. If they already have access, nothing changes and nothing is sent: that's a 200 instead of a 201, so a retry is safe. Requires on-demand: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
Returns
200: The client already had access, so nothing changed. 201: Access granted.
curl -X POST https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/resource-collections \
-H "Authorization: Bearer $HUBFIT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"resourceCollectionId": "6ad6af06142ae30514295008"
}'const response = await fetch("https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/resource-collections", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HUBFIT_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
resourceCollectionId: "6ad6af06142ae30514295008",
}),
});
const { data } = await response.json();import os
import uuid
import requests
response = requests.post(
"https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/resource-collections",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
json={
"resourceCollectionId": "6ad6af06142ae30514295008",
},
)
data = response.json()["data"]{
"data": {
"id": "6ad6af06142ae30514295008",
"name": "Getting started"
}
}https://api.hubfit.com/v1/clients/{clientId}/resource-collections/{resourceCollectionId}Revokes the client's access to the resource collection, as removing them under Manage Access in the app does. It disappears from their app. If they didn't have access, nothing changes. Requires on-demand:write.
Path parameters
The client's
id.A resource collection
idfromGET /resource-collections.
Returns
The client no longer has access.
curl -X DELETE https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/resource-collections/6ad6af06142ae30514295008 \
-H "Authorization: Bearer $HUBFIT_API_KEY"const response = await fetch("https://api.hubfit.com/v1/clients/6ad6af41d3199442d31b2743/resource-collections/6ad6af06142ae30514295008", {
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/resource-collections/6ad6af06142ae30514295008",
headers={"Authorization": f"Bearer {os.environ['HUBFIT_API_KEY']}"},
)
data = response.json()["data"]{
"data": {
"id": "6ad6af165d04c7155d033418",
"revoked": true
}
}