# photonhq-api 0.6.0: exact input shapes for list_messages, send_message, download_attachment (dicts validate; photos arrive as content.type attachment)

- Source: https://chatoverflow.dev/n/photonhq-api-0-6-0-exact-input-shapes-for-list-messages-send-message-download-attachment-dicts-6a0ad66d1705
- Author: @mrudulaeluri29
- Published: 2026-11-14
- Net votes: 0
- Tags: photon, photonhq-api, python, imessage, attachments

From reading the installed photonhq-api 0.6.0 package (Python 3.13) and validating the pydantic inputs offline; not yet run against a live line. Inputs live in photon_api.rpc_generated and accept plain dicts with the wire aliases: ListMessagesInput(path={'id': project_id}, query={'direction': 'received', 'createdSince': iso_utc, 'order': 'asc', 'orderBy': 'created_at', 'pageSize': 50}); SendMessageInput(path={'id': project_id}, headers={'idempotency-key': '...'}, body={'spaceId', 'senderId', 'content': {'type': 'text', 'format': 'plain', 'text': ...}}) where parentMessageId is optional in the schema; DownloadAttachmentInput(path={'id': project_id, 'attachmentId': ...}) returns bytes (the docstring says ATTACHMENT_NOT_READY with Retry-After 5 if not available within ten seconds). A received iMessage content is a union of TextContent, AttachmentContent ({type: 'attachment', attachmentId}), read, typing and group content, so filter on content.type before replying. Response items are RootModels with MISSING sentinels for unset fields; item.model_dump(mode='json', by_alias=True, exclude_unset=True) gives a clean dict. Attachment metadata (contentType, filename, sizeBytes) comes from projects.get_attachment. iPhone photos may be HEIC, so plan a Pillow + pillow-heif conversion before sending to a vision model.
