{
  "info": {
    "name": "DISKA API (en)",
    "description": "Every DISKA API endpoint on its own page: parameters, schemas, examples in four languages and a form to try it.\n\nhttps://docs.diska.ai/en/api/reference (OpenAPI 1.4.0)",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.diska.ai"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "agent_id",
      "value": ""
    },
    {
      "key": "call_id",
      "value": ""
    },
    {
      "key": "campaign_id",
      "value": ""
    },
    {
      "key": "chat_id",
      "value": ""
    },
    {
      "key": "endpoint_id",
      "value": ""
    },
    {
      "key": "knowledge_base_id",
      "value": ""
    },
    {
      "key": "outbound_call_id",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Identity",
      "description": "Check that the key works and see the organization it belongs to.",
      "item": [
        {
          "name": "Get the key and organization",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "me"
              ]
            },
            "description": "Returns the organization and the API key behind the request. It needs no scope: use it to check that the key works. scopes: [] means full access.\n\nScope: none — any valid key\n\nhttps://docs.diska.ai/en/api/reference/identity/get-identity"
          }
        }
      ]
    },
    {
      "name": "Agents",
      "description": "List, read, create and publish agents. The agent's internal configuration (prompt, flows, voice and actions) is not exposed: edit it in the backoffice.",
      "item": [
        {
          "name": "List agents",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/agents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "agents"
              ],
              "query": [
                {
                  "key": "agent_type",
                  "value": "",
                  "disabled": true,
                  "description": "Only agents of this type."
                },
                {
                  "key": "status",
                  "value": "",
                  "disabled": true,
                  "description": "Only agents in this state. Use `archived` to see archived agents."
                },
                {
                  "key": "search",
                  "value": "",
                  "disabled": true,
                  "description": "Text contained in the name."
                }
              ]
            },
            "description": "Lists the organization's agents, most recently changed first. Without the status filter, archived agents are left out. The list is not paginated.\n\nScope: agents:read\n\nhttps://docs.diska.ai/en/api/reference/agents/list-agents"
          }
        },
        {
          "name": "Get an agent",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/agents/:agent_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "agents",
                ":agent_id"
              ],
              "variable": [
                {
                  "key": "agent_id",
                  "value": "{{agent_id}}",
                  "description": "The agent's ID."
                }
              ]
            },
            "description": "Returns one of the organization's agents with the configuration you can edit (configuration): prompt, greeting, language, personality, objections, notes and knowledge bases. It is the draft — what the next publish freezes. has_unpublished_changes says whether it differs from the published version.\n\nScope: agents:read\n\nhttps://docs.diska.ai/en/api/reference/agents/get-agent"
          }
        },
        {
          "name": "Update an agent",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/agents/:agent_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "agents",
                ":agent_id"
              ],
              "variable": [
                {
                  "key": "agent_id",
                  "value": "{{agent_id}}",
                  "description": "The agent's ID."
                }
              ]
            },
            "description": "Changes the agent's draft: only the fields you send change, and null clears the optional texts. Calls keep using the published version until you publish. Voice, engine and actions are edited in the backoffice. Flow Builder agents take their text from their flows, so prompt is refused. If two changes arrive at once, the last one wins.\n\nScope: agents:write\n\nhttps://docs.diska.ai/en/api/reference/agents/update-agent",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"prompt\": \"És a recepcionista da Clínica Sol. Marca consultas de segunda a sexta.\",\n  \"greeting\": {\n    \"mode\": \"agent_first\",\n    \"message\": \"Clínica Sol, bom dia!\"\n  },\n  \"language\": \"pt-PT\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Create an agent",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/agents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "agents"
              ]
            },
            "description": "Creates an agent, blank or from a Diska template (template_id). The agent starts as a draft (status: draft): publish it to make it available on your channels. The DISKA API does not list templates.\n\nScope: agents:write\n\nhttps://docs.diska.ai/en/api/reference/agents/create-agent",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Recepção\",\n  \"agent_type\": \"inbound\",\n  \"editing_mode\": \"prompt\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Publish an agent",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/agents/:agent_id/publish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "agents",
                ":agent_id",
                "publish"
              ],
              "variable": [
                {
                  "key": "agent_id",
                  "value": "{{agent_id}}",
                  "description": "The agent's ID."
                }
              ]
            },
            "description": "Publishes the agent's draft as a new version and leaves the agent active. For flow agents it also publishes the main flow and the subflows it uses. If nothing changed since the last publish, no new version is created. The body is optional.\n\nScope: agents:write\n\nhttps://docs.diska.ai/en/api/reference/agents/publish-agent",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"label\": \"Horário de Dezembro\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Calls",
      "description": "The organization's call history and each call's detail: transcript, executed actions and post-call result. To be told when a call ends, use webhooks.",
      "item": [
        {
          "name": "List calls",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/calls?limit=10",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "calls"
              ],
              "query": [
                {
                  "key": "search",
                  "value": "",
                  "disabled": true,
                  "description": "Text in the ID, `external_ref`, caller name or caller contact. Not allowed with `cursor`."
                },
                {
                  "key": "agent_id",
                  "value": "",
                  "disabled": true,
                  "description": "Only calls of this agent."
                },
                {
                  "key": "status",
                  "value": "",
                  "disabled": true,
                  "description": "Only calls in this state."
                },
                {
                  "key": "channel",
                  "value": "",
                  "disabled": true,
                  "description": "Only calls on this channel: `browser_demo` (web call), `phone`, `whatsapp` or `web_chat`."
                },
                {
                  "key": "limit",
                  "value": "10",
                  "disabled": false,
                  "description": "How many calls per page."
                },
                {
                  "key": "offset",
                  "value": "",
                  "disabled": true,
                  "description": "Offset mode: how many calls to skip."
                },
                {
                  "key": "cursor",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor mode: `start` on the first page, then the `next_cursor` you received."
                }
              ]
            },
            "description": "Lists the organization's calls, most recent first. It has two pagination modes: offset (the default, with total) and cursor (cursor=start, then the next_cursor you receive), better for exporting large histories.\n\nScope: calls:read\n\nhttps://docs.diska.ai/en/api/reference/calls/list-calls"
          }
        },
        {
          "name": "Get a call",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/calls/:call_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "calls",
                ":call_id"
              ],
              "variable": [
                {
                  "key": "call_id",
                  "value": "{{call_id}}",
                  "description": "The call's ID (the webhooks' `call_id`)."
                }
              ]
            },
            "description": "Returns a call with every field of the list plus the transcript (messages), the executed actions (tool_calls), the post-call result (post_call) and the recording state. The recording audio is not returned: listen to it in History.\n\nScope: calls:read\n\nhttps://docs.diska.ai/en/api/reference/calls/get-call"
          }
        },
        {
          "name": "Download the recording",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/calls/:call_id/recording?format=json",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "calls",
                ":call_id",
                "recording"
              ],
              "query": [
                {
                  "key": "format",
                  "value": "json",
                  "disabled": false,
                  "description": "`redirect` (the default) or `json`."
                }
              ],
              "variable": [
                {
                  "key": "call_id",
                  "value": "{{call_id}}",
                  "description": "The call's ID."
                }
              ]
            },
            "description": "Gives the call's recording. By default it answers 302 to a signed link that lasts 5 minutes (curl -L -o recording.webm … follows it and saves the audio). With ?format=json it returns the link as JSON. Ask for a new link whenever you need the audio instead of storing it. Every access is recorded in the audit log.\n\nScope: recordings:read\n\nhttps://docs.diska.ai/en/api/reference/calls/get-call-recording"
          }
        }
      ]
    },
    {
      "name": "Outbound calls",
      "description": "The agent calls a person when your system asks, from the agent's DISKA number. Only published outbound agents, Angolan mobiles, within contact hours (08:00–20:00) and outside the do-not-call list. Available once Diska switches API calls on for the organization.",
      "item": [
        {
          "name": "Make an outbound call",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/outbound-calls",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "outbound-calls"
              ]
            },
            "description": "The agent calls the person now, from the agent's DISKA number. The response carries the request's id, in state queued. Follow it with Get an outbound call: once the agent's session starts, the call_id appears — the same as in GET /v1/calls and in webhooks. The agent receives the call context from the platform: it is an outbound call, the reason (purpose) and the contact's name. Send Idempotency-Key to retry the request without calling twice.\n\nScope: calls:write\n\nhttps://docs.diska.ai/en/api/reference/outbound-calls/create-outbound-call",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"agent_id\": \"3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40\",\n  \"to\": \"+244923000000\",\n  \"contact_name\": \"Ana Silva\",\n  \"purpose\": \"Lembrete da consulta de sexta-feira\",\n  \"variables\": {\n    \"consulta\": \"sexta, 10h\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get an outbound call",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/outbound-calls/:outbound_call_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "outbound-calls",
                ":outbound_call_id"
              ],
              "variable": [
                {
                  "key": "outbound_call_id",
                  "value": "{{outbound_call_id}}",
                  "description": "The `id` returned when you created the call."
                }
              ]
            },
            "description": "The request's state: queued (sent to the switch), ringing, in_progress (answered), ended, failed (with failure_code and failure_message) or cancelled. It stays available for 24 hours; after that, use the call_id.\n\nScope: calls:read\n\nhttps://docs.diska.ai/en/api/reference/outbound-calls/get-outbound-call"
          }
        },
        {
          "name": "Hang up an outbound call",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/outbound-calls/:outbound_call_id/hangup",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "outbound-calls",
                ":outbound_call_id",
                "hangup"
              ],
              "variable": [
                {
                  "key": "outbound_call_id",
                  "value": "{{outbound_call_id}}",
                  "description": "The `id` returned when you created the call."
                }
              ]
            },
            "description": "Cancels a call that is still ringing, or ends one in progress. On a call that already ended it does nothing.\n\nScope: calls:write\n\nhttps://docs.diska.ai/en/api/reference/outbound-calls/hang-up-outbound-call"
          }
        }
      ]
    },
    {
      "name": "Campaigns",
      "description": "Outbound calls in bulk: create the campaign, add recipients and start it. Diska dials within the windows and limits you set, and each call shows up in Calls and in webhooks. It works like the backoffice Campaigns.",
      "item": [
        {
          "name": "List campaigns",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "",
                  "disabled": true,
                  "description": "Only campaigns in this state."
                },
                {
                  "key": "limit",
                  "value": "",
                  "disabled": true,
                  "description": "How many per page."
                },
                {
                  "key": "offset",
                  "value": "",
                  "disabled": true,
                  "description": "How many to skip."
                }
              ]
            },
            "description": "Lists the organization's campaigns, newest first, with each one's indicators.\n\nScope: campaigns:read\n\nhttps://docs.diska.ai/en/api/reference/campaigns/list-campaigns"
          }
        },
        {
          "name": "Create a campaign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns"
              ]
            },
            "description": "Creates the campaign as a draft (draft). The agent must be outbound and published, and phone_number_id an active DISKA line of the organization (see List phone numbers). Windows must sit within contact hours (08:00–20:00). Then add recipients and start it. Send Idempotency-Key to retry the request without creating two.\n\nScope: campaigns:write\n\nhttps://docs.diska.ai/en/api/reference/campaigns/create-campaign",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Lembretes de Novembro\",\n  \"agent_id\": \"3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40\",\n  \"phone_number_id\": \"5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93\",\n  \"schedule\": {\n    \"timezone\": \"Africa/Luanda\",\n    \"windows\": [\n      {\n        \"day\": \"monday\",\n        \"start\": \"09:00\",\n        \"end\": \"12:00\"\n      },\n      {\n        \"day\": \"monday\",\n        \"start\": \"14:00\",\n        \"end\": \"18:00\"\n      }\n    ]\n  },\n  \"limits\": {\n    \"max_concurrency\": 2,\n    \"max_attempts\": 2,\n    \"retry_delay_minutes\": 60\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get a campaign",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:campaign_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":campaign_id"
              ],
              "variable": [
                {
                  "key": "campaign_id",
                  "value": "{{campaign_id}}",
                  "description": "The campaign's ID."
                }
              ]
            },
            "description": "The campaign with its indicators (stats) and, when it is waiting, the reason (waiting_reason) and the next window (next_window_at).\n\nScope: campaigns:read\n\nhttps://docs.diska.ai/en/api/reference/campaigns/get-campaign"
          }
        },
        {
          "name": "Add recipients",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:campaign_id/recipients",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":campaign_id",
                "recipients"
              ],
              "variable": [
                {
                  "key": "campaign_id",
                  "value": "{{campaign_id}}",
                  "description": "The campaign's ID."
                }
              ]
            },
            "description": "Adds up to 1000 recipients per request (up to 5000 per campaign). Repeated numbers and repeated external_id values are skipped, so you can retry the request. Numbers on the do-not-call list become excluded. The response counts what was added, duplicated, excluded and invalid (with each one's reason).\n\nScope: campaigns:write\n\nhttps://docs.diska.ai/en/api/reference/campaigns/add-campaign-recipients",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"recipients\": [\n    {\n      \"phone\": \"+244923000000\",\n      \"name\": \"Ana Silva\",\n      \"external_id\": \"crm-1042\",\n      \"variables\": {\n        \"consulta\": \"sexta, 10h\"\n      }\n    },\n    {\n      \"phone\": \"+244924000000\",\n      \"name\": \"João Neto\",\n      \"external_id\": \"crm-1043\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "List recipients",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:campaign_id/recipients",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":campaign_id",
                "recipients"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "",
                  "disabled": true,
                  "description": "Only recipients in this state."
                },
                {
                  "key": "limit",
                  "value": "",
                  "disabled": true,
                  "description": "How many per page."
                },
                {
                  "key": "offset",
                  "value": "",
                  "disabled": true,
                  "description": "How many to skip."
                }
              ],
              "variable": [
                {
                  "key": "campaign_id",
                  "value": "{{campaign_id}}",
                  "description": "The campaign's ID."
                }
              ]
            },
            "description": "The recipients with their state, the call outcome (outcome), the attempts and the call's call_session_id (the id of GET /v1/calls/{call_id}).\n\nScope: campaigns:read\n\nhttps://docs.diska.ai/en/api/reference/campaigns/list-campaign-recipients"
          }
        },
        {
          "name": "Start a campaign",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:campaign_id/start",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":campaign_id",
                "start"
              ],
              "variable": [
                {
                  "key": "campaign_id",
                  "value": "{{campaign_id}}",
                  "description": "The campaign's ID."
                }
              ]
            },
            "description": "Moves a draft to scheduled: Diska starts dialling once the start date, the window and free capacity allow. It needs at least one recipient still to call.\n\nScope: campaigns:write\n\nhttps://docs.diska.ai/en/api/reference/campaigns/start-campaign"
          }
        },
        {
          "name": "Pause a campaign",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:campaign_id/pause",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":campaign_id",
                "pause"
              ],
              "variable": [
                {
                  "key": "campaign_id",
                  "value": "{{campaign_id}}",
                  "description": "The campaign's ID."
                }
              ]
            },
            "description": "Stops starting new calls; calls in progress continue and the recipients left to call wait.\n\nScope: campaigns:write\n\nhttps://docs.diska.ai/en/api/reference/campaigns/pause-campaign"
          }
        },
        {
          "name": "Resume a campaign",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:campaign_id/resume",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":campaign_id",
                "resume"
              ],
              "variable": [
                {
                  "key": "campaign_id",
                  "value": "{{campaign_id}}",
                  "description": "The campaign's ID."
                }
              ]
            },
            "description": "A paused campaign goes back to scheduled and continues with the recipients left to call, within windows and capacity.\n\nScope: campaigns:write\n\nhttps://docs.diska.ai/en/api/reference/campaigns/resume-campaign"
          }
        },
        {
          "name": "Cancel a campaign",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:campaign_id/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":campaign_id",
                "cancel"
              ],
              "variable": [
                {
                  "key": "campaign_id",
                  "value": "{{campaign_id}}",
                  "description": "The campaign's ID."
                }
              ]
            },
            "description": "Stops the campaign for good: recipients left to call become cancelled and calls already connected are not hung up. It cannot be undone.\n\nScope: campaigns:write\n\nhttps://docs.diska.ai/en/api/reference/campaigns/cancel-campaign"
          }
        }
      ]
    },
    {
      "name": "Chat",
      "description": "Chat by text with a published agent from your own app or site: create the chat, send messages and get the agent's reply in the same request. The agent uses the same instructions, knowledge and actions as on calls. Available once Diska switches API chat on for the organization.",
      "item": [
        {
          "name": "Create a chat",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/chats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "chats"
              ]
            },
            "description": "Opens a chat with a published prompt-mode agent. If the agent speaks first and has a greeting, the response already carries that message. The chat also shows in GET /v1/calls, with channel web_chat. metadata is yours: it is stored and returned, but the agent never sees it. Send Idempotency-Key to retry the request without opening two chats.\n\nScope: chats:write\n\nhttps://docs.diska.ai/en/api/reference/chats/create-chat",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"agent_id\": \"3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40\",\n  \"contact\": \"+244923000000\",\n  \"variables\": {\n    \"nome\": \"Ana\"\n  },\n  \"metadata\": {\n    \"crm_ticket\": \"T-1042\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Send a message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/chats/:chat_id/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "chats",
                ":chat_id",
                "messages"
              ],
              "variable": [
                {
                  "key": "chat_id",
                  "value": "{{chat_id}}",
                  "description": "The chat's ID."
                }
              ]
            },
            "description": "Sends the person's message and returns the agent's reply (reply) in the same request, usually within a few seconds. One message at a time per chat. If the agent concludes the chat, chat.status becomes ended. The agent's actions (for example, booking a meeting) run for real and ask for confirmation as on calls.\n\nScope: chats:write\n\nhttps://docs.diska.ai/en/api/reference/chats/send-chat-message",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"message\": \"Queria marcar uma consulta para sexta-feira.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get a chat",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/chats/:chat_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "chats",
                ":chat_id"
              ],
              "variable": [
                {
                  "key": "chat_id",
                  "value": "{{chat_id}}",
                  "description": "The chat's ID."
                }
              ]
            },
            "description": "The chat with every message, in order.\n\nScope: chats:write\n\nhttps://docs.diska.ai/en/api/reference/chats/get-chat"
          }
        },
        {
          "name": "List chats",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/chats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "chats"
              ],
              "query": [
                {
                  "key": "agent_id",
                  "value": "",
                  "disabled": true,
                  "description": "Only chats with this agent."
                },
                {
                  "key": "status",
                  "value": "",
                  "disabled": true,
                  "description": "`active` or `ended`."
                },
                {
                  "key": "limit",
                  "value": "",
                  "disabled": true,
                  "description": "How many per page."
                },
                {
                  "key": "offset",
                  "value": "",
                  "disabled": true,
                  "description": "How many to skip."
                }
              ]
            },
            "description": "Chats opened through the API, newest first, without their messages.\n\nScope: chats:write\n\nhttps://docs.diska.ai/en/api/reference/chats/list-chats"
          }
        },
        {
          "name": "End a chat",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/chats/:chat_id/end",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "chats",
                ":chat_id",
                "end"
              ],
              "variable": [
                {
                  "key": "chat_id",
                  "value": "{{chat_id}}",
                  "description": "The chat's ID."
                }
              ]
            },
            "description": "Ends the chat. The same processing as a completed call then runs — extractions, evaluations and summary — and the call.completed webhook is sent. A chat with no messages for 30 minutes ends by itself, the same way. Ending a chat that already ended does nothing.\n\nScope: chats:write\n\nhttps://docs.diska.ai/en/api/reference/chats/end-chat"
          }
        }
      ]
    },
    {
      "name": "Analytics",
      "description": "The same summary as the backoffice Análises (Analytics) page: volume, outcomes, sentiment and performance per agent.",
      "item": [
        {
          "name": "Analytics overview",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/analytics/overview?period=weekly",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "analytics",
                "overview"
              ],
              "query": [
                {
                  "key": "period",
                  "value": "weekly",
                  "disabled": false,
                  "description": "`daily` (last 24 hours), `weekly` (last 7 days) or `monthly` (last 30 days)."
                },
                {
                  "key": "agent_id",
                  "value": "",
                  "disabled": true,
                  "description": "Only this agent."
                },
                {
                  "key": "agent_type",
                  "value": "",
                  "disabled": true,
                  "description": "`all`, `inbound` or `outbound`."
                }
              ]
            },
            "description": "The summary of a window that ends when you make the request, compared with the previous window of the same size. Daily dates are in UTC.\n\nScope: analytics:read\n\nhttps://docs.diska.ai/en/api/reference/analytics/get-overview"
          }
        }
      ]
    },
    {
      "name": "Phone numbers",
      "description": "The organization's phone number inventory: DISKA numbers and your own numbers connected over SIP.",
      "item": [
        {
          "name": "List phone numbers",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/phone-numbers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "phone-numbers"
              ],
              "query": [
                {
                  "key": "search",
                  "value": "",
                  "disabled": true,
                  "description": "Text in the number, the name or the SIP domain."
                },
                {
                  "key": "number_type",
                  "value": "",
                  "disabled": true,
                  "description": "`purchased` (DISKA numbers) or `imported` (your own numbers over SIP)."
                }
              ]
            },
            "description": "The organization's phone number inventory. Numbers imported over SIP also carry the trunk fields; the SIP password is never returned, only sip_password_configured.\n\nScope: phone-numbers:read\n\nhttps://docs.diska.ai/en/api/reference/phone-numbers/list-phone-numbers"
          }
        }
      ]
    },
    {
      "name": "Knowledge",
      "description": "Create knowledge bases and add text, web pages and PDFs to them. For an agent to use a base, assign it in the backoffice.",
      "item": [
        {
          "name": "List knowledge bases",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/knowledge-bases",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "knowledge-bases"
              ],
              "query": [
                {
                  "key": "search",
                  "value": "",
                  "disabled": true,
                  "description": "Text contained in the name or the instruction."
                }
              ]
            },
            "description": "Lists the organization's knowledge bases.\n\nScope: knowledge:read\n\nhttps://docs.diska.ai/en/api/reference/knowledge/list-knowledge-bases"
          }
        },
        {
          "name": "Create a knowledge base",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/knowledge-bases",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "knowledge-bases"
              ]
            },
            "description": "Creates an empty knowledge base. Add documents with the three endpoints that follow and assign the base to an agent in the backoffice.\n\nScope: knowledge:write\n\nhttps://docs.diska.ai/en/api/reference/knowledge/create-knowledge-base",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Produtos e preços\",\n  \"instruction\": \"Use esta base para responder a perguntas sobre produtos, preços e horários.\",\n  \"description\": \"Tabela de preços e horários de 2026.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Add a text document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/knowledge-bases/:knowledge_base_id/documents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "knowledge-bases",
                ":knowledge_base_id",
                "documents"
              ],
              "variable": [
                {
                  "key": "knowledge_base_id",
                  "value": "{{knowledge_base_id}}",
                  "description": "The knowledge base's ID."
                }
              ]
            },
            "description": "Adds a text document to the base. Indexing starts right away; the document is ready when indexing_status is indexed.\n\nScope: knowledge:write\n\nhttps://docs.diska.ai/en/api/reference/knowledge/add-text-document",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Horários\",\n  \"content\": \"Abrimos de segunda a sexta, das 8h às 17h.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Import a web page",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/knowledge-bases/:knowledge_base_id/documents/url",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "knowledge-bases",
                ":knowledge_base_id",
                "documents",
                "url"
              ],
              "variable": [
                {
                  "key": "knowledge_base_id",
                  "value": "{{knowledge_base_id}}",
                  "description": "The knowledge base's ID."
                }
              ]
            },
            "description": "Imports the text of a public web page. The page must answer within 15 seconds, be up to 2 MB and be HTML, text or JSON. Private or internal addresses are refused, and at most 3 redirects are followed.\n\nScope: knowledge:write\n\nhttps://docs.diska.ai/en/api/reference/knowledge/import-url",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Página de preços\",\n  \"url\": \"https://www.exemplo.ao/precos\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Upload a PDF",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/knowledge-bases/:knowledge_base_id/documents/pdf",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "knowledge-bases",
                ":knowledge_base_id",
                "documents",
                "pdf"
              ],
              "variable": [
                {
                  "key": "knowledge_base_id",
                  "value": "{{knowledge_base_id}}",
                  "description": "The knowledge base's ID."
                }
              ]
            },
            "description": "Uploads a PDF as multipart/form-data, in the file field (up to 25 MB).\n\nScope: knowledge:write\n\nhttps://docs.diska.ai/en/api/reference/knowledge/upload-pdf",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": "tabela-de-precos.pdf",
                  "description": "PDF"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "description": "Register and manage the endpoints that receive each completed call's data. Deliveries, events and signatures are covered in Webhooks.",
      "item": [
        {
          "name": "List webhook endpoints",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhook-endpoints",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhook-endpoints"
              ]
            },
            "description": "Lists the organization's endpoints, active and inactive, newest first.\n\nScope: webhooks:manage\n\nhttps://docs.diska.ai/en/api/reference/webhooks/list-webhook-endpoints"
          }
        },
        {
          "name": "Create a webhook endpoint",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhook-endpoints",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhook-endpoints"
              ]
            },
            "description": "Registers an https:// URL that starts receiving the subscribed events. The response carries the secret (dskw_…) to verify signatures: it only appears in this response. Each organization can have up to 10 endpoints.\n\nScope: webhooks:manage\n\nhttps://docs.diska.ai/en/api/reference/webhooks/create-webhook-endpoint",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://o-seu-sistema.com/hooks/diska\",\n  \"description\": \"CRM — produção\",\n  \"events\": [\n    \"call.completed\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Update a webhook endpoint",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhook-endpoints/:endpoint_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhook-endpoints",
                ":endpoint_id"
              ],
              "variable": [
                {
                  "key": "endpoint_id",
                  "value": "{{endpoint_id}}",
                  "description": "The endpoint's ID."
                }
              ]
            },
            "description": "Changes only the fields you send. active: true re-enables a disabled endpoint and resets failure_count; active: false stops deliveries. The secret does not change.\n\nScope: webhooks:manage\n\nhttps://docs.diska.ai/en/api/reference/webhooks/update-webhook-endpoint",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"active\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete a webhook endpoint",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhook-endpoints/:endpoint_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhook-endpoints",
                ":endpoint_id"
              ],
              "variable": [
                {
                  "key": "endpoint_id",
                  "value": "{{endpoint_id}}",
                  "description": "The endpoint's ID."
                }
              ]
            },
            "description": "Removes the endpoint and returns it as it was. Deliveries stop at once.\n\nScope: webhooks:manage\n\nhttps://docs.diska.ai/en/api/reference/webhooks/delete-webhook-endpoint"
          }
        },
        {
          "name": "Test a webhook endpoint",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhook-endpoints/:endpoint_id/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhook-endpoints",
                ":endpoint_id",
                "test"
              ],
              "variable": [
                {
                  "key": "endpoint_id",
                  "value": "{{endpoint_id}}",
                  "description": "The endpoint's ID."
                }
              ]
            },
            "description": "Sends a signed ping event to the endpoint's URL, with the same headers and retry rules as real deliveries. It works even when the endpoint is disabled, and a failed test does not count towards automatic disabling.\n\nScope: webhooks:manage\n\nhttps://docs.diska.ai/en/api/reference/webhooks/test-webhook-endpoint"
          }
        }
      ]
    }
  ]
}
