Zapier & Webhooks
Connect the Connected Performance Zapier app with an API token, choose from its polling triggers and instant webhooks, use its two actions, or subscribe your own endpoint to the same events.
Overview
Zapier lets you push Connected Performance events into other tools (a CRM, a spreadsheet, Slack) and create users or send chat messages from the outside without writing code. The integration is a Zapier app authenticated with a token you generate in Settings, plus a set of outbound webhooks the server fires when something happens in your organization.
The same webhook mechanism is available to your own software: a signed-in API client can subscribe any HTTPS URL to the same event names.
Everything on this page depends on the Zapier Integration feature being enabled for your organization. It is off by default and is switched on by Connected Performance support. When it is off, the Zapier tab is hidden in Settings and no webhooks are delivered, even ones already subscribed.
How To
Generate a Zapier token
- Open My App > Settings and choose the Zapier tab under Integrations.
- Click Generate New API Token.
- Copy the token from the dialog. The dialog warns "Save this token now! You won't be able to see it again." That is literal: only a hash is stored, and the tokens table shows an 8-character preview such as
sk-3f9a1c.... - Click I've Saved My Token.
- In Zapier, add a Connected Performance step and paste the token when asked to connect your account.
The token is bound to your organization and to the user who created it. Tokens do not expire. The table under API Tokens lists every token you have created with its preview and creation date; there is no delete button in the UI. To revoke one, call DELETE /api/zapier/auth/token with a JSON body of { "tokenPreview": "sk-3f9a1c..." } using your normal session or bearer token.
The same operations exist as endpoints for scripted setup, all authenticated with a normal user token:
| Method | Path | Purpose |
|---|---|---|
GET | /api/zapier/auth/token | Mint a token; returns { token, warning } |
GET | /api/zapier/auth/tokens | List the caller's tokens: { tokens: [{ id, preview, created_at }] } |
DELETE | /api/zapier/auth/token | Delete by tokenPreview |
Zapier itself verifies a token with GET /api/zapier/auth, sending Authorization: Bearer sk-.... A valid token returns { message: "Authenticated successfully", organization: { id, name } }; an invalid one returns 401 with Invalid token.
Choose a trigger
The Zapier app has two kinds of triggers. Polling triggers call a list endpoint on Zapier's schedule and fire for records it has not seen before. Instant triggers register a webhook URL and fire the moment the event happens.
Polling endpoints. Each takes the Zapier token as a bearer header and returns every matching record in your organization, newest first, with no paging.
| Endpoint | Returns |
|---|---|
GET /api/zapier/assessment-responses | Assessment results with item responses, the athlete and user, the assessment, and who graded it |
GET /api/zapier/questionnaire-responses | A flattened questionnaire submission (see the payload below) |
GET /api/zapier/completed-workouts | Logged workouts with athlete, workout type, exercises and pitches (50 most recent) |
GET /api/zapier/users | Every user in the organization |
GET /api/zapier/bookings is also routed but currently answers 401 with Not authorized for every token, because it requires a signed-in user and the Zapier token route does not establish one. Use the new_booking instant trigger for bookings instead.
Instant triggers. Zapier subscribes by calling POST /api/zapier/webhooks/subscribe with { "eventName": "...", "url": "<zapier hook url>" } and the token as a bearer header. The server stores the hook and returns { message: "Subscribed to <event>", id: "<hook id>" }. Turning the Zap off calls DELETE /api/zapier/webhooks/unsubscribe/:id with that id.
The events that fire are:
eventName | When it fires | Payload |
|---|---|---|
new_user | Any user is created: self-registration, staff adding a user, bulk import, or the Zapier action | { name, email } |
new_assessment_response | An assessment result is recorded | The assessment response record |
new_questionnaire_response | A questionnaire is submitted | The flattened submission below |
new_completed_workout | A workout is logged | The completed workout record with its exercises |
new_booking | A booking is created, including each booking of a recurring series and camp registrations | The booking record |
booking_payment_succeeded | A card payment for a booking settles | { bookingId, amount, currency, athlete: { id, name, email }, availabilityBlock, paymentIntentId or checkoutSessionId } |
booking_payment_failed | A booking charge is declined | As above plus failureReason |
booking_payment_canceled | A booking payment intent is cancelled | As above plus cancellationReason |
booking_payment_expired | A booking checkout session expires unpaid | As above |
The questionnaire payload is shaped for Zapier field mapping:
Q1/A1, Q2/A2 and so on are one pair per question, in questionnaire order. Entity payloads (new_assessment_response, new_completed_workout, new_booking) are the raw server records, so field names match the REST API.
Use the actions
Two inbound actions let Zapier write into your organization.
Register user. POST /api/zapier/users with { "name": "...", "email": "..." }. The Zapier app sends its own signed credential for this call; it is not callable with the raw sk- token. The user is created with the base user role and a generated password, and a new_user webhook fires. An email already in use returns 400 with User with this email already exists.
Send message. POST /api/zapier/messages with the sk- token and { "senderEmail": "...", "recipientEmail": "...", "messageBody": "..." }. Both addresses must belong to users in the token's organization; otherwise 400 with Sender not found with email: ... or Recipient not found with email: .... The message lands in the existing 1:1 chat between the two users, or opens one. The response returns { data: { id, body, sender, recipient, chat, createdAt } }.
Subscribe your own endpoint
Outside Zapier, any signed-in user can register a URL for the same events with a normal user token:
Note the path: /subscribe and /unsubscribe sit at the host root, not under /api, and so are outside the /api rate limit. The response is { message, webhook: { id, eventName, url, status } }. To remove it, POST /unsubscribe with the same eventName and url. There is no list endpoint; keep your own record of what you subscribed.
headers is an optional object merged into every delivery, which is how you authenticate deliveries to your endpoint: the server does not sign payloads. Each delivery is a POST with Content-Type: application/json, User-Agent: Connected-Performance-Webhooks/1.0, your custom headers, and the payload as the body.
Delivery rules, which also apply to Zapier hooks:
| Rule | Behaviour |
|---|---|
| Timeout | 10 seconds. Respond with any 2xx quickly and do your work afterwards. |
| Retries | None. A failed delivery is not re-sent. |
| Failure count | Any non-2xx, timeout or connection error counts as one failure; a success resets the count to zero. |
| Disabling | After 5 consecutive failures the hook's status becomes FAILED and it stops receiving events. Re-subscribe to resume. |
| Fan-out | Every active hook for the event receives it, in parallel. |
| Ordering | Not guaranteed across events. |
Tips
- Create the token from a dedicated admin account rather than a personal one. Tokens are listed per user, and the person who made one is the only one who sees it in Settings.
- Treat the
sk-token like a password. Anyone holding it can read every assessment, workout and user in your organization and send chat messages as any user. - Return
200from your endpoint before doing slow work. Five timeouts in a row silently turn the hook off, and nothing in the UI tells you. - If you need idempotency, key on the record's
idin the payload. The same booking can be delivered to several hooks but each hook sees it once. - Point a test hook at a request-capture service first to see the exact payload for your organization; entity payloads include every column of the record.
Troubleshooting
The Zapier tab is missing in Settings. The Zapier Integration feature is not enabled for your organization. Ask Connected Performance support to enable it.
Zapier says "Invalid token" when connecting. The token was mistyped or deleted. Generate a new one; previews in the API Tokens table confirm which tokens still exist.
Zaps connect fine but never fire. Either the feature was switched off after the Zap was created (delivery checks it on every event), or the hook has been disabled after 5 failures. Turn the Zap off and on again to re-subscribe.
The bookings polling trigger returns 401.
Known limitation; GET /api/zapier/bookings cannot authenticate a Zapier token. Use the new_booking instant trigger.
Register user returns 400 "User with this email already exists".
A user with that email is already in the organization. Look them up with GET /api/zapier/users instead of creating again.
Send message returns 400 "Recipient not found with email".
The address is not a user in the token's organization, or is spelled differently from their account. Compare against GET /api/zapier/users.
Related
- API Access for Developers
- REST API Endpoints
- Setting Up Automations
- Connected Apps (MCP)
Referenced by
- 'REST API Endpoints'integrations