# Operations (sample payloads)

## Main operations

### Archive contact

Archives a single contact.
**Sample Input**
**Sample Output**

### Assign conversation

Assigns a conversation to an admin or team. It also can be automatically assigned following assignment rules.
**Sample Input**
**Sample Output**

### Attach contact to company

Attaches a single contact to a company.
**Sample Input**
**Sample Output**

```json
{
    "type": "company",
    "company_id": "1a2b3c4d5e6f7g8h9i0j1k",
    "id": "1a2b3c4d5e6f7g8h9i0j1k",
    "app_id": "abc123def456",
    "name": "Acme Corporation",
    "remote_created_at": 1609459200,
    "created_at": 1609459200,
    "updated_at": 1625097600,
    "monthly_spend": 5000,
    "session_count": 150,
    "user_count": 50,
    "size": 200,
    "website": "https://www.acmecorp.com",
    "industry": "Technology",
    "tags": {
        "type": "list",
        "tags": [
            \{
                "type": "tag",
                "name": "Enterprise",
                "id": "tag123"
            \},
            \{
                "type": "tag",
                "name": "High Value",
                "id": "tag456"
            \}
        ]
    },
    "segments": {
        "type": "list",
        "segments": [
            \{
                "type": "segment",
                "id": "seg123",
                "name": "Active Users",
                "created_at": 1609459200,
                "updated_at": 1625097600
            \}
        ]
    },
    "plan": \{
        "type": "plan",
        "id": "plan123",
        "name": "Enterprise Plan"
    \},
    "custom_attributes": {
        "creation_source": "api"
    }
}
```

### Attach contact to conversation

Add participants who are contacts to a conversation, on behalf of either another contact or an admin.
**Sample Input**
**Sample Output**

```json
{
    "customers": [
        \{
            "type": "contact",
            "id": "5f1a2b3c4d5e6f7g8h9i0j"
        \}
    ]
}
```

### Attach tag to contact

Tags a single contact.
**Sample Input**
**Sample Output**

```json
\{
    "type": "tag",
    "id": "1a2b3c4d5e6f7g8h9i0j1k",
    "name": "VIP Customer"
\}
```

### Close conversation

Closes a conversation.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4=",
    "conversation_id": "123456",
    "admin_id": "987654",
    "body": "Thank you for contacting us. This conversation is now closed."
\}
```

**Sample Output**

### Create contact

Creates a new contact (user or lead).
**Sample Input**
**Sample Output**

### Create conversation

Creates in-app conversation initiated by a contact (ie. user or lead).
**Sample Input**
**Sample Output**

### Create message as admin

Creates a message that has been initiated by an admin. The conversation can be either an in-app message or an email.
**Sample Input**

```json
{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=",
    "message_type": "email",
    "subject": "Important Update: New Feature Release",
    "body": "Hello,<br><br>We're excited to announce the release of our new feature. This update includes...<br><br>Best regards,<br>Your Support Team",
    "template": "personal",
    "from_conversation": {
        "id": "1234567"
    },
    "to_message": \{
        "type": "user",
        "id": "user_abc123"
    \}
}
```

**Sample Output**

### Create note

Create a note to a single contact.
**Sample Input**
**Sample Output**

### Create/update company

Create or update a company in Intercom.
**Sample Input**
**Sample Output**

### Delete contact

Delete a single contact.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=",
    "contact_id": "5f1a2b3c4d5e6f7g8h9i0j"
\}
```

**Sample Output**

### Detach contact from company

Detaches a single contact from a company.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4=",
    "company_id": "5f8b3a1b9d8f1e2a3c4b5d6e",
    "contact_id": "6a7b8c9d0e1f2g3h4i5j6k7"
\}
```

**Sample Output**

```json
{
    "type": "company",
    "company_id": "5f8b3a1b9d8f1e2a3c4b5d6e",
    "id": "5f8b3a1b9d8f1e2a3c4b5d6e",
    "app_id": "abc123xyz456",
    "name": "Acme Corporation",
    "remote_created_at": 1605024000,
    "created_at": 1605024000,
    "updated_at": 1621036800,
    "monthly_spend": 5000,
    "session_count": 1250,
    "user_count": 50,
    "size": 100,
    "website": "https://www.acmecorp.com",
    "industry": "Technology",
    "tags": {
        "type": "list",
        "tags": [
            \{
                "type": "tag",
                "name": "Enterprise",
                "id": "tag_123"
            \},
            \{
                "type": "tag",
                "name": "High Value",
                "id": "tag_456"
            \}
        ]
    },
    "segments": {
        "type": "list",
        "segments": [
            \{
                "type": "segment",
                "id": "seg_789",
                "name": "Active Users",
                "created_at": 1605024000,
                "updated_at": 1621036800
            \}
        ]
    },
    "plan": \{
        "type": "plan",
        "id": "plan_premium",
        "name": "Premium"
    \},
    "custom_attributes": {
        "creation_source": "api"
    }
}
```

### Detach contact from conversation

Detach contact from conversation.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=",
    "conversation_id": "123456789",
    "contact_id": "987654321",
    "admin_id": "admin_123"
\}
```

