# Plain

> Run your Plain support desk from workflows: open, label, assign, snooze, close and reply to threads, keep customers and accounts in step with your own systems, add notes and set account tiers.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/plain

## Actions

### Add labels to thread

Put one or more labels on a thread.

**Inputs**

- Thread (`thread_id`, text, required): The thread's id (th_...) or its reference such as T-123, from 'List threads' or an earlier step.
- Labels (`label_type_ids`, list, required): The labels to use. Pick one or more.

**Outputs**

- `labels` (list): The labels added
- `thread` (object): The thread

**Example output**

```json
{
  "labels": [
    {
      "id": "l_01HXAMPLELABEL",
      "labelType": {
        "id": "lt_01HXBUG",
        "name": "Bug"
      }
    }
  ],
  "thread": {
    "account": {
      "id": "acc_01HXACME",
      "name": "Acme Inc"
    },
    "assignedTo": {
      "email": "sam@yourcompany.com",
      "fullName": "Sam Support",
      "id": "u_01HXAMPLEUSER",
      "type": "user"
    },
    "channel": "API",
    "createdAt": "2026-10-15T09:00:00.000Z",
    "customer": {
      "email": "jo@example.com",
      "fullName": "Jo Bloggs",
      "id": "c_01HXAMPLECUSTOMER",
      "isEmailVerified": false
    },
    "description": "The export button does nothing.",
    "externalId": "ticket-77",
    "id": "th_01HXAMPLETHREAD",
    "labels": [
      {
        "id": "l_01HXAMPLELABEL",
        "labelType": {
          "id": "lt_01HXBUG",
          "name": "Bug"
        }
      }
    ],
    "previewText": "The export button does nothing.",
    "priority": 1,
    "priorityLabel": "High",
    "ref": "T-1042",
    "status": "TODO",
    "statusChangedAt": "2026-10-15T09:00:00.000Z",
    "tier": {
      "id": "tier_01HXGOLD",
      "name": "Gold"
    },
    "title": "Cannot export invoices",
    "updatedAt": "2026-10-15T09:05:00.000Z"
  }
}
```

### Add note

Add an internal note to a customer, or to one of their threads. Only your team sees it.

**Inputs**

- Customer (`customer`, text, required): The customer's email address, Plain id (c_...) or your own external id for them.
- Note (`text`, text, required): The note. Markdown such as **bold** and links works.
- Thread (`thread_id`, text): Put the note on this thread of theirs (id or reference such as T-123). Leave empty to add it to the customer.

**Outputs**

- `note` (object): The note

**Example output**

```json
{
  "note": {
    "createdAt": "2026-10-15T09:10:00.000Z",
    "customerId": "c_01HXAMPLECUSTOMER",
    "id": "n_01HXAMPLENOTE",
    "markdown": "Called them about the export bug.",
    "text": "Called them about the export bug.",
    "threadId": "th_01HXAMPLETHREAD"
  }
}
```

### Change thread status

Mark a thread done or to do, or snooze it until a time. Any new message moves it back to to do.

**Inputs**

- Thread (`thread_id`, text, required): The thread's id (th_...) or its reference such as T-123, from 'List threads' or an earlier step.
- Status (`status`, text, required): The thread's new status. One of: `TODO` (To do), `SNOOZED`, `DONE`.
- Snooze until (`snooze_until`, date and time): When the thread comes back to to do. Only when Status is Snoozed.

**Outputs**

- `thread` (object): The thread

**Example output**

```json
{
  "thread": {
    "account": {
      "id": "acc_01HXACME",
      "name": "Acme Inc"
    },
    "assignedTo": {
      "email": "sam@yourcompany.com",
      "fullName": "Sam Support",
      "id": "u_01HXAMPLEUSER",
      "type": "user"
    },
    "channel": "API",
    "createdAt": "2026-10-15T09:00:00.000Z",
    "customer": {
      "email": "jo@example.com",
      "fullName": "Jo Bloggs",
      "id": "c_01HXAMPLECUSTOMER",
      "isEmailVerified": false
    },
    "description": "The export button does nothing.",
    "externalId": "ticket-77",
    "id": "th_01HXAMPLETHREAD",
    "labels": [
      {
        "id": "l_01HXAMPLELABEL",
        "labelType": {
          "id": "lt_01HXBUG",
          "name": "Bug"
        }
      }
    ],
    "previewText": "The export button does nothing.",
    "priority": 1,
    "priorityLabel": "High",
    "ref": "T-1042",
    "status": "DONE",
    "statusChangedAt": "2026-10-15T09:00:00.000Z",
    "tier": {
      "id": "tier_01HXGOLD",
      "name": "Gold"
    },
    "title": "Cannot export invoices",
    "updatedAt": "2026-10-15T09:05:00.000Z"
  }
}
```

