Skip to content

POST /v1/projects/{id}/platforms/imessage/assignments

Maps an end user's iMessage handle — an E.164 phone number or an email address — onto one of the project's pooled shared iMessage lines, consuming a seat from the project's entitlement. The assigned number is allocated by the server. When an email address is supplied in email the user is sent an invite asynchronously to that address; it is never inferred from the handle, and the response never reports whether the send succeeded. Requires the platforms:write permission bound to the project resource in the path.

photon.projects.platforms.imessage.assignments.create(input: CreateSharedLineAssignmentInput, options?: RequestOptions): Promise<CreateSharedLineAssignmentOutput>
import { Photon } from "@photon-ai/api";

const photon = new Photon({
  headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.platforms.imessage.assignments.create({
  path: {
    id: "id",
  },
  headers: {
    idempotencyKey: "idempotencyKey",
  },
  body: {
    handle: "handle",
  },
});
{
  "assignedPhoneNumber": "string",
  "assignmentId": "string",
  "createdAt": "2026-01-01T00:00:00.000Z",
  "email": "string",
  "firstName": "string",
  "handle": "string",
  "lastName": "string",
  "optIn": {
    "receivedAt": "2026-01-01T00:00:00.000Z",
    "state": "pending"
  },
  "platform": "imessage",
  "projectId": "string",
  "releasedAt": "2026-01-01T00:00:00.000Z",
  "updatedAt": "2026-01-01T00:00:00.000Z"
}

Parameters

Photon-VersionPhotonVersion

Selects the API contract date. Without it, the request is served as 2026-07-01.

Idempotency-Keystringrequired

Identifies one logical mutation across retries.

idstringrequired

Body

emailstring (email)
firstNamestring
handleImessageHandlerequired
lastNamestring

Returns

201 The created shared line assignment. SharedLineAssignment

Headers: Photon-Version. The raw response carries these headers; see Raw responses.

assignedPhoneNumberstringrequired
assignmentIdstringrequired
createdAtstring (date-time)required
emailstring
firstNamestring
handlestringrequired
lastNamestring
optInSharedLineAssignmentOptInrequired

Whether the end user has texted the assigned line from their handle since this assignment was created. Until they have, sends to them on this line are refused; once they have, the project can message them while the assignment is unreleased. A released assignment keeps its opt-in, and a re-created assignment starts pending. This records only that Photon allows replies; it is not a consent record for SMS compliance.

platformSharedLineAssignmentPlatformrequired
projectIdstringrequired
releasedAtstring (date-time)
updatedAtstring (date-time)required