openapi: 3.0.0 info: version: 1.0.0 title: Channel Accounts Drafts API contact: name: Front Platform url: https://community.front.com servers: - url: https://api2.frontapp.com security: - http: [] tags: - name: Drafts paths: /channels/{channel_id}/drafts: post: summary: Create draft operationId: create-draft description: 'Create a draft message which is the first message of a new [conversation](https://dev.frontapp.com/reference/conversations). Required scope: `drafts:write`' tags: - Drafts parameters: - in: path name: channel_id required: true description: The channel ID. Alternatively, you can supply the channel address as a [resource alias](https://dev.frontapp.com/docs/resource-aliases-1). schema: type: string default: cha_123 requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateDraft' responses: '200': $ref: '#/components/responses/message' x-required-scopes: - drafts:write /conversations/{conversation_id}/drafts: get: summary: List conversation drafts operationId: list-conversation-drafts description: 'List the drafts in a conversation. Required scope: `drafts:read`' tags: - Drafts parameters: - in: path name: conversation_id required: true description: The conversation ID schema: type: string default: cnv_123 responses: '200': $ref: '#/components/responses/listOfMessages' '301': description: If the conversation has been merged, the response redirects you to the merged conversation. x-required-scopes: - drafts:read post: summary: Create draft reply operationId: create-draft-reply description: 'Create a new draft as a reply to the last message in the conversation. Required scope: `drafts:write`' tags: - Drafts parameters: - in: path name: conversation_id required: true description: The conversation ID schema: type: string default: cnv_123 requestBody: content: application/json: schema: $ref: '#/components/schemas/ReplyDraft' responses: '200': $ref: '#/components/responses/message' '301': description: If the conversation has been merged, the response redirects you to the merged conversation. x-required-scopes: - drafts:write /drafts/{draft_id}: delete: summary: Delete draft operationId: delete-draft description: 'Delete a draft message. Required scope: `drafts:delete`' tags: - Drafts parameters: - in: path name: draft_id required: true description: The draft ID schema: type: string default: msg_123 requestBody: content: application/json: schema: $ref: '#/components/schemas/DeleteDraft' responses: '204': description: No content x-required-scopes: - drafts:delete /drafts/{message_id}/: patch: summary: Edit draft operationId: edit-draft description: 'Edit a draft message. Required scope: `drafts:write`' tags: - Drafts parameters: - in: path name: message_id required: true description: The draft ID schema: type: string default: msg_123 requestBody: content: application/json: schema: $ref: '#/components/schemas/EditDraft' responses: '200': $ref: '#/components/responses/message' x-required-scopes: - drafts:write components: responses: message: description: A message content: application/json: schema: $ref: '#/components/schemas/MessageResponse' listOfMessages: description: Array of messages content: application/json: schema: type: object properties: _pagination: type: object properties: next: type: string nullable: true description: Link to next [page of results](https://dev.frontapp.com/docs/pagination) example: https://yourCompany.api.frontapp.com/conversations/cnv_y4xb93i/messages?page_token=klsljs8023j09suidfjlsjiei00043lllwww998303dkef0g _links: type: object properties: self: type: string description: Link to resource example: https://yourCompany.api.frontapp.com/conversations/cnv_y4xb93i/messages _results: type: array items: $ref: '#/components/schemas/MessageResponse' schemas: ReplyDraft: required: - body - channel_id allOf: - $ref: '#/components/schemas/CreateDraft' - type: object properties: channel_id: type: string description: ID of the channel from which the draft will be sent. Alternatively, you can supply the channel address as a [resource alias](https://dev.frontapp.com/docs/resource-aliases-1). MessageResponse: type: object properties: _links: type: object properties: self: type: string description: Link to resource example: https://yourCompany.api.frontapp.com/messages/msg_1q15qmtq related: type: object properties: conversation: type: string description: Link to message conversation example: https://yourCompany.api.frontapp.com/conversations/cnv_yo1kg5q message_replied_to: type: string description: Link to message this message replied to example: https://yourCompany.api.frontapp.com/messages/msg_2y67qldq message_seen: type: string description: Link to message seen information example: https://yourCompany.api.frontapp.com/messages/msg_1q15qmtq/seen id: type: string description: Unique identifier of the message example: msg_1q15qmtq message_uid: type: string description: Secondary unique identifier of a message. Generated by Front on message creation. Learn more at about the [message UID](https://dev.frontapp.com/reference/messages#creating-a-new-message). example: 1eab543f84a0785f7b6b8967cck18f4d type: type: string description: Type of the message enum: - call - custom - email - facebook - front_chat - googleplay - intercom - internal - phone-call - sms - tweet - tweet_dm - whatsapp - yalo_wha example: email is_inbound: type: boolean description: Whether or not the message has been received or sent example: false draft_mode: type: string nullable: true description: If the message is a draft, describes the draft mode. Can be 'private' (draft is visible to the author only) or 'shared' (draft is visible to all teammates with access to the conversation). enum: - shared - private example: shared error_type: type: string description: Type of the error when the draft failed to be sent example: null version: type: string description: The current version of the message in Front example: 551ba368f3e7803cce51503ee3e58ef0-26028-1701804863304-945c created_at: type: number description: The timestamp when the message was sent or received example: 1701292639 subject: type: string description: Subject of the message example: Jim's pranks are getting out of hand blurb: type: string description: Preview of the message body example: It's high time we discuss the pranking culture in the office author: $ref: '#/components/schemas/TeammateResponse' description: Front teammate who sent this message recipients: type: array items: $ref: '#/components/schemas/RecipientResponse' body: type: string description: Body of the message example:
Hi there,
I wanted to let you know that I'm suggesting an update to Dunder Mifflin's Pranking Policy to provide non-humorous employees greater control over their well-being in the office.
text: type: string description: Text version of the body for email messages example: Hi there,\n\nI wanted to let you know that I'm suggesting an update to Dunder Mifflin's Pranking Policy (https://dundermifflin.com/privacy/pranks) to provide non-humorous employees greater control over their well-being in the office. attachments: type: array items: $ref: '#/components/schemas/Attachment' description: List of files attached to the message signature: $ref: '#/components/schemas/SignatureResponse' description: The signature attached to this message metadata: type: object description: Optional metadata about the message properties: intercom_url: type: string description: For `intercom` messages only. URL of the Intercom conversation the message is coming from. example: http://intercom.com duration: type: integer description: For `truly-call` messages only. Length of the call in seconds. example: 189 have_been_answered: type: boolean description: For `truly-call` messages only. Whether or not the call have been answered. example: false external_id: type: string description: For `tweet` or 'custom' (partner channel token authenticated) messages only. Unique message identifier in the underlying provider (Twitter or Partner). For custom messages, only present for partner channel token authenticated requests. example: dkd84992kduo903 twitter_url: type: string description: For `tweet` messages only. URL of the tweet. example: https://twitter.com is_retweet: type: boolean description: For `tweet` messages only. Whether or not the tweet is a retweet. example: true have_been_retweeted: type: boolean description: For `tweet` messages only. Whether or not the tweet have been retweeted. example: true have_been_favorited: type: boolean description: For `tweet` messages only. Whether or not the tweet have been favorited. example: false thread_ref: type: string description: For `custom` messages only. Custom reference which is used to thread messages. example: t0930k9000-394 headers: type: object description: For `custom` messages only. Custom object holding internal information. chat_visitor_url: type: string description: For `front_chat` messages only. Source URL from the chat widget when sending a message. example: https://yourCompany.com/products CustomFieldParameter: type: object description: An object whose key is the `name` property defined for the custom field in the Front UI. The value of the key must use the same `type` specified for the custom field, as described in https://dev.frontapp.com/reference/custom-fields example: city: London, UK isVIP: true renewal_date: 1525417200 sla_time: 90 owner: leela@planet-express.com replyTo: inb_55c8c149 Job Title: firefighter SignatureResponse: type: object required: - _links - id - name - body - sender_info - is_private - is_visible_for_all_teammate_channels - is_default - channel_ids properties: _links: type: object properties: self: type: string description: Link to resource example: https://yourCompany.api.frontapp.com/signatures/sig_6rrv2 related: type: object properties: owner: type: string description: Link to signature's owner (either a team or teammate) example: https://yourCompany.api.frontapp.com/teams/tim_k30 id: type: string description: Unique identifier of the signature example: sig_6rrv2 name: type: string nullable: true description: Name of the signature example: Finer Things Club signature body: type: string description: Body of the signature example: