Guides

Server Data API

Send people, companies and events from your own backend.

Keys

Create a server key in Whazzup under Settings → Data API. The key is shown once, stored hashed and can be rotated or revoked at any time. Keep it on your server only.

Endpoints

  • POST /api/public/data/v1/people - create or update a person by external user ID or email.
  • POST /api/public/data/v1/companies - create or update a company by external ID or name.
  • POST /api/public/data/v1/events - record an event for an existing person.
  • GET /api/public/data/v1/people/:id - read a person by ID or external user ID.

Examples

People
curl -X POST https://whazzup.io/api/public/data/v1/people \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"externalUserId":"42","email":"ada@example.com","attributes":{"plan":"pro","monthlyValue":49},"company":{"externalId":"acme","name":"Acme Inc","plan":"business","size":120}}'
Events
curl -X POST https://whazzup.io/api/public/data/v1/events \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"externalUserId":"42","name":"invoice_failed","properties":{"amount":49}}'

Fixing 401 unauthorized

Base URL is https://whazzup.io/api/public/data/v1. Send the key as Authorization: Bearer wz_… or X-Api-Key: wz_…. Server-to-server calls are allowed from any IP; there is no origin or IP allowlist on this API. Identity verification only applies to the browser widget, never to the Data API.

A key looks like wz_XXXXXXXX_<64 hex chars> and is shown once when created. The public workspace ID used by widget.js is not a Data API key.

Check the key without writing data
curl https://whazzup.io/api/public/data/v1/whoami \
  -H "Authorization: Bearer $WHAZZUP_API_KEY"

Every 401 response carries a reason and a hint:

  • missing_credentials - No key was sent. Add the header Authorization: Bearer wz_… (or X-Api-Key).
  • malformed_key - The value is not a Data API key. Use the wz_XXXXXXXX_… key, not the public widget workspace ID.
  • unknown_key - No active key matches. The key was rotated or copied incompletely – create a new one.
  • revoked_key - The key was revoked. Create a new key under Settings → Data API.