UNPKG

@epilot/message-client

Version:
1,861 lines 67.4 kB
{ "openapi": "3.0.2", "info": { "title": "Message API", "version": "1.0.0", "description": "Send and receive email messages via your epilot organization\n" }, "security": [ { "EpilotAuth": [] }, { "EpilotOrg": [] } ], "tags": [ { "name": "Messages" }, { "name": "Threads" }, { "name": "Drafts" }, { "name": "message_schema", "x-displayName": "Message", "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Message\" />\n" }, { "name": "thread_schema", "x-displayName": "Thread", "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Thread\" />\n" } ], "x-tagGroups": [ { "name": "APIs", "tags": [ "Messages", "Threads", "Drafts" ] }, { "name": "Schemas", "tags": [ "message_schema", "thread_schema" ] } ], "paths": { "/v1/message/messages": { "post": { "operationId": "sendMessage", "summary": "sendMessage", "description": "Send an email message", "tags": [ "Messages" ], "parameters": [ { "in": "query", "name": "do_not_create_entities", "description": "When true, this flag lets the caller to send only the message and by-pass creating the thread & message entities.", "schema": { "default": false, "type": "boolean" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageRequestParams" } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageRequestParams" } } } }, "403": { "description": "Forbidden" } } }, "put": { "operationId": "updateMessage", "summary": "updateMessage", "description": "Update message metadata", "tags": [ "Messages" ], "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/BaseEntity" }, { "$ref": "#/components/schemas/Message" } ] } } } }, "403": { "description": "Forbidden" } } } }, "/v1/message/messages/{id}": { "get": { "operationId": "getMessage", "summary": "getMessage", "description": "Get an email message by id", "tags": [ "Messages" ], "parameters": [ { "name": "id", "description": "Message ID", "in": "path", "required": true, "schema": { "type": "string", "example": "4d74976d-fb64-47fd-85e2-65eea140f5eb" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/BaseEntity" }, { "$ref": "#/components/schemas/Message" } ] } } } }, "302": { "description": "Redirect to V2 API to fetch the download URL", "headers": { "Location": { "description": "V2 API", "schema": { "type": "string", "example": "https://message.sls.epilot.io/v2/messages/4d74976d-fb64-47fd-85e2-65eea140f5eb" } } } }, "403": { "description": "Forbidden" } } }, "delete": { "operationId": "deleteMessage", "summary": "deleteMessage", "description": "Immediately and permanently delete a message. This operation cannot be undone.", "tags": [ "Messages" ], "parameters": [ { "name": "id", "description": "Message ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/messages:search": { "post": { "operationId": "searchMessages", "summary": "searchMessages", "description": "Search Messages", "tags": [ "Messages" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchParamsV2" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "hits", "results" ], "properties": { "hits": { "type": "number", "description": "Total of matched messages", "example": 14 }, "results": { "type": "array", "description": "Matched messages", "items": { "allOf": [ { "$ref": "#/components/schemas/BaseEntity" }, { "$ref": "#/components/schemas/Message" } ] } } } } } } }, "403": { "description": "Forbidden" } } } }, "/v1/message/messages/{id}/trash": { "post": { "operationId": "trashMessage", "summary": "trashMessage", "description": "Move a message to the trash", "tags": [ "Messages" ], "parameters": [ { "name": "id", "description": "Message ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/messages/{id}/untrash": { "post": { "operationId": "untrashMessage", "summary": "untrashMessage", "description": "Restore a trashed message", "tags": [ "Messages" ], "parameters": [ { "name": "id", "description": "Message ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/messages/{id}/read": { "post": { "operationId": "markReadMessage", "summary": "markReadMessage", "description": "Mark message as read", "tags": [ "Messages" ], "parameters": [ { "name": "id", "description": "Message ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v2/message/messages/{id}/read": { "post": { "operationId": "markReadMessageV2", "summary": "markReadMessageV2", "description": "Mark message as read within a scope", "tags": [ "Messages" ], "parameters": [ { "name": "id", "description": "Message ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadMessagePayload" } } } }, "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/messages/{id}/unread": { "post": { "operationId": "markUnreadMessage", "summary": "markUnreadMessage", "description": "Mark message as unread", "tags": [ "Messages" ], "parameters": [ { "name": "id", "description": "Message ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/messages/unread/{actor}": { "get": { "operationId": "getUnread", "summary": "getUnread", "description": "Get all unread messages by actor", "tags": [ "Messages" ], "parameters": [ { "name": "actor", "description": "Actor performing call, can be user or organization", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "organization", "user" ] } }, { "in": "query", "name": "email_filter", "description": "emails to filter by", "schema": { "default": "test@epilot.dev", "type": "array" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "count" ], "properties": { "count": { "type": "number", "description": "Total of unread messages", "example": 14 }, "unread": { "type": "number", "description": "Total of unread messages", "example": 0 }, "drafts": { "type": "number", "description": "Total of drafts messages", "example": 12 }, "unassigned": { "type": "number", "description": "Total of unassigned messages", "example": 1 } } } } } }, "403": { "description": "Forbidden" } } } }, "/v2/message/messages/{id}/unread": { "post": { "operationId": "markUnreadMessageV2", "summary": "markUnreadMessageV2", "description": "Mark message as unread within a scope", "tags": [ "Messages" ], "parameters": [ { "name": "id", "description": "Message ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadMessagePayload" } } } }, "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads:search": { "post": { "operationId": "searchThreads", "summary": "searchThreads", "description": "Search for threads of email messages.\n\nMessages with no replies yet are treated as threads with single message.\n\nLucene syntax supported.\n", "tags": [ "Threads" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchParams" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "hits", "results" ], "properties": { "hits": { "type": "number", "description": "Total of matched threads", "example": 14 }, "results": { "type": "array", "description": "Matched threads", "items": { "allOf": [ { "$ref": "#/components/schemas/BaseEntity" }, { "$ref": "#/components/schemas/Thread" } ] } } } } } } }, "403": { "description": "Forbidden" } } } }, "/v2/message/threads:search": { "post": { "operationId": "searchThreadsV2", "summary": "searchThreadsV2", "description": "Search for threads of email messages.\n\nMessages with no replies yet are treated as threads with single message.\n\nLucene syntax supported.\n", "tags": [ "Threads" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchParamsV2" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "hits", "results" ], "properties": { "hits": { "type": "number", "description": "Total of matched threads", "example": 14 }, "results": { "type": "array", "description": "Matched threads", "items": { "allOf": [ { "$ref": "#/components/schemas/BaseEntity" }, { "$ref": "#/components/schemas/Thread" } ] } } } } } } }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads:searchIds": { "post": { "operationId": "searchIds", "summary": "Search threads and return all id's", "description": "Return all thread id's that match a criteria\n\nLucene syntax supported.\n", "tags": [ "Threads" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchIDParams" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "required": [ "hits", "results" ], "properties": { "hits": { "type": "number", "description": "Total of matched threads", "example": 14 }, "results": { "type": "array", "description": "Matched threads ids", "items": { "type": "string" } } } } } } }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads": { "put": { "operationId": "updateThread", "summary": "updateThread", "description": "Modify thread metadata", "tags": [ "Threads" ], "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/BaseEntity" }, { "$ref": "#/components/schemas/Thread" } ] } } } }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}": { "delete": { "operationId": "deleteThread", "summary": "deleteThread", "description": "Immediately and permanently delete a thread. This operation cannot be undone.", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}:markAsDone": { "post": { "operationId": "markThreadAsDone", "summary": "markThreadAsDone", "description": "Mark thread as done", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "400": { "description": "Bad Request" } } } }, "/v1/message/threads/{id}:markAsOpen": { "post": { "operationId": "markThreadAsOpen", "summary": "markThreadAsOpen", "description": "Mark thread as open", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "400": { "description": "Bad Request" } } } }, "/v1/message/threads/{id}/timeline": { "get": { "operationId": "getThreadTimeline", "summary": "getThreadTimeline", "description": "Get thread timeline", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThreadTimeline" } } } }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}/trash": { "post": { "operationId": "trashThread", "summary": "trashThread", "description": "Move a thread to trash", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}/untrash": { "post": { "operationId": "untrashThread", "summary": "untrashThread", "description": "Restore a trashed thread", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/bulk:read": { "post": { "operationId": "threadBulkActionsRead", "summary": "threadBulkActionsRead", "description": "Perform a bulk action of marking an array of thread ids as read", "tags": [ "Threads" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkActionsPayloadWithScopes" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/bulk:unread": { "post": { "operationId": "threadBulkActionsUnread", "summary": "threadBulkActionsUnread", "description": "Perform a bulk action of marking an array of thread ids as unread", "tags": [ "Threads" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkActionsPayloadWithScopes" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/bulk:favorite": { "post": { "operationId": "threadBulkActionsFavorite", "summary": "threadBulkActionsFavorite", "description": "Perform a bulk action of marking an array of thread ids favorite", "tags": [ "Threads" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkActionsPayload" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/bulk:unfavorite": { "post": { "operationId": "threadBulkActionsUnfavorite", "summary": "threadBulkActionsUnfavorite", "description": "Perform a bulk action of marking an array of thread ids unfavorited", "tags": [ "Threads" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkActionsPayload" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/bulk:trash": { "post": { "operationId": "threadBulkActionsTrash", "summary": "threadBulkActionsTrash", "description": "Perform a bulk action of trashing an array of threads", "tags": [ "Threads" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkActionsPayload" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/bulk:untrash": { "post": { "operationId": "threadBulkActionsUntrash", "summary": "threadBulkActionsUntrash", "description": "Perform a bulk action of untrashing an array of threads", "tags": [ "Threads" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkActionsPayload" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/bulk:delete": { "post": { "operationId": "threadBulkActionsDelete", "summary": "threadBulkActionsDelete", "description": "Performs a bulk permanent delete for all threads", "tags": [ "Threads" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkActionsPayload" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/bulk:done": { "post": { "operationId": "threadBulkActionsDone", "summary": "threadBulkActionsDone", "description": "Perform a bulk action of marking an array of threads as done", "tags": [ "Threads" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkActionsPayload" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/bulk:open": { "post": { "operationId": "threadBulkActionsOpen", "summary": "threadBulkActionsOpen", "description": "Perform a bulk action of marking an array of threads as open", "tags": [ "Threads" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkActionsPayload" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}/read": { "post": { "operationId": "markReadThread", "summary": "markReadThread", "description": "Mark thread as read", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v2/message/threads/{id}/read": { "post": { "operationId": "markReadThreadV2", "summary": "markReadThreadV2", "description": "Mark thread as read within a scope", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadMessagePayload" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}/unread": { "post": { "operationId": "markUnreadThread", "summary": "markUnreadThread", "description": "Mark thread as unread", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v2/message/threads/{id}/unread": { "post": { "operationId": "markUnreadThreadV2", "summary": "markUnreadThreadV2", "description": "Mark thread as unread within a scope", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadMessagePayload" } } } }, "responses": { "200": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}/assign": { "post": { "operationId": "assignThread", "summary": "assignThread", "description": "Assign thread to entities", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "description": "Entities which thread is assigned to", "type": "array", "items": { "type": "object", "properties": { "slug": { "description": "Entity slug", "type": "string", "example": "contact" }, "entity_id": { "description": "Entity ID", "type": "string", "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3" }, "org_id": { "description": "Organization ID", "type": "string", "example": "206801" }, "is_main_entity": { "description": "To indicate this is main entity", "type": "boolean", "example": true } } } } } } }, "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}/unassign": { "post": { "operationId": "unassignThread", "summary": "unassignThread", "description": "Unassign thread from entities", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "description": "Entities which thread is unassigned from", "type": "array", "items": { "type": "object", "properties": { "slug": { "description": "Entity slug", "type": "string", "example": "contact" }, "entity_id": { "description": "Entity ID", "type": "string", "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3" } } } } } } }, "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}/assign:users": { "post": { "operationId": "assignUsers", "summary": "assignUsers", "description": "Assign users to thread for receiving notifications.\nThe operation replaces all existing assigned users in thread.\n", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "description": "User IDs of users assigned to thread", "type": "object", "properties": { "assigned_to": { "type": "array", "description": "IDs of users assigned to thread", "items": { "type": "string", "example": "206801" } } } } } } }, "responses": { "204": { "description": "Success" }, "403": { "description": "Forbidden" } } } }, "/v1/message/threads/{id}:pin": { "post": { "operationId": "pinThread", "summary": "Pin a single thread", "description": "Pin a single thread", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "400": { "description": "Bad request" }, "404": { "description": "Thread not found" }, "409": { "description": "Concurrent update error" }, "500": { "description": "Internal server error" } } }, "delete": { "operationId": "unpinThread", "summary": "Unpin a single thread", "description": "Unpin a single thread", "tags": [ "Threads" ], "parameters": [ { "name": "id", "description": "Thread ID", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Success" }, "400": { "description": "Bad request" }, "404": { "description": "Thread not found" }, "409": { "description": "Concurrent update error" }, "500": { "description": "Internal server error" } } } }, "/v1/message/drafts": { "post": { "operationId": "createDraft", "summary": "createDraft", "description": "Create a new draft", "tags": [ "Drafts" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageRequestParams" } } } }, "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/BaseEntity" }, { "$ref": "#/components/schemas/Message" } ] } } } }, "403": { "description": "Forbidden" } } } }, "/v1/message/drafts:send": { "post": { "operationId": "sendDraft", "summary": "sendDraft", "description": "Send the existing draft to the recipients", "tags": [ "Drafts" ], "responses": { "201": { "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/BaseEntity" }, { "$ref": "#/components/schemas/Message" } ] } } } }, "403": { "description": "Forbidden" } } } }, "/v2/message/messages/{id}": { "get": { "operationId": "getMessageV2", "summary": "getMessageV2", "description": "- Fetches message by ID\n- If the message html is omitted on the entity, then it keeps the content on the message as a signed url\n {\n ...\n _id: \"4d74976d-fb64-47fd-85e2-65eea140f5eb\",\n _schema: \"message\",\n _org: \"org-123\",\n html_omitted: true,\n html_download_url: \"https://s3.eu-central-1.amazonaws.com/epilot-attachments/3f34ce73-089c-4d45-a5ee-c161234e41c3/3f34ce73-089c-4d45-a5ee-c161234e41c3.html\"\n }\n", "tags": [ "Messages" ], "parameters": [ { "name": "id", "description": "Message ID", "in": "path", "required": true, "schema": { "type": "string", "example": "4d74976d-fb64-47fd-85e2-65eea140f5eb" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/MessageV2" } ] } } } }, "403": { "description": "Forbidden" } } } } }, "components": { "securitySchemes": { "EpilotAuth": { "type": "http", "scheme": "bearer", "description": "Authorization header with epilot OAuth2 bearer token", "bearerFormat": "JWT" }, "EpilotOrg": { "description": "Overrides the target organization to allow shared tenant access", "name": "x-epilot-org-id", "in": "header", "type": "apiKey" } }, "schemas": { "BaseEntity": { "type": "object", "required": [ "_id", "_title", "_org", "_schema", "_created_at", "_updated_at" ], "properties": { "_id": { "type": "string", "description": "Entity ID", "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, "_title": { "type": "string", "description": "Entity title" }, "_org": { "type": "string", "description": "Organization ID the entity belongs to", "example": "206801" }, "_schema": { "type": "string", "description": "URL-friendly identifier for the entity schema", "example": "message" }, "_tags": { "type": "array", "description": "Entity tags", "items": { "type": "string" }, "example": [ "pricing", "INBOX" ] }, "_created_at": { "type": "string", "description": "Created date", "format": "date-time", "example": "2021-02-09T12:41:43.662Z" }, "_updated_at": { "type": "string", "description": "Updated date", "format": "date-time", "example": "2021-02-10T09:14:31.990Z" } } }, "Thread": { "description": "Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.", "required": [ "topic" ], "properties": { "topic": { "type": "string", "description": "Message topic (e.g. which service sends the message or message category)", "example": "CUSTOMER_MESSAGE" }, "assigned_to": { "type": "array", "description": "User ID of who the message is assigned to. Default is the user who sends message.", "items": { "type": "string", "example": [ "206801", "200109" ] } }, "org_read_message": { "type": "array", "description": "Organization ID of organization read the message.", "items": { "type": "string", "example": [ "789372", "210291" ] } }, "done": { "type": "boolean", "description": "Whether the thread is marked as Done", "example": false }, "latest_message": { "type": "object", "description": "Latest message of thread", "$ref": "#/components/schemas/Message" }, "latest_trash_message": { "type": "object", "description": "Latest trash message of thread", "$ref": "#/components/schemas/Message" }, "latest_message_at": { "type": "string", "description": "The date of the latest message time in the thread", "example": "2024-02-10T09:14:31.990Z" } } }, "Message": { "type": "object", "required": [ "subject", "from" ], "properties": { "message_id": { "type": "string", "description": "Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.", "example": "<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>" }, "sender": { "type": "string", "description": "User ID of user sends the message.", "example": "206801" }, "subject": { "type": "string", "description": "Subject", "example": "Request for solar panel price" }, "html": { "type": "string", "description": "HTML body", "example": "<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>" }, "text": { "type": "string", "description": "Text body", "example": "We at ABC GmbH would like to request a price quote for the solar panel." }, "from": { "$ref": "#/components/schemas/Address" }, "reply_to": { "$ref": "#/components/schemas/Address" }, "to": { "type": "array", "description": "To email addresses", "items": { "$ref": "#/components/schemas/Address" } }, "cc": { "type": "array", "description": "Cc email addresses", "items": { "$ref": "#/components/schemas/Address" } }, "bcc": { "type": "array", "description": "Bcc email addresses", "items": { "$ref": "#/components/schemas/Address" } }, "file": { "$ref": "#/components/schemas/AttachmentsRelation" }, "references": { "type": "string", "description": "References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent. The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread. The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.\n", "example": "<0102