curl -X POST "https://api.fitsociety.io/public/v1/habit-templates" \
-H "Authorization: Bearer <access_token>" \
-H "Idempotency-Key: habit-template-create-20260826" \
-H "Content-Type: application/json" \
-d '{
"defaultLanguage": "en",
"name": { "en": "Drink water" },
"description": { "en": "Daily hydration target" },
"habitType": "build",
"goalPeriod": "day",
"logMode": "value",
"goalValue": 2.5,
"unit": "custom",
"customUnitName": { "en": "liter" },
"taskDaysMode": "everyday",
"reminders": [
{
"enabled": true,
"time": "08:30",
"message": { "en": "Drink water" }
}
]
}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
defaultLanguage: 'en',
name: {en: 'Drink water'},
habitType: 'build',
unit: 'custom'
})
};
fetch('https://api.fitsociety.io/public/v1/habit-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.fitsociety.io/public/v1/habit-templates"
payload = {
"defaultLanguage": "en",
"name": { "en": "Drink water" },
"habitType": "build",
"unit": "custom"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"template": {
"templateId": "66f7b8b1e13c8d25f4d3d90a",
"icon": "string",
"color": "string",
"name": {},
"defaultLanguage": "string",
"description": {},
"habitType": "string",
"goalPeriod": "string",
"logMode": "string",
"goalValue": 1,
"allowableValue": 1,
"unit": "string",
"customUnitName": {},
"taskDaysMode": "string",
"specificDaysOfWeek": [
"string"
],
"reminders": [
{
"enabled": true,
"time": "string",
"message": {}
}
],
"createdAt": "2026-07-14T10:00:00.000Z",
"updatedAt": "2026-07-14T10:00:00.000Z"
}
},
"meta": {
"requestId": "4f849d7d-f4f1-45cc-b4b7-3984a3d17f83",
"rateLimit": {
"limit": 10,
"remaining": 9,
"resetSeconds": 1
},
"idempotency": {
"replayed": false
}
}
}Create standard habit template
Requires habits:write. Creates a company-scoped standard habit template with a required defaultLanguage and localized name, description, customUnitName and reminder message maps. The internal habit runtime uses the declared source text. Apply templates to a client to create client habit instances that can receive entries.
curl -X POST "https://api.fitsociety.io/public/v1/habit-templates" \
-H "Authorization: Bearer <access_token>" \
-H "Idempotency-Key: habit-template-create-20260826" \
-H "Content-Type: application/json" \
-d '{
"defaultLanguage": "en",
"name": { "en": "Drink water" },
"description": { "en": "Daily hydration target" },
"habitType": "build",
"goalPeriod": "day",
"logMode": "value",
"goalValue": 2.5,
"unit": "custom",
"customUnitName": { "en": "liter" },
"taskDaysMode": "everyday",
"reminders": [
{
"enabled": true,
"time": "08:30",
"message": { "en": "Drink water" }
}
]
}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
defaultLanguage: 'en',
name: {en: 'Drink water'},
habitType: 'build',
unit: 'custom'
})
};
fetch('https://api.fitsociety.io/public/v1/habit-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.fitsociety.io/public/v1/habit-templates"
payload = {
"defaultLanguage": "en",
"name": { "en": "Drink water" },
"habitType": "build",
"unit": "custom"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"template": {
"templateId": "66f7b8b1e13c8d25f4d3d90a",
"icon": "string",
"color": "string",
"name": {},
"defaultLanguage": "string",
"description": {},
"habitType": "string",
"goalPeriod": "string",
"logMode": "string",
"goalValue": 1,
"allowableValue": 1,
"unit": "string",
"customUnitName": {},
"taskDaysMode": "string",
"specificDaysOfWeek": [
"string"
],
"reminders": [
{
"enabled": true,
"time": "string",
"message": {}
}
],
"createdAt": "2026-07-14T10:00:00.000Z",
"updatedAt": "2026-07-14T10:00:00.000Z"
}
},
"meta": {
"requestId": "4f849d7d-f4f1-45cc-b4b7-3984a3d17f83",
"rateLimit": {
"limit": 10,
"remaining": 9,
"resetSeconds": 1
},
"idempotency": {
"replayed": false
}
}
}Authorizations
Public API access token issued by /public/v1/oauth/token. Example: Authorization: Bearer fspt_.... Each resource request rechecks the token company's current provider access. Disabling access blocks existing tokens with 403 auth.provider_unavailable.
Headers
Required for Public API write requests. Reusing the same key with the same method, path, and body replays the stored successful response; reusing it with a different request returns 409 idempotency.conflict.
1 - 200"booking-create-20260714-001"
Body
Up to 25 languages per field. Valid BCP 47 keys are canonicalized; duplicate canonical keys and und are rejected. Every non-empty map must contain defaultLanguage. Required text cannot be empty. A supplied map replaces all languages for that field; {} clears an optional field. Null maps, null values and plain strings are rejected.
Show child attributes
Show child attributes
Required on create and on the first public text update of an unlocalized resource. Omit on later PATCH requests to preserve it. Changing it requires the new language in all retained non-empty text maps. Declaring a legacy source language does not translate the source text.
80build, quit Up to 25 languages per field. Valid BCP 47 keys are canonicalized; duplicate canonical keys and und are rejected. Every non-empty map must contain defaultLanguage. Required text cannot be empty. A supplied map replaces all languages for that field; {} clears an optional field. Null maps, null values and plain strings are rejected.
Show child attributes
Show child attributes
day, week, month, value Up to 25 languages per field. Valid BCP 47 keys are canonicalized; duplicate canonical keys and und are rejected. Every non-empty map must contain defaultLanguage. Required text cannot be empty. A supplied map replaces all languages for that field; {} clears an optional field. Null maps, null values and plain strings are rejected.
Show child attributes
Show child attributes
everyday, weekdays, weekends, specific Show child attributes
Show child attributes