Skip to main content
POST
Create contacts

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create a contact in the current workspace. Scramble reads these rules to document the request body. Mirrors the validation in the existing ContactsController::store.

phone
string
required

Phone number in international format (digits, E.164). Required.

Maximum string length: 32
name
string | null

Contact's full display name. Required when first_name is omitted.

Maximum string length: 191
first_name
string | null

Optional name parts. Combined into name when name is blank.

Maximum string length: 191
middle_name
string | null
Maximum string length: 191
last_name
string | null
Maximum string length: 191
title
string | null

Optional salutation/title (e.g. Mr, Dr).

Maximum string length: 50
country_code
string | null

Country dial code (e.g. +91). Prefixed onto the phone if missing.

Maximum string length: 10
email
string<email> | null

Optional email address.

Maximum string length: 191
language
string | null

Optional preferred language / locale.

Maximum string length: 80
address
string | null

Optional postal address.

Maximum string length: 1000
note
string | null

Optional free-text note attached to the contact.

Maximum string length: 2000
attributes
string[] | null

Free-form key/value attributes stored against the contact.

is_unsubscribed
boolean | null

Whether the contact has opted out of messages. Defaults to false.

group_ids
integer[] | null

Group ids the contact belongs to. Each must exist.

Scope the existence check to the caller's workspace so a foreign group id is rejected (was a global exists → cross-tenant ref).

Response

Resource created successfully.

data
any[]
required
meta
string
required