Create a contact

Vorschau
posthttps://api.expiryedge.com/v2/contacts
editor or admin60/minIdempotency-Key
Anfrage
curl -X POST 'https://api.expiryedge.com/v2/contacts' \
  -H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "first_name": "Priya",
  "last_name": "Shah",
  "email": "priya.shah@northwinddental.example",
  "sms_phone": "+15550123456",
  "job_title": "Practice Manager",
  "contact_group": "Licensing",
  "timezone": "America/New_York"
}'
Antwort
{
  "id": "c_8Hk2pQ",
  "organization_id": "org_northwind",
  "user_id": "u_71bXq",
  "first_name": "Priya",
  "last_name": "Shah",
  "email": "priya.shah@northwinddental.example",
  "sms_phone": "+15550123456",
  "whatsapp_phone": null,
  "contact_type": "Staff",
  "job_title": "Practice Manager",
  "timezone": "America/New_York",
  "contact_group": "Licensing",
  "is_default": false,
  "email_opt_in": true,
  "sms_opt_in": true,
  "whatsapp_opt_in": false,
  "sendNotifications": true,
  "created_at": "2026-09-27T14:05:00.000Z",
  "updated_at": "2026-09-27T14:05:00.000Z"
}

Field names as stored (snake_case, plus sendNotifications); unknown fields are rejected (400). Email must be unique in the organization (409 EMAIL_EXISTS). Counts toward the plan's contact limit.

Header

  • Idempotency-Keystring
    Optional client-generated key (1-255 characters of letters, digits, - _ : .).
    pattern: ^[A-Za-z0-9_\-:.]{1,255}$

Body-Parameter

application/json
  • first_namestringerforderlich
  • last_namestring
    Defaults to empty on create.
  • emailstring | null
    format: email
  • sms_phonestring | null
  • whatsapp_phonestring | null
  • contact_typestring | null
  • job_titlestring | null
  • timezonestring
    IANA timezone; defaults to Europe/London on create.
  • contact_groupstring | null
    Group name; a new name creates the group.
  • is_defaultboolean
  • email_opt_inboolean
  • sms_opt_inboolean
  • whatsapp_opt_inboolean
  • sendNotificationsboolean
    Stored camelCase (legacy name).

Rückgabe

201
Created.
  • first_namestring
  • last_namestring
    Defaults to empty on create.
  • emailstring | null
    format: email
  • sms_phonestring | null
  • whatsapp_phonestring | null
  • contact_typestring | null
  • job_titlestring | null
  • timezonestring
    IANA timezone; defaults to Europe/London on create.
  • contact_groupstring | null
    Group name; a new name creates the group.
  • is_defaultboolean
  • email_opt_inboolean
  • sms_opt_inboolean
  • whatsapp_opt_inboolean
  • sendNotificationsboolean
    Stored camelCase (legacy name).
  • idstringschreibgeschützt
  • organization_idstringschreibgeschützt
  • user_idstringschreibgeschützt
  • created_atstring
    UTC timestamp, ISO 8601. Every v1 response uses this form, never a raw Firestore Timestamp ({_seconds, _nanoseconds}).
    format: date-time
  • updated_atstring
    UTC timestamp, ISO 8601. Every v1 response uses this form, never a raw Firestore Timestamp ({_seconds, _nanoseconds}).
    format: date-time

Fehler

400
Invalid parameters or body (VALIDATION_FAILED; details names the fields).
401
Missing, invalid or expired token (UNAUTHORIZED).
403
FORBIDDEN (role / no organization) or PLAN_LIMIT_REACHED (details: current, limit, remaining).
405
Wrong HTTP method for this path; the Allow header lists the valid ones.
409
State or uniqueness conflict: EMAIL_EXISTS (contacts), GROUP_EXISTS (contact groups), CONFLICT (folder name taken), FOLDER_NOT_EMPTY, CLIENT_HAS_PROJECTS, TOO_MANY_ATTACHMENTS, INVALID_STATE (collection request cancel/resend), or IDEMPOTENCY_IN_PROGRESS (same Idempotency-Key still running; see Retry-After).
422
The Idempotency-Key was already used with a different body (IDEMPOTENCY_KEY_REUSED).
429
Too many requests for this endpoint from your IP. Wait Retry-After seconds.