{
  "info": {
    "_postman_id": "chatlane-api-v1",
    "name": "Chatlane API",
    "description": "Chatlane REST API v1 — manage conversations, messages, contacts, and custom entity records.\n\nReplace `{{api_token}}` with your token (Settings → API Tokens). All endpoints are scoped to the team the token belongs to.\n\nDocs: https://chatlane.io/docs/api-documentation",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      { "key": "token", "value": "{{api_token}}", "type": "string" }
    ]
  },
  "variable": [
    { "key": "base_url", "value": "https://chatlane.io/api/v1", "type": "string" },
    { "key": "api_token", "value": "your-api-token", "type": "string" }
  ],
  "item": [
    {
      "name": "Conversations",
      "item": [
        {
          "name": "List conversations",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/conversations?status=active&limit=50",
              "host": ["{{base_url}}"],
              "path": ["conversations"],
              "query": [
                { "key": "status", "value": "active", "description": "active | pending | closed" },
                { "key": "inbox_id", "value": "1", "disabled": true },
                { "key": "created_after", "value": "2026-01-26T00:00:00Z", "disabled": true },
                { "key": "limit", "value": "50" },
                { "key": "offset", "value": "0", "disabled": true }
              ]
            },
            "description": "Returns a paginated list of conversations. Supports filtering by inbox, status, and creation time for efficient polling."
          }
        },
        {
          "name": "Get conversation",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/conversations/:id",
              "host": ["{{base_url}}"],
              "path": ["conversations", ":id"],
              "variable": [{ "key": "id", "value": "1", "description": "Conversation ID" }]
            },
            "description": "Fetch a single conversation with its full message thread."
          }
        },
        {
          "name": "Create conversation",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"inbox_id\": 1,\n  \"contact_id\": 123,\n  \"subject\": \"New conversation\",\n  \"body\": \"Initial message content\",\n  \"status\": \"active\",\n  \"tags\": [\"vip\", \"billing\"]\n}"
            },
            "url": {
              "raw": "{{base_url}}/conversations",
              "host": ["{{base_url}}"],
              "path": ["conversations"]
            },
            "description": "Create a conversation in an inbox. Optionally seed it with an initial email message via the `body` field."
          }
        }
      ]
    },
    {
      "name": "Messages",
      "item": [
        {
          "name": "List messages",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/messages?conversation_id=1",
              "host": ["{{base_url}}"],
              "path": ["messages"],
              "query": [
                { "key": "conversation_id", "value": "1" },
                { "key": "inbox_id", "value": "1", "disabled": true },
                { "key": "type", "value": "email", "disabled": true, "description": "email | sms | whatsapp | note | phone_call | facebook | instagram" },
                { "key": "created_after", "value": "2026-01-26T00:00:00Z", "disabled": true },
                { "key": "limit", "value": "50", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "Get message",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/messages/:id",
              "host": ["{{base_url}}"],
              "path": ["messages", ":id"],
              "variable": [{ "key": "id", "value": "1" }]
            }
          }
        },
        {
          "name": "Create message",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"body\": \"Thank you for your inquiry!\",\n  \"type\": \"email\",\n  \"is_draft\": false\n}"
            },
            "url": {
              "raw": "{{base_url}}/conversations/:conversationId/messages",
              "host": ["{{base_url}}"],
              "path": ["conversations", ":conversationId", "messages"],
              "variable": [{ "key": "conversationId", "value": "1" }]
            },
            "description": "Send a message into an existing conversation, or save it as a draft for the team to send later."
          }
        }
      ]
    },
    {
      "name": "Contacts",
      "item": [
        {
          "name": "List contacts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/contacts?limit=50",
              "host": ["{{base_url}}"],
              "path": ["contacts"],
              "query": [
                { "key": "search", "value": "john", "disabled": true },
                { "key": "limit", "value": "50" },
                { "key": "offset", "value": "0", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "Get contact",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/contacts/:id",
              "host": ["{{base_url}}"],
              "path": ["contacts", ":id"],
              "variable": [{ "key": "id", "value": "1" }]
            }
          }
        },
        {
          "name": "Create contact",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\",\n  \"phone\": \"+15551234567\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/contacts",
              "host": ["{{base_url}}"],
              "path": ["contacts"]
            }
          }
        },
        {
          "name": "Update contact",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"John A. Doe\",\n  \"email\": \"john.doe@example.com\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/contacts/:id",
              "host": ["{{base_url}}"],
              "path": ["contacts", ":id"],
              "variable": [{ "key": "id", "value": "1" }]
            }
          }
        }
      ]
    },
    {
      "name": "Custom entity records",
      "item": [
        {
          "name": "List records",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/custom-entities/:entity/records",
              "host": ["{{base_url}}"],
              "path": ["custom-entities", ":entity", "records"],
              "variable": [{ "key": "entity", "value": "orders" }]
            }
          }
        },
        {
          "name": "Get record",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/custom-entities/:entity/records/:id",
              "host": ["{{base_url}}"],
              "path": ["custom-entities", ":entity", "records", ":id"],
              "variable": [
                { "key": "entity", "value": "orders" },
                { "key": "id", "value": "1" }
              ]
            }
          }
        },
        {
          "name": "Create record",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"data\": {\n    \"order_number\": \"ORD-1001\",\n    \"status\": \"shipped\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/custom-entities/:entity/records",
              "host": ["{{base_url}}"],
              "path": ["custom-entities", ":entity", "records"],
              "variable": [{ "key": "entity", "value": "orders" }]
            }
          }
        },
        {
          "name": "Update record",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"data\": {\n    \"status\": \"delivered\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/custom-entities/:entity/records/:id",
              "host": ["{{base_url}}"],
              "path": ["custom-entities", ":entity", "records", ":id"],
              "variable": [
                { "key": "entity", "value": "orders" },
                { "key": "id", "value": "1" }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Inboxes",
      "item": [
        {
          "name": "List inboxes",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/inboxes",
              "host": ["{{base_url}}"],
              "path": ["inboxes"]
            }
          }
        },
        {
          "name": "Get inbox",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/inboxes/:id",
              "host": ["{{base_url}}"],
              "path": ["inboxes", ":id"],
              "variable": [{ "key": "id", "value": "1" }]
            }
          }
        }
      ]
    }
  ]
}