**Sample Output**

```json
{
    "customers": [
        \{
            "type": "contact",
            "id": "987654321"
        \}
    ]
}
```

### Detach tag from contact

Untags a single contact.
**Sample Input**
**Sample Output**

```json
\{
    "type": "tag",
    "id": "1a2b3c4d5e6f7g8h9i0j1k",
    "name": "VIP Customer"
\}
```

### Get admin

Get an admin by their id in Intercom.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4tMTIzNDU2Nzg5MA==",
    "admin_id": "5678901234"
\}
```

**Sample Output**

```json
\{
    "type": "admin",
    "id": "5678901234",
    "name": "John Doe",
    "email": "john.doe@example.com",
    "away_mode_enabled": false,
    "away_mode_reassign": true,
    "has_inbox_seat": true,
    "team_ids": [
        1,
        2,
        3
    ]
\}
```

### Get company

Retrieves a company by their Intercom internal ID, company ID, or their name in Intercom.
**Sample Input**

```json
\{
    "access_token": "dG9rZW46YWJjMTIzZGVmNDU2",
    "company_id": "123456",
    "allow_errors": false
\}
```

**Sample Output**

```json
{
    "type": "company",
    "company_id": "123456",
    "id": "5f8a9b3c2d1e0f7a6b5c4d3e",
    "app_id": "abc123def456",
    "name": "Acme Corporation",
    "created_at": 1602691200,
    "updated_at": 1634227200,
    "last_request_at": 1634313600,
    "monthly_spend": 5000,
    "session_count": 250,
    "user_count": 50,
    "tags": {
        "type": "list",
        "tags": [
            \{
                "type": "tag",
                "name": "Enterprise",
                "id": "tag_123"
            \},
            \{
                "type": "tag",
                "name": "High Value",
                "id": "tag_456"
            \}
        ]
    },
    "segments": {
        "type": "list",
        "segments": [
            \{
                "type": "segment",
                "id": "segment_789"
            \}
        ]
    },
    "plan": {},
    "custom_attributes": \{
        "industry": "Technology",
        "account_manager": "John Doe"
    \}
}
```

### Get contact

Retrieves the details of a single contact.
**Sample Input**
**Sample Output**

### Get conversation

Retrives the details of a single conversation.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4tMTIzNDU2Nzg5MA==",
    "conversation_id": "123456",
    "display_as_plain_text": true
\}
```

**Sample Output**

```json
{
    "type": "conversation",
    "id": "123456",
    "created_at": 1623456789,
    "updated_at": 1623457890,
    "waiting_since": 1623458901,
    "snoozed_until": "2023-06-15T10:00:00Z",
    "source": {
        "type": "email",
        "id": "789012",
        "delivered_as": "email",
        "subject": "Need help with product",
        "body": "Hi, I'm having trouble with your product. Can you help?",
        "author": \{
            "type": "user",
            "id": "user_123",
            "name": "John Doe",
            "email": "john.doe@example.com"
        \},
        "attachments": [
            \{
                "type": "image",
                "name": "screenshot.png",
                "url": "https://example.com/attachments/screenshot.png",
                "content_type": "image/png",
                "filesize": 1024000,
                "width": "800",
                "height": "600"
            \}
        ],
        "url": "https://app.intercom.com/a/apps/abc123/conversations/123456"
    },
    "contacts": {
        "type": "contact.list",
        "contacts": [
            \{
                "type": "user",
                "id": "user_123"
            \}
        ]
    },
    "first_contact_reply": \{
        "created_at": 1623457000,
        "type": "conversation_part",
        "url": "https://app.intercom.com/a/apps/abc123/conversations/123456#conversation-part-987654"
    \},
    "open": true,
    "state": "open",
    "read": false,
    "tags": {
        "type": "tag.list",
        "tags": [
            \{
                "id": "tag_123",
                "name": "Support",
                "type": "tag"
            \}
        ]
    },
    "priority": "normal",
    "sla_applied": "standard",
    "statistics": {
        "time_to_assignment": 300,
        "time_to_admin_reply": 600,
        "time_to_first_close": 3600,
        "time_to_last_close": 3600,
        "median_time_to_reply": 450,
        "first_contacat_reply_at": 1623457000,
        "first_assignment_at": 1623456900,
        "first_admin_reply_at": 1623457300,
        "first_close_at": 1623460389,
        "last_assignment_at": 1623456900,
        "last_assignment_admin_reply_at": 1623457300,
        "last_contact_reply_at": 1623457000,
        "last_admin_reply_at": 1623457300,
        "last_close_at": 1623460389,
        "last_closed_by": \{
            "type": "admin",
            "id": "admin_456",
            "name": "Support Agent",
            "email": "agent@company.com"
        \}
    },
    "conversation_parts": {
        "type": "conversation_part.list",
        "conversation_parts": [
            {
                "type": "conversation_part",
                "id": "part_123",
                "part_type": "comment",
                "body": "Sure, I'd be happy to help. Can you please provide more details about the issue you're experiencing?",
                "created_at": 1623457300,
                "updated_at": 1623457300,
                "notified_at": 1623457301,
                "assigned_to": \{
                    "type": "admin",
                    "id": "admin_456"
                \},
                "author": \{
                    "type": "admin",
                    "id": "admin_456"
                \},
                "attachments": [],
                "external_id": "reply_1"
            }
        ],
        "total_count": 1
    },
    "teammates": {
        "type": "admin.list",
        "admins": [
            \{
                "id": "admin_456",
                "type": "admin",
                "name": "Support Agent",
                "email": "agent@company.com"
            \}
        ]
    },
    "assignee": \{
        "id": "admin_456",
        "type": "admin",
        "name": "Support Agent",
        "email": "agent@company.com"
    \}
}
```