### Create or update account

Add an account (a company you support), or update the one with this id of yours: its name and link.

**Inputs**

- Your id for it (`external_id`, text, required): The account's id in your own systems, which finds it if it exists.
- Name (`name`, text, required): The account's name, such as the company name.
- Link (`url`, text): A link to the account in your own product or admin.

**Outputs**

- `account` (object): The account
- `result` (text): CREATED, UPDATED or NOOP (nothing to change)

**Example output**

```json
{
  "account": {
    "createdAt": "2026-10-01T09:00:00.000Z",
    "externalId": "acme",
    "id": "acc_01HXACME",
    "name": "Acme Inc",
    "primaryDomain": "acme.example.com",
    "tier": {
      "id": "tier_01HXGOLD",
      "name": "Gold"
    },
    "updatedAt": "2026-10-15T09:00:00.000Z",
    "url": "https://acme.example.com/admin"
  },
  "result": "CREATED"
}
```

### Create or update customer

Add a customer, or update the one with this email address: their name, short name and your own id for them. Plain does not email them.

**Inputs**

- Email (`email`, text, required): The customer's email address, which finds them if they exist.
- Full name (`full_name`, text, required): The customer's full name.
- Short name (`short_name`, text): What to call them, usually their first name.
- Your id for them (`external_id`, text): The customer's id in your own systems.
- Account (`account_id`, text): The account (company) this belongs to in Plain.

**Outputs**

- `customer` (object): The customer
- `result` (text): CREATED, UPDATED or NOOP (nothing to change)

**Example output**

```json
{
  "customer": {
    "avatarUrl": "https://example.com/jo.png",
    "createdAt": "2026-10-15T09:00:00.000Z",
    "email": "jo@example.com",
    "externalId": "cust-1001",
    "fullName": "Jo Bloggs",
    "id": "c_01HXAMPLECUSTOMER",
    "isEmailVerified": false,
    "markedAsSpamAt": "",
    "shortName": "Jo",
    "updatedAt": "2026-10-15T09:00:00.000Z"
  },
  "result": "CREATED"
}
```

### Create thread

Open a support thread for a customer, with a title, priority, labels and assignee. The customer is not messaged; use 'Reply to thread' to write to them.

**Inputs**

- Customer (`customer`, text, required): The customer's email address, Plain id (c_...) or your own external id for them.
- Title (`title`, text, required): What the thread is about.
- Description (`description`, text): More detail, shown as the thread's preview in Plain.
- Priority (`priority`, text): How urgent the thread is. New threads are Normal unless set. One of: `0` (Urgent), `1` (High), `2` (Normal), `3` (Low).
- Labels (`label_type_ids`, list): Labels to put on the thread.
- Assign to (`assigned_to_user_id`, text): The teammate to assign the thread to.
- Account (`account_id`, text): The account (company) this belongs to in Plain.
- Your id for it (`external_id`, text): The thread's id in your own systems, such as a ticket number.

**Outputs**

- `thread` (object): The thread

**Example output**

```json
{
  "thread": {
    "account": {
      "id": "acc_01HXACME",
      "name": "Acme Inc"
    },
    "assignedTo": {
      "email": "sam@yourcompany.com",
      "fullName": "Sam Support",
      "id": "u_01HXAMPLEUSER",
      "type": "user"
    },
    "channel": "API",
    "createdAt": "2026-10-15T09:00:00.000Z",
    "customer": {
      "email": "jo@example.com",
      "fullName": "Jo Bloggs",
      "id": "c_01HXAMPLECUSTOMER",
      "isEmailVerified": false
    },
    "description": "The export button does nothing.",
    "externalId": "ticket-77",
    "id": "th_01HXAMPLETHREAD",
    "labels": [
      {
        "id": "l_01HXAMPLELABEL",
        "labelType": {
          "id": "lt_01HXBUG",
          "name": "Bug"
        }
      }
    ],
    "previewText": "The export button does nothing.",
    "priority": 1,
    "priorityLabel": "High",
    "ref": "T-1042",
    "status": "TODO",
    "statusChangedAt": "2026-10-15T09:00:00.000Z",
    "tier": {
      "id": "tier_01HXGOLD",
      "name": "Gold"
    },
    "title": "Cannot export invoices",
    "updatedAt": "2026-10-15T09:05:00.000Z"
  }
}
```

### Delete account

Delete an account. Its customers and threads stay, without it.

**Inputs**

- Account (`account_id`, text, required): The account (company) in Plain.

**Outputs**

