{
  "info": {
    "name": "Sortd API v2",
    "description": "Sortd's public API — the work/operations layer around the mailbox. Email threads become owned,\nstateful work items with assignments, AI classification and customer context.\n\n**Base URL** — `https://api.sortd.com/v2` (same-origin in local/dev).\n\n**Auth** — send an API key as a Bearer token: `Authorization: Bearer sk_live_…`. Create and\nscope keys in the app under Settings → API; the secret is shown once. `GET /me` needs no scopes\nand is the quickest way to confirm a key works.\n\n**Responses** — every success is `{ \"data\": …, \"meta\": { \"request_id\": … } }`; lists add\n`meta.pagination` (`next_cursor`, `has_more`, `limit`). Errors are\n`{ \"error\": { \"code\", \"message\" } }`. **Tolerate unknown fields** — the API evolves additively.\n\n**Writes** — every write (`POST`/`PUT`/`PATCH`/`DELETE`) accepts an optional `Idempotency-Key`\nheader so retries are safe: a repeated request with the same key replays the original response,\nand reusing a key with a different body returns `409`. Each endpoint lists the scopes it requires;\na key missing a scope gets `403`.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.sortd.com/v2"
    },
    {
      "key": "api_key",
      "value": "sk_live_…"
    }
  ],
  "item": [
    {
      "name": "Identity",
      "item": [
        {
          "name": "Get the authenticated principal",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/me",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "me"
              ]
            },
            "description": "Returns the user and the API key the request authenticated with. Requires no scopes — the quickest way to confirm a key works."
          }
        }
      ]
    },
    {
      "name": "Teams",
      "item": [
        {
          "name": "List teams the API is enabled for",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/teams",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "teams"
              ]
            },
            "description": "The teams (organisations) your key can act within. A team `id` is the `team_id` you pass to list boards."
          }
        },
        {
          "name": "Get a team",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/teams/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "teams",
                ":id"
              ]
            },
            "description": "Fetch a single team by id."
          }
        }
      ]
    },
    {
      "name": "Boards",
      "item": [
        {
          "name": "List boards for a team",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards"
              ],
              "query": [
                {
                  "key": "team_id",
                  "value": "",
                  "description": "Team id",
                  "disabled": false
                }
              ]
            },
            "description": "Boards a team owns. Use `team_id` from `/me` or `/teams`; the returned `id` (brd_…) feeds the lists and tasks endpoints."
          }
        },
        {
          "name": "Create a board",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards"
              ]
            },
            "description": "Creates a shared team board under a team. `team_id` and `name` are required. Returns the created board with its opaque id (brd_…).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get a board",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards",
                ":id"
              ]
            },
            "description": "Fetch a single board by its opaque id (brd_…)."
          }
        },
        {
          "name": "Rename a board",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards",
                ":id"
              ]
            },
            "description": "Renames a board. Send `name`. Returns the updated board.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete a board",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards",
                ":id"
              ]
            },
            "description": "Soft-deletes a board (it stops appearing in reads but is recoverable). Returns the board id with `deleted: true`."
          }
        },
        {
          "name": "List a board's task lists",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards/:id/lists",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards",
                ":id",
                "lists"
              ]
            },
            "description": "The lists (columns) on a board. A list `id` (lst_…) is where you create or move tasks."
          }
        },
        {
          "name": "List a board's custom fields",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards/:id/custom-fields",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards",
                ":id",
                "custom-fields"
              ]
            },
            "description": "The board’s custom fields with their `type` and, for tag/status/select fields, the `options` (id + label). Use a field `id` as `field_id` when setting values via PATCH /tasks/{id}. Fields flagged `ai: true` are managed by Sortd AI and are read-only."
          }
        }
      ]
    },
    {
      "name": "Lists",
      "item": [
        {
          "name": "Create a list on a board",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards/:id/lists",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards",
                ":id",
                "lists"
              ]
            },
            "description": "Adds a task list (column) to a board. Send `name`. Returns the created list with its opaque id (lst_…).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Rename a list",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/lists/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "lists",
                ":id"
              ]
            },
            "description": "Renames a list. Send `name`. Returns the updated list.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete a list",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/lists/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "lists",
                ":id"
              ]
            },
            "description": "Soft-deletes a list (it stops appearing in reads but the list and its tasks are recoverable). Returns the list id with `deleted: true`."
          }
        }
      ]
    },
    {
      "name": "Custom fields",
      "item": [
        {
          "name": "Create a custom field on a board",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards/:id/custom-fields",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards",
                ":id",
                "custom-fields"
              ]
            },
            "description": "Creates a custom-field definition on a board. Send `name` and `type`; for option types (select/status/tag/multiselect) include `options`. For status/tag fields you can also set `display_on_card` to show the field on task cards. Returns the created field.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Update a custom field",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards/:id/custom-fields/:fieldId",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards",
                ":id",
                "custom-fields",
                ":fieldId"
              ]
            },
            "description": "Partial update of a custom-field definition — send `name`, `options`, and/or `display_on_card` (status/tag fields only). Returns the updated field.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete a custom field",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/boards/:id/custom-fields/:fieldId",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "boards",
                ":id",
                "custom-fields",
                ":fieldId"
              ]
            },
            "description": "Soft-deletes a custom field from a board (it stops appearing in reads but its values are preserved and recoverable). Returns the field id with `deleted: true`."
          }
        }
      ]
    },
    {
      "name": "Tasks",
      "item": [
        {
          "name": "List or search tasks on a board, list, email thread, or CRM contact",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tasks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tasks"
              ],
              "query": [
                {
                  "key": "board_id",
                  "value": "",
                  "description": "Opaque board id (brd_…) — tasks on this board",
                  "disabled": true
                },
                {
                  "key": "list_id",
                  "value": "",
                  "description": "Opaque list id (lst_…) — tasks on this list",
                  "disabled": true
                },
                {
                  "key": "thread_id",
                  "value": "",
                  "description": "Email thread id (hex) — tasks linked to that thread",
                  "disabled": true
                },
                {
                  "key": "contact_id",
                  "value": "",
                  "description": "Opaque contact id (con_…) — tasks linked to that CRM contact",
                  "disabled": true
                },
                {
                  "key": "q",
                  "value": "",
                  "description": "Search text — case-insensitive substring match on title and notes",
                  "disabled": true
                },
                {
                  "key": "completed",
                  "value": "",
                  "description": "Filter by completion (true/false)",
                  "disabled": true
                },
                {
                  "key": "shade",
                  "value": "",
                  "description": "Filter by task colour name (e.g. \"red\", \"none\")",
                  "disabled": true
                },
                {
                  "key": "due_before",
                  "value": "",
                  "description": "Only tasks due on/before this ISO-8601 datetime",
                  "disabled": true
                },
                {
                  "key": "due_after",
                  "value": "",
                  "description": "Only tasks due on/after this ISO-8601 datetime",
                  "disabled": true
                },
                {
                  "key": "assigned_to",
                  "value": "",
                  "description": "Filter by assignee email (exact) or display name (substring)",
                  "disabled": true
                },
                {
                  "key": "custom_field_id",
                  "value": "",
                  "description": "Filter to tasks that have this custom field set",
                  "disabled": true
                },
                {
                  "key": "custom_field_value",
                  "value": "",
                  "description": "With custom_field_id — require this value (matches a scalar value or membership of a multi-value field)",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "Page size (max 200)",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "Opaque pagination cursor",
                  "disabled": true
                }
              ]
            },
            "description": "A scope is required (mutually exclusive, precedence `thread_id` → `contact_id` → `list_id` → `board_id`): pass `thread_id` (hex Gmail thread id) for tasks linked to a thread, `contact_id` (con_…) for tasks linked to a CRM contact (sale cards + contact custom-field links), `list_id` for a list, or `board_id` for a board. (There is no cross-board \"all my tasks\" listing.) Optional search/filter (applies to the board / list scopes, not thread/contact): `q` (case-insensitive match on title + notes), `completed`, `shade`, `due_before`/`due_after`, `assigned_to`, and `custom_field_id` (+ optional `custom_field_value`). Only tasks on boards you are a member of are ever returned. Cursor-paginated — pass `meta.pagination.next_cursor` back as `cursor`; `limit` caps page size (max 200)."
          }
        },
        {
          "name": "Create a task",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tasks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tasks"
              ]
            },
            "description": "Creates a task in a list. `list_id` and `title` are required; `notes` and `due_at` optional. Send an `Idempotency-Key` header so a retried request returns the same task instead of creating a duplicate.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get a task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tasks/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tasks",
                ":id"
              ]
            },
            "description": "Fetch a single task by its opaque id (tsk_…), including its colours and custom-field values."
          }
        },
        {
          "name": "Update a task",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tasks/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tasks",
                ":id"
              ]
            },
            "description": "Partial update — send only the fields to change. Supports `shade` (the task colour; a named enum, `\"none\"` clears) and `custom_fields` (set values by `field_id`; for tag/status/select pass option id(s) from GET /boards/{id}/custom-fields). Setting custom_fields additionally requires the `customfields.write` scope. Returns the updated task.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete a task",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tasks/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tasks",
                ":id"
              ]
            },
            "description": "Soft-deletes a task (it stops appearing in reads but is recoverable). Any synced email thread is left intact. Returns the task id with `deleted: true`."
          }
        },
        {
          "name": "Mark a task complete",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tasks/:id/complete",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tasks",
                ":id",
                "complete"
              ]
            },
            "description": "Marks the task complete. Idempotent — completing an already-complete task is a no-op. Returns the updated task."
          }
        },
        {
          "name": "Reopen a completed task",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tasks/:id/reopen",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tasks",
                ":id",
                "reopen"
              ]
            },
            "description": "Reopens a completed task. Returns the updated task."
          }
        },
        {
          "name": "Move a task to another list",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tasks/:id/move",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tasks",
                ":id",
                "move"
              ]
            },
            "description": "Moves the task to the destination `list_id` (on any board the key can access). Returns the updated task.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Contacts",
      "item": [
        {
          "name": "Search a team's CRM contacts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts"
              ],
              "query": [
                {
                  "key": "team_id",
                  "value": "",
                  "description": "The team/organisation id whose contacts to search (required).",
                  "disabled": true
                },
                {
                  "key": "q",
                  "value": "",
                  "description": "Search text — matches contact name, company name and contact-info values.",
                  "disabled": true
                },
                {
                  "key": "type",
                  "value": "",
                  "description": "Contact type (e.g. sale, general, hire). Applied together with stage.",
                  "disabled": true
                },
                {
                  "key": "stage",
                  "value": "",
                  "description": "Contact stage (e.g. Lead, Customer). Applied together with type.",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "Page size (max 200)",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "Opaque pagination cursor",
                  "disabled": true
                }
              ]
            },
            "description": "Searches the contacts of one team you belong to (pass the required `team_id`). Results are **company-grouped** — each entry is a company with a matching contact. `q` does a case-insensitive match on contact name, company name and contact-info values; `type` and `stage` filter together (e.g. type=sale & stage=Lead). Returns only contacts in that team (per-contact visibility is not applied — it mirrors the in-product view where members see the team's contacts). Requires the `contacts.read` scope and the team's Contacts subscription feature. Cursor-paginated; `limit` max 200."
          }
        },
        {
          "name": "Create a CRM contact",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts"
              ]
            },
            "description": "Create a contact in a team (`team_id` required). Link a company via `company_id` (existing) or `company_name` (find-or-create); with neither, the org default company is used. Requires the Contacts subscription feature.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get a CRM contact",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts",
                ":id"
              ]
            },
            "description": "Fetch a single contact by its opaque id (con_…), including its company."
          }
        },
        {
          "name": "Update a CRM contact",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts",
                ":id"
              ]
            },
            "description": "Partial update — provide only the fields to change. `company_id` re-links to a different company.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete a CRM contact",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts",
                ":id"
              ]
            },
            "description": "Soft-deletes the contact (recoverable; stops appearing in reads)."
          }
        }
      ]
    },
    {
      "name": "Companies",
      "item": [
        {
          "name": "List a team's CRM companies",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies"
              ],
              "query": [
                {
                  "key": "team_id",
                  "value": "",
                  "description": "Team/organisation id (required).",
                  "disabled": true
                },
                {
                  "key": "q",
                  "value": "",
                  "description": "Filter by company name (substring).",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "Page size (max 200)",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "Opaque pagination cursor",
                  "disabled": true
                }
              ]
            },
            "description": "Companies in the team (`team_id` required); optional `q` name filter. Cursor-paginated. Requires the Contacts subscription feature."
          }
        },
        {
          "name": "Create a CRM company",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies"
              ]
            },
            "description": "Create a company in a team (`team_id` required). Requires the Contacts subscription feature.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get a CRM company",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                ":id"
              ]
            },
            "description": "Fetch a single company by its opaque id (cmp_…)."
          }
        },
        {
          "name": "Update a CRM company",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                ":id"
              ]
            },
            "description": "Partial update — provide only the fields to change.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete a CRM company",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                ":id"
              ]
            },
            "description": "Soft-deletes the company AND its contacts (cascade), mirroring the in-product behaviour."
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "Create a webhook subscription",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/subscriptions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "subscriptions"
              ]
            },
            "description": "Subscribe a `target_url` to one or more event types. Optionally set `filters.scope` (`tasked`|`all`) to control `thread.reply_received` delivery. The response includes a signing `secret` (whsec_…), shown once — store it to verify the `x-sortd-signature` on each delivery.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "List webhook subscriptions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/subscriptions",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "subscriptions"
              ]
            },
            "description": "Your webhook subscriptions (target url, events, status) — never the signing secret."
          }
        },
        {
          "name": "Delete a webhook subscription",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/subscriptions/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "subscriptions",
                ":id"
              ]
            },
            "description": "Removes a subscription. Deliveries stop immediately."
          }
        },
        {
          "name": "Update or pause a webhook subscription",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/subscriptions/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "subscriptions",
                ":id"
              ]
            },
            "description": "Change a subscription’s `events`, `target_url`, or `status`. Set `status` to `disabled` to pause delivery (events are still recorded) or `active` to resume — resuming clears the failure streak. Note: a subscription is auto-disabled after repeated failed deliveries; resume it here once the endpoint is healthy.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Rotate a webhook signing secret",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/subscriptions/:id/rotate-secret",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "subscriptions",
                ":id",
                "rotate-secret"
              ]
            },
            "description": "Issues a new signing secret (whsec_…), shown once. Update your signature verifier when you rotate."
          }
        },
        {
          "name": "Send a test ping to a webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/subscriptions/:id/test",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "subscriptions",
                ":id",
                "test"
              ]
            },
            "description": "Delivers a synthetic `ping` event so you can confirm your endpoint and signature verification work."
          }
        },
        {
          "name": "List a webhook’s delivery log",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/subscriptions/:id/deliveries",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "subscriptions",
                ":id",
                "deliveries"
              ]
            },
            "description": "Recent delivery attempts (status, timing, response code) for debugging. Each has a delivery id you can replay."
          }
        },
        {
          "name": "Replay a webhook delivery",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/deliveries/:deliveryId/replay",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                "deliveries",
                ":deliveryId",
                "replay"
              ]
            },
            "description": "Re-sends a past delivery by its id — handy after fixing your endpoint."
          }
        }
      ]
    },
    {
      "name": "Zapier",
      "item": [
        {
          "name": "Zapier REST Hook subscribe",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/zapier/hooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "zapier",
                "hooks"
              ]
            },
            "description": "Registers a target URL for an event type (used by the Zapier app’s REST Hook triggers)."
          }
        },
        {
          "name": "Zapier REST Hook unsubscribe",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/zapier/hooks/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "zapier",
                "hooks",
                ":id"
              ]
            },
            "description": "Removes a Zapier REST Hook subscription by id (called when a Zap is turned off)."
          }
        },
        {
          "name": "Zapier polling trigger (event feed since cursor)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/zapier/poll",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "zapier",
                "poll"
              ],
              "query": [
                {
                  "key": "event",
                  "value": "",
                  "description": "Event type to poll",
                  "disabled": false
                },
                {
                  "key": "since",
                  "value": "",
                  "description": "ISO timestamp cursor",
                  "disabled": true
                }
              ]
            },
            "description": "Returns events of the given type newer than the `since` cursor — the polling fallback for Zapier triggers."
          }
        },
        {
          "name": "Sample event payload for Zapier setup",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/zapier/sample",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "zapier",
                "sample"
              ],
              "query": [
                {
                  "key": "event",
                  "value": "",
                  "description": "Event type",
                  "disabled": false
                }
              ]
            },
            "description": "A representative payload for an event type — Zapier uses it to map fields when building a Zap."
          }
        }
      ]
    },
    {
      "name": "Email",
      "item": [
        {
          "name": "Get the key owner's mailbox connection state",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email/mailbox",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email",
                "mailbox"
              ]
            },
            "description": "Probes the mailbox the API key can reach (always its owner's own — Flow A). Verifies the stored email credentials without reading any mail and reports `connected` with a `reason` when false. The quickest way to confirm email endpoints will work for this key."
          }
        },
        {
          "name": "List the mailbox's labels/folders",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email/labels",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email",
                "labels"
              ]
            },
            "description": "The Gmail labels in the key owner's mailbox, each typed `system` (INBOX, SENT, SPAM, TRASH, DRAFT, STARRED, IMPORTANT, CATEGORY_*) or `user` (custom). Use these with the thread-search `label` filter or the `label:`/`in:` operators in `q`. Gmail mailboxes only."
          }
        },
        {
          "name": "Search the key owner's mailbox (Gmail query)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads"
              ],
              "query": [
                {
                  "key": "q",
                  "value": "",
                  "description": "Gmail search query (free text + operators). At least one of q/label/category is required.",
                  "disabled": true
                },
                {
                  "key": "label",
                  "value": "",
                  "description": "Convenience: restrict to a label/folder (folded into the query as label:…)",
                  "disabled": true
                },
                {
                  "key": "category",
                  "value": "",
                  "description": "Convenience: Gmail category (primary|social|promotions|updates|forums)",
                  "disabled": true
                },
                {
                  "key": "include_spam_trash",
                  "value": "",
                  "description": "Include Spam/Trash (default false; auto-enabled when the query targets them)",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "Page size (max 100)",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "Opaque page cursor (Gmail page token) from a previous response",
                  "disabled": true
                }
              ]
            },
            "description": "Searches threads in the mailbox the key can reach (Flow A, **Gmail only**). Pass `q` with the full Gmail search syntax — free text plus operators like `in:inbox`, `from:x@y.com`, `to:`, `subject:`, `has:attachment`, `after:`/`before:`, `label:`, `category:`, `is:unread`. `label` and `category` are optional conveniences folded into the query. At least one of `q`, `label` or `category` is required. With no `in:`/folder the search covers All Mail except Spam/Trash; **Spam/Trash are only included when `include_spam_trash=true` or the query targets them** (`in:spam`/`in:trash`/`in:anywhere`); use `in:anywhere` rather than `in:all`. Returns thread metadata only (no bodies, no linked tasks — fetch a thread for those). Pages via an opaque `cursor` (Gmail page token); `limit` caps page size (max 100). Note: matching a folder/label returns threads that have *any* message with that label."
          }
        },
        {
          "name": "Get an email thread from the key owner’s mailbox",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId"
              ],
              "query": [
                {
                  "key": "include",
                  "value": "",
                  "description": "Set to `messages` to include full messages with bodies (email.body.read scope)",
                  "disabled": true
                }
              ]
            },
            "description": "Fetches a thread by its raw Gmail thread id (hex, as used by the Gmail API). Returns metadata — subject, participants, snippet, unread state and any Sortd tasks the thread is linked to. Pass `include=messages` to also get the messages with bodies (requires the email.body.read scope)."
          }
        },
        {
          "name": "Mark an email thread read or unread",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId/read-state",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId",
                "read-state"
              ]
            },
            "description": "Marks the thread read/unread in the owner’s mailbox AND keeps linked Sortd tasks in sync using the product’s rules: task read state derives from its threads; on an assigned task only an assignee’s action can make it read, while anyone marking unread flags it for everyone. Returns the affected tasks with their resulting read state.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Archive an email thread",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId/archive",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId",
                "archive"
              ]
            },
            "description": "Removes the thread from the mailbox Inbox (Gmail archive). The thread and any linked tasks are unaffected otherwise."
          }
        },
        {
          "name": "Unarchive an email thread",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId/unarchive",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId",
                "unarchive"
              ]
            },
            "description": "Moves the thread back into the mailbox Inbox."
          }
        },
        {
          "name": "Add or remove Gmail labels on a thread",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId/labels",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId",
                "labels"
              ]
            },
            "description": "Applies raw Gmail label ids to the thread — send `add` and/or `remove` arrays.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Snooze an email thread",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId/snooze",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId",
                "snooze"
              ]
            },
            "description": "Archives the thread now and returns it to the Inbox at `until` (the product’s snooze).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Create a draft on a thread",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId/drafts",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId",
                "drafts"
              ]
            },
            "description": "Creates a Gmail draft threaded onto the conversation. The draft lives in Gmail — the user can edit, send or delete it there (or an API key with drafts.send can send it). This scope can never send mail. Send an `Idempotency-Key` header so retries don’t create duplicate drafts.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "List your drafts on a thread",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId/drafts",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId",
                "drafts"
              ]
            },
            "description": "The key owner’s Gmail drafts sitting on this thread — metadata only (subject, snippet, recipients), never bodies."
          }
        },
        {
          "name": "Send an existing draft",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId/drafts/:draftId/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId",
                "drafts",
                ":draftId",
                "send"
              ]
            },
            "description": "Sends a previously created Gmail draft — the \"approve by sending\" pattern: one key creates drafts (drafts.write), a human or a key with drafts.send releases them. Sending is irreversible; use an `Idempotency-Key`."
          }
        },
        {
          "name": "Reply to a thread (recipients derived from the thread)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email-threads/:threadId/reply",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email-threads",
                ":threadId",
                "reply"
              ]
            },
            "description": "Sends a reply where you control ONLY the body — recipients are derived server-side from the thread (honouring Reply-To; `mode: reply_all` keeps the To/Cc audience) and cannot be supplied. Content can never leave the thread’s existing audience, making this the safe send scope for agents. Sending is irreversible; use an `Idempotency-Key`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Compose and send an email",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email",
                "send"
              ]
            },
            "description": "Sends a new message to arbitrary recipients from the key owner’s mailbox (optionally onto an existing thread via `thread_id`). The highest-risk email scope — grant it deliberately. Sending is irreversible; use an `Idempotency-Key`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Create a new draft",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/email/drafts",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "email",
                "drafts"
              ]
            },
            "description": "Creates a brand-new Gmail draft (a fresh conversation, not attached to any thread). `to` and `subject` are required; the body may be empty. The draft lives in Gmail — the user can edit, send or delete it there (or an API key with drafts.send can send it). This scope can never send mail. Send an `Idempotency-Key` header so retries don’t create duplicate drafts. To draft a reply onto an existing conversation, use POST /email-threads/{threadId}/drafts instead.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "AI",
      "item": [
        {
          "name": "Read cached AI analyses for a thread",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/ai/analyses",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "ai",
                "analyses"
              ],
              "query": [
                {
                  "key": "thread_id",
                  "value": "",
                  "description": "Provider thread id",
                  "disabled": false
                }
              ]
            },
            "description": "The cached AI analyses (status, urgency, sentiment, classification) for a thread, if any. Returns instantly and never enqueues work — use classify-thread to request a fresh analysis."
          }
        },
        {
          "name": "Classify a thread (cached or enqueue)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/ai/classify-thread",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "ai",
                "classify-thread"
              ]
            },
            "description": "Returns a cached analysis instantly, or 202 with a poll URL (typically 10–30s)."
          }
        },
        {
          "name": "Poll an AI classification job",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/ai/jobs/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "ai",
                "jobs",
                ":id"
              ]
            },
            "description": "Poll a job returned by classify-thread’s 202 (`poll_url`) until its status is no longer queued/processing, then read the result."
          }
        }
      ]
    }
  ]
}