### Get current user

Returns data about the current user.
**Sample Input**

```json
{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo="
}
```

**Sample Output**

### Get note

Returns a note.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=",
    "note_id": "123456789"
\}
```

**Sample Output**

### Get team

Retrieves a team using an ID.
**Sample Input**
**Sample Output**

### List admins

Get a list of all the admins in Intercom.
**Sample Input**
**Sample Output**

### List attached companies

Retrieves a list of companies that are associated to a contact.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=",
    "contact_id": "5f1a2b3c4d5e6f7g8h9i0j",
    "per_page": 50,
    "page": 1
\}
```

**Sample Output**

```json
{
    "type": "list",
    "pages": \{
        "type": "pages",
        "next": "https://api.intercom.io/companies?contact_id=5f1a2b3c4d5e6f7g8h9i0j&per_page=50&page=2",
        "page": 1,
        "per_page": 50,
        "total_pages": 3
    \},
    "companies": [
        {
            "type": "company",
            "company_id": "abc123",
            "id": "5f1a2b3c4d5e6f7g8h9i0j1k",
            "app_id": "lmn456",
            "name": "Acme Corporation",
            "created_at": 1609459200,
            "updated_at": 1625097600,
            "last_request_at": 1640995200,
            "monthly_spend": 1000,
            "session_count": 250,
            "user_count": 50,
            "industry": "Technology",
            "tags": {
                "type": "list",
                "tags": [
                    \{
                        "type": "tag",
                        "name": "Enterprise",
                        "id": "tag123"
                    \},
                    \{
                        "type": "tag",
                        "name": "High Value",
                        "id": "tag456"
                    \}
                ]
            },
            "segments": {
                "type": "list",
                "segments": [
                    \{
                        "type": "segment",
                        "id": "seg789",
                        "name": "Active Users",
                        "created_at": 1609459200,
                        "updated_at": 1625097600
                    \}
                ]
            },
            "plan": \{
                "type": "plan",
                "id": "plan101",
                "name": "Enterprise"
            \},
            "custom_attributes": \{
                "account_manager": "John Doe",
                "renewal_date": "2023-12-31"
            \}
        }
    ],
    "total_count": 125
}
```

### List attached tags

Retrieves a list of tags that are associated to a contact.
**Sample Input**
**Sample Output**

```json
{
    "type": "list",
    "tags": [
        \{
            "type": "tag",
            "id": "123456",
            "name": "VIP Customer"
        \},
        \{
            "type": "tag",
            "id": "789012",
            "name": "Product Feedback"
        \},
        \{
            "type": "tag",
            "id": "345678",
            "name": "Support Tier 1"
        \}
    ]
}
```

### List companies

Get a list of companies in Intercom.
**Sample Input**
**Sample Output**

### List contacts

Retrieves a list of all contacts.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=",
    "per_page": 50,
    "starting_after": "contact_5f9b2b3c7e8d9a0001234567"
