{ "openapi": "3.0.3", "info": { "title": "messages API", "version": "1.0.0 (v1.0)", "description": "This is the messages API schema." }, "paths": { "/api/v1.0/blob/{id}/download/": { "get": { "operationId": "blob_download_retrieve", "description": "Download binary data for the specified blob ID.\n\nThis endpoint returns the raw binary content of a blob. Access is controlled\nby checking if the user has access to any mailbox that owns this blob.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "blob" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "description": "No response body" } } } }, "/api/v1.0/blob/{id}/preview/": { "get": { "operationId": "blob_preview_retrieve", "description": "Serve a blob inline for the FilePreview viewer.\n\nSibling of ``download`` with the same authorization model but two\nextra guarantees:\n\n- the response Content-Type is the MIME type detected from the bytes\n (via ``python-magic``), not the value declared at upload time;\n- the detected MIME must belong to ``PREVIEWABLE_MIME_TYPES``,\n otherwise the endpoint refuses with 415.\n\nReturning 415 (rather than 200 with the raw payload) is the security\ncontract that lets the frontend render the response inline: any byte\nwe send back has been re-classified server-side as one of the safe\npreviewable types.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "blob" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } }, "description": "Inline preview of the blob. The Content-Type is the MIME type detected server-side and is guaranteed to belong to ``PREVIEWABLE_MIME_TYPES``." }, "400": { "description": "Invalid blob ID" }, "403": { "description": "Forbidden - User does not have permission to preview this blob" }, "404": { "description": "Blob not found" }, "415": { "description": "Unsupported media type for inline preview. The detected MIME is not in ``PREVIEWABLE_MIME_TYPES`` or does not match the declared Content-Type. The response body includes a ``code`` field set to either ``suspicious`` (declared type was previewable but bytes disagree) or ``unsupported`` (type is plainly not previewable)." }, "500": { "description": "Internal server error" } } } }, "/api/v1.0/blob/upload/{mailbox_id}/": { "post": { "operationId": "blob_upload_create", "description": "Upload binary data and create a Blob record.\n This endpoint accepts multipart/form-data containing a file and returns a\n blob ID and other metadata. The blob is associated with the specified mailbox.\n ", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string" }, "description": "ID of the mailbox to associate the blob with", "required": true } ], "tags": [ "blob" ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary", "description": "The file to upload" } }, "required": [ "file" ] } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "type": "object", "properties": { "blobId": { "type": "string", "format": "uuid" }, "type": { "type": "string" }, "size": { "type": "integer" }, "sha256": { "type": "string" } }, "required": [ "blobId", "type", "size", "sha256" ] } } }, "description": "Blob created successfully" }, "400": { "description": "Bad request - No file provided" }, "403": { "description": "Forbidden - User does not have permission to upload to this mailbox" }, "404": { "description": "Mailbox not found" }, "413": { "description": "Payload too large - exceeds MAX_OUTGOING_ATTACHMENT_SIZE" }, "500": { "description": "Internal server error" } } } }, "/api/v1.0/config/": { "get": { "operationId": "config_retrieve", "description": "Return a dictionary of public settings for the frontend to consume.", "tags": [ "config" ], "security": [ { "cookieAuth": [] }, {} ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "ENVIRONMENT": { "type": "string", "readOnly": true }, "RELEASE": { "type": "string", "description": "Version of the application", "readOnly": true }, "LANGUAGES": { "type": "array", "description": "Available languages, as (code, label) pairs", "items": { "type": "array", "items": { "type": "string" } }, "readOnly": true }, "LANGUAGE_CODE": { "type": "string", "readOnly": true }, "AI_ENABLED": { "type": "boolean", "readOnly": true }, "FEATURE_AI_SUMMARY": { "type": "boolean", "readOnly": true }, "FEATURE_AI_AUTOLABELS": { "type": "boolean", "readOnly": true }, "FEATURE_MAILBOX_ADMIN_CHANNELS": { "type": "array", "items": { "type": "string" }, "readOnly": true }, "DRIVE": { "type": "object", "description": "The URLs of the Drive external service.", "properties": { "sdk_url": { "type": "string" }, "api_url": { "type": "string" }, "file_url": { "type": "string" }, "preview_url": { "type": "string" }, "app_name": { "type": "string" } }, "required": [ "sdk_url", "api_url", "file_url", "preview_url", "app_name" ], "readOnly": true }, "SCHEMA_CUSTOM_ATTRIBUTES_USER": { "type": "object", "readOnly": true }, "SCHEMA_CUSTOM_ATTRIBUTES_MAILDOMAIN": { "type": "object", "readOnly": true }, "MAX_OUTGOING_ATTACHMENT_SIZE": { "type": "integer", "description": "Maximum size in bytes for outgoing email attachments", "readOnly": true }, "MAX_RECIPIENTS_PER_MESSAGE": { "type": "integer", "description": "Maximum number of recipients per message (to + cc + bcc)", "readOnly": true }, "MAX_TEMPLATE_IMAGE_SIZE": { "type": "integer", "description": "Maximum size in bytes for images embedded in templates and signatures", "readOnly": true }, "IMAGE_PROXY_ENABLED": { "type": "boolean", "description": "Whether external images should be proxied", "readOnly": true }, "MESSAGE_TRUSTED_LINK_DOMAINS": { "type": "array", "items": { "type": "string" }, "description": "Hostnames whose external links skip the redirect confirmation modal (a leading *. wildcard also matches subdomains)", "readOnly": true }, "FEATURE_MAILDOMAIN_CREATE": { "type": "boolean", "readOnly": true }, "FEATURE_MAILDOMAIN_MANAGE_ACCESSES": { "type": "boolean", "readOnly": true }, "FEATURE_THREAD_SPLIT": { "type": "boolean", "readOnly": true }, "FEATURE_MAILDOMAIN_MANAGE_TOTP": { "type": "boolean", "readOnly": true }, "MESSAGES_MANUAL_RETRY_MAX_AGE": { "type": "integer", "description": "Maximum age in seconds for a message to be eligible for manual retry of failed deliveries", "readOnly": true }, "FRONTEND_SILENT_LOGIN_ENABLED": { "type": "boolean", "description": "Whether silent OIDC login is enabled", "readOnly": true }, "SENTRY_DSN": { "type": "string", "description": "Sentry DSN shared with the frontend", "readOnly": true }, "FRONTEND_THEME_CONFIG": { "type": "object", "description": "Theme configuration for the frontend (theme, terms_of_service_url, footer)", "readOnly": true }, "FRONTEND_FORCED_DEFAULT_LANGUAGE": { "type": "boolean", "description": "Whether the frontend should fall back to LANGUAGE_CODE instead of the browser language", "readOnly": true }, "FRONTEND_MULTIPART_UPLOAD_CHUNK_SIZE_MB": { "type": "integer", "description": "Chunk size in MB for frontend multipart uploads", "readOnly": true }, "FRONTEND_HELP_CENTER_URL": { "type": "string", "description": "Help center URL", "readOnly": true }, "FRONTEND_FEEDBACK_WIDGET_CONFIG": { "type": "object", "description": "Configuration of the feedback widget", "properties": { "api_url": { "type": "string" }, "path": { "type": "string" }, "channel": { "type": "string" }, "home_channel": { "type": "string" } }, "readOnly": true }, "FRONTEND_LAGAUFRE_WIDGET_CONFIG": { "type": "object", "description": "Configuration of the Lagaufre widget", "properties": { "api_url": { "type": "string" }, "path": { "type": "string" } }, "readOnly": true }, "MOBILE_OTA_MANIFEST_URL": { "type": "string", "description": "OTA channel manifest URL the mobile apps poll at startup; unset disables OTA updates", "readOnly": true }, "PUSH_ENABLED": { "type": "boolean", "description": "Whether push notifications are available on this deployment (gates the device-registration UI).", "readOnly": true }, "PUSH_VAPID_PUBLIC_KEY": { "type": "string", "description": "VAPID public key (base64url) the web client passes as applicationServerKey to subscribe; null when Web Push is not configured.", "readOnly": true } }, "required": [ "ENVIRONMENT", "RELEASE", "LANGUAGES", "LANGUAGE_CODE", "AI_ENABLED", "FEATURE_AI_SUMMARY", "FEATURE_AI_AUTOLABELS", "FEATURE_MAILBOX_ADMIN_CHANNELS", "SCHEMA_CUSTOM_ATTRIBUTES_USER", "SCHEMA_CUSTOM_ATTRIBUTES_MAILDOMAIN", "MAX_OUTGOING_ATTACHMENT_SIZE", "MAX_RECIPIENTS_PER_MESSAGE", "MAX_TEMPLATE_IMAGE_SIZE", "IMAGE_PROXY_ENABLED", "MESSAGE_TRUSTED_LINK_DOMAINS", "FEATURE_MAILDOMAIN_CREATE", "FEATURE_MAILDOMAIN_MANAGE_ACCESSES", "FEATURE_THREAD_SPLIT", "FEATURE_MAILDOMAIN_MANAGE_TOTP", "MESSAGES_MANUAL_RETRY_MAX_AGE", "FRONTEND_SILENT_LOGIN_ENABLED", "PUSH_ENABLED" ] } } }, "description": "A dictionary of public configuration settings." } } } }, "/api/v1.0/contacts/": { "get": { "operationId": "contacts_list", "description": "List contacts with optional filtering by mailbox and search query.\nFor a mailbox, it returns all contacts in the mailbox and all contacts\nin the same domain as the mailbox.\n\nQuery parameters:\n- mailbox_id: Optional UUID to filter contacts by mailbox\n- q: Optional search query for name or email (case insensitive)", "parameters": [ { "in": "query", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "description": "Filter contacts by mailbox ID." }, { "in": "query", "name": "q", "schema": { "type": "string" }, "description": "Search contacts by name or email (case insensitive)." } ], "tags": [ "contacts" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Contact" } } } }, "description": "" } } } }, "/api/v1.0/contacts/{id}/": { "get": { "operationId": "contacts_retrieve", "description": "ViewSet for Contact model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "contacts" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Contact" } } }, "description": "" } } } }, "/api/v1.0/draft/": { "post": { "operationId": "draft_create", "description": "\n Create or update a draft message.\n\n This endpoint allows you to:\n - Create a new draft message in a new thread\n - Create a draft reply to an existing message in an existing thread\n - Update an existing draft message\n\n For creating a new draft:\n - Do not include messageId\n - Include parentId if replying to an existing message\n\n For updating an existing draft:\n - Include messageId of the draft to update\n - Only the fields that are provided will be updated\n\n At least one of draftBody must be provided.\n\n To add attachments, upload them first using the /api/v1.0/blob/upload/{mailbox_id}/ endpoint\n and include the returned blobIds in the attachmentIds field.\n ", "tags": [ "messages" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DraftMessageRequestRequest" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/DraftMessageRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } } }, "description": "" }, "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "403": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "404": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" } } }, "put": { "operationId": "draft_update", "description": "\n Create or update a draft message.\n\n This endpoint allows you to:\n - Create a new draft message in a new thread\n - Create a draft reply to an existing message in an existing thread\n - Update an existing draft message\n\n For creating a new draft:\n - Do not include messageId\n - Include parentId if replying to an existing message\n\n For updating an existing draft:\n - Include messageId of the draft to update\n - Only the fields that are provided will be updated\n\n At least one of draftBody must be provided.\n\n To add attachments, upload them first using the /api/v1.0/blob/upload/{mailbox_id}/ endpoint\n and include the returned blobIds in the attachmentIds field.\n ", "tags": [ "messages" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DraftMessageRequestRequest" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/DraftMessageRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } } }, "description": "" }, "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "403": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "404": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" } } } }, "/api/v1.0/draft/{message_id}/": { "post": { "operationId": "draft_create_2", "description": "\n Create or update a draft message.\n\n This endpoint allows you to:\n - Create a new draft message in a new thread\n - Create a draft reply to an existing message in an existing thread\n - Update an existing draft message\n\n For creating a new draft:\n - Do not include messageId\n - Include parentId if replying to an existing message\n\n For updating an existing draft:\n - Include messageId of the draft to update\n - Only the fields that are provided will be updated\n\n At least one of draftBody must be provided.\n\n To add attachments, upload them first using the /api/v1.0/blob/upload/{mailbox_id}/ endpoint\n and include the returned blobIds in the attachmentIds field.\n ", "parameters": [ { "in": "path", "name": "message_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "messages" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DraftMessageRequestRequest" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/DraftMessageRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } } }, "description": "" }, "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "403": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "404": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" } } }, "put": { "operationId": "draft_update_2", "description": "\n Create or update a draft message.\n\n This endpoint allows you to:\n - Create a new draft message in a new thread\n - Create a draft reply to an existing message in an existing thread\n - Update an existing draft message\n\n For creating a new draft:\n - Do not include messageId\n - Include parentId if replying to an existing message\n\n For updating an existing draft:\n - Include messageId of the draft to update\n - Only the fields that are provided will be updated\n\n At least one of draftBody must be provided.\n\n To add attachments, upload them first using the /api/v1.0/blob/upload/{mailbox_id}/ endpoint\n and include the returned blobIds in the attachmentIds field.\n ", "parameters": [ { "in": "path", "name": "message_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "messages" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DraftMessageRequestRequest" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/DraftMessageRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } } }, "description": "" }, "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" }, "examples": { "NewDraftMessage": { "value": { "subject": "Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ], "cc": [ "cc@example.com" ], "bcc": [ "bcc@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "New Draft Message" }, "DraftReply": { "value": { "parentId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Re: Hello", "draftBody": "{\"arbitrary\": \"json content\"}", "to": [ "recipient@example.com" ] }, "summary": "Draft Reply" }, "UpdateDraftWithAttachments": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "subject": "Updated subject", "draftBody": "{\"arbitrary\": \"new json content\"}", "to": [ "new-recipient@example.com" ], "signatureId": "123e4567-e89b-12d3-a456-426614174000", "attachments": [ { "partId": "att-1", "blobId": "123e4567-e89b-12d3-a456-426614174001", "name": "document.pdf" } ] }, "summary": "Update Draft with Attachments" } } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "403": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "404": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" } } } }, "/api/v1.0/draft/{message_id}/placeholders/": { "get": { "operationId": "draft_placeholders_retrieve", "description": "Resolve placeholder values for the authenticated user in the context of a draft message. The mailbox is derived from the draft's sender. recipient_name is resolved from the draft's TO recipients.", "summary": "Resolve placeholder values for a draft", "parameters": [ { "in": "path", "name": "message_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "messages" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "description": "Placeholder keys mapped to their resolved values", "additionalProperties": { "type": "string" }, "example": { "name": "John Doe", "recipient_name": "Jane Smith", "job_title": "Developer" } } } }, "description": "" }, "404": { "content": { "application/json": { "schema": { "description": "Draft not found" } } }, "description": "" } } } }, "/api/v1.0/flag/": { "post": { "operationId": "flag_create", "description": "Change a specific flag (unread, starred, trashed, archived, spam) for multiple messages or all messages within multiple threads. Uses request body.", "tags": [ "flags" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChangeFlagRequestRequest" }, "examples": { "MarkMessagesAsRead": { "value": { "flag": "unread", "value": false, "message_ids": [ "123e4567-e89b-12d3-a456-426614174001", "123e4567-e89b-12d3-a456-426614174002" ] }, "summary": "Mark messages as read" }, "TrashThreads": { "value": { "flag": "trashed", "value": true, "thread_ids": [ "a1b2c3d4-e5f6-7890-1234-567890abcdef", "b2c3d4e5-f6a7-8901-2345-67890abcdef0" ] }, "summary": "Trash threads" }, "ArchiveThreads": { "value": { "flag": "archived", "value": true, "thread_ids": [ "a1b2c3d4-e5f6-7890-1234-567890abcdef", "b2c3d4e5-f6a7-8901-2345-67890abcdef0" ] }, "summary": "Archive threads" }, "StarMessagesAndThreads": { "value": { "flag": "starred", "value": true, "message_ids": [ "123e4567-e89b-12d3-a456-426614174005" ], "thread_ids": [ "a1b2c3d4-e5f6-7890-1234-567890abcdef" ] }, "summary": "Star messages and threads" } } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ChangeFlagRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" }, "examples": { "MarkMessagesAsRead": { "value": { "flag": "unread", "value": false, "message_ids": [ "123e4567-e89b-12d3-a456-426614174001", "123e4567-e89b-12d3-a456-426614174002" ] }, "summary": "Mark messages as read" }, "TrashThreads": { "value": { "flag": "trashed", "value": true, "thread_ids": [ "a1b2c3d4-e5f6-7890-1234-567890abcdef", "b2c3d4e5-f6a7-8901-2345-67890abcdef0" ] }, "summary": "Trash threads" }, "ArchiveThreads": { "value": { "flag": "archived", "value": true, "thread_ids": [ "a1b2c3d4-e5f6-7890-1234-567890abcdef", "b2c3d4e5-f6a7-8901-2345-67890abcdef0" ] }, "summary": "Archive threads" }, "StarMessagesAndThreads": { "value": { "flag": "starred", "value": true, "message_ids": [ "123e4567-e89b-12d3-a456-426614174005" ], "thread_ids": [ "a1b2c3d4-e5f6-7890-1234-567890abcdef" ] }, "summary": "Star messages and threads" } } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "403": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" } } } }, "/api/v1.0/labels/": { "get": { "operationId": "labels_list", "description": "\n List all labels accessible to the user in a hierarchical structure.\n\n The response returns labels in a tree structure where:\n - Labels are ordered alphabetically by name\n - Each label includes its children (sub-labels)\n - The hierarchy is determined by the label's name (e.g., \"Inbox/Important\" is a child of \"Inbox\")\n\n You can filter labels by mailbox using the mailbox_id query parameter.\n ", "parameters": [ { "in": "query", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "description": "\n Filter labels by mailbox ID. If not provided, returns labels from all accessible mailboxes.\n " } ], "tags": [ "labels" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TreeLabel" } } } }, "description": "List of labels in hierarchical structure" } } }, "post": { "operationId": "labels_create", "description": "View and manage labels", "tags": [ "labels" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LabelRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/LabelRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Label" } } }, "description": "Created label" }, "400": { "content": { "application/json": { "schema": { "detail": "Validation error" } } }, "description": "Invalid input data" }, "403": { "content": { "application/json": { "schema": { "detail": "You need EDITOR, SENDER or ADMIN role to manage labels" } } }, "description": "Permission denied" } } } }, "/api/v1.0/labels/{id}/": { "put": { "operationId": "labels_update", "description": "View and manage labels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "labels" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LabelRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/LabelRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Label" } } }, "description": "Label updated successfully" }, "400": { "content": { "application/json": { "schema": { "detail": "Validation error" } } }, "description": "Invalid input data" }, "403": { "content": { "application/json": { "schema": { "detail": "You need EDITOR, SENDER or ADMIN role to manage labels" } } }, "description": "Permission denied" } } }, "patch": { "operationId": "labels_partial_update", "description": "View and manage labels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "labels" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedLabelRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedLabelRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Label" } } }, "description": "" } } }, "delete": { "operationId": "labels_destroy", "description": "View and manage labels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "labels" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "Label deleted successfully" }, "403": { "content": { "application/json": { "schema": { "detail": "You need EDITOR, SENDER or ADMIN role to manage labels" } } }, "description": "Permission denied" }, "404": { "description": "Label not found" } } } }, "/api/v1.0/labels/{id}/add-threads/": { "post": { "operationId": "labels_add_threads_create", "description": "View and manage labels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "labels" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "thread_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "List of thread IDs to add to this label" } } } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Label" } } }, "description": "Threads added to label successfully" }, "400": { "content": { "application/json": { "schema": { "detail": "Validation error" } } }, "description": "Invalid input data" }, "403": { "content": { "application/json": { "schema": { "detail": "You need EDITOR, SENDER or ADMIN role to manage labels" } } }, "description": "Permission denied" } } } }, "/api/v1.0/labels/{id}/remove-threads/": { "post": { "operationId": "labels_remove_threads_create", "description": "View and manage labels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "labels" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "thread_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "List of thread IDs to remove from this label" } } } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Label" } } }, "description": "Threads removed from label successfully" }, "400": { "content": { "application/json": { "schema": { "detail": "Validation error" } } }, "description": "Invalid input data" }, "403": { "content": { "application/json": { "schema": { "detail": "You need EDITOR, SENDER or ADMIN role to manage labels" } } }, "description": "Permission denied" } } } }, "/api/v1.0/mailboxes/": { "get": { "operationId": "mailboxes_list", "description": "ViewSet for Mailbox model.", "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Mailbox" } } } }, "description": "" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/accesses/": { "get": { "operationId": "mailboxes_accesses_list", "description": "ViewSet for managing MailboxAccess records for a specific Mailbox.\nThe mailbox_id is expected as part of the URL.\nAccess is allowed if the user has MailboxAccess (ADMIN role)\nto the target Mailbox itself, or is a domain admin of the mailbox's domain.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true }, { "name": "page", "required": false, "in": "query", "description": "A page number within the paginated result set.", "schema": { "type": "integer" } } ], "tags": [ "mailbox-accesses" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedMailboxAccessReadList" } } }, "description": "" } } }, "post": { "operationId": "mailboxes_accesses_create", "description": "ViewSet for managing MailboxAccess records for a specific Mailbox.\nThe mailbox_id is expected as part of the URL.\nAccess is allowed if the user has MailboxAccess (ADMIN role)\nto the target Mailbox itself, or is a domain admin of the mailbox's domain.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailbox-accesses" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAccessWriteRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MailboxAccessWriteRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAccessWrite" } } }, "description": "" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/accesses/{id}/": { "get": { "operationId": "mailboxes_accesses_retrieve", "description": "ViewSet for managing MailboxAccess records for a specific Mailbox.\nThe mailbox_id is expected as part of the URL.\nAccess is allowed if the user has MailboxAccess (ADMIN role)\nto the target Mailbox itself, or is a domain admin of the mailbox's domain.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailbox-accesses" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAccessRead" } } }, "description": "" } } }, "put": { "operationId": "mailboxes_accesses_update", "description": "ViewSet for managing MailboxAccess records for a specific Mailbox.\nThe mailbox_id is expected as part of the URL.\nAccess is allowed if the user has MailboxAccess (ADMIN role)\nto the target Mailbox itself, or is a domain admin of the mailbox's domain.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailbox-accesses" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAccessWriteRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MailboxAccessWriteRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAccessWrite" } } }, "description": "" } } }, "patch": { "operationId": "mailboxes_accesses_partial_update", "description": "ViewSet for managing MailboxAccess records for a specific Mailbox.\nThe mailbox_id is expected as part of the URL.\nAccess is allowed if the user has MailboxAccess (ADMIN role)\nto the target Mailbox itself, or is a domain admin of the mailbox's domain.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailbox-accesses" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedMailboxAccessWriteRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedMailboxAccessWriteRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAccessWrite" } } }, "description": "" } } }, "delete": { "operationId": "mailboxes_accesses_destroy", "description": "ViewSet for managing MailboxAccess records for a specific Mailbox.\nThe mailbox_id is expected as part of the URL.\nAccess is allowed if the user has MailboxAccess (ADMIN role)\nto the target Mailbox itself, or is a domain admin of the mailbox's domain.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailbox-accesses" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/calendar/add/": { "post": { "operationId": "mailboxes_calendar_add_create", "description": "Add an event to the mailbox's CalDAV calendar via a background task.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "calendar" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarAddEventRequestRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/CalendarAddEventRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarAddEventResponse" } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "Missing ics_data." }, "503": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "Task broker unavailable; the add-event could not be enqueued." } } } }, "/api/v1.0/mailboxes/{mailbox_id}/calendar/calendars/": { "get": { "operationId": "mailboxes_calendar_calendars_retrieve", "description": "Return the list of calendars available for the mailbox.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "calendar" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarListResponse" } } }, "description": "" }, "403": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "Per-mailbox CalDAV channel denied access (upstream 403). Not returned for the deployment-default config, where a 403 is treated as an empty calendar list." }, "502": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "CalDAV server error while listing calendars." } } } }, "/api/v1.0/mailboxes/{mailbox_id}/calendar/conflicts/": { "post": { "operationId": "mailboxes_calendar_conflicts_create", "description": "Return a list of events overlapping the requested time range.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "calendar" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarConflictsRequestRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/CalendarConflictsRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarConflictsResponse" } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "Missing or invalid start/end." }, "502": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "CalDAV server error while checking conflicts." } } } }, "/api/v1.0/mailboxes/{mailbox_id}/calendar/rsvp/": { "post": { "operationId": "mailboxes_calendar_rsvp_create", "description": "Submit an RSVP response via a background CalDAV task.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "calendar" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarRsvpRequestRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/CalendarRsvpRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CalendarRsvpResponse" } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "Missing or invalid ics_data / response." }, "503": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "Task broker unavailable; the RSVP could not be enqueued." } } } }, "/api/v1.0/mailboxes/{mailbox_id}/channels/": { "get": { "operationId": "mailboxes_channels_list", "description": "Manage integration channels for a mailbox", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "channels" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Channel" } } } }, "description": "" } } }, "post": { "operationId": "mailboxes_channels_create", "description": "Manage integration channels for a mailbox", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "channels" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChannelRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ChannelRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChannelCreateResponse" } } }, "description": "Channel created successfully. The response carries the one-time plaintext credential (api_key / secret) which is never returned again." }, "400": { "description": "Invalid input data" }, "403": { "description": "Permission denied" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/channels/{id}/": { "get": { "operationId": "mailboxes_channels_retrieve", "description": "Manage integration channels for a mailbox", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "channels" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Channel" } } }, "description": "" } } }, "put": { "operationId": "mailboxes_channels_update", "description": "Manage integration channels for a mailbox", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "channels" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChannelRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ChannelRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Channel" } } }, "description": "Channel updated successfully" }, "400": { "description": "Invalid input data" }, "403": { "description": "Permission denied" }, "404": { "description": "Channel not found" } } }, "patch": { "operationId": "mailboxes_channels_partial_update", "description": "Manage integration channels for a mailbox", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "channels" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedChannelRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedChannelRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Channel" } } }, "description": "" } } }, "delete": { "operationId": "mailboxes_channels_destroy", "description": "Manage integration channels for a mailbox", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "channels" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "Channel deleted successfully" }, "403": { "description": "Permission denied" }, "404": { "description": "Channel not found" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/channels/{id}/regenerate-secret/": { "post": { "operationId": "mailboxes_channels_regenerate_secret_create", "description": "Manage integration channels for a mailbox", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "channels" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegeneratedSecretResponse" } } }, "description": "Rotates the channel's secret. Single-active: the previous credential is invalidated immediately. The response carries exactly one of ``api_key`` / ``secret`` matching the channel's type (and, for webhooks, its current ``auth_method``)." }, "400": { "description": "Channel type has no rotatable secret" }, "403": { "description": "Permission denied" }, "404": { "description": "Channel not found" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/image-proxy/": { "get": { "operationId": "mailboxes_image_proxy_list", "description": "Proxy an external image through the server.\n\n This endpoint fetches images from external sources and serves them\n through the application to protect user privacy. Requires the\n IMAGE_PROXY_ENABLED environment variable to be set to true.\n ", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string" }, "description": "ID of the mailbox", "required": true }, { "in": "query", "name": "url", "schema": { "type": "string" }, "description": "The external image URL to proxy", "required": true } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "description": "Image content" }, "400": { "description": "Invalid request" }, "403": { "description": "Forbidden" }, "413": { "description": "Image too large" }, "502": { "description": "Failed to fetch external image" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/imports/": { "get": { "operationId": "mailboxes_imports_list", "description": "Start, list, retrieve and manage import runs for one mailbox.\n\nMailbox-nested and gated by ``IsMailboxAdmin`` on the URL mailbox — imports\nbulk-load mail into a mailbox, so they are an admin operation (matching the\n``import_messages`` ability that gates the UI).", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "import" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ImportRun" } } } }, "description": "" } } }, "post": { "operationId": "mailboxes_imports_create", "description": "Start an import into the URL mailbox (``source=file`` from an\nuploaded archive, or ``source=imap`` from a live server).", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "import" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportCreateRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ImportCreateRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportRun" } } }, "description": "Import started; returns the import run to poll." }, "400": { "description": "Invalid input data or file format" }, "403": { "description": "No access to the mailbox" }, "404": { "description": "Mailbox not found" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/imports/{id}/": { "get": { "operationId": "mailboxes_imports_retrieve", "description": "Start, list, retrieve and manage import runs for one mailbox.\n\nMailbox-nested and gated by ``IsMailboxAdmin`` on the URL mailbox — imports\nbulk-load mail into a mailbox, so they are an admin operation (matching the\n``import_messages`` ability that gates the UI).", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "import" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportRun" } } }, "description": "" } } }, "patch": { "operationId": "mailboxes_imports_partial_update", "description": "Arm or pause a continuous import via ``mode`` / ``is_active``.\n\n* ``mode=continuous`` (IMAP only) (re-)arms the import as a poller —\n flips ``is_active=True`` and dispatches a run now. Also the \"re-enable\n a finished oneshot as continuous\" path: stored credentials are reused,\n no re-auth.\n* ``mode=oneshot`` demotes a continuous poller back to a one-shot —\n polling stops (``is_active=False``); credentials and watermark are\n kept so it can be re-armed later.\n* ``is_active=false`` pauses a continuous poller (credentials are kept).\n\nThe poll cadence is the global ``MESSAGES_IMPORT_IMAP_POLL_INTERVAL``\nsetting, not settable here.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "import" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedImportUpdateRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedImportUpdateRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportRun" } } }, "description": "" } } }, "delete": { "operationId": "mailboxes_imports_destroy", "description": "Forget an import run, keeping the mail it imported.\n\nDeletes the Channel row (``Message.channel`` is SET_NULL, so the\nmessages survive) — the opposite of ``cancel``, which deletes the\nmessages (and then the row too). Only a settled run can be forgotten:\ncancel a running import first, and pause (or demote) a continuous\npoller so a live worker never loses its channel row mid-run.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "import" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "Import forgotten. Its imported messages are kept." }, "400": { "description": "The import is still running or still polling." }, "403": { "description": "Permission denied" }, "404": { "description": "Import not found" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/imports/{id}/cancel/": { "post": { "operationId": "mailboxes_imports_cancel_create", "description": "Cancel an import.\n\nFlips it to ``cancelled`` synchronously (so the run stops and the\nscheduler won't resume it) and offloads the potentially-large message\ndeletion + orphan-thread cleanup to an idempotent background task —\nwhich also removes the run from ``/imports/`` once it has settled.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "import" ], "security": [ { "cookieAuth": [] } ], "responses": { "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportRun" } } }, "description": "Import cancelled. The run is marked cancelled immediately; its imported messages are deleted (and empty threads cleaned) in the background. Imported messages in threads with non-import activity (e.g. a reply) are kept." }, "403": { "description": "Permission denied" }, "404": { "description": "Import not found" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/imports/upload/": { "post": { "operationId": "mailboxes_imports_upload_create", "description": "Create a multipart upload (returns ``upload_id``) or a direct\npresigned PUT url for a file in the imports bucket.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "201": { "description": "No response body" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/imports/upload/{upload_id}/": { "put": { "operationId": "mailboxes_imports_upload_update", "description": "Complete a multipart upload by providing all part ETags.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true }, { "in": "path", "name": "upload_id", "schema": { "type": "string" }, "required": true } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "description": "No response body" } } }, "delete": { "operationId": "mailboxes_imports_upload_destroy", "description": "Abort a multipart upload.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true }, { "in": "path", "name": "upload_id", "schema": { "type": "string" }, "required": true } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/imports/upload/{upload_id}/part/": { "post": { "operationId": "mailboxes_imports_upload_part_create", "description": "Create a presigned url to upload one part of a multipart upload.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true }, { "in": "path", "name": "upload_id", "schema": { "type": "string" }, "required": true } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "description": "No response body" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/message-templates/": { "get": { "operationId": "mailboxes_message_templates_list", "description": "List message templates for a mailbox.", "parameters": [ { "in": "query", "name": "bodies", "schema": { "type": "string" }, "description": "Comma-separated list of body fields to include in the response. Allowed values: raw, html, text. Example: ?bodies=raw,html" }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true }, { "in": "query", "name": "type", "schema": { "type": "array", "items": { "type": "string", "enum": [ "autoreply", "message", "signature" ] } } } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ReadMessageTemplate" } } } }, "description": "" } } }, "post": { "operationId": "mailboxes_message_templates_create", "description": "Create a template and return a read-serialized response.", "parameters": [ { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailboxes" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplateRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MessageTemplateRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplate" } } }, "description": "" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/message-templates/{id}/": { "get": { "operationId": "mailboxes_message_templates_retrieve", "description": "Retrieve a message template.", "parameters": [ { "in": "query", "name": "bodies", "schema": { "type": "string" }, "description": "Comma-separated list of body fields to include in the response. Allowed values: raw, html, text. Example: ?bodies=raw,html" }, { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadMessageTemplate" } } }, "description": "" } } }, "put": { "operationId": "mailboxes_message_templates_update", "description": "Update a template and return a read-serialized response.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailboxes" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplateRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MessageTemplateRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplate" } } }, "description": "" } } }, "patch": { "operationId": "mailboxes_message_templates_partial_update", "description": "ViewSet for managing message templates for a mailbox.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailboxes" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedMessageTemplateRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedMessageTemplateRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplate" } } }, "description": "" } } }, "delete": { "operationId": "mailboxes_message_templates_destroy", "description": "ViewSet for managing message templates for a mailbox.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/message-templates/{id}/render/": { "get": { "operationId": "mailboxes_message_templates_render_retrieve", "description": "Render the template's html and text bodies with placeholders resolved from the mailbox and the authenticated user (name, user_name, custom attributes). When a draft message_id is provided, message-level placeholders (recipient_name) are also resolved. Unresolved placeholders keep their {placeholder} token.", "summary": "Render a message template", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true }, { "in": "query", "name": "message_id", "schema": { "type": "string", "format": "uuid" }, "description": "Optional draft id used to resolve message-level placeholders. Ignored unless it references a draft owned by this mailbox." } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "description": "The rendered template bodies.", "properties": { "html_body": { "type": "string" }, "text_body": { "type": "string" } }, "required": [ "html_body", "text_body" ], "example": { "html_body": "

John Doe

", "text_body": "John Doe" } } } }, "description": "" } } } }, "/api/v1.0/mailboxes/{mailbox_id}/message-templates/available/": { "get": { "operationId": "mailboxes_message_templates_available_list", "description": "List message templates.", "parameters": [ { "in": "query", "name": "bodies", "schema": { "type": "string" }, "description": "Comma-separated list of body fields to include in the response. Allowed values: raw, html, text. Example: ?bodies=raw,html" }, { "in": "path", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "required": true }, { "in": "query", "name": "type", "schema": { "type": "string", "enum": [ "autoreply", "message", "signature" ] } } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ReadMessageTemplate" } } } }, "description": "" } } } }, "/api/v1.0/mailboxes/{id}/": { "get": { "operationId": "mailboxes_retrieve", "description": "ViewSet for Mailbox model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Mailbox" } } }, "description": "" } } }, "patch": { "operationId": "mailboxes_partial_update", "description": "Rename a mailbox (its display contact name). Mailbox admins only.\n\n``partial=True`` keeps true PATCH semantics: omitting ``name`` is a no-op\nrather than a 400, so the runtime matches the optional request schema.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "mailboxes" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedMailboxNameUpdateRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedMailboxNameUpdateRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Mailbox" } } }, "description": "" } } } }, "/api/v1.0/mailboxes/{id}/search/": { "get": { "operationId": "mailboxes_search_list", "description": "Search mailboxes by domain, local part and contact name.\n\nQuery parameters:\n- q: Optional search query for local part and contact name", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "query", "name": "q", "schema": { "type": "string" }, "description": "Search mailboxes by domain, local part and contact name." } ], "tags": [ "mailboxes" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MailboxLight" } } } }, "description": "" } } } }, "/api/v1.0/maildomains/": { "get": { "operationId": "maildomains_list", "description": "List mail domains, optionally filtered by name with the `q` parameter.", "parameters": [ { "name": "page", "required": false, "in": "query", "description": "A page number within the paginated result set.", "schema": { "type": "integer" } }, { "in": "query", "name": "q", "schema": { "type": "string" }, "description": "Filter domains whose name contains this value (case-insensitive)." } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedMailDomainAdminList" } } }, "description": "" } } }, "post": { "operationId": "maildomains_create", "description": "ViewSet for listing MailDomains the user administers.\nProvides a top-level entry for mail domain administration.\nEndpoint: /maildomains//", "tags": [ "maildomains" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailDomainAdminWriteRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MailDomainAdminWriteRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailDomainAdminWrite" } } }, "description": "" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/": { "get": { "operationId": "maildomains_retrieve", "description": "ViewSet for listing MailDomains the user administers.\nProvides a top-level entry for mail domain administration.\nEndpoint: /maildomains//", "parameters": [ { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailDomainAdmin" } } }, "description": "" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/accesses/": { "get": { "operationId": "maildomains_accesses_list", "description": "ViewSet for managing MaildomainAccess records for a specific Maildomain.\nAccess is allowed if the user is maildomain admin or a super user.", "parameters": [ { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomain-accesses" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MaildomainAccessRead" } } } }, "description": "" } } }, "post": { "operationId": "maildomains_accesses_create", "description": "ViewSet for managing MaildomainAccess records for a specific Maildomain.\nAccess is allowed if the user is maildomain admin or a super user.", "parameters": [ { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomain-accesses" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MaildomainAccessWriteRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MaildomainAccessWriteRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MaildomainAccessWrite" } } }, "description": "" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/accesses/{id}/": { "get": { "operationId": "maildomains_accesses_retrieve", "description": "ViewSet for managing MaildomainAccess records for a specific Maildomain.\nAccess is allowed if the user is maildomain admin or a super user.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomain-accesses" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MaildomainAccessRead" } } }, "description": "" } } }, "delete": { "operationId": "maildomains_accesses_destroy", "description": "ViewSet for managing MaildomainAccess records for a specific Maildomain.\nAccess is allowed if the user is maildomain admin or a super user.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomain-accesses" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/check-dns/": { "post": { "operationId": "maildomains_check_dns_create", "description": "Check DNS records for a specific mail domain.", "parameters": [ { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DNSCheckResponse" } } }, "description": "" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/mailboxes/": { "get": { "operationId": "maildomains_mailboxes_list", "description": "List mailboxes, optionally filtered by local part / contact name.", "parameters": [ { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true }, { "name": "page", "required": false, "in": "query", "description": "A page number within the paginated result set.", "schema": { "type": "integer" } }, { "in": "query", "name": "q", "schema": { "type": "string" }, "description": "Filter mailboxes whose local part or contact name contains this value (case-insensitive)." } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedMailboxAdminList" } } }, "description": "" } } }, "post": { "operationId": "maildomains_mailboxes_create", "description": "Create new mailbox in a specific maildomain.", "parameters": [ { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAdminCreatePayloadRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MailboxAdminCreatePayloadRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAdminCreate" } } }, "description": "The new mailbox with one extra field `one_time_password` if identity provider is keycloak." } } } }, "/api/v1.0/maildomains/{maildomain_pk}/mailboxes/{id}/": { "get": { "operationId": "maildomains_mailboxes_retrieve", "description": "ViewSet for managing Mailboxes within a specific MailDomain.\nNested under /maildomains/{maildomain_pk}/mailboxes/\nPermissions are checked by IsMailDomainAdmin for the maildomain_pk.\n\nThis viewset serves a different purpose than the one in mailbox.py (/api/v1.0/mailboxes/).\nThat other one is for listing the mailboxes a user has access to in regular app use.\nThis one is for managing mailboxes within a specific maildomain in the admin interface.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAdmin" } } }, "description": "" } } }, "patch": { "operationId": "maildomains_mailboxes_partial_update", "description": "Partially update a mailbox in a specific maildomain.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedMailboxAdminPartialUpdatePayloadRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedMailboxAdminPartialUpdatePayloadRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAdmin" } } }, "description": "The updated mailbox." } } }, "delete": { "operationId": "maildomains_mailboxes_destroy", "description": "ViewSet for managing Mailboxes within a specific MailDomain.\nNested under /maildomains/{maildomain_pk}/mailboxes/\nPermissions are checked by IsMailDomainAdmin for the maildomain_pk.\n\nThis viewset serves a different purpose than the one in mailbox.py (/api/v1.0/mailboxes/).\nThat other one is for listing the mailboxes a user has access to in regular app use.\nThis one is for managing mailboxes within a specific maildomain in the admin interface.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/mailboxes/{id}/mandatory-totp/": { "post": { "operationId": "maildomains_mailboxes_set_mandatory_totp", "description": "Toggle the Keycloak realm role indicated by KEYCLOAK_TOTP_ROLE_ID on the user backing this mailbox.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAdminMandatoryTotpPayloadRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MailboxAdminMandatoryTotpPayloadRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAdminMandatoryTotpResponse" } } }, "description": "" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/mailboxes/{id}/reset-password/": { "patch": { "operationId": "maildomains_mailboxes_reset_password", "description": "Reset the Keycloak password for a specific mailbox.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResetPasswordResponse" } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResetPasswordError" } } }, "description": "" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResetPasswordNotFound" } } }, "description": "" }, "500": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResetPasswordInternalServerError" } } }, "description": "" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/mailboxes/{id}/reset-totp/": { "patch": { "operationId": "maildomains_mailboxes_reset_totp", "description": "Remove existing OTP credentials and require the user to re-enroll in TOTP on next login.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxAdminResetTotpResponse" } } }, "description": "" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/message-templates/": { "get": { "operationId": "maildomains_message_templates_list", "description": "List message templates for a maildomain.", "parameters": [ { "in": "query", "name": "bodies", "schema": { "type": "string" }, "description": "Comma-separated list of body fields to include in the response. Allowed values: raw, html, text. Example: ?bodies=raw,html" }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true }, { "in": "query", "name": "type", "schema": { "type": "string", "enum": [ "autoreply", "message", "signature" ] } } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ReadMessageTemplate" } } } }, "description": "" } } }, "post": { "operationId": "maildomains_message_templates_create", "description": "Create a template and return a read-serialized response.", "parameters": [ { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplateRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MessageTemplateRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplate" } } }, "description": "" } } } }, "/api/v1.0/maildomains/{maildomain_pk}/message-templates/{id}/": { "get": { "operationId": "maildomains_message_templates_retrieve", "description": "Retrieve a message template.", "parameters": [ { "in": "query", "name": "bodies", "schema": { "type": "string" }, "description": "Comma-separated list of body fields to include in the response. Allowed values: raw, html, text. Example: ?bodies=raw,html" }, { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadMessageTemplate" } } }, "description": "" } } }, "put": { "operationId": "maildomains_message_templates_update", "description": "Update a template and return a read-serialized response.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplateRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MessageTemplateRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplate" } } }, "description": "" } } }, "patch": { "operationId": "maildomains_message_templates_partial_update", "description": "ViewSet for managing message templates for a maildomain.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedMessageTemplateRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedMessageTemplateRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageTemplate" } } }, "description": "" } } }, "delete": { "operationId": "maildomains_message_templates_destroy", "description": "ViewSet for managing message templates for a maildomain.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "maildomains" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/messages/": { "get": { "operationId": "messages_list", "description": "ViewSet for Message model.", "tags": [ "messages" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Message" } } } }, "description": "" } } } }, "/api/v1.0/messages/{id}/": { "get": { "operationId": "messages_retrieve", "description": "ViewSet for Message model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true } ], "tags": [ "messages" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" } } }, "description": "" } } }, "delete": { "operationId": "messages_destroy", "description": "Delete a message. Object permission checked by IsAllowedToAccess.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true } ], "tags": [ "messages" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/messages/{id}/delivery-statuses/": { "patch": { "operationId": "messages_delivery_statuses_partial_update", "description": "Update delivery status of message recipients.\n\nRequest body should be a dict mapping MessageRecipient IDs to target statuses.\nExample: {\"recipient_id_1\": \"cancelled\", \"recipient_id_2\": \"retry\"}\n\nAllowed transitions:\n- FAILED -> CANCELLED\n- FAILED -> RETRY manual retry, only for messages sent within the configured max age: MESSAGES_MANUAL_RETRY_MAX_AGE\n- RETRY -> CANCELLED", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true } ], "tags": [ "messages" ], "requestBody": { "content": { "type": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified request body" } }, "additionalProperties": { "schema": { "$ref": "#/components/schemas/MessageDeliveryStatusChoices" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeliveryStatusUpdateResponse" } } }, "description": "" } } } }, "/api/v1.0/messages/{id}/eml/": { "get": { "operationId": "messages_eml_retrieve", "description": "Return the EML file for a message.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true } ], "tags": [ "messages" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" } } }, "description": "" } } } }, "/api/v1.0/placeholders/": { "get": { "operationId": "placeholders_retrieve", "description": "Get the structure of all available fields with their labels", "summary": "Get field structure", "tags": [ "placeholders" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "description": "Field slugs mapped to their label metadata. Built-in fields have an empty object and are localized client-side. Custom attribute fields expose their schema title and optional per-language translations.", "additionalProperties": { "type": "object", "properties": { "title": { "type": "string", "description": "Default label (custom fields only)." }, "i18n": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Label translations by language code, from the schema 'x-i18n' entry (custom fields only)." } } }, "example": { "name": {}, "recipient_name": {}, "job_title": { "title": "Job title", "i18n": { "en": "Job title", "fr": "Fonction" } } } } } }, "description": "" } } } }, "/api/v1.0/send/": { "post": { "operationId": "send_create", "description": "\n Send a previously created draft message.\n\n This endpoint finalizes and sends a message previously saved as a draft.\n The message content (subject, body, recipients) should be set when creating/updating the draft.\n Returns a task ID that can be used to track the sending status.\n ", "tags": [ "messages" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageRequest" }, "examples": { "SendDraft": { "value": { "messageId": "123e4567-e89b-12d3-a456-426614174000", "senderId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "textBody": "Hello, world!", "htmlBody": "

Hello, world!

" }, "summary": "Send Draft" } } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/SendMessageRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageResponse" }, "examples": { "SendDraftResult": { "value": { "task_id": "123e4567-e89b-12d3-a456-426614174000" }, "summary": "Send Draft Result" } } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "403": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" }, "500": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": {}, "description": "Unspecified response body" } } }, "description": "" } } } }, "/api/v1.0/tasks/{task_id}/": { "get": { "operationId": "tasks_retrieve", "description": "\n Get the status of an async task.\n\n This endpoint returns the current status of a task identified by its ID.\n ", "parameters": [ { "in": "path", "name": "task_id", "schema": { "type": "string" }, "required": true } ], "tags": [ "tasks" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskStatusResponse" }, "examples": { "TaskStatus": { "value": { "status": "SUCCESS", "result": { "success": true }, "error": null }, "summary": "Task Status" } } } }, "description": "" } } } }, "/api/v1.0/third-party/drive/": { "get": { "operationId": "third_party_drive_retrieve", "description": "Search for files created by the current user.", "parameters": [ { "in": "query", "name": "title", "schema": { "type": "string" }, "description": "Search files by title." } ], "tags": [ "third-party/drive" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedDriveItemResponse" } } }, "description": "Files found" } } }, "post": { "operationId": "third_party_drive_create", "description": "Save an attachment to the user's Drive workspace. If the file already exists (matched by title and size), returns the existing item with a 200 status. Otherwise, creates a new file and returns it with a 201 status.", "tags": [ "third-party/drive" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DriveUploadAttachmentRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/DriveUploadAttachmentRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PartialDriveItem" } } }, "description": "File already exists in Drive" }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PartialDriveItem" } } }, "description": "File created successfully" } } } }, "/api/v1.0/threads/": { "get": { "operationId": "threads_list", "description": "List threads with optional search functionality.", "parameters": [ { "in": "query", "name": "has_active", "schema": { "type": "integer" }, "description": "Filter threads that have active messages (1=true, 0=false)." }, { "in": "query", "name": "has_archived", "schema": { "type": "integer" }, "description": "Filter threads that have archived (1=true, 0=false)." }, { "in": "query", "name": "has_assigned_to_me", "schema": { "type": "integer" }, "description": "Filter threads assigned to the current user (1=true, 0=false)." }, { "in": "query", "name": "has_attachments", "schema": { "type": "integer" }, "description": "Filter threads with attachments (1=true, 0=false)." }, { "in": "query", "name": "has_delivery_pending", "schema": { "type": "integer" }, "description": "Filter threads that have delivery pending messages: sending, retry or failed (1=true, 0=false)." }, { "in": "query", "name": "has_draft", "schema": { "type": "integer" }, "description": "Filter threads with draft messages (1=true, 0=false)." }, { "in": "query", "name": "has_mention", "schema": { "type": "integer" }, "description": "Filter threads with any mention (read or unread) for the current user (1=true, 0=false)." }, { "in": "query", "name": "has_messages", "schema": { "type": "integer" }, "description": "Filter threads that have messages (1=true, 0=false)." }, { "in": "query", "name": "has_sender", "schema": { "type": "integer" }, "description": "Filter threads with messages sent by the user (1=true, 0=false)." }, { "in": "query", "name": "has_starred", "schema": { "type": "integer" }, "description": "Filter threads with starred messages (1=true, 0=false)." }, { "in": "query", "name": "has_trashed", "schema": { "type": "integer" }, "description": "Filter threads that have trashed messages (1=true, 0=false)." }, { "in": "query", "name": "has_unassigned", "schema": { "type": "integer" }, "description": "Filter threads with no active assignment from any user (1=true, 0=false)." }, { "in": "query", "name": "has_unread", "schema": { "type": "integer" }, "description": "Filter threads with unread messages (1=true, 0=false). Requires mailbox_id." }, { "in": "query", "name": "has_unread_mention", "schema": { "type": "integer" }, "description": "Filter threads with unread mentions for the current user (1=true, 0=false)." }, { "in": "query", "name": "is_spam", "schema": { "type": "integer" }, "description": "Filter threads that are spam (1=true, 0=false)." }, { "in": "query", "name": "is_trashed", "schema": { "type": "integer" }, "description": "Filter threads that have all messages trashed (1=true, 0=false)." }, { "in": "query", "name": "label_slug", "schema": { "type": "string" }, "description": "Filter threads by label slug." }, { "in": "query", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "description": "Filter threads by mailbox ID." }, { "name": "page", "required": false, "in": "query", "description": "A page number within the paginated result set.", "schema": { "type": "integer" } }, { "in": "query", "name": "search", "schema": { "type": "string" }, "description": "Search threads by content (subject, sender, recipients, message body)." } ], "tags": [ "threads" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedThreadList" } } }, "description": "" } } } }, "/api/v1.0/threads/{id}/": { "get": { "operationId": "threads_retrieve", "description": "Retrieve a single thread, ignoring spam/trashed filters.\n\nDeep-link sharing relies on a stable URL that survives state\nchanges: a shared link must keep working after the thread is\narchived, marked as spam, or moved to trash. The ThreadAccess\npermission check still applies, so unauthorized users get 404.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "threads" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Thread" } } }, "description": "" } } }, "delete": { "operationId": "threads_destroy", "description": "Delete a thread, requiring EDITOR role on the thread.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "threads" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/threads/{id}/refresh-summary/": { "post": { "operationId": "threads_refresh_summary_create", "description": "Refresh the summary of a thread.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "threads" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "summary": { "type": "string" } } } } }, "description": "Summary successfully refreshed." }, "403": { "content": { "application/json": { "schema": { "detail": "Permission denied" } } }, "description": "User does not have permission to refresh the summary of this thread." } } } }, "/api/v1.0/threads/{id}/split/": { "post": { "operationId": "threads_split_create", "description": "Split a thread by moving the specified message and all later messages to a new thread.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "threads" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadSplitRequestRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ThreadSplitRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Thread" } } }, "description": "" }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "Validation error." }, "403": { "content": { "application/json": { "schema": { "detail": "Permission denied" } } }, "description": "User does not have editor permission on this thread." } } } }, "/api/v1.0/threads/{id}/summary/": { "get": { "operationId": "threads_summary_retrieve", "description": "Retrieve the summary of a thread.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "threads" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "summary": { "type": "string" } } } } }, "description": "Thread summary retrieved successfully." }, "403": { "content": { "application/json": { "schema": { "detail": "Permission denied" } } }, "description": "User does not have permission to access this thread." } } } }, "/api/v1.0/threads/{thread_id}/accesses/": { "get": { "operationId": "threads_accesses_list", "description": "ViewSet for ThreadAccess model.", "parameters": [ { "in": "query", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "description": "Filter thread accesses by mailbox ID." }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-access" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadAccess" } } } }, "description": "" } } }, "post": { "operationId": "threads_accesses_create", "description": "Create a new thread access.", "parameters": [ { "in": "query", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "description": "Filter thread accesses by mailbox ID." }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-access" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadAccessRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ThreadAccessRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadAccess" } } }, "description": "" } } } }, "/api/v1.0/threads/{thread_id}/accesses/{id}/": { "put": { "operationId": "threads_accesses_update", "description": "ViewSet for ThreadAccess model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "query", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "description": "Filter thread accesses by mailbox ID." }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-access" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadAccessRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ThreadAccessRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadAccess" } } }, "description": "" } } }, "patch": { "operationId": "threads_accesses_partial_update", "description": "ViewSet for ThreadAccess model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "query", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "description": "Filter thread accesses by mailbox ID." }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-access" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedThreadAccessRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedThreadAccessRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadAccess" } } }, "description": "" } } }, "delete": { "operationId": "threads_accesses_destroy", "description": "ViewSet for ThreadAccess model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "query", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "description": "Filter thread accesses by mailbox ID." }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-access" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/threads/{thread_id}/events/": { "get": { "operationId": "threads_events_list", "description": "ViewSet for ThreadEvent model.", "parameters": [ { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-events" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadEvent" } } } }, "description": "" } } }, "post": { "operationId": "threads_events_create", "description": "Create a ThreadEvent.\n\nFor ASSIGN/UNASSIGN, delegates to the service layer which owns the\nidempotence rules, edit-rights validation and the undo window.\nFor IM, persists the event via the serializer and then re-syncs\nMENTION rows.\n\nReturns 204 when the service decides nothing was new (every\nassignee already assigned, full UNASSIGN absorbed by undo, …).", "parameters": [ { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-events" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadEventRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ThreadEventRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadEvent" } } }, "description": "" } } } }, "/api/v1.0/threads/{thread_id}/events/{id}/": { "get": { "operationId": "threads_events_retrieve", "description": "ViewSet for ThreadEvent model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-events" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadEvent" } } }, "description": "" } } }, "put": { "operationId": "threads_events_update", "description": "ViewSet for ThreadEvent model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-events" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadEventRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ThreadEventRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadEvent" } } }, "description": "" } } }, "patch": { "operationId": "threads_events_partial_update", "description": "ViewSet for ThreadEvent model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-events" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedThreadEventRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedThreadEventRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadEvent" } } }, "description": "" } } }, "delete": { "operationId": "threads_events_destroy", "description": "ViewSet for ThreadEvent model.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-events" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" } } } }, "/api/v1.0/threads/{thread_id}/events/{id}/read-mention/": { "patch": { "operationId": "threads_events_read_mention_partial_update", "description": "Mark the current user's unread MENTION on this ThreadEvent as read.\n\nReturns 204 even when no UserEvent matches (idempotent); the thread\nevent itself is resolved via the standard ``get_object`` lookup so a\nmissing event yields 404.", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "required": true }, { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-events" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "No response body" }, "404": { "description": "Thread event not found" } } } }, "/api/v1.0/threads/{thread_id}/users/": { "get": { "operationId": "threads_users_list", "description": "List distinct users who have access to a thread (via ThreadAccess → Mailbox → MailboxAccess).", "parameters": [ { "in": "path", "name": "thread_id", "schema": { "type": "string", "format": "uuid" }, "required": true } ], "tags": [ "thread-users" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadMentionableUser" } } } }, "description": "" } } } }, "/api/v1.0/threads/bulk-delete/": { "post": { "operationId": "threads_bulk_delete_create", "description": "Permanently delete (hard-delete) draft messages within the given accessible and editable threads. A thread emptied by the deletion is removed; otherwise its stats are recomputed.", "tags": [ "threads" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadBulkDeleteRequestRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ThreadBulkDeleteRequestRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "deleted_count": { "type": "integer" } }, "required": [ "success", "deleted_count" ] } } }, "description": "Messages permanently deleted." }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "Missing or invalid parameters." }, "401": { "description": "Authentication credentials were not provided or are invalid." }, "403": { "description": "You do not have permission to delete drafts in one or more targeted threads." } } } }, "/api/v1.0/threads/stats/": { "get": { "operationId": "threads_stats_retrieve", "description": "Get aggregated statistics for threads based on filters.", "parameters": [ { "in": "query", "name": "has_archived", "schema": { "type": "integer" }, "description": "Filter threads that are archived (1=true, 0=false)." }, { "in": "query", "name": "has_assigned_to_me", "schema": { "type": "integer" }, "description": "Filter threads assigned to the current user (1=true, 0=false)." }, { "in": "query", "name": "has_attachments", "schema": { "type": "integer" }, "description": "Filter threads with attachments (1=true, 0=false)." }, { "in": "query", "name": "has_delivery_pending", "schema": { "type": "integer" }, "description": "Filter threads with delivery pending messages: sending, retry or failed (1=true, 0=false)." }, { "in": "query", "name": "has_draft", "schema": { "type": "integer" }, "description": "Filter threads with draft messages (1=true, 0=false)." }, { "in": "query", "name": "has_mention", "schema": { "type": "integer" }, "description": "Filter threads with any mention (read or unread) for the current user (1=true, 0=false)." }, { "in": "query", "name": "has_sender", "schema": { "type": "integer" }, "description": "Filter threads with messages sent by the user (1=true, 0=false)." }, { "in": "query", "name": "has_starred", "schema": { "type": "integer" }, "description": "Filter threads with starred messages (1=true, 0=false)." }, { "in": "query", "name": "has_trashed", "schema": { "type": "integer" }, "description": "Filter threads that are trashed (1=true, 0=false)." }, { "in": "query", "name": "has_unassigned", "schema": { "type": "integer" }, "description": "Filter threads with no active assignment from any user (1=true, 0=false)." }, { "in": "query", "name": "has_unread_mention", "schema": { "type": "integer" }, "description": "Filter threads with unread mentions for the current user (1=true, 0=false)." }, { "in": "query", "name": "label_slug", "schema": { "type": "string" }, "description": "Filter threads by label slug." }, { "in": "query", "name": "mailbox_id", "schema": { "type": "string", "format": "uuid" }, "description": "Filter threads by mailbox ID." }, { "in": "query", "name": "search", "schema": { "type": "string" }, "description": "Search threads by content (subject, sender, recipients, message body)." }, { "in": "query", "name": "stats_fields", "schema": { "type": "string", "enum": [ "all", "all_unread", "has_assigned_to_me", "has_delivery_failed", "has_delivery_pending", "has_mention", "has_unassigned", "has_unread_mention" ] }, "description": "Comma-separated list of fields to aggregate.\n Special values: 'all' (count all threads), 'all_unread' (count all unread threads).\n Boolean fields: has_trashed, has_draft, has_starred, has_attachments, has_archived,\n has_sender, has_active, has_delivery_pending, has_delivery_failed, is_spam, has_messages, has_unread_mention, has_mention, has_assigned_to_me, has_unassigned.\n Unread variants ('_unread' suffix): count threads where the condition is true AND the thread is unread.\n Examples: 'all,all_unread', 'has_starred,has_starred_unread', 'is_spam,is_spam_unread'", "required": true, "explode": false, "style": "form" } ], "tags": [ "threads" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "integer" } } } }, "description": "A dictionary containing the aggregated counts. Keys correspond to the fields requested via the `stats_fields` query parameter. Each value is an integer count. Keys not requested will not be present in the response." }, "400": { "content": { "application/json": { "schema": { "type": "object", "properties": { "detail": { "type": "string" } } } } }, "description": "Returned if `stats_fields` parameter is missing or contains invalid fields." } } } }, "/api/v1.0/users/": { "get": { "operationId": "users_list", "description": "List users.\nSearch users by email, full name or maildomain.\nA search query of at least 3 characters is required.", "parameters": [ { "in": "query", "name": "maildomain_pk", "schema": { "type": "string", "format": "uuid" }, "description": "Filter users by maildomain." }, { "in": "query", "name": "q", "schema": { "type": "string" }, "description": "Search users by full name, short name or email." } ], "tags": [ "admin-users-list" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/UserWithoutAbilities" } } } }, "description": "" } } } }, "/api/v1.0/users/me/": { "get": { "operationId": "users_me_retrieve", "description": "Return information on currently logged user", "tags": [ "users" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserWithAbilities" } } }, "description": "" }, "401": { "description": "Authentication credentials were not provided or are invalid." } } } }, "/api/v1.0/users/me/channels/": { "get": { "operationId": "users_me_channels_list", "description": "Manage personal (scope_level=user) integration channels", "tags": [ "channels" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Channel" } } } }, "description": "" } } }, "post": { "operationId": "users_me_channels_create", "description": "Manage personal (scope_level=user) integration channels", "tags": [ "channels" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserChannelCreateRequestRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/UserChannelCreateRequestRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Channel" } } }, "description": "Existing push device refreshed (idempotent re-register)." }, "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChannelCreateResponse" } } }, "description": "Channel created (or push device registered)." } } } }, "/api/v1.0/users/me/channels/{id}/": { "get": { "operationId": "users_me_channels_retrieve", "description": "Manage personal (scope_level=user) integration channels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "channels" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Channel" } } }, "description": "" } } }, "put": { "operationId": "users_me_channels_update", "description": "Manage personal (scope_level=user) integration channels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "channels" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChannelRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ChannelRequest" } } }, "required": true }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Channel" } } }, "description": "Channel updated successfully" }, "400": { "description": "Invalid input data" }, "403": { "description": "Permission denied" }, "404": { "description": "Channel not found" } } }, "patch": { "operationId": "users_me_channels_partial_update", "description": "Manage personal (scope_level=user) integration channels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "channels" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchedChannelRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/PatchedChannelRequest" } } } }, "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Channel" } } }, "description": "" } } }, "delete": { "operationId": "users_me_channels_destroy", "description": "Manage personal (scope_level=user) integration channels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "channels" ], "security": [ { "cookieAuth": [] } ], "responses": { "204": { "description": "Channel deleted successfully" }, "403": { "description": "Permission denied" }, "404": { "description": "Channel not found" } } } }, "/api/v1.0/users/me/channels/{id}/regenerate-secret/": { "post": { "operationId": "users_me_channels_regenerate_secret_create", "description": "Manage personal (scope_level=user) integration channels", "parameters": [ { "in": "path", "name": "id", "schema": { "type": "string" }, "required": true } ], "tags": [ "channels" ], "security": [ { "cookieAuth": [] } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegeneratedSecretResponse" } } }, "description": "Rotates the channel's secret. Single-active: the previous credential is invalidated immediately. The response carries exactly one of ``api_key`` / ``secret`` matching the channel's type (and, for webhooks, its current ``auth_method``)." }, "400": { "description": "Channel type has no rotatable secret" }, "403": { "description": "Permission denied" }, "404": { "description": "Channel not found" } } } } }, "components": { "schemas": { "Attachment": { "type": "object", "description": "Serialize attachments.", "properties": { "blobId": { "type": "string", "format": "uuid", "readOnly": true }, "name": { "type": "string", "readOnly": true, "title": "File name", "description": "Original filename of the attachment" }, "size": { "type": "integer", "description": "Return the size of the associated blob.", "readOnly": true }, "type": { "type": "string", "readOnly": true }, "sha256": { "type": "string", "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "cid": { "type": "string", "readOnly": true, "nullable": true, "description": "Content-ID for inline images" } }, "required": [ "blobId", "cid", "created_at", "name", "sha256", "size", "type" ] }, "CalendarAddEventRequestRequest": { "type": "object", "properties": { "ics_data": { "type": "string", "minLength": 1, "description": "Raw ICS content of the event" }, "calendar_id": { "type": "string", "nullable": true, "minLength": 1, "description": "Optional specific calendar URL" } }, "required": [ "ics_data" ] }, "CalendarAddEventResponse": { "type": "object", "properties": { "task_id": { "type": "string" } }, "required": [ "task_id" ] }, "CalendarConflictsRequestRequest": { "type": "object", "properties": { "start": { "type": "string", "format": "date-time", "description": "Start of the time range (ISO 8601)" }, "end": { "type": "string", "format": "date-time", "description": "End of the time range (ISO 8601)" }, "exclude_uid": { "type": "string", "nullable": true, "description": "Optional UID of an event to exclude from conflicts (avoids flagging prior imports of the same invite)." } }, "required": [ "end", "start" ] }, "CalendarConflictsResponse": { "type": "object", "properties": { "conflicts": { "type": "array", "items": { "type": "object", "additionalProperties": {} } }, "existing_partstats": { "type": "object", "additionalProperties": { "type": "string" }, "description": "PARTSTAT per attendee identity (calendar owner email, lowercased) on the prior copy of ``exclude_uid``. Lets the UI pre-select the right prior RSVP for the *selected* calendar when a mailbox can act through several attendee-owned calendars." } }, "required": [ "conflicts", "existing_partstats" ] }, "CalendarListResponse": { "type": "object", "properties": { "calendars": { "type": "array", "items": { "type": "object", "additionalProperties": {} } }, "web_url": { "type": "string", "nullable": true, "description": "Public URL of the calendar web UI, if configured." }, "configured": { "type": "boolean", "description": "True when a CalDAV service is configured for this mailbox (per-mailbox channel or deployment default). False means the integration is disabled." } }, "required": [ "calendars", "configured", "web_url" ] }, "CalendarRsvpRequestRequest": { "type": "object", "properties": { "ics_data": { "type": "string", "minLength": 1, "description": "Raw ICS content of the event" }, "response": { "allOf": [ { "$ref": "#/components/schemas/ResponseEnum" } ], "description": "RSVP response\n\n* `ACCEPTED` - ACCEPTED\n* `DECLINED` - DECLINED\n* `TENTATIVE` - TENTATIVE" }, "calendar_id": { "type": "string", "nullable": true, "minLength": 1, "description": "Optional specific calendar URL" } }, "required": [ "ics_data", "response" ] }, "CalendarRsvpResponse": { "type": "object", "properties": { "task_id": { "type": "string" } }, "required": [ "task_id" ] }, "ChangeFlagRequestRequest": { "type": "object", "properties": { "flag": { "$ref": "#/components/schemas/FlagEnum" }, "value": { "type": "boolean" }, "message_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "List of message UUIDs to apply the flag change to." }, "thread_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "List of thread UUIDs where all messages should have the flag change applied." }, "mailbox_id": { "type": "string", "format": "uuid", "description": "Mailbox UUID. Required when flag is 'unread' or 'starred'." }, "read_at": { "type": "string", "format": "date-time", "nullable": true, "description": "Timestamp up to which messages are considered read. When provided with flag='unread', sets ThreadAccess.read_at directly. null means nothing has been read (all messages unread)." }, "starred_at": { "type": "string", "format": "date-time", "nullable": true, "description": "Timestamp when the thread was starred. When provided with flag='starred' and value=true, sets ThreadAccess.starred_at. null or value=false removes the starred flag." } }, "required": [ "flag", "value" ] }, "Channel": { "type": "object", "description": "Serialize Channel model.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "description": "Human-readable name for this channel", "maxLength": 255 }, "type": { "type": "string", "description": "Type of channel", "maxLength": 255 }, "scope_level": { "allOf": [ { "$ref": "#/components/schemas/ScopeLevelEnum" } ], "readOnly": true }, "is_active": { "type": "boolean", "title": "Active", "description": "Uncheck to pause this channel without deleting it." }, "settings": { "description": "Channel-specific configuration settings" }, "mailbox": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "readOnly": true, "nullable": true }, "maildomain": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "readOnly": true, "nullable": true }, "user": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "readOnly": true, "nullable": true }, "last_used_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true }, "token_hash": { "type": "string", "nullable": true, "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" } }, "required": [ "created_at", "id", "last_used_at", "mailbox", "maildomain", "name", "scope_level", "token_hash", "type", "updated_at", "user" ] }, "ChannelCreateResponse": { "type": "object", "description": "Schema-only view of the channel-create 201 response.\n\n``ChannelViewSet.create`` returns the full ``ChannelSerializer``\npayload plus the freshly-minted plaintext credentials — surfaced\nexactly once on creation and never retrievable again. They are\ndeclared here as read-only fields so generated API clients see them\nin the OpenAPI schema. This serializer is never used to serialize a\nresponse directly; the view assembles the body by hand.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "description": "Human-readable name for this channel", "maxLength": 255 }, "type": { "type": "string", "description": "Type of channel", "maxLength": 255 }, "scope_level": { "allOf": [ { "$ref": "#/components/schemas/ScopeLevelEnum" } ], "readOnly": true }, "is_active": { "type": "boolean", "title": "Active", "description": "Uncheck to pause this channel without deleting it." }, "settings": { "description": "Channel-specific configuration settings" }, "mailbox": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "readOnly": true, "nullable": true }, "maildomain": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "readOnly": true, "nullable": true }, "user": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "readOnly": true, "nullable": true }, "last_used_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true }, "token_hash": { "type": "string", "nullable": true, "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" }, "api_key": { "type": "string", "description": "Plaintext API key — api_key channels and webhook channels with auth_method=api_key." }, "secret": { "type": "string", "description": "webhook channels with auth_method=jwt — the HMAC/JWT signing secret." } }, "required": [ "created_at", "id", "last_used_at", "mailbox", "maildomain", "name", "scope_level", "token_hash", "type", "updated_at", "user" ] }, "ChannelRequest": { "type": "object", "description": "Serialize Channel model.", "properties": { "name": { "type": "string", "minLength": 1, "description": "Human-readable name for this channel", "maxLength": 255 }, "type": { "type": "string", "minLength": 1, "description": "Type of channel", "maxLength": 255 }, "is_active": { "type": "boolean", "title": "Active", "description": "Uncheck to pause this channel without deleting it." }, "settings": { "description": "Channel-specific configuration settings" } }, "required": [ "name", "type" ] }, "Contact": { "type": "object", "description": "Serialize contacts.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "nullable": true, "maxLength": 255 }, "email": { "type": "string", "format": "email", "maxLength": 254 } }, "required": [ "email", "id" ] }, "DNSCheckResponse": { "type": "object", "properties": { "domain": { "type": "string" }, "records": { "type": "array", "items": { "$ref": "#/components/schemas/DNSRecordCheck" } } }, "required": [ "domain", "records" ] }, "DNSCheckResult": { "type": "object", "properties": { "status": { "type": "string" }, "found": { "type": "array", "items": { "type": "string" } }, "error": { "type": "string" } }, "required": [ "status" ] }, "DNSRecordCheck": { "type": "object", "properties": { "target": { "type": "string" }, "type": { "type": "string" }, "value": { "type": "string" }, "_check": { "allOf": [ { "$ref": "#/components/schemas/DNSCheckResult" } ], "title": " check" } }, "required": [ "_check", "target", "type", "value" ] }, "DeliveryStatusUpdateResponse": { "type": "object", "properties": { "updated_count": { "type": "integer" } }, "required": [ "updated_count" ] }, "DraftMessageRequestRequest": { "type": "object", "properties": { "messageId": { "type": "string", "format": "uuid", "nullable": true, "description": "Message ID if updating an existing draft" }, "parentId": { "type": "string", "format": "uuid", "nullable": true, "description": "Message ID if replying to an existing message" }, "senderId": { "type": "string", "format": "uuid", "description": "Mailbox ID to use as sender" }, "subject": { "type": "string", "nullable": true, "description": "Subject of the message (optional; empty or null allowed)" }, "draftBody": { "type": "string", "description": "Content of the draft message as arbitrary text (usually JSON)" }, "to": { "type": "array", "items": { "type": "string", "format": "email", "minLength": 1 }, "description": "List of recipient email addresses" }, "cc": { "type": "array", "items": { "type": "string", "format": "email", "minLength": 1 }, "description": "List of CC recipient email addresses" }, "bcc": { "type": "array", "items": { "type": "string", "format": "email", "minLength": 1 }, "description": "List of BCC recipient email addresses" }, "attachments": { "type": "array", "items": { "type": "object", "additionalProperties": {} }, "description": "List of attachment objects with blobId, partId, and name" }, "signatureId": { "type": "string", "format": "uuid", "nullable": true, "description": "ID of the signature template to use" } }, "required": [ "senderId" ] }, "DriveUploadAttachmentRequest": { "type": "object", "properties": { "blob_id": { "type": "string", "minLength": 1, "description": "ID of the attachment to upload (format: msg_{message_id}_{attachment_index})" } }, "required": [ "blob_id" ] }, "FlagEnum": { "enum": [ "unread", "starred", "trashed", "archived", "spam" ], "type": "string", "description": "* `unread` - unread\n* `starred` - starred\n* `trashed` - trashed\n* `archived` - archived\n* `spam` - spam" }, "ImportCreateRequest": { "type": "object", "description": "Body of ``POST /mailboxes/{id}/imports/`` — starts a file or IMAP import.\n\nThe target mailbox comes from the URL. ``source`` discriminates: ``file``\nneeds the ``file_key`` returned by the upload endpoint (unique per upload —\nnothing in the bucket is ever overwritten) plus the original ``filename``\n(display + MIME-type hint); ``imap`` needs the connection fields.\n``continuous`` mode is IMAP-only. Read-only run state is returned via\n``ImportRunSerializer``.", "properties": { "source": { "allOf": [ { "$ref": "#/components/schemas/SourceEnum" } ], "description": "'file' (an uploaded archive — the backend sniffs eml/mbox/pst) or 'imap' (a live server).\n\n* `file` - file\n* `imap` - imap" }, "file_key": { "type": "string", "minLength": 1, "description": "Storage key returned when the archive was uploaded." }, "filename": { "type": "string", "minLength": 1, "description": "Original archive filename (display + MIME-type hint)." }, "imap_server": { "type": "string", "minLength": 1 }, "imap_port": { "type": "integer", "maximum": 65535, "minimum": 1 }, "username": { "type": "string", "minLength": 1 }, "password": { "type": "string", "writeOnly": true, "minLength": 1 }, "use_ssl": { "type": "boolean", "default": true }, "mode": { "allOf": [ { "$ref": "#/components/schemas/ModeEnum" } ], "default": "oneshot" } }, "required": [ "source" ] }, "ImportRun": { "type": "object", "description": "Read-only view of an import run (a ``Channel`` with type=import).\n\nProgress lives in Redis and terminal state on the channel; the serializer\nreads the merged view so the frontend can poll the import resource\n(``GET /mailboxes/{id}/imports/{id}/``) instead of the raw Celery task state.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "readOnly": true, "description": "Human-readable name for this channel" }, "mailbox": { "type": "string", "format": "uuid", "description": "Mailbox that receives messages from this channel", "readOnly": true, "nullable": true }, "is_active": { "type": "boolean", "readOnly": true, "title": "Active", "description": "Uncheck to pause this channel without deleting it." }, "status": { "type": "string", "nullable": true, "readOnly": true }, "source_type": { "type": "string", "nullable": true, "readOnly": true }, "mode": { "type": "string", "nullable": true, "readOnly": true }, "poll_interval": { "type": "integer", "nullable": true, "readOnly": true }, "imap_username": { "type": "string", "nullable": true, "readOnly": true }, "total_messages": { "type": "integer", "readOnly": true }, "success_count": { "type": "integer", "readOnly": true }, "failure_count": { "type": "integer", "readOnly": true }, "failure_reasons": { "type": "object", "additionalProperties": { "type": "integer" }, "nullable": true, "readOnly": true }, "progress": { "type": "number", "format": "double", "readOnly": true }, "error": { "type": "string", "nullable": true, "readOnly": true }, "started_at": { "type": "string", "nullable": true, "readOnly": true }, "finished_at": { "type": "string", "nullable": true, "readOnly": true }, "last_used_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true, "description": "Operational timestamp updated (throttled) whenever the channel is used." }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" } }, "required": [ "created_at", "error", "failure_count", "failure_reasons", "finished_at", "id", "imap_username", "is_active", "last_used_at", "mailbox", "mode", "name", "poll_interval", "progress", "source_type", "started_at", "status", "success_count", "total_messages", "updated_at" ] }, "Label": { "type": "object", "description": "Serializer for Label model.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "description": "Name of the label/folder (can use slashes for hierarchy, e.g. 'Work/Projects')", "maxLength": 255 }, "slug": { "type": "string", "readOnly": true, "description": "URL-friendly version of the name", "pattern": "^[-a-zA-Z0-9_]+$" }, "color": { "type": "string", "description": "Color of the label in hex format (e.g. #FF0000)", "maxLength": 7 }, "display_name": { "type": "string", "readOnly": true }, "mailbox": { "type": "string", "format": "uuid", "description": "Mailbox that owns this label" }, "threads": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Threads that have this label" }, "description": { "type": "string", "description": "Description of the label, used by AI to understand its purpose", "maxLength": 255 }, "is_auto": { "type": "boolean", "title": "Auto labeling", "description": "Whether this label should be automatically applied by AI" } }, "required": [ "display_name", "id", "mailbox", "name", "slug" ] }, "LabelRequest": { "type": "object", "description": "Serializer for Label model.", "properties": { "name": { "type": "string", "minLength": 1, "description": "Name of the label/folder (can use slashes for hierarchy, e.g. 'Work/Projects')", "maxLength": 255 }, "color": { "type": "string", "minLength": 1, "description": "Color of the label in hex format (e.g. #FF0000)", "maxLength": 7 }, "mailbox": { "type": "string", "format": "uuid", "description": "Mailbox that owns this label" }, "threads": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Threads that have this label" }, "description": { "type": "string", "description": "Description of the label, used by AI to understand its purpose", "maxLength": 255 }, "is_auto": { "type": "boolean", "title": "Auto labeling", "description": "Whether this label should be automatically applied by AI" } }, "required": [ "mailbox", "name" ] }, "MailDomainAccessRoleChoices": { "type": "string", "enum": [ "admin" ] }, "MailDomainAdmin": { "type": "object", "description": "Serialize mail domains for admin view.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" }, "expected_dns_records": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "target": { "type": "string" }, "type": { "type": "string" }, "value": { "type": "string" } }, "required": [ "target", "type", "value" ] }, "readOnly": true }, "mailbox_count": { "type": "string", "readOnly": true }, "identity_sync": { "type": "boolean", "readOnly": true, "description": "Sync mailboxes to an identity provider." }, "abilities": { "type": "object", "description": "Instance permissions and capabilities", "properties": { "get": { "type": "boolean", "description": "Can read" }, "post": { "type": "boolean", "description": "Can create" }, "put": { "type": "boolean", "description": "Can update" }, "patch": { "type": "boolean", "description": "Can partially update" }, "delete": { "type": "boolean", "description": "Can delete" }, "manage_accesses": { "type": "boolean", "description": "Can manage accesses" }, "manage_mailboxes": { "type": "boolean", "description": "Can manage mailboxes" } }, "required": [ "get", "post", "put", "patch", "delete", "manage_accesses", "manage_mailboxes" ], "readOnly": true } }, "required": [ "abilities", "created_at", "expected_dns_records", "id", "identity_sync", "mailbox_count", "name", "updated_at" ] }, "MailDomainAdminWrite": { "type": "object", "description": "Serialize mail domains for creating / editing admin view.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$", "maxLength": 253 }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" }, "oidc_autojoin": { "type": "boolean", "description": "Create mailboxes automatically based on OIDC emails." }, "identity_sync": { "type": "boolean", "description": "Sync mailboxes to an identity provider." }, "custom_attributes": { "description": "Metadata to sync to the maildomain group in the identity provider." } }, "required": [ "created_at", "id", "name", "updated_at" ] }, "MailDomainAdminWriteRequest": { "type": "object", "description": "Serialize mail domains for creating / editing admin view.", "properties": { "name": { "type": "string", "minLength": 1, "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$", "maxLength": 253 }, "oidc_autojoin": { "type": "boolean", "description": "Create mailboxes automatically based on OIDC emails." }, "identity_sync": { "type": "boolean", "description": "Sync mailboxes to an identity provider." }, "custom_attributes": { "description": "Metadata to sync to the maildomain group in the identity provider." } }, "required": [ "name" ] }, "Mailbox": { "type": "object", "description": "Serialize mailboxes.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "email": { "type": "string", "readOnly": true }, "name": { "type": "string", "nullable": true, "description": "Return the display name of the mailbox (its contact name).", "readOnly": true }, "domain_id": { "type": "string", "format": "uuid", "readOnly": true }, "is_identity": { "type": "boolean", "readOnly": true, "description": "Whether this mailbox identifies a person (i.e. is not an alias or a group)" }, "is_shared": { "type": "boolean", "description": "Return True if the mailbox is shared (non-identity or has more than one access).\n\nDrives mailbox-level UI gating for collaboration features (assignment\nsub-folders, mention folder) that have no purpose in a mono-user\nidentity mailbox.", "readOnly": true }, "role": { "allOf": [ { "$ref": "#/components/schemas/MailboxRoleChoices" } ], "nullable": true, "readOnly": true }, "count_unread_threads": { "type": "integer", "description": "Return the number of threads with unread messages in the mailbox.", "readOnly": true }, "count_threads": { "type": "integer", "description": "Return the number of threads in the mailbox.", "readOnly": true }, "count_delivering": { "type": "integer", "description": "Return the number of threads with messages being delivered.", "readOnly": true }, "count_unread_mentions": { "type": "integer", "description": "Return the number of threads with unread mentions for the current user.", "readOnly": true }, "count_assigned": { "type": "integer", "description": "Return the number of threads in this mailbox currently assigned to the current user.", "readOnly": true }, "abilities": { "type": "object", "description": "Instance permissions and capabilities", "properties": { "get": { "type": "boolean", "description": "Can read" }, "post": { "type": "boolean", "description": "Can create" }, "put": { "type": "boolean", "description": "Can update" }, "patch": { "type": "boolean", "description": "Can partially update" }, "delete": { "type": "boolean", "description": "Can delete" }, "manage_accesses": { "type": "boolean", "description": "Can manage accesses" }, "view_messages": { "type": "boolean", "description": "Can view mailbox messages" }, "send_messages": { "type": "boolean", "description": "Can send messages from mailbox" }, "manage_labels": { "type": "boolean", "description": "Can manage mailbox labels" }, "manage_message_templates": { "type": "boolean", "description": "Can manage mailbox message templates" }, "import_messages": { "type": "boolean", "description": "Can import messages" } }, "required": [ "get", "post", "put", "patch", "delete", "manage_accesses", "view_messages", "send_messages", "manage_labels", "manage_message_templates", "import_messages" ], "readOnly": true } }, "required": [ "abilities", "count_assigned", "count_delivering", "count_threads", "count_unread_mentions", "count_unread_threads", "domain_id", "email", "id", "is_identity", "is_shared", "name", "role" ] }, "MailboxAccessNestedUser": { "type": "object", "description": "Serialize MailboxAccess for nesting within MailboxAdminSerializer.\nShows user details and their role on the mailbox.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "user": { "allOf": [ { "$ref": "#/components/schemas/UserWithoutAbilities" } ], "readOnly": true }, "role": { "allOf": [ { "$ref": "#/components/schemas/MailboxRoleChoices" } ], "readOnly": true } }, "required": [ "id", "role", "user" ] }, "MailboxAccessRead": { "type": "object", "description": "Serialize mailbox access information for read operations with nested user details.\nMailbox context is implied by the URL, so mailbox details are not included here.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "user_details": { "allOf": [ { "$ref": "#/components/schemas/UserWithoutAbilities" } ], "readOnly": true }, "role": { "allOf": [ { "$ref": "#/components/schemas/MailboxRoleChoices" } ], "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" } }, "required": [ "created_at", "id", "role", "updated_at", "user_details" ] }, "MailboxAccessWrite": { "type": "object", "description": "Serializer for creating and updating mailbox access records.\nMailbox is set from the view based on URL parameters.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "user": { "type": "string", "format": "uuid", "description": "User ID (UUID) or email address" }, "role": { "$ref": "#/components/schemas/MailboxRoleChoices" }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" } }, "required": [ "created_at", "id", "role", "updated_at", "user" ] }, "MailboxAccessWriteRequest": { "type": "object", "description": "Serializer for creating and updating mailbox access records.\nMailbox is set from the view based on URL parameters.", "properties": { "user": { "type": "string", "format": "uuid", "description": "User ID (UUID) or email address" }, "role": { "$ref": "#/components/schemas/MailboxRoleChoices" } }, "required": [ "role", "user" ] }, "MailboxAdmin": { "type": "object", "description": "Serialize Mailbox details for admin view, including users with access.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "local_part": { "type": "string", "pattern": "^[a-zA-Z0-9_.-]+$", "maxLength": 64 }, "domain_name": { "type": "string", "readOnly": true }, "is_identity": { "type": "boolean", "readOnly": true, "description": "Whether this mailbox identifies a person (i.e. is not an alias or a group)" }, "alias_of": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "nullable": true }, "accesses": { "type": "array", "items": { "$ref": "#/components/schemas/MailboxAccessNestedUser" }, "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" }, "can_reset_password": { "type": "boolean", "readOnly": true }, "contact": { "allOf": [ { "$ref": "#/components/schemas/Contact" } ], "readOnly": true, "nullable": true }, "last_accessed_at": { "type": "string", "format": "date-time", "nullable": true, "readOnly": true, "description": "Most recent ``accessed_at`` across all mailbox accesses." }, "has_mandatory_totp": { "type": "boolean", "nullable": true, "readOnly": true, "description": "Whether the Keycloak user backing this mailbox carries the KEYCLOAK_TOTP_ROLE_ID realm role. ``null`` when the feature is disabled or the role id isn't configured." } }, "required": [ "accesses", "can_reset_password", "contact", "created_at", "domain_name", "has_mandatory_totp", "id", "is_identity", "last_accessed_at", "local_part", "updated_at" ] }, "MailboxAdminCreate": { "type": "object", "description": "Serialize Mailbox details for create admin endpoint, including users with access and\nmetadata.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "local_part": { "type": "string", "readOnly": true }, "domain_name": { "type": "string", "readOnly": true }, "is_identity": { "type": "boolean", "readOnly": true, "description": "Whether this mailbox identifies a person (i.e. is not an alias or a group)" }, "alias_of": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "nullable": true }, "accesses": { "type": "array", "items": { "$ref": "#/components/schemas/MailboxAccessNestedUser" }, "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" }, "can_reset_password": { "type": "boolean", "readOnly": true }, "contact": { "allOf": [ { "$ref": "#/components/schemas/Contact" } ], "readOnly": true, "nullable": true }, "last_accessed_at": { "type": "string", "format": "date-time", "nullable": true, "readOnly": true, "description": "Most recent ``accessed_at`` across all mailbox accesses." }, "has_mandatory_totp": { "type": "boolean", "nullable": true, "readOnly": true, "description": "Whether the Keycloak user backing this mailbox carries the KEYCLOAK_TOTP_ROLE_ID realm role. ``null`` when the feature is disabled or the role id isn't configured." }, "one_time_password": { "type": "string", "nullable": true, "description": "Fake method just to make the OpenAPI schema valid.", "readOnly": true } }, "required": [ "accesses", "can_reset_password", "contact", "created_at", "domain_name", "has_mandatory_totp", "id", "is_identity", "last_accessed_at", "local_part", "one_time_password", "updated_at" ] }, "MailboxAdminCreateMetadataRequest": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/MailboxAdminCreateMetadataTypeEnum" }, "first_name": { "type": "string" }, "last_name": { "type": "string" }, "name": { "type": "string" }, "custom_attributes": {} }, "required": [ "type" ] }, "MailboxAdminCreateMetadataTypeEnum": { "enum": [ "personal", "shared", "redirect" ], "type": "string", "description": "* `personal` - personal\n* `shared` - shared\n* `redirect` - redirect" }, "MailboxAdminCreatePayloadRequest": { "type": "object", "properties": { "local_part": { "type": "string", "minLength": 1 }, "alias_of": { "type": "string", "format": "uuid" }, "metadata": { "$ref": "#/components/schemas/MailboxAdminCreateMetadataRequest" } }, "required": [ "local_part", "metadata" ] }, "MailboxAdminMandatoryTotpPayloadRequest": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] }, "MailboxAdminMandatoryTotpResponse": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] }, "MailboxAdminResetTotpResponse": { "type": "object", "properties": { "removed_credentials": { "type": "integer" } }, "required": [ "removed_credentials" ] }, "MailboxAdminUpdateMetadataRequest": { "type": "object", "properties": { "full_name": { "type": "string" }, "name": { "type": "string" }, "custom_attributes": {} } }, "MailboxLight": { "type": "object", "description": "Serializer for mailbox details in thread access.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "email": { "type": "string", "readOnly": true }, "name": { "type": "string", "readOnly": true }, "is_identity": { "type": "boolean", "readOnly": true, "description": "Whether this mailbox identifies a person (i.e. is not an alias or a group)" } }, "required": [ "email", "id", "is_identity", "name" ] }, "MailboxRoleChoices": { "type": "string", "enum": [ "viewer", "editor", "sender", "admin" ] }, "MaildomainAccessRead": { "type": "object", "description": "Serialize maildomain access information for read operations with nested user details.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "user": { "allOf": [ { "$ref": "#/components/schemas/UserWithoutAbilities" } ], "readOnly": true }, "role": { "allOf": [ { "$ref": "#/components/schemas/MailDomainAccessRoleChoices" } ], "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" } }, "required": [ "created_at", "id", "role", "updated_at", "user" ] }, "MaildomainAccessWrite": { "type": "object", "description": "Serializer for creating and updating maildomain access records.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "user": { "type": "string", "format": "uuid", "description": "User ID (UUID) or email address" }, "role": { "$ref": "#/components/schemas/MailDomainAccessRoleChoices" }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" } }, "required": [ "created_at", "id", "role", "updated_at", "user" ] }, "MaildomainAccessWriteRequest": { "type": "object", "description": "Serializer for creating and updating maildomain access records.", "properties": { "user": { "type": "string", "format": "uuid", "description": "User ID (UUID) or email address" }, "role": { "$ref": "#/components/schemas/MailDomainAccessRoleChoices" } }, "required": [ "role", "user" ] }, "Message": { "type": "object", "description": "Serialize messages, getting parsed details from the Message model.\nAligns field names with JMAP where appropriate (textBody, htmlBody, to, cc, bcc).", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "parent_id": { "type": "string", "format": "uuid", "readOnly": true, "nullable": true }, "thread_id": { "type": "string", "format": "uuid", "readOnly": true, "nullable": true }, "subject": { "type": "string", "readOnly": true, "nullable": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" }, "htmlBody": { "type": "array", "items": { "$ref": "#/components/schemas/MessageBodyItem" }, "readOnly": true }, "textBody": { "type": "array", "items": { "$ref": "#/components/schemas/MessageBodyItem" }, "readOnly": true }, "draftBody": { "type": "string", "nullable": true, "readOnly": true }, "attachments": { "type": "array", "items": { "$ref": "#/components/schemas/Attachment" }, "readOnly": true }, "sender": { "allOf": [ { "$ref": "#/components/schemas/Contact" } ], "readOnly": true }, "sender_user": { "allOf": [ { "$ref": "#/components/schemas/MessageSenderUser" } ], "readOnly": true, "nullable": true }, "to": { "type": "array", "items": { "$ref": "#/components/schemas/MessageRecipient" }, "readOnly": true }, "cc": { "type": "array", "items": { "$ref": "#/components/schemas/MessageRecipient" }, "readOnly": true }, "bcc": { "type": "array", "items": { "$ref": "#/components/schemas/MessageRecipient" }, "readOnly": true }, "sent_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true }, "is_sender": { "type": "boolean", "readOnly": true }, "is_draft": { "type": "boolean", "readOnly": true }, "is_unread": { "type": "boolean", "readOnly": true }, "is_trashed": { "type": "boolean", "readOnly": true }, "is_archived": { "type": "boolean", "readOnly": true }, "has_attachments": { "type": "boolean", "readOnly": true }, "mime_id": { "type": "string", "readOnly": true, "nullable": true }, "signature": { "allOf": [ { "$ref": "#/components/schemas/ReadMessageTemplate" } ], "nullable": true, "readOnly": true }, "stmsg_headers": { "type": "object", "additionalProperties": {}, "description": "Return the STMSG headers of the message.", "readOnly": true } }, "required": [ "attachments", "bcc", "cc", "created_at", "draftBody", "has_attachments", "htmlBody", "id", "is_archived", "is_draft", "is_sender", "is_trashed", "is_unread", "mime_id", "parent_id", "sender", "sender_user", "sent_at", "signature", "stmsg_headers", "subject", "textBody", "thread_id", "to", "updated_at" ] }, "MessageBodyItem": { "type": "object", "description": "Message body item serializer.", "properties": { "partId": { "type": "string" }, "type": { "type": "string" }, "content": { "type": "string" } }, "required": [ "content", "partId", "type" ] }, "MessageDeliveryStatusChoices": { "type": "string", "enum": [ "internal", "sent", "failed", "retry", "cancelled" ] }, "MessageRecipient": { "type": "object", "description": "Serialize message recipients.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "contact": { "allOf": [ { "$ref": "#/components/schemas/Contact" } ], "readOnly": true }, "delivery_status": { "allOf": [ { "$ref": "#/components/schemas/MessageDeliveryStatusChoices" } ], "readOnly": true, "nullable": true }, "delivery_message": { "type": "string", "readOnly": true, "nullable": true }, "retry_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true }, "delivered_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true } }, "required": [ "contact", "delivered_at", "delivery_message", "delivery_status", "id", "retry_at" ] }, "MessageSenderUser": { "type": "object", "description": "Lightweight serializer for the user who sent a message.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "full_name": { "type": "string", "readOnly": true, "nullable": true }, "email": { "type": "string", "format": "email", "readOnly": true, "nullable": true, "title": "Identity email address" } }, "required": [ "email", "full_name", "id" ] }, "MessageTemplate": { "type": "object", "description": "Serialize message templates for POST/PUT/PATCH operations.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "description": "Name of the template (e.g., 'Standard Reply', 'Out of Office', 'Work Signature')", "maxLength": 255 }, "html_body": { "type": "string" }, "text_body": { "type": "string" }, "raw_body": { "type": "string" }, "type": { "$ref": "#/components/schemas/MessageTemplateTypeChoices" }, "is_active": { "type": "boolean", "description": "Whether this template is available for use" }, "is_forced": { "type": "boolean", "default": false, "description": "Set as forced template" }, "is_default": { "type": "boolean", "default": false, "description": "Set as default template (auto-loaded when composing a new message)" }, "metadata": { "type": "object", "additionalProperties": true }, "signature_id": { "type": "string", "format": "uuid", "nullable": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" } }, "required": [ "created_at", "id", "name", "type", "updated_at" ] }, "MessageTemplateRequest": { "type": "object", "description": "Serialize message templates for POST/PUT/PATCH operations.", "properties": { "name": { "type": "string", "minLength": 1, "description": "Name of the template (e.g., 'Standard Reply', 'Out of Office', 'Work Signature')", "maxLength": 255 }, "html_body": { "type": "string", "minLength": 1 }, "text_body": { "type": "string", "minLength": 1 }, "raw_body": { "type": "string", "minLength": 1 }, "type": { "$ref": "#/components/schemas/MessageTemplateTypeChoices" }, "is_active": { "type": "boolean", "description": "Whether this template is available for use" }, "is_forced": { "type": "boolean", "default": false, "description": "Set as forced template" }, "is_default": { "type": "boolean", "default": false, "description": "Set as default template (auto-loaded when composing a new message)" }, "metadata": { "type": "object", "additionalProperties": true }, "signature_id": { "type": "string", "format": "uuid", "nullable": true } }, "required": [ "name", "type" ] }, "MessageTemplateTypeChoices": { "type": "string", "enum": [ "message", "signature", "autoreply" ] }, "ModeEnum": { "enum": [ "oneshot", "continuous" ], "type": "string", "description": "* `oneshot` - oneshot\n* `continuous` - continuous" }, "PaginatedDriveItemResponse": { "type": "object", "properties": { "count": { "type": "integer" }, "next": { "type": "string", "nullable": true }, "previous": { "type": "string", "nullable": true }, "results": { "type": "array", "items": { "$ref": "#/components/schemas/PartialDriveItem" } } }, "required": [ "count", "next", "previous", "results" ] }, "PaginatedMailDomainAdminList": { "type": "object", "required": [ "count", "results" ], "properties": { "count": { "type": "integer", "example": 123 }, "next": { "type": "string", "nullable": true, "format": "uri", "example": "http://api.example.org/accounts/?page=4" }, "previous": { "type": "string", "nullable": true, "format": "uri", "example": "http://api.example.org/accounts/?page=2" }, "results": { "type": "array", "items": { "$ref": "#/components/schemas/MailDomainAdmin" } } } }, "PaginatedMailboxAccessReadList": { "type": "object", "required": [ "count", "results" ], "properties": { "count": { "type": "integer", "example": 123 }, "next": { "type": "string", "nullable": true, "format": "uri", "example": "http://api.example.org/accounts/?page=4" }, "previous": { "type": "string", "nullable": true, "format": "uri", "example": "http://api.example.org/accounts/?page=2" }, "results": { "type": "array", "items": { "$ref": "#/components/schemas/MailboxAccessRead" } } } }, "PaginatedMailboxAdminList": { "type": "object", "required": [ "count", "results" ], "properties": { "count": { "type": "integer", "example": 123 }, "next": { "type": "string", "nullable": true, "format": "uri", "example": "http://api.example.org/accounts/?page=4" }, "previous": { "type": "string", "nullable": true, "format": "uri", "example": "http://api.example.org/accounts/?page=2" }, "results": { "type": "array", "items": { "$ref": "#/components/schemas/MailboxAdmin" } } } }, "PaginatedThreadList": { "type": "object", "required": [ "count", "results" ], "properties": { "count": { "type": "integer", "example": 123 }, "next": { "type": "string", "nullable": true, "format": "uri", "example": "http://api.example.org/accounts/?page=4" }, "previous": { "type": "string", "nullable": true, "format": "uri", "example": "http://api.example.org/accounts/?page=2" }, "results": { "type": "array", "items": { "$ref": "#/components/schemas/Thread" } } } }, "PartialDriveItem": { "type": "object", "description": "Serializer for Drive Item resource (OpenAPI purpose only...).\nIt supports partially the Drive Item resource response structure.\nWe declare only fields that are useful in the Messages context.", "properties": { "id": { "type": "string", "format": "uuid" }, "filename": { "type": "string" }, "mimetype": { "type": "string" }, "size": { "type": "integer" } }, "required": [ "filename", "id", "mimetype", "size" ] }, "PatchedChannelRequest": { "type": "object", "description": "Serialize Channel model.", "properties": { "name": { "type": "string", "minLength": 1, "description": "Human-readable name for this channel", "maxLength": 255 }, "type": { "type": "string", "minLength": 1, "description": "Type of channel", "maxLength": 255 }, "is_active": { "type": "boolean", "title": "Active", "description": "Uncheck to pause this channel without deleting it." }, "settings": { "description": "Channel-specific configuration settings" } } }, "PatchedImportUpdateRequest": { "type": "object", "description": "Body of ``PATCH /mailboxes/{id}/imports/{id}/`` — change how a run runs.\n\nBoth fields optional (partial). ``mode=continuous`` (re-)arms an IMAP import\nas a poller; ``mode=oneshot`` demotes a continuous poller (stops polling);\n``is_active=false`` pauses a continuous poller (credentials are kept). The\npoll cadence itself is a global operator setting, not settable here.\nValidation is source-aware: only IMAP imports can go continuous.", "properties": { "mode": { "$ref": "#/components/schemas/ModeEnum" }, "is_active": { "type": "boolean" } } }, "PatchedLabelRequest": { "type": "object", "description": "Serializer for Label model.", "properties": { "name": { "type": "string", "minLength": 1, "description": "Name of the label/folder (can use slashes for hierarchy, e.g. 'Work/Projects')", "maxLength": 255 }, "color": { "type": "string", "minLength": 1, "description": "Color of the label in hex format (e.g. #FF0000)", "maxLength": 7 }, "mailbox": { "type": "string", "format": "uuid", "description": "Mailbox that owns this label" }, "threads": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Threads that have this label" }, "description": { "type": "string", "description": "Description of the label, used by AI to understand its purpose", "maxLength": 255 }, "is_auto": { "type": "boolean", "title": "Auto labeling", "description": "Whether this label should be automatically applied by AI" } } }, "PatchedMailboxAccessWriteRequest": { "type": "object", "description": "Serializer for creating and updating mailbox access records.\nMailbox is set from the view based on URL parameters.", "properties": { "user": { "type": "string", "format": "uuid", "description": "User ID (UUID) or email address" }, "role": { "$ref": "#/components/schemas/MailboxRoleChoices" } } }, "PatchedMailboxAdminPartialUpdatePayloadRequest": { "type": "object", "properties": { "metadata": { "$ref": "#/components/schemas/MailboxAdminUpdateMetadataRequest" } } }, "PatchedMailboxNameUpdateRequest": { "type": "object", "description": "Validate and apply a mailbox display-name update (its contact name).", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 } } }, "PatchedMessageTemplateRequest": { "type": "object", "description": "Serialize message templates for POST/PUT/PATCH operations.", "properties": { "name": { "type": "string", "minLength": 1, "description": "Name of the template (e.g., 'Standard Reply', 'Out of Office', 'Work Signature')", "maxLength": 255 }, "html_body": { "type": "string", "minLength": 1 }, "text_body": { "type": "string", "minLength": 1 }, "raw_body": { "type": "string", "minLength": 1 }, "type": { "$ref": "#/components/schemas/MessageTemplateTypeChoices" }, "is_active": { "type": "boolean", "description": "Whether this template is available for use" }, "is_forced": { "type": "boolean", "default": false, "description": "Set as forced template" }, "is_default": { "type": "boolean", "default": false, "description": "Set as default template (auto-loaded when composing a new message)" }, "metadata": { "type": "object", "additionalProperties": true }, "signature_id": { "type": "string", "format": "uuid", "nullable": true } } }, "PatchedThreadAccessRequest": { "type": "object", "description": "Serialize thread access information.", "properties": { "thread": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "mailbox": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "role": { "$ref": "#/components/schemas/ThreadAccessRoleChoices" } } }, "PatchedThreadEventRequest": { "type": "object", "description": "Serialize thread event information.", "properties": { "type": { "$ref": "#/components/schemas/ThreadEventTypeEnum" }, "message": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "nullable": true }, "data": { "$ref": "#/components/schemas/ThreadEventDataRequest" } } }, "PlatformEnum": { "enum": [ "apns", "fcm", "web" ], "type": "string", "description": "* `apns` - Apple (APNs)\n* `fcm` - Google (FCM)\n* `web` - Web Push" }, "PushChannelCreateRequest": { "type": "object", "description": "Schema variant of the push registration body for ``POST .../channels/``.\n\nIdentical to ``PushDeviceRegistrationSerializer`` plus the ``type``\ndiscriminator, so the polymorphic create endpoint documents the push shape\n({type:\"push\", platform, token, keys?, name?, app_version?}) alongside the\ngeneric channel shape. Validation at runtime still uses the parent.", "properties": { "platform": { "$ref": "#/components/schemas/PlatformEnum" }, "token": { "type": "string", "minLength": 1, "maxLength": 8192 }, "app_version": { "type": "string", "maxLength": 64 }, "keys": { "$ref": "#/components/schemas/WebPushKeysRequest" }, "name": { "type": "string", "maxLength": 255 }, "type": { "$ref": "#/components/schemas/PushChannelCreateTypeEnum" } }, "required": [ "platform", "token", "type" ] }, "PushChannelCreateTypeEnum": { "enum": [ "push" ], "type": "string", "description": "* `push` - push" }, "ReadMessageTemplate": { "type": "object", "description": "Serialize message templates with dynamic body field inclusion.\n\nBody fields (html_body, text_body, raw_body) are only included when\nexplicitly requested via the ``?bodies=`` query parameter or the\n``body_fields`` keyword argument (for nested usage).\n\nAllowed values: ``raw``, ``html``, ``text`` (comma-separated).\nMapping: ``raw`` → ``raw_body``, ``html`` → ``html_body``, ``text`` → ``text_body``.\n\nWhen neither query param nor kwarg is provided, no body field is returned.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "readOnly": true, "description": "Name of the template (e.g., 'Standard Reply', 'Out of Office', 'Work Signature')" }, "html_body": { "type": "string", "nullable": true }, "text_body": { "type": "string", "nullable": true }, "raw_body": { "type": "string", "nullable": true }, "type": { "$ref": "#/components/schemas/MessageTemplateTypeChoices" }, "is_active": { "type": "boolean", "readOnly": true, "description": "Whether this template is available for use" }, "is_forced": { "type": "boolean", "readOnly": true, "description": "Whether this template is forced; no other template of the same type can be used in the same scope" }, "is_default": { "type": "boolean", "readOnly": true, "description": "Whether this template is the default; it will be automatically loaded when composing a new message" }, "metadata": { "type": "object", "additionalProperties": true }, "signature": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "readOnly": true }, "is_active_autoreply": { "type": "boolean", "nullable": true, "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" } }, "required": [ "created_at", "id", "is_active", "is_active_autoreply", "is_default", "is_forced", "name", "signature", "type", "updated_at" ] }, "RegeneratedSecretResponse": { "type": "object", "properties": { "id": { "type": "string", "description": "Channel id." }, "api_key": { "type": "string", "description": "Present for ``api_key`` channels and webhook channels with ``auth_method='api_key'`` — the plaintext API key. api_key channels send it as ``X-API-Key`` on inbound API calls; api_key webhooks present it as ``Authorization: Bearer``. Returned ONCE; for api_key webhooks it changes whenever the root rotates." }, "secret": { "type": "string", "description": "Present for webhook channels with ``auth_method='jwt'`` — the freshly minted root receivers use to verify the HMAC sig and JWT." } }, "required": [ "id" ] }, "ResetPasswordError": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] }, "ResetPasswordInternalServerError": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] }, "ResetPasswordNotFound": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ] }, "ResetPasswordResponse": { "type": "object", "properties": { "one_time_password": { "type": "string" } }, "required": [ "one_time_password" ] }, "ResponseEnum": { "enum": [ "ACCEPTED", "DECLINED", "TENTATIVE" ], "type": "string", "description": "* `ACCEPTED` - ACCEPTED\n* `DECLINED` - DECLINED\n* `TENTATIVE` - TENTATIVE" }, "ScopeEnum": { "enum": [ "draft" ], "type": "string", "description": "* `draft` - draft" }, "ScopeLevelEnum": { "enum": [ "global", "maildomain", "mailbox", "user" ], "type": "string", "description": "* `global` - Global\n* `maildomain` - Maildomain\n* `mailbox` - Mailbox\n* `user` - User" }, "SendMessageRequest": { "type": "object", "description": "Serializer for sending messages.", "properties": { "messageId": { "type": "string", "format": "uuid" }, "senderId": { "type": "string", "format": "uuid" }, "archive": { "type": "boolean", "default": false }, "textBody": { "type": "string" }, "htmlBody": { "type": "string" } }, "required": [ "messageId", "senderId" ] }, "SendMessageResponse": { "type": "object", "properties": { "task_id": { "type": "string", "format": "uuid", "description": "Task ID for tracking" } }, "required": [ "task_id" ] }, "SourceEnum": { "enum": [ "file", "imap" ], "type": "string", "description": "* `file` - file\n* `imap` - imap" }, "StatusEnum": { "enum": [ "FAILURE", "PENDING", "PROGRESS", "RECEIVED", "RETRY", "REVOKED", "STARTED", "SUCCESS" ], "type": "string", "description": "* `FAILURE` - FAILURE\n* `PENDING` - PENDING\n* `PROGRESS` - PROGRESS\n* `RECEIVED` - RECEIVED\n* `RETRY` - RETRY\n* `REVOKED` - REVOKED\n* `STARTED` - STARTED\n* `SUCCESS` - SUCCESS" }, "TaskStatusResponse": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/StatusEnum" }, "result": { "nullable": true }, "error": { "type": "string", "nullable": true } }, "required": [ "error", "result", "status" ] }, "Thread": { "type": "object", "description": "Serialize threads.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "subject": { "type": "string", "readOnly": true, "nullable": true }, "snippet": { "type": "string", "readOnly": true }, "messages": { "type": "string", "readOnly": true }, "has_unread": { "type": "boolean", "readOnly": true }, "has_unread_mention": { "type": "boolean", "readOnly": true }, "has_trashed": { "type": "boolean", "readOnly": true }, "is_trashed": { "type": "boolean", "readOnly": true, "description": "Whether all messages in the thread are trashed" }, "has_archived": { "type": "boolean", "readOnly": true }, "has_draft": { "type": "boolean", "readOnly": true }, "has_starred": { "type": "boolean", "readOnly": true }, "has_attachments": { "type": "boolean", "readOnly": true }, "has_sender": { "type": "boolean", "readOnly": true }, "has_messages": { "type": "boolean", "readOnly": true }, "has_delivery_failed": { "type": "boolean", "readOnly": true, "description": "True if thread has messages with permanent delivery failure." }, "has_delivery_pending": { "type": "boolean", "readOnly": true, "description": "True if thread has messages awaiting successful delivery (sending, retrying, or failed)." }, "is_spam": { "type": "boolean", "readOnly": true }, "has_active": { "type": "boolean", "readOnly": true }, "messaged_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true }, "active_messaged_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true, "description": "Date of the last active (received, not spam/archived/trashed/draft) message." }, "draft_messaged_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true, "description": "Date of the last draft (non-trashed) message." }, "sender_messaged_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true, "description": "Date of the last sent (non-trashed, non-draft) message." }, "archived_messaged_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true, "description": "Date of the last archived (non-trashed) message." }, "trashed_messaged_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true, "description": "Date of the last trashed message." }, "sender_names": { "type": "array", "items": { "type": "string" }, "readOnly": true }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" }, "user_role": { "allOf": [ { "$ref": "#/components/schemas/ThreadAccessRoleChoices" } ], "nullable": true, "readOnly": true }, "accesses": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadAccessDetail" }, "readOnly": true }, "labels": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadLabel" }, "readOnly": true }, "summary": { "type": "string", "readOnly": true }, "events_count": { "type": "integer", "readOnly": true }, "abilities": { "type": "object", "additionalProperties": { "type": "boolean" }, "readOnly": true }, "assigned_users": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadEventUser" }, "readOnly": true } }, "required": [ "abilities", "accesses", "active_messaged_at", "archived_messaged_at", "assigned_users", "draft_messaged_at", "events_count", "has_active", "has_archived", "has_attachments", "has_delivery_failed", "has_delivery_pending", "has_draft", "has_messages", "has_sender", "has_starred", "has_trashed", "has_unread", "has_unread_mention", "id", "is_spam", "is_trashed", "labels", "messaged_at", "messages", "sender_messaged_at", "sender_names", "snippet", "subject", "summary", "trashed_messaged_at", "updated_at", "user_role" ] }, "ThreadAccess": { "type": "object", "description": "Serialize thread access information.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "thread": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "mailbox": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "role": { "$ref": "#/components/schemas/ThreadAccessRoleChoices" }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" }, "users": { "type": "array", "items": { "$ref": "#/components/schemas/UserWithoutAbilities" }, "readOnly": true } }, "required": [ "created_at", "id", "mailbox", "role", "thread", "updated_at", "users" ] }, "ThreadAccessDetail": { "type": "object", "description": "Serializer for thread access details.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "mailbox": { "$ref": "#/components/schemas/MailboxLight" }, "role": { "allOf": [ { "$ref": "#/components/schemas/ThreadAccessRoleChoices" } ], "readOnly": true }, "read_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true }, "starred_at": { "type": "string", "format": "date-time", "readOnly": true, "nullable": true } }, "required": [ "id", "mailbox", "read_at", "role", "starred_at" ] }, "ThreadAccessRequest": { "type": "object", "description": "Serialize thread access information.", "properties": { "thread": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "mailbox": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID" }, "role": { "$ref": "#/components/schemas/ThreadAccessRoleChoices" } }, "required": [ "mailbox", "role", "thread" ] }, "ThreadAccessRoleChoices": { "type": "string", "enum": [ "viewer", "editor" ] }, "ThreadBulkDeleteRequestRequest": { "type": "object", "description": "Payload for the bulk-delete endpoint: a scope and the threads/messages\nto permanently delete.", "properties": { "scope": { "allOf": [ { "$ref": "#/components/schemas/ScopeEnum" } ], "description": "Which messages to permanently delete. Only 'draft' (draft messages) is supported.\n\n* `draft` - draft" }, "thread_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Threads whose scope-matching messages should be deleted." }, "message_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "description": "Specific messages to delete (still scope-filtered)." } }, "required": [ "scope" ] }, "ThreadEvent": { "type": "object", "description": "Serialize thread event information.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "thread": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "readOnly": true }, "type": { "$ref": "#/components/schemas/ThreadEventTypeEnum" }, "channel": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "readOnly": true, "nullable": true }, "message": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "nullable": true }, "author": { "allOf": [ { "$ref": "#/components/schemas/UserWithoutAbilities" } ], "readOnly": true }, "author_display": { "type": "string", "nullable": true, "readOnly": true }, "data": { "$ref": "#/components/schemas/ThreadEventData" }, "has_unread_mention": { "type": "boolean", "readOnly": true }, "is_editable": { "type": "boolean", "readOnly": true }, "created_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Created on", "description": "date and time at which a record was created" }, "updated_at": { "type": "string", "format": "date-time", "readOnly": true, "title": "Updated on", "description": "date and time at which a record was last updated" } }, "required": [ "author", "author_display", "channel", "created_at", "data", "has_unread_mention", "id", "is_editable", "thread", "type", "updated_at" ] }, "ThreadEventAssigneesData": { "type": "object", "description": "OpenAPI-only serializer: shape of ``ThreadEvent.data`` for ``ASSIGN`` and ``UNASSIGN`` events.\n\nBoth event types share the exact same payload shape, so a single serializer\n(and thus a single generated TypeScript type) covers them.\n\nNot used for runtime validation (handled by\n``ThreadEvent.validate_data()`` against ``ThreadEvent.DATA_SCHEMAS``);\nexists solely to produce a named component in the OpenAPI schema consumed\nby the generated frontend client.", "properties": { "assignees": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadEventUser" } } }, "required": [ "assignees" ] }, "ThreadEventAssigneesDataRequest": { "type": "object", "description": "OpenAPI-only serializer: shape of ``ThreadEvent.data`` for ``ASSIGN`` and ``UNASSIGN`` events.\n\nBoth event types share the exact same payload shape, so a single serializer\n(and thus a single generated TypeScript type) covers them.\n\nNot used for runtime validation (handled by\n``ThreadEvent.validate_data()`` against ``ThreadEvent.DATA_SCHEMAS``);\nexists solely to produce a named component in the OpenAPI schema consumed\nby the generated frontend client.", "properties": { "assignees": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadEventUserRequest" } } }, "required": [ "assignees" ] }, "ThreadEventData": { "oneOf": [ { "$ref": "#/components/schemas/ThreadEventIMData" }, { "$ref": "#/components/schemas/ThreadEventAssigneesData" } ] }, "ThreadEventDataRequest": { "oneOf": [ { "$ref": "#/components/schemas/ThreadEventIMDataRequest" }, { "$ref": "#/components/schemas/ThreadEventAssigneesDataRequest" } ] }, "ThreadEventIMData": { "type": "object", "description": "OpenAPI-only serializer: shape of ``ThreadEvent.data`` for ``IM`` events.\n\nNot used for runtime validation (handled by\n``ThreadEvent.validate_data()`` against ``ThreadEvent.DATA_SCHEMAS``);\nexists solely to produce a named component in the OpenAPI schema consumed\nby the generated frontend client.", "properties": { "content": { "type": "string" }, "mentions": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadEventUser" } } }, "required": [ "content" ] }, "ThreadEventIMDataRequest": { "type": "object", "description": "OpenAPI-only serializer: shape of ``ThreadEvent.data`` for ``IM`` events.\n\nNot used for runtime validation (handled by\n``ThreadEvent.validate_data()`` against ``ThreadEvent.DATA_SCHEMAS``);\nexists solely to produce a named component in the OpenAPI schema consumed\nby the generated frontend client.", "properties": { "content": { "type": "string", "minLength": 1 }, "mentions": { "type": "array", "items": { "$ref": "#/components/schemas/ThreadEventUserRequest" } } }, "required": [ "content" ] }, "ThreadEventRequest": { "type": "object", "description": "Serialize thread event information.", "properties": { "type": { "$ref": "#/components/schemas/ThreadEventTypeEnum" }, "message": { "type": "string", "format": "uuid", "description": "primary key for the record as UUID", "nullable": true }, "data": { "$ref": "#/components/schemas/ThreadEventDataRequest" } }, "required": [ "data", "type" ] }, "ThreadEventTypeEnum": { "enum": [ "im", "assign", "unassign" ], "type": "string", "description": "* `im` - Instant message\n* `assign` - Assign\n* `unassign` - Unassign" }, "ThreadEventUser": { "type": "object", "description": "OpenAPI-only serializer: describes a single user inside\nan ThreadEvent.data payload. (used for ``IM`` and ``ASSIGNEES`` events)\n\nNot used for runtime validation (handled by\n``ThreadEvent.validate_data()`` against ``ThreadEvent.DATA_SCHEMAS``);\nexists solely to produce a named component in the OpenAPI schema consumed\nby the generated frontend client.", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } }, "required": [ "id", "name" ] }, "ThreadEventUserRequest": { "type": "object", "description": "OpenAPI-only serializer: describes a single user inside\nan ThreadEvent.data payload. (used for ``IM`` and ``ASSIGNEES`` events)\n\nNot used for runtime validation (handled by\n``ThreadEvent.validate_data()`` against ``ThreadEvent.DATA_SCHEMAS``);\nexists solely to produce a named component in the OpenAPI schema consumed\nby the generated frontend client.", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "minLength": 1 } }, "required": [ "id", "name" ] }, "ThreadLabel": { "type": "object", "description": "Serializer to get labels details for a thread.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "name": { "type": "string", "description": "Name of the label/folder (can use slashes for hierarchy, e.g. 'Work/Projects')", "maxLength": 255 }, "slug": { "type": "string", "readOnly": true, "description": "URL-friendly version of the name", "pattern": "^[-a-zA-Z0-9_]+$" }, "color": { "type": "string", "description": "Color of the label in hex format (e.g. #FF0000)", "maxLength": 7 }, "display_name": { "type": "string", "readOnly": true }, "description": { "type": "string", "description": "Description of the label, used by AI to understand its purpose", "maxLength": 255 }, "is_auto": { "type": "boolean", "title": "Auto labeling", "description": "Whether this label should be automatically applied by AI" } }, "required": [ "display_name", "id", "name", "slug" ] }, "ThreadMentionableUser": { "type": "object", "description": "User listed in a thread's mention suggestions, with comment capability flag.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "email": { "type": "string", "format": "email", "readOnly": true, "nullable": true, "title": "Identity email address" }, "full_name": { "type": "string", "readOnly": true, "nullable": true }, "custom_attributes": { "type": "object", "additionalProperties": {}, "description": "Get custom attributes for the instance.", "readOnly": true }, "can_post_comments": { "type": "boolean", "readOnly": true } }, "required": [ "can_post_comments", "custom_attributes", "email", "full_name", "id" ] }, "ThreadSplitRequestRequest": { "type": "object", "properties": { "message_id": { "type": "string", "format": "uuid", "description": "ID of the message to split from. This message and all chronologically later messages will be moved to a new thread." } }, "required": [ "message_id" ] }, "TreeLabel": { "type": "object", "description": "Serializer for tree label response structure (OpenAPI purpose only...).", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true }, "name": { "type": "string", "readOnly": true }, "slug": { "type": "string", "readOnly": true }, "color": { "type": "string", "readOnly": true }, "display_name": { "type": "string", "readOnly": true }, "children": { "type": "array", "items": { "$ref": "#/components/schemas/TreeLabel" }, "readOnly": true }, "description": { "type": "string", "readOnly": true }, "is_auto": { "type": "boolean", "readOnly": true } }, "required": [ "children", "color", "description", "display_name", "id", "is_auto", "name", "slug" ] }, "UserChannelCreateRequestRequest": { "oneOf": [ { "$ref": "#/components/schemas/ChannelRequest" }, { "$ref": "#/components/schemas/PushChannelCreateRequest" } ] }, "UserWithAbilities": { "type": "object", "description": "Serialize users with abilities.\nAllow to have separated OpenAPI definition for users with and without abilities.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "email": { "type": "string", "format": "email", "readOnly": true, "nullable": true, "title": "Identity email address" }, "full_name": { "type": "string", "readOnly": true, "nullable": true }, "custom_attributes": { "type": "object", "additionalProperties": {}, "description": "Get custom attributes for the instance.", "readOnly": true }, "csrf_token": { "type": "string", "description": "Return the session-bound CSRF token for the SPA to echo as X-CSRFToken.\n\nWith ``CSRF_USE_SESSIONS`` the secret lives in the session and is no\nlonger exposed as a cookie, so the token is delivered here over the\nauthenticated ``/users/me/`` channel.", "readOnly": true }, "abilities": { "type": "object", "description": "Instance permissions and capabilities", "properties": { "view_maildomains": { "type": "boolean", "description": "Can view domain admin" }, "create_maildomains": { "type": "boolean", "description": "Can create maildomains" }, "manage_maildomain_accesses": { "type": "boolean", "description": "Can manage maildomain accesses" } }, "required": [ "view_maildomains", "create_maildomains", "manage_maildomain_accesses" ], "readOnly": true } }, "required": [ "abilities", "csrf_token", "custom_attributes", "email", "full_name", "id" ] }, "UserWithoutAbilities": { "type": "object", "description": "Serialize users without abilities.\nAllow to have separated OpenAPI definition for users with and without abilities.", "properties": { "id": { "type": "string", "format": "uuid", "readOnly": true, "description": "primary key for the record as UUID" }, "email": { "type": "string", "format": "email", "readOnly": true, "nullable": true, "title": "Identity email address" }, "full_name": { "type": "string", "readOnly": true, "nullable": true }, "custom_attributes": { "type": "object", "additionalProperties": {}, "description": "Get custom attributes for the instance.", "readOnly": true } }, "required": [ "custom_attributes", "email", "full_name", "id" ] }, "WebPushKeysRequest": { "type": "object", "description": "The Web Push subscription key pair (``p256dh`` and ``auth``).", "properties": { "p256dh": { "type": "string", "minLength": 1 }, "auth": { "type": "string", "minLength": 1 } }, "required": [ "auth", "p256dh" ] } }, "securitySchemes": { "cookieAuth": { "type": "apiKey", "in": "cookie", "name": "sessionid" } } } }