Auth API reference

Auth API · End-Users

post/v1/apps/{app_id}/end-users/{user_id}/contactsAuth

Add a contact for an end-user (unverified).

Path parameters

app_id*string

Id of the app.

user_id*string

Id of the user.

Headers

Idempotency-Keystring

Retry safety: a repeat with the same key and body replays the first response instead of creating a contact again. Same key with a different body: 409 `IDEMPOTENCY_KEY_REUSE`. 24 h window.

Request body

type*enum (2)

Contact kind: `email` or `phone`.

Example: "email"

value*string

Email or phone value (E.164 recommended for phone)

Example: "ada@example.com"

is_primaryboolean

Whether to flag the new contact as primary for its type. Demotes the previous primary of the same type. Default false.

Response · 201

id*string

Unique identifier of the contact.

type*object

Contact kind: `email` or `phone`.

value*string

The contact value: an email address or an E.164 phone number.

is_primary*boolean

True when this is the account's primary contact of its type.

verified_at*string · date-time

When the contact was verified (ISO 8601), or `null` while unverified.

created_at*string · date-time

When the contact was created (ISO 8601).

Example

Request

POST https://api.auth.productcraft.co/v1/apps/{app_id}/end-users/{user_id}/contacts
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "type": "email",
  "value": "ada@example.com",
  "is_primary": false
}

Response

{
  "id": "string",
  "type": {},
  "value": "string",
  "is_primary": false,
  "verified_at": "2026-01-01T00:00:00.000Z",
  "created_at": "2026-01-01T00:00:00.000Z"
}