\}
```

**Sample Output**

```json
{
    "type": "list",
    "data": [
        {
            "type": "contact",
            "id": "5f9b2b3c7e8d9a0001234568",
            "workspace_id": "abc123",
            "external_id": "user_123",
            "role": "user",
            "email": "john.doe@example.com",
            "phone": "+1234567890",
            "name": "John Doe",
            "avatar": "https://example.com/avatar.jpg",
            "owner_id": "5f9b2b3c7e8d9a0001234569",
            "social_profiles": {
                "type": "list",
                "data": [
                    \{
                        "type": "social_profile",
                        "name": "twitter",
                        "url": "https://twitter.com/johndoe"
                    \}
                ]
            },
            "has_hard_bounced": false,
            "marked_email_as_spam": false,
            "unsubscribed_from_emails": false,
            "created_at": 1603987200,
            "updated_at": 1604073600,
            "signed_up_at": "2020-10-29T12:00:00Z",
            "last_seen_at": "2021-03-15T09:30:00Z",
            "last_replied_at": "2021-03-10T14:45:00Z",
            "last_contacted_at": "2021-03-12T11:20:00Z",
            "last_email_opened_at": "2021-03-14T16:00:00Z",
            "last_email_clicked_at": "2021-03-14T16:05:00Z",
            "language_override": "en",
            "browser": "Chrome",
            "browser_version": "89.0.4389.82",
            "browser_language": "en-US",
            "os": "macOS",
            "location": \{
                "type": "location",
                "country": "United States",
                "region": "California",
                "city": "San Francisco"
            \},
            "android_app_name": null,
            "android_app_version": null,
            "android_device": null,
            "android_os_version": null,
            "android_sdk_version": null,
            "android_last_seen_at": null,
            "ios_app_name": "ExampleApp",
            "ios_app_version": "2.1.0",
            "ios_device": "iPhone12,1",
            "ios_os_version": "14.4",
            "ios_sdk_version": "1.2.3",
            "ios_last_seen_at": "2021-03-15T09:30:00Z",
            "custom_attributes": \{
                "plan": "premium",
                "last_purchase": "2021-02-28"
            \},
            "tags": {
                "type": "list",
                "data": [
                    \{
                        "type": "tag",
                        "id": "5f9b2b3c7e8d9a0001234570",
                        "url": "https://api.intercom.io/tags/5f9b2b3c7e8d9a0001234570"
                    \}
                ],
                "url": "https://api.intercom.io/contacts/5f9b2b3c7e8d9a0001234568/tags",
                "total_count": 1,
                "has_more": false
            },
            "notes": {
                "type": "list",
                "data": [
                    \{
                        "type": "note",
                        "id": "5f9b2b3c7e8d9a0001234571",
                        "url": "https://api.intercom.io/notes/5f9b2b3c7e8d9a0001234571"
                    \}
                ],
                "url": "https://api.intercom.io/contacts/5f9b2b3c7e8d9a0001234568/notes",
                "total_count": 1,
                "has_more": false
            },
            "companies": {
                "type": "list",
                "data": [
                    \{
                        "type": "company",
                        "id": "5f9b2b3c7e8d9a0001234572",
                        "url": "https://api.intercom.io/companies/5f9b2b3c7e8d9a0001234572"
                    \}
                ],
                "url": "https://api.intercom.io/contacts/5f9b2b3c7e8d9a0001234568/companies",
                "total_count": 1,
                "has_more": false
            }
        }
    ],
    "total_count": 1,
    "pages": {
        "type": "pages",
        "next": \{
            "page": 2,
            "starting_after": "5f9b2b3c7e8d9a0001234568"
        \},
        "page": 1,
        "per_page": 50,
        "total_pages": 1
    }
}
```

### List contacts attached to company

Retrieves a list of all contacts that belong to a company.
**Sample Input**
**Sample Output**

### List conversations

Retrieves a list of all conversations.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4=",
    "order": "desc",
    "sort": "updated_at",
    "per_page": 50,
    "page": 1
\}
```

**Sample Output**

