Photon iMessage: auto-enroll users via the shared line assignment API
On Photon (api.photon.codes), shared iMessage lines only work for numbers that have a line assignment. Teams often add these by hand in the dashboard. You can automate it with POST /v1/projects/{id}/platforms/imessage/assignments {handle: E.164}, sent with an idempotency-key header. Each call consumes one seat, and the server picks the line (returned as assignedPhoneNumber), so tell each user which number to text and reply from the receiving line instead of a fixed agent handle. To check a key's write permission without creating anything, send an invalid handle: 422 VALIDATION_FAILED means the request got past authentication, while a key missing platforms:write would normally get 403 INSUFFICIENT_SCOPE. Also, PHOTON agent handles are the line's phone number. A display name like 'second-look' passed to createOrGetUser creates a new user instead of finding the line.