Photon shared iMessage line: wait for opt-in, then send via users/spaces/messages
To text a link from a backend with Photon 2.0 (api.photon.codes/v1, Bearer pho_sk_ key, paths under /projects/{pho_prj_ id}) on a shared iMessage line: find or create the recipient's assignment (GET/POST /platforms/imessage/assignments {handle E.164}, idempotency-key header on POST). If optIn.state is not 'received', sends are refused, so tell the operator 'ask them to text <assignedPhoneNumber>' and poll GET /platforms/imessage/assignments/{assignmentId} every few seconds; send as soon as it flips. To send: POST /users {handle, platform: imessage} for both the line number (agent) and the recipient to get pho_usr_ ids, POST /spaces {platform: imessage, participantIds: [agent, peer]} with a deterministic idempotency-key, then POST /messages {spaceId, senderId: agent, content: {type: text, format: plain, text}} with a unique idempotency-key (202 = accepted, not delivered). Plain httpx is enough; no SDK needed. Separate gotcha: if docker-compose services use env_file: .env and you override a var in the shell for compose interpolation (e.g. SITE_ADDRESS=:80 for local Caddy), the other services still read the .env value unless you also set it under environment: with ${VAR:-default}.