```json
{
    "type": "conversation.list",
    "pages": \{
        "type": "pages",
        "next": "https://api.intercom.io/conversations?per_page=50&page=2",
        "page": 1,
        "per_page": 50,
        "total_pages": 3
    \},
    "total_count": 125,
    "conversations": [
        {
            "type": "conversation",
            "id": "123456789",
            "created_at": 1623456789,
            "updated_at": 1623567890,
            "waiting_since": 1623567890,
            "snoozed_until": null,
            "source": {
                "type": "conversation",
                "id": "987654321",
                "delivered_as": "customer_initiated",
                "subject": "Need help with integration",
                "body": "Hi, I'm having trouble integrating your API. Can you help?",
                "author": \{
                    "type": "user",
                    "id": "user_123",
                    "name": "John Doe",
                    "email": "john.doe@example.com"
                \},
                "attachments": [],
                "url": "https://app.intercom.com/a/apps/abc123/conversations/987654321"
            },
            "contacts": {
                "type": "contact.list",
                "contacts": [
                    \{
                        "type": "contact",
                        "id": "5f7b5e8c7b44b30c9a9b1234"
                    \}
                ]
            },
            "first_contact_reply": \{
                "created_at": 1623567891,
                "type": "conversation_part",
                "url": "https://app.intercom.com/a/apps/abc123/conversations/987654321"
            \},
            "open": true,
            "state": "open",
            "read": false,
            "tags": {
                "type": "tag.list",
                "tags": [
                    \{
                        "id": "4567890",
                        "name": "Integration",
                        "type": "tag"
                    \}
                ]
            },
            "priority": "normal",
            "sla_applied": null,
            "statistics": \{
                "type": "conversation_statistics",
                "time_to_assignment": "1h",
                "time_to_admin_reply": "2h",
                "time_to_first_close": null,
                "time_to_last_close": null,
                "median_time_to_reply": "30m",
                "first_contact_reply_at": 1623567891,
                "first_assignment_at": "2023-06-13T10:30:00Z",
                "first_admin_reply_at": "2023-06-13T11:30:00Z",
                "first_close_at": null,
                "last_assignment_at": "2023-06-13T10:30:00Z",
                "last_assignment_admin_reply_at": "2023-06-13T11:30:00Z",
                "last_contact_reply_at": 1623567891,
                "last_admin_reply_at": "2023-06-13T11:30:00Z",
                "last_close_at": null,
                "last_closed_by_id": null,
                "count_reopens": 0,
                "count_assignments": 1,
                "count_conversation_parts": 2
            \},
            "conversation_rating": null,
            "teammates": {
                "type": "admin.list",
                "admins": [
                    \{
                        "id": "3456789",
                        "type": "admin",
                        "name": "Support Team",
                        "email": "support@company.com"
                    \}
                ]
            },
            "assignee": \{
                "id": "3456789",
                "type": "admin",
                "name": "Support Team",
                "email": "support@company.com"
            \}
        }
    ]
}
```

### List data attributes

Retrieves a list of available data attributes.
**Sample Input**
**Sample Output**

### List data events

Retrieves a list of all data events that are less than 90 days old.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=",
    "external_user_id": "user_123456",
    "email": "johndoe@example.com",
    "intercom_user_id": "5f1a2b3c4d5e6f7g8h9i0j",
    "summary": true,
    "per_page": 25
\}
```

**Sample Output**

```json
{
    "type": "list",
    "events": [
        {
            "type": "event",
            "id": "ev_123456789",
            "created_at": 1623456789,
            "event_name": "purchased_item",
            "user_id": "user_123456",
            "email": "johndoe@example.com",
            "intercom_user_id": "5f1a2b3c4d5e6f7g8h9i0j",
            "metadata": {
                "friend": "Jane Smith",
                "load": 2.5,
                "created_date": 1623456700,
                "article": \{
                    "url": "https://example.com/blog/new-product",
                    "value": "New Product Launch"
                \},
                "price": \{
                    "amount": 99.99,
                    "currency": "USD"
                \},
                "food": "Pizza"
            }
        }
    ],
    "pages": {
        "since": "2023-06-12T10:30:00Z"
    }
}
```

### List notes

Retrieves a list of all notes.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=",
    "contact_id": "5f1a2b3c4d5e6f7g8h9i0j",
    "per_page": 50,
    "page": 1
\}
```

**Sample Output**

### List segments

Retrieves a list of all segments.
**Sample Input**

```json
\{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=",
    "include_count": true
\}
```

**Sample Output**

### List tags

Retrieves a list of all tags.
**Sample Input**

```json
{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo="
}
```

**Sample Output**

### List teams

Retrieves a list of all teams.
**Sample Input**

```json
{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo="
}
```

**Sample Output**

```json
{
    "type": "list",
    "teams": [
        \{
            "type": "team",
            "id": "123456",
            "name": "Customer Support",
            "admin_ids": [
                1001,
                1002,
                1003
            ]
        \},
        \{
            "type": "team",
            "id": "789012",
            "name": "Sales",
            "admin_ids": [
                2001,
                2002
            ]
        \},
        \{
            "type": "team",
            "id": "345678",
            "name": "Product Development",
            "admin_ids": [
                3001,
                3002,
                3003,
                3004
            ]
        \}
    ]
}
```

### Merge contacts

