Skip to content
Hoursmith Docs
APIReferenceClients

Add a contact to a client

Add a contact to a client. Requires Manager, Admin or Owner. Member tokens receive 403 forbidden_scope — Members have no client access in Hoursmith. Write scope. Sends no email. Confirmation rule (stateless, from the request alone): portalEnabled true requires confirmPortalAccess: true (the email may sign in to the client portal and see this client's invoices); isBillingDefault true requires confirmBillingDefault: true (invoice emails and automatic reminders default to this contact unless the client has its own billingEmail); on PATCH, supplying email requires confirmEmailChange: true. A missing acknowledgement is a 422 whose `fields` name the flag and why; nothing is changed. Turning a flag or portal access off never needs confirmation.

POST
/clients/{id}/contacts

Authorization

BearerAuth
AuthorizationBearer <token>

Personal Access Token. Mint at Settings → API. Token shape: hsk_<env>_<prefix12>_<secret32>.

In: header

Path Parameters

id*string

Client UUID.

Header Parameters

Idempotency-Key*string

Caller-generated UUID/ULID; replay returns the cached response within 24h.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/clients/497f6eca-6276-4993-bfeb-53cbbbba6f08/contacts" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "portalEnabled": true  }'
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",    "email": "user@example.com",    "name": "string",    "title": "string",    "phone": "string",    "isPrimary": true,    "isBillingDefault": true,    "portalEnabled": true,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
Was this page helpful?