curl --request POST \
--url https://spectrum.photon.codes/projects/{projectId}/users/ \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"phoneNumber": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com"
}
'{
"succeed": true,
"data": {
"id": "<string>",
"projectId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"assignedPhoneNumber": "<string>",
"meta": {},
"createdAt": "<string>"
}
}Creates a new user for the project. Pass type: "shared" for a shared user (server assigns a phone number from the Cosmos pool, enforces maxSharedUsers, and returns the existing record if phoneNumber or email matches an active shared user). Pass type: "dedicated" for a dedicated user, which requires assignedPhoneNumber to match an iMessage line owned by the project; the operation is idempotent on the full (phoneNumber, assignedPhoneNumber) tuple — calling it again with the same tuple returns the existing row, while calling it with the same phoneNumber but a different assignedPhoneNumber creates a new row (the same user phone may be assigned to multiple lines). firstName, lastName, and email are optional in both cases. Requires Authorization: Basic base64(projectId:projectSecret).
curl --request POST \
--url https://spectrum.photon.codes/projects/{projectId}/users/ \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"phoneNumber": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com"
}
'{
"succeed": true,
"data": {
"id": "<string>",
"projectId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"assignedPhoneNumber": "<string>",
"meta": {},
"createdAt": "<string>"
}
}Documentation Index
Fetch the complete documentation index at: https://docs.photon.codes/docs/llms.txt
Use this file to discover all available pages before exploring further.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Was this page helpful?