openapi: 3.0.1 info: title: Pipedrive API v1 Activities Mailbox API version: 1.0.0 description: 'Activities are appointments/tasks/events on a calendar that can be associated with a deal, a lead, a person and an organization. Activities can be of different type (such as call, meeting, lunch or a custom type - see ActivityTypes object) and can be assigned to a particular user. Note that activities can also be created without a specific date/time. ' servers: - url: https://api.pipedrive.com/v1 tags: - name: Mailbox description: 'Mailbox was designed to be the email control hub inside Pipedrive. Pipedrive supports all major providers (including Gmail, Outlook and also custom IMAP/SMTP). There are 2 options for syncing user emails: 2-way sync: Mail Connection is established with the mail provider (example Gmail). There can be only 1 active Mail Connection per user in company. 1-way sync: SmartBCC feature which stores the copies of email messages to Pipedrive by adding the SmartBCC specific address to mail recipients. ' paths: /mailbox/mailMessages/{id}: get: summary: Get one mail message description: Returns data about a specific mail message. x-token-cost: 2 operationId: getMailMessage tags: - Mailbox security: - api_key: [] - oauth2: - mail:read - mail:full parameters: - in: path name: id required: true schema: type: integer description: The ID of the mail message to fetch - in: query name: include_body schema: title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: Whether to include the full message body or not. `0` = Don't include, `1` = Include. responses: '200': description: The mail messages that are being synced with Pipedrive content: application/json: schema: title: GetMailMessageResponse allOf: - type: object title: MailServiceBaseResponse properties: success: type: boolean description: If the response is successful or not statusCode: description: The email service specific status code and it is returned through the response body. type: integer statusText: description: The status text of the response. type: string service: description: The service name of the response. type: string - type: object properties: data: type: object title: MailMessageData properties: id: description: ID of the mail message. type: integer from: type: array description: The array of mail message sender (object) items: type: object properties: id: description: ID of the mail participant type: integer email_address: description: Mail address of the mail participant type: string name: description: Name of the mail participant type: string linked_person_id: description: ID of the linked person to the mail message type: integer linked_person_name: description: Name of the linked person to the mail message type: string mail_message_party_id: description: ID of the mail message participant type: integer to: type: array description: The array of mail message receiver (object) items: type: object properties: id: description: ID of the mail participant type: integer email_address: description: Mail address of the mail participant type: string name: description: Name of the mail participant type: string linked_person_id: description: ID of the linked person to the mail message type: integer linked_person_name: description: Name of the linked person to the mail message type: string mail_message_party_id: description: ID of the mail message participant type: integer cc: type: array description: The array of mail message copies (object) items: type: object properties: id: description: ID of the mail participant type: integer email_address: description: Mail address of the mail participant type: string name: description: Name of the mail participant type: string linked_person_id: description: ID of the linked person to the mail message type: integer linked_person_name: description: Name of the linked person to the mail message type: string mail_message_party_id: description: ID of the mail message participant type: integer bcc: type: array description: The array of mail message blind copies (object) items: type: object properties: id: description: ID of the mail participant type: integer email_address: description: Mail address of the mail participant type: string name: description: Name of the mail participant type: string linked_person_id: description: ID of the linked person to the mail message type: integer linked_person_name: description: Name of the linked person to the mail message type: string mail_message_party_id: description: ID of the mail message participant type: integer body_url: type: string description: The mail message body URL account_id: type: string description: The connection account ID user_id: type: integer description: ID of the user whom mail message will be assigned to mail_thread_id: type: integer description: ID of the mail message thread subject: type: string description: The subject of mail message snippet: type: string description: The snippet of mail message. Snippet length is up to 225 characters. mail_tracking_status: type: string nullable: true description: The status of tracking mail message. Value is `null` if tracking is not enabled. enum: - opened - not opened mail_link_tracking_enabled_flag: description: Whether the link tracking in mail message body is enabled. allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 read_flag: description: Whether the mail message is read or not by the user allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 draft: type: string description: If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. draft_flag: description: Whether the mail message is a draft or not allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 synced_flag: description: Whether the mail message is synced with the provider or not allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 deleted_flag: allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: Whether the mail message is deleted or not has_body_flag: description: Whether the mail message has a body or not allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 sent_flag: description: Whether the mail message has been sent or not allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 sent_from_pipedrive_flag: description: Whether the mail message has been sent from Pipedrive app or not allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 smart_bcc_flag: description: Whether the mail message has been created by Smart Email BCC feature or not allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 message_time: type: string format: date-time description: Creation or receival time of the mail message add_time: type: string format: date-time description: The insertion into the database time of the mail message update_time: type: string format: date-time description: The updating time in the database of the mail message has_attachments_flag: description: Whether the mail message has an attachment or not allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_inline_attachments_flag: description: Whether the mail message has an inline attachment or not allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_real_attachments_flag: description: Whether the mail message has an attachment (which is not inline) or not allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 example: success: true statusCode: 2000 statusText: Success service: email-api data: id: 1 from: - id: 1 email_address: mail@example.org name: Test linked_person_id: 1 linked_person_name: '' mail_message_party_id: 1 to: - id: 1 email_address: mail@example.org name: Test linked_person_id: 1 linked_person_name: '' mail_message_party_id: 1 cc: - id: 1 email_address: mail@example.org name: Test linked_person_id: 1 linked_person_name: '' mail_message_party_id: 1 bcc: - id: 1 email_address: mail@example.org name: Test linked_person_id: 1 linked_person_name: '' mail_message_party_id: 1 body_url: https://example.org account_id: test user_id: 1 mail_thread_id: 1 subject: test subject snippet: test subject mail_tracking_status: opened mail_link_tracking_enabled_flag: 0 read_flag: 1 draft: '' draft_flag: 0 synced_flag: 1 deleted_flag: 0 has_body_flag: 1 sent_flag: 0 sent_from_pipedrive_flag: 0 smart_bcc_flag: 0 message_time: '2019-11-14T06:02:06.000Z' add_time: '2019-11-14T06:02:06.000Z' update_time: '2019-11-14T07:15:49.000Z' has_attachments_flag: 1 has_inline_attachments_flag: 0 has_real_attachments_flag: 1 /mailbox/mailThreads: get: summary: Get mail threads description: Returns mail threads in a specified folder ordered by the most recent message within. x-token-cost: 20 operationId: getMailThreads tags: - Mailbox security: - api_key: [] - oauth2: - mail:read - mail:full parameters: - in: query name: folder required: true schema: type: string enum: - inbox - drafts - sent - archive default: inbox description: The type of folder to fetch - in: query name: start description: Pagination start schema: type: integer default: 0 - in: query name: limit description: Items shown per page schema: type: integer responses: '200': description: Get mail threads content: application/json: schema: title: GetMailThreadResponse allOf: - title: baseResponse type: object properties: success: type: boolean description: If the response is successful or not - type: object properties: data: type: array description: The array of mail threads items: title: MailThread allOf: - type: object properties: id: type: integer description: ID of the mail thread account_id: type: string description: The connection account ID user_id: type: integer description: ID of the user whom mail message will be assigned to subject: type: string description: The subject snippet: type: string description: A snippet read_flag: description: Whether the mail thread is read allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 mail_tracking_status: type: string nullable: true description: Mail tracking status has_attachments_flag: description: Whether the mail thread has an attachment allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_inline_attachments_flag: description: Whether the mail thread has inline attachments allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_real_attachments_flag: description: Whether the mail thread has real attachments (which are not inline) allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 deleted_flag: allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: Whether the mail thread is deleted synced_flag: description: Whether the mail thread is synced allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 smart_bcc_flag: description: Whether one of the parties of the mail thread is Bcc allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 mail_link_tracking_enabled_flag: description: Whether the link tracking of the mail thread is enabled allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 - type: object properties: parties: type: object description: Parties of the mail thread properties: to: type: array description: Recipients of the mail thread items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID from: type: array description: Senders of the mail thread items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID drafts_parties: type: array description: Parties of the drafted mail thread items: type: object folders: type: array description: Folders in which messages from thread are being stored items: type: string version: type: number description: Version snippet_draft: type: string nullable: true description: A snippet from a draft snippet_sent: type: string description: A snippet from a message sent message_count: type: integer description: An amount of messages has_draft_flag: type: number description: Whether the mail thread has any drafts allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_sent_flag: type: number description: Whether the mail thread has messages sent allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 archived_flag: allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: Whether the mail thread is archived shared_flag: description: Whether the mail thread is shared allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 external_deleted_flag: description: Whether the mail thread has been deleted externally allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 first_message_to_me_flag: description: Whether the mail thread was initialized by others allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 last_message_timestamp: type: string format: date-time description: Last message timestamp first_message_timestamp: type: string format: date-time description: The time when the mail thread has had the first message received or created last_message_sent_timestamp: type: string format: date-time nullable: true description: The last time when the mail thread has had a message sent last_message_received_timestamp: type: string format: date-time description: The last time when the mail thread has had a message received add_time: type: string format: date-time description: The time when the mail thread was inserted to database update_time: type: string format: date-time description: The time when the mail thread was updated in database received deal_id: type: integer nullable: true description: The ID of the deal deal_status: type: string nullable: true description: Status of the deal lead_id: type: string format: uuid nullable: true description: The ID of the lead all_messages_sent_flag: type: number description: Whether all the mail thread messages have been sent allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 example: success: true data: - id: 1 parties: to: - id: 2 name: '' latest_sent: false email_address: example@test.com message_time: 1574677850000 linked_person_id: 3 linked_person_name: Tester linked_organization_id: null mail_message_party_id: 5318 from: - id: 3 name: '' latest_sent: false email_address: example@test.com message_time: 1574677850000 linked_person_id: 2 linked_person_name: Tester linked_organization_id: null mail_message_party_id: 5318 drafts_parties: [] folders: - inbox account_id: 123412jhfsaa221 user_id: 232 version: 9 subject: Example snippet: Example Snippet snippet_draft: null snippet_sent: '' has_attachments_flag: 1 has_inline_attachments_flag: 1 has_real_attachments_flag: 0 has_draft_flag: 0 has_sent_flag: 0 archived_flag: 0 deleted_flag: 0 shared_flag: 1 synced_flag: 1 external_deleted_flag: 0 smart_bcc_flag: 0 first_message_to_me_flag: 1 mail_link_tracking_enabled_flag: 0 last_message_timestamp: '2019-11-20T20:20:46.000Z' first_message_timestamp: '2019-11-20T17:40:46.000Z' last_message_sent_timestamp: null last_message_received_timestamp: '2019-11-20T20:20:46.000Z' add_time: '2019-11-20T17:40:59.000Z' update_time: '2019-11-20T20:21:22.000Z' deal_id: null deal_status: null all_messages_sent_flag: 0 /mailbox/mailThreads/{id}: delete: summary: Delete mail thread description: Marks a mail thread as deleted. x-token-cost: 6 operationId: deleteMailThread tags: - Mailbox security: - api_key: [] - oauth2: - mail:full parameters: - in: path name: id description: The ID of the mail thread required: true schema: type: integer responses: '200': description: Marks mail thread as deleted content: application/json: schema: title: DeleteMailThreadResponse allOf: - title: baseResponse type: object properties: success: type: boolean description: If the response is successful or not - type: object properties: data: type: object properties: id: type: integer description: The ID of the deleted mail thread example: success: true statusCode: 2000 statusText: Success service: email-api data: id: 1 get: summary: Get one mail thread description: Returns a specific mail thread. x-token-cost: 20 operationId: getMailThread tags: - Mailbox security: - api_key: [] - oauth2: - mail:read - mail:full parameters: - in: path name: id description: The ID of the mail thread required: true schema: type: integer responses: '200': description: Get mail threads content: application/json: schema: title: GetMailThreadResponse allOf: - title: baseResponse type: object properties: success: type: boolean description: If the response is successful or not - type: object properties: data: description: The mail thread object allOf: - title: MailThread allOf: - type: object properties: id: type: integer description: ID of the mail thread account_id: type: string description: The connection account ID user_id: type: integer description: ID of the user whom mail message will be assigned to subject: type: string description: The subject snippet: type: string description: A snippet read_flag: description: Whether the mail thread is read allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 mail_tracking_status: type: string nullable: true description: Mail tracking status has_attachments_flag: description: Whether the mail thread has an attachment allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_inline_attachments_flag: description: Whether the mail thread has inline attachments allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_real_attachments_flag: description: Whether the mail thread has real attachments (which are not inline) allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 deleted_flag: allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: Whether the mail thread is deleted synced_flag: description: Whether the mail thread is synced allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 smart_bcc_flag: description: Whether one of the parties of the mail thread is Bcc allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 mail_link_tracking_enabled_flag: description: Whether the link tracking of the mail thread is enabled allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 - type: object properties: parties: type: object description: Parties of the mail thread properties: to: type: array description: Recipients of the mail thread items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID from: type: array description: Senders of the mail thread items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID drafts_parties: type: array description: Parties of the drafted mail thread items: type: object folders: type: array description: Folders in which messages from thread are being stored items: type: string version: type: number description: Version snippet_draft: type: string nullable: true description: A snippet from a draft snippet_sent: type: string description: A snippet from a message sent message_count: type: integer description: An amount of messages has_draft_flag: type: number description: Whether the mail thread has any drafts allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_sent_flag: type: number description: Whether the mail thread has messages sent allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 archived_flag: allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: Whether the mail thread is archived shared_flag: description: Whether the mail thread is shared allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 external_deleted_flag: description: Whether the mail thread has been deleted externally allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 first_message_to_me_flag: description: Whether the mail thread was initialized by others allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 last_message_timestamp: type: string format: date-time description: Last message timestamp first_message_timestamp: type: string format: date-time description: The time when the mail thread has had the first message received or created last_message_sent_timestamp: type: string format: date-time nullable: true description: The last time when the mail thread has had a message sent last_message_received_timestamp: type: string format: date-time description: The last time when the mail thread has had a message received add_time: type: string format: date-time description: The time when the mail thread was inserted to database update_time: type: string format: date-time description: The time when the mail thread was updated in database received deal_id: type: integer nullable: true description: The ID of the deal deal_status: type: string nullable: true description: Status of the deal lead_id: type: string format: uuid nullable: true description: The ID of the lead all_messages_sent_flag: type: number description: Whether all the mail thread messages have been sent allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 example: success: true data: id: 1 parties: to: - id: 2 name: '' latest_sent: false email_address: example@test.com message_time: 1574677850000 linked_person_id: 3 linked_person_name: Tester linked_organization_id: null mail_message_party_id: 5318 from: - id: 3 name: '' latest_sent: false email_address: example@test.com message_time: 1574677850000 linked_person_id: 2 linked_person_name: Tester linked_organization_id: null mail_message_party_id: 5318 drafts_parties: [] folders: - inbox account_id: 123412jhfsaa221 user_id: 232 version: 9 subject: Example snippet: Example Snippet snippet_draft: null snippet_sent: '' has_attachments_flag: 1 has_inline_attachments_flag: 1 has_real_attachments_flag: 0 has_draft_flag: 0 has_sent_flag: 0 archived_flag: 0 deleted_flag: 0 shared_flag: 1 synced_flag: 1 external_deleted_flag: 0 smart_bcc_flag: 0 first_message_to_me_flag: 1 mail_link_tracking_enabled_flag: 0 last_message_timestamp: '2019-11-20T20:20:46.000Z' first_message_timestamp: '2019-11-20T17:40:46.000Z' last_message_sent_timestamp: null last_message_received_timestamp: '2019-11-20T20:20:46.000Z' add_time: '2019-11-20T17:40:59.000Z' update_time: '2019-11-20T20:21:22.000Z' deal_id: null deal_status: null all_messages_sent_flag: 0 put: summary: Update mail thread details description: Updates the properties of a mail thread. x-token-cost: 10 operationId: updateMailThreadDetails tags: - Mailbox security: - api_key: [] - oauth2: - mail:full parameters: - in: path name: id description: The ID of the mail thread required: true schema: type: integer requestBody: content: application/x-www-form-urlencoded: schema: title: updateMailThreadDetailsRequest type: object properties: deal_id: type: integer description: The ID of the deal this thread is associated with lead_id: type: string format: uuid description: The ID of the lead this thread is associated with shared_flag: allOf: - title: numberBoolean type: number enum: - 0 - 1 description: Whether this thread is shared with other users in your company read_flag: allOf: - title: numberBoolean type: number enum: - 0 - 1 description: Whether this thread is read or unread archived_flag: allOf: - title: numberBoolean type: number enum: - 0 - 1 description: Whether this thread is archived or not. You can only archive threads that belong to Inbox folder. Archived threads will disappear from Inbox. responses: '200': description: Updates the properties of a mail thread content: application/json: schema: title: UpdateMailThreadResponse allOf: - title: baseResponse type: object properties: success: type: boolean description: If the response is successful or not - type: object properties: data: title: MailThread allOf: - type: object properties: id: type: integer description: ID of the mail thread account_id: type: string description: The connection account ID user_id: type: integer description: ID of the user whom mail message will be assigned to subject: type: string description: The subject snippet: type: string description: A snippet read_flag: description: Whether the mail thread is read allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 mail_tracking_status: type: string nullable: true description: Mail tracking status has_attachments_flag: description: Whether the mail thread has an attachment allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_inline_attachments_flag: description: Whether the mail thread has inline attachments allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_real_attachments_flag: description: Whether the mail thread has real attachments (which are not inline) allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 deleted_flag: allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: Whether the mail thread is deleted synced_flag: description: Whether the mail thread is synced allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 smart_bcc_flag: description: Whether one of the parties of the mail thread is Bcc allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 mail_link_tracking_enabled_flag: description: Whether the link tracking of the mail thread is enabled allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 - type: object properties: parties: type: object description: Parties of the mail thread properties: to: type: array description: Recipients of the mail thread items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID from: type: array description: Senders of the mail thread items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID drafts_parties: type: array description: Parties of the drafted mail thread items: type: object folders: type: array description: Folders in which messages from thread are being stored items: type: string version: type: number description: Version snippet_draft: type: string nullable: true description: A snippet from a draft snippet_sent: type: string description: A snippet from a message sent message_count: type: integer description: An amount of messages has_draft_flag: type: number description: Whether the mail thread has any drafts allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_sent_flag: type: number description: Whether the mail thread has messages sent allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 archived_flag: allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: Whether the mail thread is archived shared_flag: description: Whether the mail thread is shared allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 external_deleted_flag: description: Whether the mail thread has been deleted externally allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 first_message_to_me_flag: description: Whether the mail thread was initialized by others allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 last_message_timestamp: type: string format: date-time description: Last message timestamp first_message_timestamp: type: string format: date-time description: The time when the mail thread has had the first message received or created last_message_sent_timestamp: type: string format: date-time nullable: true description: The last time when the mail thread has had a message sent last_message_received_timestamp: type: string format: date-time description: The last time when the mail thread has had a message received add_time: type: string format: date-time description: The time when the mail thread was inserted to database update_time: type: string format: date-time description: The time when the mail thread was updated in database received deal_id: type: integer nullable: true description: The ID of the deal deal_status: type: string nullable: true description: Status of the deal lead_id: type: string format: uuid nullable: true description: The ID of the lead all_messages_sent_flag: type: number description: Whether all the mail thread messages have been sent allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: The mail thread object example: success: true data: id: 1 folders: - inbox account_id: 12123qwaesda1 user_id: 9 version: 13 subject: '[EXAMPLE] Subject' snippet: '[EXAMPLE] Snippet' snippet_draft: null snippet_sent: '' message_count: 7 read_flag: 0 mail_tracking_status: null has_attachments_flag: 1 has_inline_attachments_flag: 1 has_real_attachments_flag: 0 has_draft_flag: 0 has_sent_flag: 0 archived_flag: 0 deleted_flag: 0 shared_flag: 1 synced_flag: 1 external_deleted_flag: 0 smart_bcc_flag: 0 first_message_to_me_flag: 1 mail_link_tracking_enabled_flag: 0 last_message_timestamp: '2019-11-25T10:30:50.000Z' first_message_timestamp: '2019-11-25T08:40:50.000Z' last_message_sent_timestamp: null last_message_received_timestamp: '2019-11-25T10:30:50.000Z' add_time: '2019-11-25T08:41:10.000Z' update_time: '2019-11-25T10:31:34.000Z' deal_id: null deal_status: null all_messages_sent_flag: 0 /mailbox/mailThreads/{id}/mailMessages: get: summary: Get all mail messages of mail thread description: Returns all the mail messages inside a specified mail thread. x-token-cost: 20 operationId: getMailThreadMessages tags: - Mailbox security: - api_key: [] - oauth2: - mail:read - mail:full parameters: - in: path name: id description: The ID of the mail thread required: true schema: type: integer responses: '200': description: Get mail messages from thread content: application/json: schema: title: GetMailThreadMessagesResponse allOf: - title: baseResponse type: object properties: success: type: boolean description: If the response is successful or not - type: object properties: data: type: array items: allOf: - type: object properties: id: type: integer description: ID of the mail thread account_id: type: string description: The connection account ID user_id: type: integer description: ID of the user whom mail message will be assigned to subject: type: string description: The subject snippet: type: string description: A snippet read_flag: description: Whether the mail thread is read allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 mail_tracking_status: type: string nullable: true description: Mail tracking status has_attachments_flag: description: Whether the mail thread has an attachment allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_inline_attachments_flag: description: Whether the mail thread has inline attachments allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 has_real_attachments_flag: description: Whether the mail thread has real attachments (which are not inline) allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 deleted_flag: allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 description: Whether the mail thread is deleted synced_flag: description: Whether the mail thread is synced allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 smart_bcc_flag: description: Whether one of the parties of the mail thread is Bcc allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 mail_link_tracking_enabled_flag: description: Whether the link tracking of the mail thread is enabled allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 - type: object properties: from: type: array description: Senders of the mail thread items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID to: type: array description: Recipients of the mail thread items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID cc: type: array description: Participants of the Cc items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID bcc: type: array description: Participants of the Bcc items: type: object description: Member of a thread properties: id: type: integer description: ID of the mail thread participant name: type: string description: Name of the mail thread participant latest_sent: type: boolean description: Whether the mail thread participant was last to send an email email_address: type: string description: Email address of the mail thread participant message_time: type: number description: Message time linked_person_id: type: integer description: ID of the linked person linked_person_name: type: string description: Email of the linked person mail_message_party_id: type: integer description: ID of the mail message party linked_organization_id: type: integer nullable: true description: Linked Organization ID body_url: type: string description: A link to the mail thread message mail_thread_id: type: integer description: ID of the mail thread draft: type: string nullable: true description: If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`. has_body_flag: type: number description: Whether the mail thread message has a body allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 sent_flag: type: number description: Whether the mail thread message is sent allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 sent_from_pipedrive_flag: type: number description: Whether the mail thread message is sent from Pipedrive allOf: - title: numberBooleanDefault0 type: number default: 0 enum: - 0 - 1 message_time: type: string format: date-time description: The time when the mail message was received or created add_time: type: string format: date-time description: The time when the mail message was inserted to database update_time: type: string format: date-time description: The time when the mail message was updated in database received description: The array of the mail messages of the mail thread example: success: true data: - id: 1 from: - id: 1 email_address: example@email.com name: Example Message linked_person_id: 4 linked_person_name: '' mail_message_party_id: 3 to: - id: 4 email_address: example@email.com name: Example Message linked_person_id: 1 linked_person_name: '' mail_message_party_id: 3 cc: [] bcc: [] body_url: http://this_would_be_the_link.cloudfront.net/ account_id: iuaousdp77asdadah user_id: 777 mail_thread_id: 2 subject: The Subject snippet: Snippet from the email mail_tracking_status: null mail_link_tracking_enabled_flag: 0 read_flag: 1 draft: null draft_flag: 0 synced_flag: 1 deleted_flag: 0 has_body_flag: 1 sent_flag: 0 sent_from_pipedrive_flag: 0 smart_bcc_flag: 0 message_time: '2019-08-07T21:15:08.000Z' add_time: '2019-08-07T21:34:35.000Z' update_time: '2019-08-07T21:34:35.000Z' has_attachments_flag: 0 has_inline_attachments_flag: 0 has_real_attachments_flag: 0 components: securitySchemes: basic_authentication: type: http scheme: basic description: Base 64 encoded string containing the `client_id` and `client_secret` values. The header value should be `Basic `. api_key: type: apiKey name: x-api-token in: header oauth2: type: oauth2 description: For more information, see https://pipedrive.readme.io/docs/marketplace-oauth-authorization flows: authorizationCode: authorizationUrl: https://oauth.pipedrive.com/oauth/authorize tokenUrl: https://oauth.pipedrive.com/oauth/token refreshUrl: https://oauth.pipedrive.com/oauth/token scopes: base: Read settings of the authorized user and currencies in an account deals:read: Read most of the data about deals and related entities - deal fields, products, followers, participants; all notes, files, filters, pipelines, stages, and statistics. Does not include access to activities (except the last and next activity related to a deal) deals:full: Create, read, update and delete deals, its participants and followers; all files, notes, and filters. It also includes read access to deal fields, pipelines, stages, and statistics. Does not include access to activities (except the last and next activity related to a deal) mail:read: Read mail threads and messages mail:full: Read, update and delete mail threads. Also grants read access to mail messages activities:read: Read activities, its fields and types; all files and filters activities:full: Create, read, update and delete activities and all files and filters. Also includes read access to activity fields and types contacts:read: Read the data about persons and organizations, their related fields and followers; also all notes, files, filters contacts:full: Create, read, update and delete persons and organizations and their followers; all notes, files, filters. Also grants read access to contacts-related fields products:read: Read products, its fields, files, followers and products connected to a deal products:full: Create, read, update and delete products and its fields; add products to deals deal-fields:full: Create, read, update and delete deal fields product-fields:full: Create, read, update and delete product fields contact-fields:full: Create, read, update and delete person and organization fields projects:read: Read projects and its fields, tasks and project templates projects:full: Create, read, update and delete projects and its fields; add projects templates and project related tasks users:read: Read data about users (people with access to a Pipedrive account), their permissions, roles and followers recents:read: Read all recent changes occurred in an account. Includes data about activities, activity types, deals, files, filters, notes, persons, organizations, pipelines, stages, products and users search:read: Search across the account for deals, persons, organizations, files and products, and see details about the returned results admin: Allows to do many things that an administrator can do in a Pipedrive company account - create, read, update and delete pipelines and its stages; deal, person and organization fields; activity types; users and permissions, etc. It also allows the app to create webhooks and fetch and delete webhooks that are created by the app leads:read: Read data about leads and lead labels leads:full: Create, read, update and delete leads and lead labels phone-integration: Enables advanced call integration features like logging call duration and other metadata, and play call recordings inside Pipedrive goals:read: Read data on all goals goals:full: Create, read, update and delete goals video-calls: Allows application to register as a video call integration provider and create conference links messengers-integration: Allows application to register as a messengers integration provider and allows them to deliver incoming messages and their statuses