Skip to Content
HelvetlyDocs
API referenceClients

Add a contact to a client

Needs a token with the write:clients scope. Authentication

Try in Playground sends a real request to app.helvetly.com with a token you paste. It stays in this browser tab only (session storage) and goes to no one else.

POST
/api/v1/clients/{id}/contacts

Adds a person to the client. The first contact becomes primary; with is_primary true a later one takes over and the others are unset. A client has exactly one primary contact while it has any. 422 validation_failed with details.fields for a missing name or a bad email or phone; 404 for an unknown client. Not idempotent: a retry adds a second contact.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token, hvt_…, with scopes such as read:* or write:invoices

Path Parameters

id*string

The client's id.

Request Body

application/json
  1. body

Fields of a contact. name is required on create. Unknown fields are refused (400).

name?string
Lengthlength <= 200
role?|
Lengthlength <= 100
email?|
Formatemail
Lengthlength <= 254
phone?|

Normalised to E.164.

Lengthlength <= 30
is_primary?boolean

true makes this the primary contact and unsets the others. false on the current primary is refused (422); make another contact primary instead.

Response Body

Created

application/json
  1. response
data*
Example Request
curl -X POST 'https://app.helvetly.com/api/v1/clients/string/contacts' \  -H 'Content-Type: application/json' \  -d '{  "name": "Anna Keller",  "role": "Accounts payable",  "email": "anna.keller@example.com",  "phone": "+41 44 123 45 67",  "is_primary": true}'
Example Response
{  "data": {    "id": "string",    "name": "string",    "role": "string",    "email": "string",    "phone": "string",    "is_primary": true  }}