NewWalk through a demo tour for your sector

API and webhooks

Read your tours, leads and training results from your own systems, and get a signed message when something happens.

On the Business plan, admins can connect Spherwise to a website, CRM or property portal. Open Settings › Organization › API and webhooks.

API keys

  1. Give the key a name, for example the system that will use it.
  2. Choose what it can read: projects and live tours, contact card leads or training results. Leads and training results are personal data, so only tick them when the other system needs them.
  3. Create key and copy it straight away. Spherwise only keeps a fingerprint of it, so you will not see it again.

Send the key with every request as Authorization: Bearer spk_…. The API is read-only and lives under /api/public/v1:

| Request | Gives | |---|---| | GET /projects | Your projects | | GET /experiences?project=… | Your tours, with the share link and an embed code when they are live | | GET /experiences/{id} | One tour and the scenes of its live release | | GET /experiences/{id}/leads | Contact card leads | | GET /experiences/{id}/training-attempts | Training results (?completed=true for finished ones) |

Lists show the newest first, 100 at a time. Pass meta.nextCursor as ?cursor= for the next page. Each key can make 120 requests per minute. Drafts never show up; a tour shows what visitors see.

Revoke stops a key at once. On another plan, keys stop working but stay listed.

Webhooks

A webhook is an address on your server that Spherwise calls when:

  • a tour goes live (publication.activated),
  • a visitor leaves contact details (lead.created),
  • a trainee finishes a training (training.attempt.completed).

The address must be https on the normal port and reachable from the internet. After Add webhook you get a signing secret, once. Every message is a JSON POST with the header Spherwise-Signature: t=…,v1=…. To check it, compute an HMAC-SHA256 of t, a dot and the raw body with your secret, compare it with v1, and ignore messages with an old t.

If your server does not answer with a 2xx status, Spherwise tries again after 1 minute, 10 minutes, 1 hour and 6 hours. After 20 failed messages in a row the webhook switches off; Switch on starts it again. Deliveries opens the delivery log: the last 50 messages, each with the HTTP status your server answered (or "Time-out"), how long it took, the body Spherwise sent and the start of your server's answer. Send again sends a message once more with the same body and event id, so your system can recognise the repeat.

Spherwise waits 10 seconds for an answer by default. If your system does slow work before it answers, such as an LMS, set Wait for an answer to 30 or 60 seconds. A time-out does not always mean the message was lost: your server may still have received and handled it.

Your own body and the tour link

Some systems, such as a learning platform, expect their own message format. Open Send your own body when you add a webhook, or Body on an existing one, and type the JSON the system expects. Placeholders between double braces are filled in when the message is sent:

  • {{param.student_id}} is a parameter from the tour link. Open the tour as /experience/…?student_id=279 and the training result or lead remembers student_id=279.
  • Add |number or |boolean to send the value as a number or true/false: {"student_id": "{{param.student_id|number}}"} sends {"student_id": 279}.
  • Also available: attempt.score, attempt.maxScore, attempt.percent, attempt.passed, attempt.participantName, lead.name, lead.email, lead.phone, lead.message, experience.id, experience.name, event and createdAt.

Choose a tour under For to send only that tour's events. Send test sends a sample event with values you type, and shows the exact body. Link parameters are whatever the link said; Spherwise does not check them, so do not use them to grant anything. They also show next to training results and leads, and in their CSV exports.