- `account_id` (text): The account deleted
- `deleted` (true/false): Always true once deleted

**Example output**

```json
{
  "account_id": "acc_01HXACME",
  "deleted": true
}
```

### Delete customer

Delete a customer for good, with their threads and notes.

**Inputs**

- Customer (`customer`, text, required): The customer's email address, Plain id (c_...) or your own external id for them.

**Outputs**

- `customer_id` (text): The customer deleted
- `deleted` (true/false): Always true once deleted

**Example output**

```json
{
  "customer_id": "c_01HXAMPLECUSTOMER",
  "deleted": true
}
```

### Delete thread

Delete a thread for good, with its messages and notes.

**Inputs**

- Thread (`thread_id`, text, required): The thread's id (th_...) or its reference such as T-123, from 'List threads' or an earlier step.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `thread_id` (text): The thread deleted

**Example output**

```json
{
  "deleted": true,
  "thread_id": "th_01HXAMPLETHREAD"
}
```

### Get customer

Find one customer by email address, Plain id or your own external id. Fails if there is none.

**Inputs**

- Customer (`customer`, text, required): The customer's email address, Plain id (c_...) or your own external id for them.

**Outputs**

- `customer` (object): The customer

**Example output**

```json
{
  "customer": {
    "avatarUrl": "https://example.com/jo.png",
    "createdAt": "2026-10-15T09:00:00.000Z",
    "email": "jo@example.com",
    "externalId": "cust-1001",
    "fullName": "Jo Bloggs",
    "id": "c_01HXAMPLECUSTOMER",
    "isEmailVerified": false,
    "markedAsSpamAt": "",
    "shortName": "Jo",
    "updatedAt": "2026-10-15T09:00:00.000Z"
  }
}
```

### Get thread

Get one thread with its status, priority, customer, assignee, labels, account and tier.

**Inputs**

- Thread (`thread_id`, text, required): The thread's id (th_...) or its reference such as T-123, from 'List threads' or an earlier step.

**Outputs**

- `thread` (object): The thread

**Example output**

```json
{
  "thread": {
    "account": {
      "id": "acc_01HXACME",
      "name": "Acme Inc"
    },
    "assignedTo": {
      "email": "sam@yourcompany.com",
      "fullName": "Sam Support",
      "id": "u_01HXAMPLEUSER",
      "type": "user"
    },
    "channel": "API",
    "createdAt": "2026-10-15T09:00:00.000Z",
    "customer": {
      "email": "jo@example.com",
      "fullName": "Jo Bloggs",
      "id": "c_01HXAMPLECUSTOMER",
      "isEmailVerified": false
    },
    "description": "The export button does nothing.",
    "externalId": "ticket-77",
    "id": "th_01HXAMPLETHREAD",
    "labels": [
      {
        "id": "l_01HXAMPLELABEL",
        "labelType": {
          "id": "lt_01HXBUG",
          "name": "Bug"
        }
      }
    ],
    "previewText": "The export button does nothing.",
    "priority": 1,
    "priorityLabel": "High",
    "ref": "T-1042",
    "status": "TODO",
    "statusChangedAt": "2026-10-15T09:00:00.000Z",
    "tier": {
      "id": "tier_01HXGOLD",
      "name": "Gold"
    },
    "title": "Cannot export invoices",
    "updatedAt": "2026-10-15T09:05:00.000Z"
  }
}
```

### List accounts