Merges a contact with a role of lead into a contact with a role of user. The contact that's specified as from will be deleted after being merged into the contact specified as into. Attributes that don't exist on the contact specified as into will be copied over.
**Sample Input**
**Sample Output**

### Open conversation

Opens a conversation.
**Sample Input**
**Sample Output**

```json
{
    "type": "conversation",
    "id": "123456",
    "created_at": 1623456789,
    "updated_at": 1623456890,
    "waiting_since": "2023-06-12T10:30:00Z",
    "snoozed_until": null,
    "source": {
        "type": "conversation",
        "id": "123456",
        "delivered_as": "email",
        "subject": "Need help with product",
        "body": "Hi, I'm having trouble with your product. Can you help?",
        "author": \{
            "type": "user",
            "id": "user_abc123",
            "name": "John Doe",
            "email": "john.doe@example.com"
        \},
        "attachments": [],
        "url": "https://app.intercom.com/a/apps/abc123/conversations/123456"
    },
    "contacts": {
        "type": "contact.list",
        "contacts": [
            \{
                "type": "user",
                "id": "user_abc123"
            \}
        ]
    },
    "first_contact_reply": \{
        "created_at": 1623456800,
        "type": "conversation",
        "url": "https://app.intercom.com/a/apps/abc123/conversations/123456"
    \},
    "open": true,
    "state": "open",
    "read": true,
    "tags": {
        "type": "tag.list",
        "tags": [
            \{
                "id": "tag_123",
                "name": "Support",
                "type": "tag"
            \}
        ]
    },
    "priority": "normal",
    "sla_applied": null,
    "statistics": \{
        "type": "conversation_statistics",
        "time_to_assignment": "00:05:00",
        "time_to_admin_reply": 300,
        "time_to_first_close": null,
        "time_to_last_close": null,
        "median_time_to_reply": 300,
        "first_contact_reply_at": 1623456800,
        "first_assignment_at": "2023-06-12T10:35:00Z",
        "first_admin_reply_at": 1623457089,
        "first_close_at": null,
        "last_assignment_at": "2023-06-12T10:35:00Z",
        "last_assignment_admin_reply_at": "2023-06-12T10:38:09Z",
        "last_contact_reply_at": 1623456800,
        "last_admin_reply_at": 1623457089,
        "last_close_at": null,
        "last_closed_by_id": null,
        "count_reopens": 0,
        "count_assignments": 1,
        "count_conversation_parts": 2
    \},
    "conversation_rating": null,
    "teammates": {
        "type": "admin.list",
        "admins": [
            \{
                "type": "admin",
                "id": "987654"
            \}
        ]
    },
    "conversation_parts": {
        "type": "conversation_part.list",
        "conversation_parts": [
            {
                "type": "conversation_part",
                "id": "part_123",
                "part_type": "comment",
                "body": "Sure, I'd be happy to help. Can you please provide more details about the issue you're experiencing?",
                "created_at": 1623457089,
                "updated_at": 1623457089,
                "notified_at": 1623457090,
                "assigned_to": "987654",
                "author": \{
                    "id": "987654",
                    "type": "admin",
                    "name": "Support Agent",
                    "email": "support@example.com"
                \},
                "attachments": [],
                "external_id": null
            }
        ],
        "total_count": 1
    },
    "assignee": \{
        "id": "987654",
        "type": "admin",
        "name": "Support Agent",
        "email": "support@example.com"
    \}
}
```

### Raw HTTP request (advanced)

Perform a raw HTTP request with some pre-configuration and processing by the connector, such as authentication.
**Sample Input**
**Sample Output**

### Reply to conversation

Replies to a conversation with a message from an admin or on behalf of a contact, or with a note for admins.
**Sample Input**
**Sample Output**

