Skip to main content
A webhook is an HTTPS 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 holds webhooks: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.
The answer carries the endpoint and its signing secret:
201
The secret is shown once. Store it right away. No later read returns it; if you lose it, rotate it. An endpoint belongs to the mode of the key that created it. A test endpoint receives only test events and a live endpoint only live events. You can hold up to 20 endpoints per mode. 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 a POST with a JSON body and three headers:
The body is the same envelope for every event:
teammate.disconnected
  • id is the event id. It equals TF-Webhook-Id and stays the same on every retry.
  • type is the event type, and data is that event’s payload (see Events).
  • mode is test or live.
  • In every payload, teammate is your own id for the teammate, the external_id you chose.
Answer with any 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.
  1. Take the raw request body exactly as it arrived, before any JSON parsing.
  2. Build the signed text: the TF-Webhook-Timestamp value, a dot, then the raw body.
  3. Compute HMAC-SHA256 of that text, keyed with your endpoint secret (the whole whsec_... text), and write it as lower-case hex.
  4. Compare it, in constant time, with each v1= value in TF-Webhook-Signature. One match is enough.
  5. 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:
this timestamp:
and this raw body (one line, no spaces between fields):
the signed text is 1795132800. followed by the body, and the signature header is:
The SDKs do this check for you:
Without an SDK:
A changed body, a wrong secret and a stale timestamp each fail this check. The SDK includes the same check, tested against the same sample deliveries.

Rotate the secret

POST /v1/webhook-endpoints/{id}/rotate-secret issues a new secret and returns it once:
200
For the next 24 hours every delivery carries two signatures, the new secret first:
A receiver that still holds the previous secret keeps verifying, so you can deploy the new secret without missing a delivery. After previous_secret_expires_at only the new secret signs.

Retries

A delivery fails when your server answers with anything but a 2xx, 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 2xx ends 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-Id values 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.
If an endpoint gets no 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. An event about a teammate needs a consent item, the same one as the matching read (for example programs, 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 the data 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
The response to the request that sent the event carries the same rejection, whatever the teammate’s consent.

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
When it arrives, stop sending data for that 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
Reason codes are 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