List the accounts (companies) your customers belong to, by name, optionally only those in one tier. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Tier (`tier_id`, text): Only accounts in this tier.
- Page size (`page_size`, number): How many to return, 1 to 100. Plain's default is 25. From 1 to 100.
- Next page cursor (`after`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `accounts` (list): The accounts
- `count` (number): How many are on this page
- `has_next_page` (true/false): Whether more follow
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last

**Example output**

```json
{
  "accounts": [
    {
      "createdAt": "2026-10-01T09:00:00.000Z",
      "externalId": "acme",
      "id": "acc_01HXACME",
      "name": "Acme Inc",
      "primaryDomain": "acme.example.com",
      "tier": {
        "id": "tier_01HXGOLD",
        "name": "Gold"
      },
      "updatedAt": "2026-10-15T09:00:00.000Z",
      "url": "https://acme.example.com/admin"
    }
  ],
  "count": 1,
  "has_next_page": false,
  "next_cursor": ""
}
```

### List customers

List customers by name, optionally only those changed since a time. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Changed since (`updated_since`, date and time): Only customers created or changed since this time.
- Page size (`page_size`, number): How many to return, 1 to 100. Plain's default is 25. From 1 to 100.
- Next page cursor (`after`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many are on this page
- `customers` (list): The customers
- `has_next_page` (true/false): Whether more follow
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last
- `total_count` (number): How many match in all

**Example output**

```json
{
  "count": 1,
  "customers": [
    {
      "avatarUrl": "https://example.com/jo.png",
      "createdAt": "2026-10-15T09:00:00.000Z",
      "email": "jo@example.com",
      "externalId": "cust-1001",
      "fullName": "Jo Bloggs",
      "id": "c_01HXAMPLECUSTOMER",
      "isEmailVerified": false,
      "markedAsSpamAt": "",
      "shortName": "Jo",
      "updatedAt": "2026-10-15T09:00:00.000Z"
    }
  ],
  "has_next_page": false,
  "next_cursor": "",
  "total_count": 1
}
```

### List labels

List the labels threads can be given in your workspace, with their ids and the group each is in.

**Inputs**

- Include archived (`include_archived`, true/false): Also list labels that have been archived.

**Outputs**

- `count` (number): How many
- `label_types` (list): The labels

**Example output**

```json
{
  "count": 1,
  "label_types": [
    {
      "color": "#FF0000",
      "description": "Something is broken",
      "externalId": "bug",
      "id": "lt_01HXBUG",
      "isArchived": false,
      "name": "Bug",
      "parentLabelType": {
        "id": "lt_01HXPRODUCT",
        "name": "Product"
      }
    }
  ]
}
```

### List threads

List support threads, filtered by status, priority, customer, label or assignee. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Status (`statuses`, list): Only threads in these statuses. All when none is picked. One or more of: `TODO` (To do), `SNOOZED`, `DONE`.
- Priority (`priorities`, list): Only threads of these priorities. All when none is picked. One or more of: `0` (Urgent), `1` (High), `2` (Normal), `3` (Low).
- Customer (`customer`, text): Only this customer's threads: their email address, Plain id or your own id for them.
- Labels (`label_type_ids`, list): Only threads with any of these labels.
- Assigned to (`assigned_to_user_id`, text): Only threads assigned to this teammate.
- Order (`sort`, text): How to order the threads. Defaults to newest first. One of: `newest` (Newest first (default)), `oldest` (Oldest first), `status_changed` (Status changed most recently), `priority` (Most urgent first), `last_message` (Latest customer message first). Default: `newest`.
- Page size (`page_size`, number): How many to return, 1 to 100. Plain's default is 25. From 1 to 100.
- Next page cursor (`after`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many are on this page
- `has_next_page` (true/false): Whether more follow
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last
- `threads` (list): The threads
- `total_count` (number): How many match in all

**Example output**

```json
{
  "count": 1,
  "has_next_page": false,
  "next_cursor": "",
  "threads": [
    {
      "account": {
        "id": "acc_01HXACME",
        "name": "Acme Inc"
      },
      "assignedTo": {
        "email": "sam@yourcompany.com",
        "fullName": "Sam Support",
        "id": "u_01HXAMPLEUSER",
        "type": "user"
      },
      "channel": "API",
      "createdAt": "2026-10-15T09:00:00.000Z",
      "customer": {
        "email": "jo@example.com",
        "fullName": "Jo Bloggs",
        "id": "c_01HXAMPLECUSTOMER",
        "isEmailVerified": false
      },
      "description": "The export button does nothing.",
      "externalId": "ticket-77",
      "id": "th_01HXAMPLETHREAD",
      "labels": [
        {
          "id": "l_01HXAMPLELABEL",
          "labelType": {
            "id": "lt_01HXBUG",
            "name": "Bug"
          }
        }
      ],
      "previewText": "The export button does nothing.",
      "priority": 1,
      "priorityLabel": "High",
      "ref": "T-1042",
      "status": "TODO",
      "statusChangedAt": "2026-10-15T09:00:00.000Z",
      "tier": {
        "id": "tier_01HXGOLD",
        "name": "Gold"
      },
      "title": "Cannot export invoices",
      "updatedAt": "2026-10-15T09:05:00.000Z"
    }
  ],
  "total_count": 1
}
```

### List tiers

List your support tiers, which set the SLAs and default priority of the threads of the accounts in them.

**Inputs**: None.

**Outputs**

- `count` (number): How many
- `tiers` (list): The tiers

**Example output**

```json
{
  "count": 1,
  "tiers": [
    {
      "color": "#FABADA",
      "defaultThreadPriority": 1,
      "externalId": "gold",
      "id": "tier_01HXGOLD",
      "isDefault": false,
      "name": "Gold"
    }
  ]
}
```

### Remove labels from thread

Take one or more labels off a thread. Labels the thread doesn't have are skipped.

**Inputs**

- Thread (`thread_id`, text, required): The thread's id (th_...) or its reference such as T-123, from 'List threads' or an earlier step.
- Labels (`label_type_ids`, list, required): The labels to use. Pick one or more.

**Outputs**

- `removed_count` (number): How many were removed
- `thread` (object): The thread

**Example output**

```json
{
  "removed_count": 1,
  "thread": {
    "account": {
      "id": "acc_01HXACME",
      "name": "Acme Inc"
    },
    "assignedTo": {
      "email": "sam@yourcompany.com",
      "fullName": "Sam Support",
      "id": "u_01HXAMPLEUSER",
      "type": "user"
    },
    "channel": "API",
    "createdAt": "2026-10-15T09:00:00.000Z",
    "customer": {
      "email": "jo@example.com",
      "fullName": "Jo Bloggs",
      "id": "c_01HXAMPLECUSTOMER",
      "isEmailVerified": false
    },
    "description": "The export button does nothing.",
    "externalId": "ticket-77",
    "id": "th_01HXAMPLETHREAD",
    "labels": [],
    "previewText": "The export button does nothing.",
    "priority": 1,
    "priorityLabel": "High",
    "ref": "T-1042",
    "status": "TODO",
    "statusChangedAt": "2026-10-15T09:00:00.000Z",
    "tier": {
      "id": "tier_01HXGOLD",
      "name": "Gold"
    },
    "title": "Cannot export invoices",
    "updatedAt": "2026-10-15T09:05:00.000Z"
  }
}
```

### Reply to thread

Send the customer a reply on the thread's own channel (email, chat, Slack or Teams), as the connected machine user. The customer receives it.

**Inputs**

- Thread (`thread_id`, text, required): The thread's id (th_...) or its reference such as T-123, from 'List threads' or an earlier step.
- Message (`message`, text, required): The reply. Markdown such as **bold** and links works.

**Outputs**

- `sent` (true/false): Always true once sent
- `thread_id` (text): The thread replied to

**Example output**

```json
{
  "sent": true,
  "thread_id": "th_01HXAMPLETHREAD"
}
```

### Set account tier

Put an account in a support tier, in place of any tier it was in.

**Inputs**

- Account (`account_id`, text, required): The account (company) in Plain.
- Tier (`tier_id`, text, required): The tier to put the account in.

**Outputs**

- `account_id` (text): The account
- `membership_id` (text): The id of the account's place in the tier
- `tier_id` (text): The tier it is now in

**Example output**

```json
{
  "account_id": "acc_01HXACME",
  "membership_id": "tm_01HXAMPLE",
  "tier_id": "tier_01HXGOLD"
}
```

### Update thread

Rename a thread, change its priority or assign it to a teammate. Empty fields are left as they are.

**Inputs**

- Thread (`thread_id`, text, required): The thread's id (th_...) or its reference such as T-123, from 'List threads' or an earlier step.
- Title (`title`, text): A new title. Leave empty to keep it.
- Priority (`priority`, text): A new priority. Leave empty to keep it. One of: `0` (Urgent), `1` (High), `2` (Normal), `3` (Low).
- Assign to (`assigned_to_user_id`, text): The teammate to assign it to. Leave empty to keep the assignee.

**Outputs**

- `thread` (object): The thread

**Example output**

```json
{
  "thread": {
    "account": {
      "id": "acc_01HXACME",
      "name": "Acme Inc"
    },
    "assignedTo": {
      "email": "sam@yourcompany.com",
      "fullName": "Sam Support",
      "id": "u_01HXAMPLEUSER",
      "type": "user"
    },
    "channel": "API",
    "createdAt": "2026-10-15T09:00:00.000Z",
    "customer": {
      "email": "jo@example.com",
      "fullName": "Jo Bloggs",
      "id": "c_01HXAMPLECUSTOMER",
      "isEmailVerified": false
    },
    "description": "The export button does nothing.",
    "externalId": "ticket-77",
    "id": "th_01HXAMPLETHREAD",
    "labels": [
      {
        "id": "l_01HXAMPLELABEL",
        "labelType": {
          "id": "lt_01HXBUG",
          "name": "Bug"
        }
      }
    ],
    "previewText": "The export button does nothing.",
    "priority": 1,
    "priorityLabel": "High",
    "ref": "T-1042",
    "status": "TODO",
    "statusChangedAt": "2026-10-15T09:00:00.000Z",
    "tier": {
      "id": "tier_01HXGOLD",
      "name": "Gold"
    },
    "title": "Cannot export invoices",
    "updatedAt": "2026-10-15T09:05:00.000Z"
  }
}
```