```json
{
    "type": "conversation",
    "id": "1234567890",
    "created_at": 1623456789,
    "updated_at": 1623456999,
    "waiting_since": null,
    "snoozed_until": null,
    "source": {
        "type": "conversation",
        "id": "1234567890",
        "delivered_as": "customer_initiated",
        "subject": "Need help with product",
        "body": "Hi, I'm having trouble with...",
        "author": \{
            "type": "user",
            "id": "5678901234",
            "name": "John Doe",
            "email": "john.doe@example.com"
        \},
        "attachments": [],
        "url": null
    },
    "contacts": {
        "type": "contact.list",
        "contacts": [
            \{
                "type": "user",
                "id": "5678901234"
            \}
        ]
    },
    "first_contact_reply": \{
        "created_at": 1623456789,
        "type": "conversation",
        "url": null
    \},
    "open": true,
    "state": "open",
    "read": true,
    "tags": \{
        "type": "tag.list",
        "tags": []
    \},
    "priority": "not_priority",
    "sla_applied": null,
    "statistics": \{
        "type": "conversation_statistics",
        "time_to_assignment": null,
        "time_to_admin_reply": 210,
        "time_to_first_close": null,
        "time_to_last_close": null,
        "median_time_to_reply": 210,
        "first_contact_reply_at": 1623456789,
        "first_assignment_at": null,
        "first_admin_reply_at": 1623456999,
        "first_close_at": null,
        "last_assignment_at": null,
        "last_assignment_admin_reply_at": null,
        "last_contact_reply_at": 1623456789,
        "last_admin_reply_at": 1623456999,
        "last_close_at": null,
        "last_closed_by_id": null,
        "count_reopens": 0,
        "count_assignments": 0,
        "count_conversation_parts": 2
    \},
    "conversation_rating": null,
    "teammates": {
        "type": "admin.list",
        "admins": [
            \{
                "type": "admin",
                "id": "3456789012"
            \}
        ]
    },
    "conversation_parts": {
        "type": "conversation_part.list",
        "conversation_parts": [
            {
                "type": "conversation_part",
                "id": "6789012345",
                "part_type": "comment",
                "body": "Thank you for reaching out. We're looking into your issue and will get back to you shortly.",
                "created_at": 1623456999,
                "updated_at": 1623456999,
                "notified_at": 1623456999,
                "assigned_to": null,
                "author": \{
                    "id": "3456789012",
                    "type": "admin",
                    "name": "Support Agent",
                    "email": "support@example.com"
                \},
                "attachments": [
                    \{
                        "type": "image",
                        "name": "image1.jpg",
                        "url": "https://example.com/image1.jpg",
                        "content_type": "image/jpeg",
                        "filesize": 102400,
                        "width": "800",
                        "height": "600"
                    \},
                    \{
                        "type": "image",
                        "name": "image2.png",
                        "url": "https://example.com/image2.png",
                        "content_type": "image/png",
                        "filesize": 81920,
                        "width": "1024",
                        "height": "768"
                    \}
                ],
                "external_id": null
            }
        ],
        "total_count": 2
    },
    "assignee": \{
        "id": "3456789012",
        "type": "admin",
        "name": "Support Agent",
        "email": "support@example.com"
    \}
}
```

### Search contacts

Searches for contacts by the value of their attributes.
**Sample Input**

```json
{
    "access_token": "your_access_token_here",
    "query": {
        "operator": "AND",
        "value": [
            \{
                "field": "email",
                "operator": "~",
                "value": "@example.com"
            \},
            \{
                "field": "created_at",
                "operator": ">",
                "value": 1609459200
            \}
        ]
    },
    "per_page": 50,
    "starting_after": "contact_id_123"
}
```

**Sample Output**

### Search conversations

Searches for conversations by the value of their attributes.
**Sample Input**
**Sample Output**

```json
{
    "type": "conversation.list",
    "pages": \{
        "type": "pages",
        "page": 1,
        "per_page": 50,
        "total_pages": 3
    \},
    "total_count": 125,
    "conversations": [
        {
            "type": "conversation",
            "id": "123456789",
            "created_at": 1625184000,
            "updated_at": 1625270400,
            "waiting_since": 1625270400,
            "snoozed_until": null,
            "source": {
                "type": "email",
                "id": "987654321",
                "delivered_as": "email",
                "subject": "Need help with product",
                "body": "Hi, I'm having trouble with...",
                "author": \{
                    "type": "user",
                    "id": "user_123",
                    "name": "John Doe",
                    "email": "john.doe@example.com"
                \},
                "attachments": [],
                "url": null
            },
            "contacts": {
                "type": "contact.list",
                "contacts": [
                    \{
                        "type": "contact",
                        "id": "contact_123"
                    \}
                ]
            },
            "first_contact_reply": \{
                "created_at": 1625270500,
                "type": "conversation_part",
                "url": null
            \},
            "open": true,
            "state": "open",
            "read": false,
            "tags": {
                "type": "tag.list",
                "tags": [
                    \{
                        "id": "tag_123",
                        "name": "Support",
                        "type": "tag"
                    \}
                ]
            },
            "priority": "normal",
            "sla_applied": null,
            "statistics": \{
                "type": "conversation_statistics",
                "time_to_assignment": "1h",
                "time_to_admin_reply": "2h",
                "time_to_first_close": null,
                "time_to_last_close": null,
                "median_time_to_reply": "30m",
                "first_contact_reply_at": 1625270500,
                "first_assignment_at": "1625270700",
                "first_admin_reply_at": "1625274000",
                "first_close_at": null,
                "last_assignment_at": "1625270700",
                "last_assignment_admin_reply_at": "1625274000",
                "last_contact_reply_at": 1625270500,
                "last_admin_reply_at": "1625274000",
                "last_close_at": null,
                "last_closed_by_id": null,
                "count_reopens": 0,
                "count_assignments": 1,
                "count_conversation_parts": 2
            \},
            "conversation_rating": null,
            "teammates": {
                "type": "admin.list",
                "admins": [
                    \{
                        "type": "admin",
                        "id": "admin_123"
                    \}
                ]
            },
            "assignee": \{
                "id": "admin_123",
                "type": "admin",
                "name": "Support Agent",
                "email": "support@company.com"
            \}
        }
    ]
}
```

