/v1/apps/{app_id}/end-users/{user_id}/contactsAuthAdd a contact for an end-user (unverified).
Path parameters
app_id*stringId of the app.
user_id*stringId of the user.
Headers
Idempotency-KeystringRetry 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*stringEmail or phone value (E.164 recommended for phone)
Example: "ada@example.com"
is_primarybooleanWhether to flag the new contact as primary for its type. Demotes the previous primary of the same type. Default false.
Response · 201
id*stringUnique identifier of the contact.
type*objectContact kind: `email` or `phone`.
value*stringThe contact value: an email address or an E.164 phone number.
is_primary*booleanTrue when this is the account's primary contact of its type.
verified_at*string · date-timeWhen the contact was verified (ISO 8601), or `null` while unverified.
created_at*string · date-timeWhen 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
}import { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const accountContact = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").endUsers.contacts.create("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { type: "email", value: "ada@example.com" });auth.admin.app(…).endUsers.contacts.create(userId, params, options?): Auth.AccountContact
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"
}