API

Contact webhook

Adds a contact from a web form or another system, without an API key. The webhook has its own domain, https://webhook.spoks.com, separate from the API. Send JSON or a regular HTML form post. Field names are matched flexibly (e-mail, phone_number, first_name and more), and a contact with the same email or phone number is updated instead of duplicated. Put test/ before the webhook id to preview the result without saving. New contacts are subscribed to email and SMS.

POSThttps://webhook.spoks.com/{webhookId}

Path Parameters

webhookId*string

Your workspace's webhook id, found under Settings → Integrations in the app. It is the only credential, so keep it to your form.

Query Parameters

isImport?boolean

Set to true when importing existing contacts. Skips the welcome message, the new-contact notification and automated flows, and leaves an existing contact's consent unchanged.

Request Body

TypeScript Definitions

Use the request body type in TypeScript.

email?string

The contact's email address. Required unless phone is set.

phone?string

The contact's phone number. Numbers without a country code are read in the workspace's country, and all numbers are stored in international format. Required unless email is set.

name?string

Full name.

first_name?string

Combined with last_name into the name when name is not sent.

last_name?string

Combined with first_name into the name when name is not sent.

tags?array<string>

Tags to add to the contact. A comma-separated string also works.

note?string

Free text saved as a note on the contact, such as the message from a contact form.

custom_fields?

Values for your custom fields, keyed by each field's data name.

curl -X POST "https://example.com/string" \  -H "Content-Type: application/json" \  -d '{    "name": "Emma Johnson",    "email": "emma.johnson@example.com",    "phone": "+1 555 010 4477",    "tags": [      "Newsletter"    ],    "note": "Signed up from the footer form"  }'
{  "status": "success"}
Empty
Empty