### Submit data event

Submits a data events.
**Sample Input**
**Sample Output**

```json
{
    "success": true
}
```

### Unarchive contact

Unarchives a single contact.
**Sample Input**
**Sample Output**

### Update contact

Updates an existing contact (user or lead).
**Sample Input**
**Sample Output**

## DDL operations

### List admins (DDL)

**Sample Input**
**Sample Output**

### List companies (DDL)

**Sample Input**

```json
{
    "access_token": "dG9rZW4tMTIzNDU2Nzg5MA=="
}
```

**Sample Output**

### List companies IDs (DDL)

> **Warning:** Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

**Sample Input**

```json
{
    "access_token": "dG9rZW4tMTIzNDU2Nzg5MA=="
}
```

**Sample Output**

### List company segments (DDL)

**Sample Input**
**Sample Output**

```json
{
    "data": [
        \{
            "id": "5f1a2b3c4d5e6f7g8h9i0j",
            "name": "High Value Companies",
            "created_at": 1623456789,
            "updated_at": 1634567890,
            "type": "company"
        \},
        \{
            "id": "1a2b3c4d5e6f7g8h9i0j1k",
            "name": "Enterprise Customers",
            "created_at": 1612345678,
            "updated_at": 1623456789,
            "type": "company"
        \},
        \{
            "id": "2b3c4d5e6f7g8h9i0j1k2l",
            "name": "SMB Customers",
            "created_at": 1601234567,
            "updated_at": 1612345678,
            "type": "company"
        \}
    ]
}
```

### List contact fields (DDL)

**Sample Input**

```json
{
    "access_token": "dG9rZW4tMTIzNDU2Nzg5MA=="
}
```

**Sample Output**

### List contacts (DDL)

**Sample Input**
**Sample Output**

### List conversations (DDL)

> **Warning:** Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

**Sample Input**

```json
{
    "access_token": "dG9rZW4xMjM0NTY3ODkwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo="
}
```

**Sample Output**

### List custom data attributes for company (DDL)

**Sample Input**
**Sample Output**

```json
[
    \{
        "name": "industry",
        "label": "Industry",
        "data_type": "string"
    \},
    \{
        "name": "company_size",
        "label": "Company Size",
        "data_type": "integer"
    \},
    \{
        "name": "last_contact_date",
        "label": "Last Contact Date",
        "data_type": "date"
    \},
    \{
        "name": "is_enterprise",
        "label": "Is Enterprise",
        "data_type": "boolean"
    \},
    \{
        "name": "annual_revenue",
        "label": "Annual Revenue",
        "data_type": "float"
    \}
]
```

### List custom data attributes for contact (DDL)

**Sample Input**
**Sample Output**

### List tags (DDL)

> **Warning:** Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

**Sample Input**

```json
{
    "access_token": "dG9rZW4tMTIzNDU2Nzg5MA=="
}
```

**Sample Output**

### List teams (DDL)

**Sample Input**
**Sample Output**

### List user segments (DDL)

> **Warning:** Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

**Sample Input**
**Sample Output**

```json
{
    "segments": [
        \{
            "id": "5f9b2c3d1e2f3a4b5c6d7e8f",
            "name": "Active Users",
            "type": "user",
            "created_at": 1603987654,
            "updated_at": 1615432109,
            "person_type": "user",
            "count": 1250
        \},
        \{
            "id": "6a7b8c9d0e1f2g3h4i5j6k7l",
            "name": "New Signups",
            "type": "user",
            "created_at": 1609876543,
            "updated_at": 1620987654,
            "person_type": "user",
            "count": 378
        \},
        \{
            "id": "7m8n9o0p1q2r3s4t5u6v7w8x",
            "name": "Premium Subscribers",
            "type": "user",
            "created_at": 1612345678,
            "updated_at": 1625432109,
            "person_type": "user",
            "count": 523
        \}
    ]
}
```

### List users (DDL)

> **Warning:** Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

**Sample Input**
**Sample Output**
