Calenzy API
APIs/For your website

Clients API

New

Add the people who order or sign up on your website to your Calenzy Clients.

/v1/clientsNot counted in your quota1 endpointFrom your server only

Send us each person who orders, books or signs up on your own website. They appear in Clients with everything else you know about them, and you can reach them later with Campaigns.

Send the same person as often as you like: we find them by their email, then by their phone number, and only add someone new when nobody matches. On a match we fill what was empty and never overwrite what is already there.

Call it from your server, never from a browser or an app: your API key would be public.

Ask on your form whether the person agrees to receive your news and offers, with a box they tick themselves, and send their answer as marketing_consent. We keep the answer on their timeline.

A new person is subscribed only when they said yes. Someone we already know who now says yes is subscribed again. Someone we already know who says no, or leaves the box empty, stays exactly as they were: an unticked box on an order is not an unsubscribe.

POST/v1/clients

Add a client

Find a person in your Clients, or add them.

Query
projectRequiredintegerYour project's ID
Body
namestringThe name as the person typed it. Or send first_name and last_name
first_name, last_namestringThe name in two parts, when your form asks for both
emailstringTheir email address. email or phone is required
phonestringTheir phone number, with its country code (+33612345678) or as your customers write it in your country (06 12 34 56 78)
languagestringTheir language, such as fr or en. en when absent
marketing_consentbooleanTheir answer to your news and offers box. See News and offers
tagsarrayTags to add to them, such as ["Online order"]. Up to 10, 40 characters each. Tags they already have stay
Response
statusstringsuccess
client.idintegerTheir ID in Clients. Send it as contact_id with an SMS
client.createdbooleantrue when we added them now, false when they were already in Clients
client.subscribedbooleanWhether they receive your campaigns
Request
POSTapi.calenzy.app/v1/clients?project=7
{
  "name": "Marie Dupont",
  "phone": "06 12 34 56 78",
  "email": "marie.dupont@example.com",
  "language": "fr",
  "marketing_consent": true,
  "tags": ["Online order"]
}
Response · 200 OK
{
  "status": "success",
  "client": {
    "id": 1234,
    "created": true,
    "subscribed": true
  }
}

Errors

Besides these, any call can answer one of the common errors.

CodeHTTPWhen
missing_project400project is missing
missing_contact400Neither email nor phone was sent
invalid_email400email is not an email address
invalid_phone400phone is not a phone number
project_not_found404The project does not exist or is not yours
client_save_failed500We could not save the person. Retry