POST TechnicallyFit sends to your server when something changes,
so you do not have to poll. You register an endpoint, choose the events it receives, and
verify each delivery with a signature.
Register an endpoint
Create an endpoint with a key that holdswebhooks:write. The URL must start with
https:// and its host must resolve to a public address. A host that resolves to a private
or internal address is refused, at registration and again before every delivery.
201
To pause an endpoint, set
"status": "paused". To resume, set "status": "active". Events
that happen while an endpoint is paused are not sent later.
What a delivery looks like
Every delivery is aPOST with a JSON body and three headers:
teammate.disconnected
idis the event id. It equalsTF-Webhook-Idand stays the same on every retry.typeis the event type, anddatais that event’s payload (see Events).modeistestorlive.- In every payload,
teammateis your own id for the teammate, theexternal_idyou chose.
2xx status within ten seconds. Do your own work after you answer, not
before. Redirects are not followed: a 3xx answer counts as a failure.
Verify the signature
Verify every delivery before you trust it. This is one delivery from start to end; the steps below say exactly how to check it.- Take the raw request body exactly as it arrived, before any JSON parsing.
- Build the signed text: the
TF-Webhook-Timestampvalue, a dot, then the raw body. - Compute HMAC-SHA256 of that text, keyed with your endpoint secret (the whole
whsec_...text), and write it as lower-case hex. - Compare it, in constant time, with each
v1=value inTF-Webhook-Signature. One match is enough. - Reject the delivery if the timestamp is more than five minutes from your own clock. That stops someone from replaying an old delivery.
A worked example
With this secret:1795132800. followed by the body, and the signature header is:
Rotate the secret
POST /v1/webhook-endpoints/{id}/rotate-secret issues a new secret and returns it once:
200
previous_secret_expires_at only the new secret
signs.
Retries
A delivery fails when your server answers with anything but a2xx, does not answer within
ten seconds, or cannot be reached. A failed delivery is retried up to seven more times,
with a longer wait each time:
Each wait is shortened by a small random amount. After the eighth attempt, about 21 hours
after the first, the delivery is marked
failed and is not sent again.
- Concurrency caps. At most two deliveries are in flight to one endpoint at a time, and at most four across all endpoints of your organization in one mode. Extra deliveries wait briefly in the queue without using an attempt, so one slow endpoint does not delay other endpoints.
- Pausing a failing endpoint. After three failed attempts in a row, deliveries to that
endpoint pause for 30 seconds without using attempts. When the pause ends, one delivery
probes your server: a
2xxends the pause immediately, and another failure doubles the pause up to 15 minutes. - At least once. The same event can arrive more than once. Keep the
TF-Webhook-Idvalues you have handled and skip one you have seen. - No order. Events can arrive out of order. Use the times and revision numbers in the payload, not the arrival order.
- Read for detail. A payload carries ids and conclusions. When you need more, call the matching read endpoint, which checks consent again.
2xx answer for five days, it is switched to disabled when a
delivery next runs out of attempts, with disabled_reason set to delivery_failures.
Deliveries still waiting for it are dropped. Fix your server, then set "status": "active"
to turn the endpoint back on.
The delivery log
GET /v1/webhook-endpoints/{id}/deliveries lists the deliveries of the last 30 days,
newest first, with every attempt. Filter with status, page with limit and cursor.
200
The log never holds the payload or your server’s answer body.
Consent
An event about a teammate needs a consent item, the same one as the matching read (for exampleprograms, body_state, events or record). Consent is checked when the
event happens and again immediately before every attempt, retries included. If the
teammate withdraws the item in between, the delivery is dropped. See
Teammates and ownership.
Events for a placeholder nobody claimed are delivered, because they describe only what you
sent.
Events
Each section shows thedata of one event type and the consent item it needs. A payload
never has a field that is not listed here. For measurement and attestation lifecycle
rules, see Verified records.
program.revised
A teammate’s program has a new revision, whether it applied automatically or a coach approved it. Consent item:programs.
program.revised
approval.mode is automatic or coach. parent_revision is null for a first revision.
A program your organization created arrives as program.revised with revision 1, a null
parent_revision and the cause kind created, when it starts: at once for a teammate with no
coach, or with approval.mode coach once their coach accepts it. A program that is saved and
not started sends no event; read its job instead.
session.changed
An applied revision changed today’s session or the next planned one. Consent item:programs.
session.changed
change is updated, added or removed. day_index counts from 0 for Monday.
proposal.created
A change is waiting for a coach to approve it. Consent item:programs.
proposal.created
feasibility.warning
A target is unlikely to be reached as the program stands. Consent item:programs.
feasibility.warning
event.rejected
An event you sent was rejected. Consent item:events. The payload names the rejected
event and the reason, and never repeats the values you sent.
event.rejected
teammate.claimed
A person claimed the placeholder you created. Consent item: none; always delivered.teammate.claimed
teammate.disconnected
A teammate is no longer connected to your organization: they left it, or they deleted their TechnicallyFit account. Both send the same payload, so you cannot tell which. Consent item: none; always delivered. It carries your id for the teammate and a time, and nothing else.teammate.disconnected
external_id (your key gets 404 for it from
now on) and apply your own retention rules to your copy of the teammate’s data. Deleting a
placeholder yourself with DELETE /v1/teammates/{external_id} sends no webhook.
location.inventory_changed
The equipment of one of your locations changed: what it has today gained or lost at least one item. Consent item: none; it is about your own location and carries no teammate data. One event is sent per location, so a baseline change sends one for each location it reaches.location.inventory_changed
A change to a count, an attribute or a note sends nothing.
teammate.at_risk
A teammate may be about to stop training. Consent item:at_risk. It carries the teammate
id, reason codes and a time, and nothing else.
teammate.at_risk
visits_dropped and sessions_missed (progress_stalled is reserved). More
may be added, so handle one you do not know. It is sent once, when the daily check opens a flag;
see At-risk teammates.
workout.logged
A teammate finished a workout in the TechnicallyFit app. Consent item:programs. Published once
per completed workout; retrying a finish sends no second event, and sets your organization sends
through the events API do not trigger it. The payload carries ids and the finish time only, never
sets, loads or effort.
workout.logged
program_id is null when the workout does not belong to a program.
body_state.changed
A body-state update stored a new snapshot whose joint state changed from the previous one. Consent item:body_state. The payload carries the teammate id and when it was computed, never a number;
read GET /v1/teammates/{external_id}/body-state for the joint values.
body_state.changed
session.adapted
Live adaptation adjusted the remaining sets of an in-progress session after a trigger fired. Consent item:programs. Published inside the adaptation write’s transaction. The payload carries
ids, the trigger code, a plain summary and the timestamp only, never set values or engine internals.
session.adapted
adaptation.vetoed
A teammate (or their coach on their behalf) vetoed a live adaptation change, restoring the earlier prescription on sets not yet done and silencing that trigger for the rest of the session. Consent item:programs. Published once when the veto is recorded; retrying a veto sends no second event.
adaptation.vetoed
measurement.recorded
A new measurement was stored in a teammate’s performance record. Consent item:record. The
payload carries ids, quantity, protocol, vouching level and time only, never a numeric value or
name. Sensitive health measures never publish an event.
measurement.recorded
measurement.corrected
An active measurement was replaced with a corrected row. Consent item:record. supersedes_id
names the replaced measurement.
measurement.corrected
measurement.withdrawn
A measurement was withdrawn from the teammate’s active record. Consent item:record. Account
erasure sends teammate.disconnected instead of one event per result.
measurement.withdrawn
attestation.created
A coach witnessed (level 3) or an approved organization certified (level 4) a measurement. Consent item:record. The payload carries the attestation id and vouching level, never the signed
statement or numeric value.
attestation.created
attestation.revoked
A coach or organization revoked a previously issued attestation. Consent item:record.
vouching_level shows the measurement’s level after revocation.
attestation.revoked
webhook.test
A test delivery you sent from the developer portal (app.technicallyfit.com/developer, Webhooks, Send test). It goes only to the endpoint you chose, whatever events it subscribed to, and is signed and logged like any other delivery. You cannot subscribe to it. Consent item: none; it carries no teammate data.webhook.test