{
  "info": {
    "_postman_id": "fa7496e4-ae84-4306-af41-bd658800392e",
    "name": "Wetel API",
    "description": "The Wetel GraphQL operations, one request each, grouped by capability.\n\n1. Import wetel.postman_environment.json too and select it.\n2. Fill in `apiKey` (and `jwt` for the dashboard operations, `agentId` for sdkStart).\n3. Run sdkStart first: its test script saves `sessionId` and `avatarToken` for the next requests.\n\nEvery request sends `x-huat-platform: {{platform}}`. Guide: https://wetel.dev/docs/developer-portal/quickstart/",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Sessions and messages",
      "description": "Start a conversation with an agent, send messages, read the replies and end it.",
      "item": [
        {
          "id": "61025da8-5156-480b-a00a-593d221aea07",
          "name": "sdkStart",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"sessionId\", get(json, \"data.sdkStart.sessionId\"));",
                  "store(\"avatarToken\", get(json, \"data.sdkStart.avatarToken\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "apikey",
              "apikey": [
                { "key": "key", "value": "X-Api-Key", "type": "string" },
                { "key": "value", "value": "{{apiKey}}", "type": "string" },
                { "key": "in", "value": "header", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation StartSession($input: SdkStartInput!) {\n  sdkStart(input: $input) {\n    sessionId\n    avatarToken\n    agentId\n    graphqlEndpoint\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"agentId\": {{agentId}},\n    \"clientId\": \"{{clientId}}\",\n    \"context\": {\n      \"ticketId\": \"T-1001\",\n      \"product\": \"laptop\"\n    }\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Start a session against an agent and receive its session token.\n\nCredential: API key. `X-Api-Key: sk_...`, kept on your server only.\n- Call it from your server only. The API key must never reach a browser or a mobile app.\n- `clientId` is your own identifier for the end user or conversation. Give each conversation its own value (for example the ticket number) if you plan to poll with `sessionsByExternalCustomerId`.\n- `context` is an optional flat JSON object (at most 32 keys, scalar values, 8 KB) that every workflow turn can read as `session.context`. Never put secrets in it.\n- Starting a session can send the agent's opening greeting, which is a metered model call.\n- Limited to 30 calls per minute per client IP.\n\nReference: https://wetel.dev/docs/developer-portal/reference/sessions/"
          },
          "response": [
            {
              "id": "10928f7f-f451-41e5-a28d-6304c1d7b71a",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartSession($input: SdkStartInput!) {\n  sdkStart(input: $input) {\n    sessionId\n    avatarToken\n    agentId\n    graphqlEndpoint\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"ticket-1001\",\n    \"context\": {\n      \"ticketId\": \"T-1001\",\n      \"product\": \"laptop\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"sdkStart\": {\n      \"sessionId\": 4211,\n      \"avatarToken\": \"example-avatar-token-not-real\",\n      \"agentId\": 7,\n      \"graphqlEndpoint\": \"https://api.wetel.dev/graphql\"\n    }\n  }\n}"
            },
            {
              "id": "9713db63-0896-4081-ae2f-18ce27065501",
              "name": "UNAUTHENTICATED: Missing API key",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartSession($input: SdkStartInput!) {\n  sdkStart(input: $input) {\n    sessionId\n    avatarToken\n    agentId\n    graphqlEndpoint\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"ticket-1001\",\n    \"context\": {\n      \"ticketId\": \"T-1001\",\n      \"product\": \"laptop\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Missing X-Api-Key header\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkStart\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Missing X-Api-Key header\",\n          \"error\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "ccf3fee7-23da-4319-ac8f-c6ec9e8ee23c",
              "name": "UNAUTHENTICATED: Unknown or revoked API key",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartSession($input: SdkStartInput!) {\n  sdkStart(input: $input) {\n    sessionId\n    avatarToken\n    agentId\n    graphqlEndpoint\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"ticket-1001\",\n    \"context\": {\n      \"ticketId\": \"T-1001\",\n      \"product\": \"laptop\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Invalid API key\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkStart\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Invalid API key\",\n          \"error\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "13e0346d-bbba-4031-aa1a-262177d41bab",
              "name": "NOT_FOUND: Agent not found in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartSession($input: SdkStartInput!) {\n  sdkStart(input: $input) {\n    sessionId\n    avatarToken\n    agentId\n    graphqlEndpoint\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"ticket-1001\",\n    \"context\": {\n      \"ticketId\": \"T-1001\",\n      \"product\": \"laptop\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Agent #7 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkStart\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Agent #7 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "97c0a08c-dc67-46b6-a5cc-2d5169285b77",
              "name": "FORBIDDEN: Platform header missing",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartSession($input: SdkStartInput!) {\n  sdkStart(input: $input) {\n    sessionId\n    avatarToken\n    agentId\n    graphqlEndpoint\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"ticket-1001\",\n    \"context\": {\n      \"ticketId\": \"T-1001\",\n      \"product\": \"laptop\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Platform is not specified!\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkStart\"\n      ],\n      \"extensions\": {\n        \"code\": \"FORBIDDEN\",\n        \"originalError\": {\n          \"message\": \"Platform is not specified!\",\n          \"error\": \"Forbidden\",\n          \"statusCode\": 403\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "e9010262-dc75-4111-aec5-64d0899a4f13",
              "name": "BAD_USER_INPUT: Unknown field in the input",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartSession($input: SdkStartInput!) {\n  sdkStart(input: $input) {\n    sessionId\n    avatarToken\n    agentId\n    graphqlEndpoint\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"customerId\": \"ticket-1001\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$input\\\" got invalid value { agentId: 7, customerId: \\\"ticket-1001\\\" }; Field \\\"customerId\\\" is not defined by type \\\"SdkStartInput\\\".\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 23\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "id": "09d00aa0-f801-4b47-a150-c0da9497d751",
          "name": "sdkStartVoiceCall",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "apikey",
              "apikey": [
                { "key": "key", "value": "X-Api-Key", "type": "string" },
                { "key": "value", "value": "{{apiKey}}", "type": "string" },
                { "key": "in", "value": "header", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation StartVoiceCall($input: SdkStartVoiceCallInput!) {\n  sdkStartVoiceCall(input: $input) {\n    sessionId\n    agentId\n    livekitUrl\n    livekitToken\n    roomName\n    expiresAt\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"call-0042\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Start a live voice call with an agent and receive the LiveKit URL and join token for the caller.\n\nCredential: API key. `X-Api-Key: sk_...`, kept on your server only.\n- Staging only, on request. Answers FORBIDDEN where voice calls are not enabled; not enabled in production.\n- Call it from your server only. The API key must never reach a browser or a mobile app.\n- The join token is valid to join for about two minutes and carries a session credential that the caller's browser can read. Treat it as belonging to one caller; never log or share it.\n- `context` is an optional flat JSON object exposed to the workflow as `ctx.session.context`, with the same rules as `sdkStart`.\n- Limited to 60 calls per minute per client address and 30 call starts per minute per workspace. The over-limit error may carry no specific code.\n- Capped at 1,000 call requests per API key per UTC day by default. Past it the call is refused with `extensions.status` 429 and the message `Daily voice call limit reached for this API key; try again tomorrow (UTC)`. A call nobody joins is closed as `EXPIRED` within about 15 minutes.\n\nReference: https://wetel.dev/docs/developer-portal/reference/sessions/"
          },
          "response": [
            {
              "id": "51925202-650a-42c9-a4e6-375f04993765",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartVoiceCall($input: SdkStartVoiceCallInput!) {\n  sdkStartVoiceCall(input: $input) {\n    sessionId\n    agentId\n    livekitUrl\n    livekitToken\n    roomName\n    expiresAt\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"call-0042\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"sdkStartVoiceCall\": {\n      \"sessionId\": 4212,\n      \"agentId\": 7,\n      \"livekitUrl\": \"wss://voice.example.com\",\n      \"livekitToken\": \"example-join-token-not-real\",\n      \"roomName\": \"call-4212\",\n      \"expiresAt\": \"2026-10-19T09:02:00.000Z\"\n    }\n  }\n}"
            },
            {
              "id": "734b45ef-04e7-4808-aaa9-740977e9f06a",
              "name": "UNAUTHENTICATED: Missing API key",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartVoiceCall($input: SdkStartVoiceCallInput!) {\n  sdkStartVoiceCall(input: $input) {\n    sessionId\n    agentId\n    livekitUrl\n    livekitToken\n    roomName\n    expiresAt\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"call-0042\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Missing X-Api-Key header\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkStartVoiceCall\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Missing X-Api-Key header\",\n          \"error\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "baf4349e-513e-4af1-a569-af4da666111e",
              "name": "UNAUTHENTICATED: Unknown or revoked API key",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartVoiceCall($input: SdkStartVoiceCallInput!) {\n  sdkStartVoiceCall(input: $input) {\n    sessionId\n    agentId\n    livekitUrl\n    livekitToken\n    roomName\n    expiresAt\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"call-0042\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Invalid API key\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkStartVoiceCall\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Invalid API key\",\n          \"error\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "26265d6b-8aca-43da-a7fa-9b9631340edb",
              "name": "FORBIDDEN: Voice calls not enabled on this environment",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartVoiceCall($input: SdkStartVoiceCallInput!) {\n  sdkStartVoiceCall(input: $input) {\n    sessionId\n    agentId\n    livekitUrl\n    livekitToken\n    roomName\n    expiresAt\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"call-0042\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Voice calls are not enabled on this environment\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkStartVoiceCall\"\n      ],\n      \"extensions\": {\n        \"code\": \"FORBIDDEN\",\n        \"originalError\": {\n          \"message\": \"Voice calls are not enabled on this environment\",\n          \"error\": \"Forbidden\",\n          \"statusCode\": 403\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "98ca47a9-cdf0-409d-abad-3abced54c550",
              "name": "NOT_FOUND: Agent not found in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation StartVoiceCall($input: SdkStartVoiceCallInput!) {\n  sdkStartVoiceCall(input: $input) {\n    sessionId\n    agentId\n    livekitUrl\n    livekitToken\n    roomName\n    expiresAt\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"clientId\": \"call-0042\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Agent #7 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkStartVoiceCall\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Agent #7 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "c1d49334-1eee-4be3-a555-73557e9b98ee",
          "name": "sdkSendMessage",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{avatarToken}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation SendMessage($input: SdkSendMessageInput!) {\n  sdkSendMessage(input: $input)\n}\n",
                "variables": "{\n  \"input\": {\n    \"sessionId\": {{sessionId}},\n    \"text\": \"My laptop cannot connect to the office VPN since this morning.\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Send one user message into the session. Returns true at once; the reply follows asynchronously.\n\nCredential: Session token (avatarToken). `Authorization: Bearer <avatarToken>`, returned by `sdkStart` for one session.\n- `true` is an acknowledgement, not the reply. Read the reply by polling the session's messages or from the `sessionEvents` subscription.\n- `text` holds up to 100,000 characters. It may be empty only when `attachments` has at least one entry.\n- `turnContext` is an optional flat JSON object for this turn only (workflows read it as `turn.context`).\n- The token must belong to the same session as `input.sessionId`.\n\nReference: https://wetel.dev/docs/developer-portal/reference/sessions/"
          },
          "response": [
            {
              "id": "07be08c1-262a-407a-a02c-ef966dd420d9",
              "name": "Success (acknowledgement only)",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation SendMessage($input: SdkSendMessageInput!) {\n  sdkSendMessage(input: $input)\n}\n",
                    "variables": "{\n  \"input\": {\n    \"sessionId\": 4211,\n    \"text\": \"My laptop cannot connect to the office VPN since this morning.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"sdkSendMessage\": true\n  }\n}"
            },
            {
              "id": "18ea7078-d058-4cb9-a358-9e857c45d5be",
              "name": "FORBIDDEN: Token for a different session",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation SendMessage($input: SdkSendMessageInput!) {\n  sdkSendMessage(input: $input)\n}\n",
                    "variables": "{\n  \"input\": {\n    \"sessionId\": 4211,\n    \"text\": \"My laptop cannot connect to the office VPN since this morning.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"This avatar token is not valid for the requested session\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkSendMessage\"\n      ],\n      \"extensions\": {\n        \"code\": \"FORBIDDEN\",\n        \"originalError\": {\n          \"message\": \"This avatar token is not valid for the requested session\",\n          \"error\": \"Forbidden\",\n          \"statusCode\": 403\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "87d6f4db-12fa-451f-a33d-77867fcd8914",
              "name": "UNAUTHENTICATED: Expired or invalid session token",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation SendMessage($input: SdkSendMessageInput!) {\n  sdkSendMessage(input: $input)\n}\n",
                    "variables": "{\n  \"input\": {\n    \"sessionId\": 4211,\n    \"text\": \"My laptop cannot connect to the office VPN since this morning.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Invalid or expired avatar token\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkSendMessage\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Invalid or expired avatar token\",\n          \"error\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "1d719540-9398-4b5a-ad11-0656886d4243",
              "name": "BAD_REQUEST: Session already ended",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation SendMessage($input: SdkSendMessageInput!) {\n  sdkSendMessage(input: $input)\n}\n",
                    "variables": "{\n  \"input\": {\n    \"sessionId\": 4211,\n    \"text\": \"My laptop cannot connect to the office VPN since this morning.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Session 4211 is not active (status: ended)\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkSendMessage\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Session 4211 is not active (status: ended)\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "f84fb1d8-aa6c-4f0e-a56e-ca62c4485d91",
              "name": "UNAUTHENTICATED: No Authorization header",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation SendMessage($input: SdkSendMessageInput!) {\n  sdkSendMessage(input: $input)\n}\n",
                    "variables": "{\n  \"input\": {\n    \"sessionId\": 4211,\n    \"text\": \"My laptop cannot connect to the office VPN since this morning.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Missing or malformed Authorization header\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkSendMessage\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Missing or malformed Authorization header\",\n          \"error\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "f2ca23ec-cd43-427d-aa79-64592e0cd2b6",
          "name": "sessionsByExternalCustomerId",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "apikey",
              "apikey": [
                { "key": "key", "value": "X-Api-Key", "type": "string" },
                { "key": "value", "value": "{{apiKey}}", "type": "string" },
                { "key": "in", "value": "header", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query PollSession($externalCustomerId: String!, $first: Int) {\n  sessionsByExternalCustomerId(externalCustomerId: $externalCustomerId, first: $first) {\n    totalCount\n    edges {\n      node {\n        id\n        status\n        messages {\n          id\n          role\n          text\n          turnIndex\n          createdAt\n        }\n      }\n    }\n  }\n}\n",
                "variables": "{\n  \"externalCustomerId\": \"{{clientId}}\",\n  \"first\": 1\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List the sessions started with one clientId, with their messages. The API-key way to poll for a reply.\n\nCredential: API key. `X-Api-Key: sk_...`, kept on your server only.\n- `externalCustomerId` is the `clientId` you passed to `sdkStart`. Sessions come oldest first; `first` defaults to 20.\n- Messages come oldest first. A reply is a `MODEL` message that follows your `USER` message. Poll every one to two seconds with a timeout; a reply usually takes a few seconds and can take longer when the workflow calls tools.\n- Do not select every field of every message: the API refuses a query whose complexity is above 50 fields.\n\nReference: https://wetel.dev/docs/developer-portal/reference/sessions/"
          },
          "response": [
            {
              "id": "988f6ec7-3142-4d9c-a634-147b96bcfe0e",
              "name": "Reply has arrived",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query PollSession($externalCustomerId: String!, $first: Int) {\n  sessionsByExternalCustomerId(externalCustomerId: $externalCustomerId, first: $first) {\n    totalCount\n    edges {\n      node {\n        id\n        status\n        messages {\n          id\n          role\n          text\n          turnIndex\n          createdAt\n        }\n      }\n    }\n  }\n}\n",
                    "variables": "{\n  \"externalCustomerId\": \"ticket-1001\",\n  \"first\": 1\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"sessionsByExternalCustomerId\": {\n      \"totalCount\": 1,\n      \"edges\": [\n        {\n          \"node\": {\n            \"id\": 4211,\n            \"status\": \"ACTIVE\",\n            \"messages\": [\n              {\n                \"id\": 90311,\n                \"role\": \"USER\",\n                \"text\": \"My laptop cannot connect to the office VPN since this morning.\",\n                \"turnIndex\": 0,\n                \"createdAt\": \"2026-10-12T03:15:02.114Z\"\n              },\n              {\n                \"id\": 90312,\n                \"role\": \"MODEL\",\n                \"text\": \"Sorry to hear that. Which operating system is the laptop running, and do you see an error message?\",\n                \"turnIndex\": 1,\n                \"createdAt\": \"2026-10-12T03:15:05.871Z\"\n              }\n            ]\n          }\n        }\n      ]\n    }\n  }\n}"
            },
            {
              "id": "f8c69202-a38a-4c54-a4b4-bed041831ed3",
              "name": "UNAUTHENTICATED: API key missing",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query PollSession($externalCustomerId: String!, $first: Int) {\n  sessionsByExternalCustomerId(externalCustomerId: $externalCustomerId, first: $first) {\n    totalCount\n    edges {\n      node {\n        id\n        status\n        messages {\n          id\n          role\n          text\n          turnIndex\n          createdAt\n        }\n      }\n    }\n  }\n}\n",
                    "variables": "{\n  \"externalCustomerId\": \"ticket-1001\",\n  \"first\": 1\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Missing X-Api-Key header\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sessionsByExternalCustomerId\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Missing X-Api-Key header\",\n          \"error\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "0117cd63-e9c6-462d-a1a3-a262073df803",
          "name": "session",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query ReadSession($id: ID!) {\n  session(id: $id) {\n    id\n    status\n    startedAt\n    endedAt\n    messages {\n      id\n      role\n      text\n      turnIndex\n    }\n  }\n}\n",
                "variables": "{\n  \"id\": \"{{sessionId}}\"\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Read one session and its full message history by id (dashboard credential).\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Takes a dashboard JWT. An API key or a session token is refused with `Unauthorized`; with an API key, poll with `sessionsByExternalCustomerId` instead.\n- Returns `null` (not an error) for an id that does not exist in your workspace.\n\nReference: https://wetel.dev/docs/developer-portal/reference/sessions/"
          },
          "response": [
            {
              "id": "a9fcdaad-0576-4bbc-ab9b-80d9fd666dca",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ReadSession($id: ID!) {\n  session(id: $id) {\n    id\n    status\n    startedAt\n    endedAt\n    messages {\n      id\n      role\n      text\n      turnIndex\n    }\n  }\n}\n",
                    "variables": "{\n  \"id\": \"4211\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"session\": {\n      \"id\": 4211,\n      \"status\": \"ENDED\",\n      \"startedAt\": \"2026-10-12T03:15:01.502Z\",\n      \"endedAt\": \"2026-10-12T03:18:40.020Z\",\n      \"messages\": [\n        {\n          \"id\": 90311,\n          \"role\": \"USER\",\n          \"text\": \"My laptop cannot connect to the office VPN since this morning.\",\n          \"turnIndex\": 0\n        },\n        {\n          \"id\": 90312,\n          \"role\": \"MODEL\",\n          \"text\": \"Sorry to hear that. Which operating system is the laptop running, and do you see an error message?\",\n          \"turnIndex\": 1\n        }\n      ]\n    }\n  }\n}"
            },
            {
              "id": "6c4213bf-6229-4a33-af6d-abb7a54b4a7e",
              "name": "Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ReadSession($id: ID!) {\n  session(id: $id) {\n    id\n    status\n    startedAt\n    endedAt\n    messages {\n      id\n      role\n      text\n      turnIndex\n    }\n  }\n}\n",
                    "variables": "{\n  \"id\": \"4211\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"session\": null\n  }\n}"
            },
            {
              "id": "1142e9ab-ae6f-4b99-ab1b-d6ad76ff6749",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ReadSession($id: ID!) {\n  session(id: $id) {\n    id\n    status\n    startedAt\n    endedAt\n    messages {\n      id\n      role\n      text\n      turnIndex\n    }\n  }\n}\n",
                    "variables": "{\n  \"id\": \"4211\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"session\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": {\n    \"session\": null\n  }\n}"
            }
          ]
        },
        {
          "id": "50752b4d-cf51-4016-ace6-909ad8601eee",
          "name": "sdkEndSession",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{avatarToken}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation EndSession($input: SdkEndSessionInput!) {\n  sdkEndSession(input: $input) {\n    sessionId\n    durationSeconds\n    evaluation {\n      score\n      summary\n    }\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"sessionId\": {{sessionId}}\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "End the session. The session token stops working for new messages.\n\nCredential: Session token (avatarToken). `Authorization: Bearer <avatarToken>`, returned by `sdkStart` for one session.\n- `evaluation` is generated asynchronously and only for conversations with at least two turns, so it is often `null` in this response.\n\nReference: https://wetel.dev/docs/developer-portal/reference/sessions/"
          },
          "response": [
            {
              "id": "09583361-39c3-47ff-a33c-ca94232dea3d",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation EndSession($input: SdkEndSessionInput!) {\n  sdkEndSession(input: $input) {\n    sessionId\n    durationSeconds\n    evaluation {\n      score\n      summary\n    }\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"sessionId\": 4211\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"sdkEndSession\": {\n      \"sessionId\": 4211,\n      \"durationSeconds\": 219,\n      \"evaluation\": null\n    }\n  }\n}"
            },
            {
              "id": "66022393-1771-4258-a0b3-a314bbdc498e",
              "name": "FORBIDDEN: Token for a different session",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation EndSession($input: SdkEndSessionInput!) {\n  sdkEndSession(input: $input) {\n    sessionId\n    durationSeconds\n    evaluation {\n      score\n      summary\n    }\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"sessionId\": 4211\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"This avatar token is not valid for the requested session\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"sdkEndSession\"\n      ],\n      \"extensions\": {\n        \"code\": \"FORBIDDEN\",\n        \"originalError\": {\n          \"message\": \"This avatar token is not valid for the requested session\",\n          \"error\": \"Forbidden\",\n          \"statusCode\": 403\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "b3e13138-81d6-44dc-abb7-26ad4be364f8",
          "name": "evaluation",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query SessionEvaluation($sessionId: Int!) {\n  evaluation(sessionId: $sessionId) {\n    id\n    sessionId\n    score\n    recommendation\n    summary\n    strengths\n    weaknesses\n    generatedAt\n  }\n}\n",
                "variables": "{\n  \"sessionId\": {{sessionId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Read the scored evaluation of an ended session (score, recommendation, summary, strengths, weaknesses).\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Returns `null` until the session has ended and the background evaluation has finished, and stays `null` for a session that was not evaluated (fewer than two turns, or evaluation not enabled for it). Poll with a back-off after `sdkEndSession`.\n- `score` is 0 to 100. For a support agent `recommendation` is one of `resolved`, `escalate` or `follow-up` (`n/a` when none fits); an agent with its own evaluation labels returns those.\n- `transcript` is also available on this type; it holds the whole conversation, so select it only if you need it.\n\nReference: https://wetel.dev/docs/developer-portal/reference/sessions/"
          },
          "response": [
            {
              "id": "c9e99324-a512-4954-ac91-e0bbc39a1516",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query SessionEvaluation($sessionId: Int!) {\n  evaluation(sessionId: $sessionId) {\n    id\n    sessionId\n    score\n    recommendation\n    summary\n    strengths\n    weaknesses\n    generatedAt\n  }\n}\n",
                    "variables": "{\n  \"sessionId\": 4211\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"evaluation\": {\n      \"id\": 1532,\n      \"sessionId\": 4211,\n      \"score\": 82,\n      \"recommendation\": \"resolved\",\n      \"summary\": \"The user could not connect to the VPN. The agent identified an expired client certificate and walked the user through renewing it; the user confirmed it works.\",\n      \"strengths\": [\n        \"Asked for the operating system and error before suggesting a fix\"\n      ],\n      \"weaknesses\": [\n        \"Did not offer to open a ticket in case the fix failed\"\n      ],\n      \"generatedAt\": \"2026-10-12T03:18:52.114Z\"\n    }\n  }\n}"
            },
            {
              "id": "59a10639-00b7-4151-a609-4f3067719b66",
              "name": "Not evaluated yet (or never)",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query SessionEvaluation($sessionId: Int!) {\n  evaluation(sessionId: $sessionId) {\n    id\n    sessionId\n    score\n    recommendation\n    summary\n    strengths\n    weaknesses\n    generatedAt\n  }\n}\n",
                    "variables": "{\n  \"sessionId\": 4211\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"evaluation\": null\n  }\n}"
            },
            {
              "id": "4af767c3-fa29-41b2-a767-2ac4e46dd845",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query SessionEvaluation($sessionId: Int!) {\n  evaluation(sessionId: $sessionId) {\n    id\n    sessionId\n    score\n    recommendation\n    summary\n    strengths\n    weaknesses\n    generatedAt\n  }\n}\n",
                    "variables": "{\n  \"sessionId\": 4211\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"evaluation\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": {\n    \"evaluation\": null\n  }\n}"
            }
          ]
        },
        {
          "id": "e0212045-72cc-4c99-a60a-2d0fb3a0a604",
          "name": "refreshAvatarToken",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"avatarToken\", get(json, \"data.refreshAvatarToken.avatarToken\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": { "type": "noauth" },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation RefreshToken($input: RefreshAvatarTokenInput!) {\n  refreshAvatarToken(input: $input) {\n    sessionId\n    avatarToken\n    expiresInMs\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"avatarToken\": \"{{avatarToken}}\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Exchange a session token that is about to expire (or expired in the last 10 minutes) for a fresh one.\n\nCredential: No credential header. The credential travels inside the input (see the operation).\n- A session token lives about one hour. The token goes in `input.avatarToken`, not in an Authorization header, because an expired token must be accepted here.\n- The session must still be active. Limited to 10 calls per minute per client IP.\n- An open `sessionEvents` WebSocket keeps the old token; close it and reopen it with the new one.\n\nReference: https://wetel.dev/docs/developer-portal/reference/sessions/"
          },
          "response": [
            {
              "id": "197753e1-dff5-449c-a345-7600524e1287",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RefreshToken($input: RefreshAvatarTokenInput!) {\n  refreshAvatarToken(input: $input) {\n    sessionId\n    avatarToken\n    expiresInMs\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"avatarToken\": \"example-avatar-token-not-real\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"refreshAvatarToken\": {\n      \"sessionId\": 4211,\n      \"avatarToken\": \"example-refreshed-token-not-real\",\n      \"expiresInMs\": 3600000\n    }\n  }\n}"
            },
            {
              "id": "39e06297-37da-4a92-aee6-6e9f7e4d28c5",
              "name": "UNAUTHENTICATED: Expired beyond the grace window, or invalid",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RefreshToken($input: RefreshAvatarTokenInput!) {\n  refreshAvatarToken(input: $input) {\n    sessionId\n    avatarToken\n    expiresInMs\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"avatarToken\": \"example-avatar-token-not-real\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Invalid or expired avatar token\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"refreshAvatarToken\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Invalid or expired avatar token\",\n          \"error\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "1354e0a5-7dce-4606-a839-20645fb3cf8a",
              "name": "BAD_REQUEST: Session already ended",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RefreshToken($input: RefreshAvatarTokenInput!) {\n  refreshAvatarToken(input: $input) {\n    sessionId\n    avatarToken\n    expiresInMs\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"avatarToken\": \"example-avatar-token-not-real\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Session 4211 is not active (status: ended)\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"refreshAvatarToken\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Session 4211 is not active (status: ended)\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Agents",
      "description": "Create, read and update agents, and attach the workflow an agent runs.",
      "item": [
        {
          "id": "345ea006-7e52-4d02-a42e-47f4ec6c2042",
          "name": "agents",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query ListAgents {\n  agents {\n    id\n    name\n    status\n    useCase\n    workflowId\n  }\n}\n",
                "variables": "{}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List every agent in your workspace (a plain list, not paginated).\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n\nReference: https://wetel.dev/docs/developer-portal/reference/agents/"
          },
          "response": [
            {
              "id": "a819853c-77ef-40fa-ab17-22d66fe17594",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListAgents {\n  agents {\n    id\n    name\n    status\n    useCase\n    workflowId\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"agents\": [\n      {\n        \"id\": 7,\n        \"name\": \"Helpdesk triage\",\n        \"status\": \"ACTIVE\",\n        \"useCase\": \"SUPPORT\",\n        \"workflowId\": 12\n      },\n      {\n        \"id\": 9,\n        \"name\": \"Onboarding guide\",\n        \"status\": \"INACTIVE\",\n        \"useCase\": \"ONBOARDING\",\n        \"workflowId\": null\n      }\n    ]\n  }\n}"
            },
            {
              "id": "ae43cbb0-0842-4b20-a965-d1ee82305403",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListAgents {\n  agents {\n    id\n    name\n    status\n    useCase\n    workflowId\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"agents\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "1d41f375-bfaa-49eb-a1ab-93f458ade795",
          "name": "agent",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query OneAgent($id: ID!) {\n  agent(id: $id) {\n    id\n    name\n    position\n    personaPrompt\n    openingGreeting\n    status\n    useCase\n    voiceTier\n    timezone\n    workflowId\n  }\n}\n",
                "variables": "{\n  \"id\": \"{{agentId}}\"\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Read one agent by id.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Returns `null` (not an error) when the id does not exist in your workspace.\n\nReference: https://wetel.dev/docs/developer-portal/reference/agents/"
          },
          "response": [
            {
              "id": "3832c20d-4e2e-4c2a-a98f-5e3535e58a82",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query OneAgent($id: ID!) {\n  agent(id: $id) {\n    id\n    name\n    position\n    personaPrompt\n    openingGreeting\n    status\n    useCase\n    voiceTier\n    timezone\n    workflowId\n  }\n}\n",
                    "variables": "{\n  \"id\": \"7\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"agent\": {\n      \"id\": 7,\n      \"name\": \"Helpdesk triage\",\n      \"position\": \"IT helpdesk assistant\",\n      \"personaPrompt\": \"You are a calm, precise IT helpdesk assistant. Ask one question at a time and never promise a fix you cannot make.\",\n      \"openingGreeting\": \"Hi, I can log an IT ticket for you. What is the problem?\",\n      \"status\": \"ACTIVE\",\n      \"useCase\": \"SUPPORT\",\n      \"voiceTier\": \"STANDARD\",\n      \"timezone\": \"Asia/Kuala_Lumpur\",\n      \"workflowId\": 12\n    }\n  }\n}"
            },
            {
              "id": "328a476e-c6b1-491c-af57-29ff5171f8f9",
              "name": "Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query OneAgent($id: ID!) {\n  agent(id: $id) {\n    id\n    name\n    position\n    personaPrompt\n    openingGreeting\n    status\n    useCase\n    voiceTier\n    timezone\n    workflowId\n  }\n}\n",
                    "variables": "{\n  \"id\": \"7\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"agent\": null\n  }\n}"
            },
            {
              "id": "851cce79-8da3-4ba1-a688-9b5917c996d8",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query OneAgent($id: ID!) {\n  agent(id: $id) {\n    id\n    name\n    position\n    personaPrompt\n    openingGreeting\n    status\n    useCase\n    voiceTier\n    timezone\n    workflowId\n  }\n}\n",
                    "variables": "{\n  \"id\": \"7\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"agent\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": {\n    \"agent\": null\n  }\n}"
            }
          ]
        },
        {
          "id": "72095bea-448b-465f-a3f5-2d47f7cd0012",
          "name": "createAgent",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"agentId\", get(json, \"data.createAgent.id\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation CreateAgent($input: CreateAgentInput!) {\n  createAgent(input: $input) {\n    id\n    name\n    status\n    workflowId\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"name\": \"Helpdesk triage\",\n    \"position\": \"IT helpdesk assistant\",\n    \"personaPrompt\": \"You are a calm, precise IT helpdesk assistant. Ask one question at a time and never promise a fix you cannot make.\",\n    \"openingGreeting\": \"Hi, I can log an IT ticket for you. What is the problem?\",\n    \"useCase\": \"SUPPORT\",\n    \"voiceTier\": \"STANDARD\",\n    \"avatarBackend\": \"CLIENT_3D\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Create an agent. It has no workflow until you attach one with updateAgent.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- [object Object]\n- `useCase: CUSTOM` also needs `evaluationPromptTemplate` (with a `{transcript}` placeholder) and `evaluationRecommendationLabels`.\n- `openingGreeting` is a fixed first message; without it the opening line is generated by a model on every session.\n\nReference: https://wetel.dev/docs/developer-portal/reference/agents/"
          },
          "response": [
            {
              "id": "ef7f0aff-a08e-43c1-aaf4-2c70b609229d",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateAgent($input: CreateAgentInput!) {\n  createAgent(input: $input) {\n    id\n    name\n    status\n    workflowId\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"Helpdesk triage\",\n    \"position\": \"IT helpdesk assistant\",\n    \"personaPrompt\": \"You are a calm, precise IT helpdesk assistant. Ask one question at a time and never promise a fix you cannot make.\",\n    \"openingGreeting\": \"Hi, I can log an IT ticket for you. What is the problem?\",\n    \"useCase\": \"SUPPORT\",\n    \"voiceTier\": \"STANDARD\",\n    \"avatarBackend\": \"CLIENT_3D\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"createAgent\": {\n      \"id\": 7,\n      \"name\": \"Helpdesk triage\",\n      \"status\": \"ACTIVE\",\n      \"workflowId\": null\n    }\n  }\n}"
            },
            {
              "id": "202710a5-6033-4435-a360-fc72bd1f8be6",
              "name": "BAD_REQUEST: CUSTOM use case without an evaluation prompt",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateAgent($input: CreateAgentInput!) {\n  createAgent(input: $input) {\n    id\n    name\n    status\n    workflowId\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"Helpdesk triage\",\n    \"position\": \"IT helpdesk assistant\",\n    \"personaPrompt\": \"You are a calm, precise IT helpdesk assistant. Ask one question at a time and never promise a fix you cannot make.\",\n    \"openingGreeting\": \"Hi, I can log an IT ticket for you. What is the problem?\",\n    \"useCase\": \"SUPPORT\",\n    \"voiceTier\": \"STANDARD\",\n    \"avatarBackend\": \"CLIENT_3D\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"CUSTOM use case requires evaluationPromptTemplate\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createAgent\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"CUSTOM use case requires evaluationPromptTemplate\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "e9c5d9da-bafd-497d-abd5-69b9b25b467d",
              "name": "BAD_USER_INPUT: A required field is missing",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateAgent($input: CreateAgentInput!) {\n  createAgent(input: $input) {\n    id\n    name\n    status\n    workflowId\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"Helpdesk triage\",\n    \"personaPrompt\": \"You are a calm, precise IT helpdesk assistant.\",\n    \"useCase\": \"SUPPORT\",\n    \"voiceTier\": \"STANDARD\",\n    \"avatarBackend\": \"CLIENT_3D\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$input\\\" got invalid value { name: \\\"Helpdesk triage\\\", personaPrompt: \\\"You are a calm, precise IT helpdesk assistant.\\\", useCase: \\\"SUPPORT\\\", voiceTier: \\\"STANDARD\\\", avatarBackend: \\\"CLIENT_3D\\\" }; Field \\\"position\\\" of required type \\\"String!\\\" was not provided.\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 22\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            },
            {
              "id": "aaa9030a-f96b-4d2e-acf3-1b080666618d",
              "name": "BAD_USER_INPUT: Unknown enum value",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateAgent($input: CreateAgentInput!) {\n  createAgent(input: $input) {\n    id\n    name\n    status\n    workflowId\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"Helpdesk triage\",\n    \"position\": \"IT helpdesk assistant\",\n    \"personaPrompt\": \"You are a calm, precise IT helpdesk assistant.\",\n    \"useCase\": \"HELPDESK\",\n    \"voiceTier\": \"STANDARD\",\n    \"avatarBackend\": \"CLIENT_3D\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$input\\\" got invalid value \\\"HELPDESK\\\" at \\\"input.useCase\\\"; Value \\\"HELPDESK\\\" does not exist in \\\"AgentUseCase\\\" enum.\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 22\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "id": "15845ba5-610e-40fe-a1cd-523b7331cfd8",
          "name": "updateAgent",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation UpdateAgent($id: ID!, $input: UpdateAgentInput!) {\n  updateAgent(id: $id, input: $input) {\n    id\n    workflowId\n    status\n    updatedAt\n  }\n}\n",
                "variables": "{\n  \"id\": \"{{agentId}}\",\n  \"input\": {\n    \"workflowId\": {{workflowId}}\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Change an agent. Send only the fields that change; attach a workflow with workflowId.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `id` is a separate argument, not a field of `input`.\n- The workflow you attach must belong to your workspace. Sessions run its **published** version, so publish it first (see Workflows).\n- Set `status` to `INACTIVE` to stop new tasks from running against the agent.\n\nReference: https://wetel.dev/docs/developer-portal/reference/agents/"
          },
          "response": [
            {
              "id": "ef607824-bad5-4778-a524-b2ac9ea1a612",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation UpdateAgent($id: ID!, $input: UpdateAgentInput!) {\n  updateAgent(id: $id, input: $input) {\n    id\n    workflowId\n    status\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"id\": \"7\",\n  \"input\": {\n    \"workflowId\": 12\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"updateAgent\": {\n      \"id\": 7,\n      \"workflowId\": 12,\n      \"status\": \"ACTIVE\",\n      \"updatedAt\": \"2026-10-12T04:02:19.311Z\"\n    }\n  }\n}"
            },
            {
              "id": "b049eeef-798c-407d-a381-d3be5ab8d84b",
              "name": "NOT_FOUND: Agent not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation UpdateAgent($id: ID!, $input: UpdateAgentInput!) {\n  updateAgent(id: $id, input: $input) {\n    id\n    workflowId\n    status\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"id\": \"7\",\n  \"input\": {\n    \"workflowId\": 12\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Agent 7 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"updateAgent\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Agent 7 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "76fc2fa4-ccd7-49b3-af17-0f6cb5886044",
              "name": "BAD_REQUEST: Workflow not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation UpdateAgent($id: ID!, $input: UpdateAgentInput!) {\n  updateAgent(id: $id, input: $input) {\n    id\n    workflowId\n    status\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"id\": \"7\",\n  \"input\": {\n    \"workflowId\": 12\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Workflow 12 not found for this tenant\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"updateAgent\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Workflow 12 not found for this tenant\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Workflows",
      "description": "Build a workflow graph, check it, publish it, run it headlessly and read its runs.",
      "item": [
        {
          "id": "6a8e59e5-f795-4743-abf6-93371edb6eb8",
          "name": "createWorkflow",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"workflowId\", get(json, \"data.createWorkflow.id\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation CreateWorkflow($input: CreateWorkflowInput!) {\n  createWorkflow(input: $input) {\n    id\n    name\n    version\n    isPublished\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"name\": \"Ticket routing\",\n    \"description\": \"Classifies a ticket as L1, L2 or L3 and tells the user where it goes.\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Create an empty workflow (name and description only).\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `CreateWorkflowInput` has no `nodes` or `edges`: add the graph with `updateWorkflow`.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "2a2ef1d5-198e-4698-a830-eb8b060deaf1",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateWorkflow($input: CreateWorkflowInput!) {\n  createWorkflow(input: $input) {\n    id\n    name\n    version\n    isPublished\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"Ticket routing\",\n    \"description\": \"Classifies a ticket as L1, L2 or L3 and tells the user where it goes.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"createWorkflow\": {\n      \"id\": 12,\n      \"name\": \"Ticket routing\",\n      \"version\": 1,\n      \"isPublished\": false\n    }\n  }\n}"
            },
            {
              "id": "c5d4df24-b058-4f5e-a4f3-cba4eb0c0323",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateWorkflow($input: CreateWorkflowInput!) {\n  createWorkflow(input: $input) {\n    id\n    name\n    version\n    isPublished\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"Ticket routing\",\n    \"description\": \"Classifies a ticket as L1, L2 or L3 and tells the user where it goes.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "4e7ef257-c9ba-494b-a075-e1085b270eed",
          "name": "updateWorkflow",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation SaveGraph($input: UpdateWorkflowInput!) {\n  updateWorkflow(input: $input) {\n    id\n    version\n    isPublished\n    updatedAt\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"id\": {{workflowId}},\n    \"nodes\": [\n      {\n        \"id\": \"start\",\n        \"type\": \"start\",\n        \"label\": \"Start\",\n        \"config\": {},\n        \"position\": {\n          \"x\": 0,\n          \"y\": 0\n        }\n      },\n      {\n        \"id\": \"classify\",\n        \"type\": \"llm\",\n        \"label\": \"Classify level\",\n        \"config\": {\n          \"promptTemplate\": \"You route IT support tickets. Read the ticket and answer with one word: L1 for password resets, account unlocks and how-to questions; L2 for a broken device, application or connection that needs a technician; L3 for an outage, a security incident or anything affecting many people.\\n\\nTicket: \\\"{{userMessage}}\\\"\",\n          \"outputVar\": \"level\",\n          \"matchAnyOf\": [\n            \"L1\",\n            \"L2\",\n            \"L3\"\n          ],\n          \"streamOutput\": false\n        },\n        \"position\": {\n          \"x\": 0,\n          \"y\": 100\n        }\n      },\n      {\n        \"id\": \"reply\",\n        \"type\": \"response\",\n        \"label\": \"Tell the user\",\n        \"config\": {\n          \"messageTemplate\": \"Thanks. Your ticket goes to the {{level}} queue; we will reply here.\"\n        },\n        \"position\": {\n          \"x\": 0,\n          \"y\": 200\n        }\n      }\n    ],\n    \"edges\": [\n      {\n        \"id\": \"e1\",\n        \"source\": \"start\",\n        \"target\": \"classify\"\n      },\n      {\n        \"id\": \"e2\",\n        \"source\": \"classify\",\n        \"target\": \"reply\"\n      }\n    ]\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Save the workflow's draft graph (nodes and edges) and optionally its name.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `nodes` and `edges` are JSON: always send them through variables, never inline in the query.\n- The draft is what you edit; sessions keep running the last published version until you call `publishWorkflow`.\n- A node config the platform cannot accept (a missing field, an out-of-range number, an unknown value) is refused with `BAD_USER_INPUT` and a message naming the node and the field. A draft may still be structurally incomplete; `publishWorkflow` checks the whole graph.\n- `input.settings.failureResponse` sets plain text (1 to 500 characters) sent instead of the standard error reply when a run fails; `null` clears it. Effective on save, not on publish.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "bf7c03cc-2ed4-4789-a7cc-4554b2eea9f4",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation SaveGraph($input: UpdateWorkflowInput!) {\n  updateWorkflow(input: $input) {\n    id\n    version\n    isPublished\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"id\": 12,\n    \"nodes\": [\n      {\n        \"id\": \"start\",\n        \"type\": \"start\",\n        \"label\": \"Start\",\n        \"config\": {},\n        \"position\": {\n          \"x\": 0,\n          \"y\": 0\n        }\n      },\n      {\n        \"id\": \"classify\",\n        \"type\": \"llm\",\n        \"label\": \"Classify level\",\n        \"config\": {\n          \"promptTemplate\": \"You route IT support tickets. Read the ticket and answer with one word: L1 for password resets, account unlocks and how-to questions; L2 for a broken device, application or connection that needs a technician; L3 for an outage, a security incident or anything affecting many people.\\n\\nTicket: \\\"{{userMessage}}\\\"\",\n          \"outputVar\": \"level\",\n          \"matchAnyOf\": [\n            \"L1\",\n            \"L2\",\n            \"L3\"\n          ],\n          \"streamOutput\": false\n        },\n        \"position\": {\n          \"x\": 0,\n          \"y\": 100\n        }\n      },\n      {\n        \"id\": \"reply\",\n        \"type\": \"response\",\n        \"label\": \"Tell the user\",\n        \"config\": {\n          \"messageTemplate\": \"Thanks. Your ticket goes to the {{level}} queue; we will reply here.\"\n        },\n        \"position\": {\n          \"x\": 0,\n          \"y\": 200\n        }\n      }\n    ],\n    \"edges\": [\n      {\n        \"id\": \"e1\",\n        \"source\": \"start\",\n        \"target\": \"classify\"\n      },\n      {\n        \"id\": \"e2\",\n        \"source\": \"classify\",\n        \"target\": \"reply\"\n      }\n    ]\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"updateWorkflow\": {\n      \"id\": 12,\n      \"version\": 1,\n      \"isPublished\": false,\n      \"updatedAt\": \"2026-10-12T04:05:41.020Z\"\n    }\n  }\n}"
            },
            {
              "id": "a0c9dfb1-ea06-4806-a925-aaa35f1b0406",
              "name": "NOT_FOUND: Workflow not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation SaveGraph($input: UpdateWorkflowInput!) {\n  updateWorkflow(input: $input) {\n    id\n    version\n    isPublished\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"id\": 12,\n    \"nodes\": [\n      {\n        \"id\": \"start\",\n        \"type\": \"start\",\n        \"label\": \"Start\",\n        \"config\": {},\n        \"position\": {\n          \"x\": 0,\n          \"y\": 0\n        }\n      },\n      {\n        \"id\": \"classify\",\n        \"type\": \"llm\",\n        \"label\": \"Classify level\",\n        \"config\": {\n          \"promptTemplate\": \"You route IT support tickets. Read the ticket and answer with one word: L1 for password resets, account unlocks and how-to questions; L2 for a broken device, application or connection that needs a technician; L3 for an outage, a security incident or anything affecting many people.\\n\\nTicket: \\\"{{userMessage}}\\\"\",\n          \"outputVar\": \"level\",\n          \"matchAnyOf\": [\n            \"L1\",\n            \"L2\",\n            \"L3\"\n          ],\n          \"streamOutput\": false\n        },\n        \"position\": {\n          \"x\": 0,\n          \"y\": 100\n        }\n      },\n      {\n        \"id\": \"reply\",\n        \"type\": \"response\",\n        \"label\": \"Tell the user\",\n        \"config\": {\n          \"messageTemplate\": \"Thanks. Your ticket goes to the {{level}} queue; we will reply here.\"\n        },\n        \"position\": {\n          \"x\": 0,\n          \"y\": 200\n        }\n      }\n    ],\n    \"edges\": [\n      {\n        \"id\": \"e1\",\n        \"source\": \"start\",\n        \"target\": \"classify\"\n      },\n      {\n        \"id\": \"e2\",\n        \"source\": \"classify\",\n        \"target\": \"reply\"\n      }\n    ]\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Workflow 12 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"updateWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Workflow 12 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "55bd9591-4577-4ea9-a114-0924a1a82eb8",
              "name": "BAD_USER_INPUT: name sent as a number",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation SaveGraph($input: UpdateWorkflowInput!) {\n  updateWorkflow(input: $input) {\n    id\n    version\n    isPublished\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"id\": 12,\n    \"name\": 42\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$input\\\" got invalid value 42 at \\\"input.name\\\"; String cannot represent a non string value: 42\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 20\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "id": "6d327f1f-c109-4fdc-a20e-0935080a515c",
          "name": "workflowDiagnostics",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Lint($id: Int!, $published: Boolean!) {\n  workflowDiagnostics(id: $id, published: $published) {\n    code\n    severity\n    nodeId\n    edgeId\n    message\n  }\n}\n",
                "variables": "{\n  \"id\": {{workflowId}},\n  \"published\": false\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Lint a workflow graph. Lists findings that will probably misbehave at run time; never blocks.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `published: false` checks the draft (what `updateWorkflow` wrote); `published: true` checks the version sessions run.\n- Switch on `code`, not on `message`. An empty list means nothing was found. Publishing has its own blocking checks.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "e4fa5bf2-e6ff-4f91-ad22-cc9854bb9a35",
              "name": "One finding",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Lint($id: Int!, $published: Boolean!) {\n  workflowDiagnostics(id: $id, published: $published) {\n    code\n    severity\n    nodeId\n    edgeId\n    message\n  }\n}\n",
                    "variables": "{\n  \"id\": 12,\n  \"published\": false\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"workflowDiagnostics\": [\n      {\n        \"code\": \"UNREACHABLE_NODE\",\n        \"severity\": \"WARNING\",\n        \"nodeId\": \"notes\",\n        \"edgeId\": null,\n        \"message\": \"Node \\\"notes\\\" (\\\"Internal notes\\\") cannot be reached from the start node, so it never runs, and publish will refuse the workflow. Connect it to the graph or delete it.\"\n      }\n    ]\n  }\n}"
            },
            {
              "id": "ca00ff52-8a21-453a-a0e1-6f1567d16aef",
              "name": "Nothing found",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Lint($id: Int!, $published: Boolean!) {\n  workflowDiagnostics(id: $id, published: $published) {\n    code\n    severity\n    nodeId\n    edgeId\n    message\n  }\n}\n",
                    "variables": "{\n  \"id\": 12,\n  \"published\": false\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"workflowDiagnostics\": []\n  }\n}"
            },
            {
              "id": "bea7ec99-4b7c-4792-a977-d827baf597b4",
              "name": "NOT_FOUND: Never published, asked for the published version",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Lint($id: Int!, $published: Boolean!) {\n  workflowDiagnostics(id: $id, published: $published) {\n    code\n    severity\n    nodeId\n    edgeId\n    message\n  }\n}\n",
                    "variables": "{\n  \"id\": 12,\n  \"published\": false\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Workflow 12 has no published version; omit published to check the draft\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"workflowDiagnostics\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Workflow 12 has no published version; omit published to check the draft\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "4a2d7f93-2c63-4b51-a1fb-8095e77dbe57",
          "name": "publishWorkflow",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation Publish($id: Int!) {\n  publishWorkflow(id: $id) {\n    id\n    version\n    isPublished\n  }\n}\n",
                "variables": "{\n  \"id\": {{workflowId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Publish the current draft. New turns of every session on the agent run this version.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Refused when the graph is not runnable, for example with no `start` node or with a node that cannot be reached.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "36a4393b-f062-4d89-aad2-b9767ffbe8df",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Publish($id: Int!) {\n  publishWorkflow(id: $id) {\n    id\n    version\n    isPublished\n  }\n}\n",
                    "variables": "{\n  \"id\": 12\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"publishWorkflow\": {\n      \"id\": 12,\n      \"version\": 2,\n      \"isPublished\": true\n    }\n  }\n}"
            },
            {
              "id": "f8a5cdc2-bf4c-4a38-a1f5-0e48e7645307",
              "name": "BAD_USER_INPUT: Node type written in capitals",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Publish($id: Int!) {\n  publishWorkflow(id: $id) {\n    id\n    version\n    isPublished\n  }\n}\n",
                    "variables": "{\n  \"id\": 12\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"node classify: type \\\"LLM\\\" must be lowercase: \\\"llm\\\"\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"publishWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "de230d7b-61cd-46b5-ad77-a413711f63d4",
              "name": "BAD_REQUEST: No start node",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Publish($id: Int!) {\n  publishWorkflow(id: $id) {\n    id\n    version\n    isPublished\n  }\n}\n",
                    "variables": "{\n  \"id\": 12\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Workflow must have a START node before publishing (node types seen: llm, response; the start type is \\\"start\\\", lowercase)\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"publishWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Workflow must have a START node before publishing (node types seen: llm, response; the start type is \\\"start\\\", lowercase)\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "752c39ac-4fc7-42cb-a79f-419ed9df4241",
          "name": "workflowVersions",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query History($workflowId: Int!, $first: Int, $after: String) {\n  workflowVersions(workflowId: $workflowId, first: $first, after: $after) {\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n    edges {\n      node {\n        id\n        versionNumber\n        isCurrent\n        source\n        restoredFromVersionNumber\n        note\n        createdAt\n      }\n    }\n  }\n}\n",
                "variables": "{\n  \"workflowId\": {{workflowId}},\n  \"first\": 20\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List a workflow's published versions, newest first (summaries only, no graph).\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- One entry for every publish, rollback or template hire that changed the published graph; republishing an unchanged graph adds none.\n- `versionNumber` (1, 2, 3 ...) is what the other version operations take. `id` is the value `currentVersionId` and a run's `workflowVersionId` hold. `isCurrent` marks the version new turns run now.\n- Page with `first` (default 20, at most 100) and `after` (a previous page's `pageInfo.endCursor`, older versions). The newest 100 versions are kept, so numbers can have gaps.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "2b2ad084-f6a3-4857-afa1-cfbf533ea8a9",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query History($workflowId: Int!, $first: Int, $after: String) {\n  workflowVersions(workflowId: $workflowId, first: $first, after: $after) {\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n    edges {\n      node {\n        id\n        versionNumber\n        isCurrent\n        source\n        restoredFromVersionNumber\n        note\n        createdAt\n      }\n    }\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"first\": 20\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"workflowVersions\": {\n      \"pageInfo\": {\n        \"hasNextPage\": false,\n        \"endCursor\": \"djox\"\n      },\n      \"edges\": [\n        {\n          \"node\": {\n            \"id\": 305,\n            \"versionNumber\": 2,\n            \"isCurrent\": true,\n            \"source\": \"PUBLISH\",\n            \"restoredFromVersionNumber\": null,\n            \"note\": \"Stricter classifier prompt\",\n            \"createdAt\": \"2026-10-15T08:40:10.000Z\"\n          }\n        },\n        {\n          \"node\": {\n            \"id\": 291,\n            \"versionNumber\": 1,\n            \"isCurrent\": false,\n            \"source\": \"PUBLISH\",\n            \"restoredFromVersionNumber\": null,\n            \"note\": null,\n            \"createdAt\": \"2026-10-14T09:02:31.000Z\"\n          }\n        }\n      ]\n    }\n  }\n}"
            },
            {
              "id": "bc560795-4ef9-48f5-aadb-9cf4b46ed27e",
              "name": "NOT_FOUND: Workflow not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query History($workflowId: Int!, $first: Int, $after: String) {\n  workflowVersions(workflowId: $workflowId, first: $first, after: $after) {\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n    edges {\n      node {\n        id\n        versionNumber\n        isCurrent\n        source\n        restoredFromVersionNumber\n        note\n        createdAt\n      }\n    }\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"first\": 20\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Workflow 12 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"workflowVersions\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Workflow 12 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "707fa28b-6c24-4938-a097-a76df8e201f1",
              "name": "BAD_REQUEST: Cursor not issued by this query",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query History($workflowId: Int!, $first: Int, $after: String) {\n  workflowVersions(workflowId: $workflowId, first: $first, after: $after) {\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n    edges {\n      node {\n        id\n        versionNumber\n        isCurrent\n        source\n        restoredFromVersionNumber\n        note\n        createdAt\n      }\n    }\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"first\": 20\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Invalid `after` cursor\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"workflowVersions\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Invalid `after` cursor\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "3240c454-eb55-484c-a71c-b34ae6520719",
          "name": "workflowVersionDiff",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Diff($workflowId: Int!, $fromVersion: Int!, $toVersion: Int) {\n  workflowVersionDiff(workflowId: $workflowId, fromVersion: $fromVersion, toVersion: $toVersion) {\n    addedNodeIds\n    removedNodeIds\n    changedNodes {\n      id\n      type\n      changedKeys\n    }\n    addedEdgeIds\n    removedEdgeIds\n    changedEdgeIds\n  }\n}\n",
                "variables": "{\n  \"workflowId\": {{workflowId}},\n  \"fromVersion\": 2\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "What changed between two versions, or between a version and the current draft. Ids and key names only, never values.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Omit `toVersion` to compare against the draft. With `fromVersion` set to the current version, that is exactly what the next `publishWorkflow` would change.\n- `changedKeys` names top-level keys (`label`, `position`, `type`) and config keys as `config.<key>`. Read both graphs with `workflowVersion` to see the values.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "bbafc910-aabe-48b4-a2b2-fbc336d3fa5f",
              "name": "Draft compared with version 2",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Diff($workflowId: Int!, $fromVersion: Int!, $toVersion: Int) {\n  workflowVersionDiff(workflowId: $workflowId, fromVersion: $fromVersion, toVersion: $toVersion) {\n    addedNodeIds\n    removedNodeIds\n    changedNodes {\n      id\n      type\n      changedKeys\n    }\n    addedEdgeIds\n    removedEdgeIds\n    changedEdgeIds\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"fromVersion\": 2\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"workflowVersionDiff\": {\n      \"addedNodeIds\": [],\n      \"removedNodeIds\": [],\n      \"changedNodes\": [\n        {\n          \"id\": \"classify\",\n          \"type\": \"llm\",\n          \"changedKeys\": [\n            \"config.promptTemplate\"\n          ]\n        }\n      ],\n      \"addedEdgeIds\": [],\n      \"removedEdgeIds\": [],\n      \"changedEdgeIds\": []\n    }\n  }\n}"
            },
            {
              "id": "99d59fc0-d473-4e4a-ae2a-608e89302694",
              "name": "NOT_FOUND: Version does not exist or was pruned",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Diff($workflowId: Int!, $fromVersion: Int!, $toVersion: Int) {\n  workflowVersionDiff(workflowId: $workflowId, fromVersion: $fromVersion, toVersion: $toVersion) {\n    addedNodeIds\n    removedNodeIds\n    changedNodes {\n      id\n      type\n      changedKeys\n    }\n    addedEdgeIds\n    removedEdgeIds\n    changedEdgeIds\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"fromVersion\": 2\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Version 2 of workflow 12 not found (it may have been pruned)\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"workflowVersionDiff\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Version 2 of workflow 12 not found (it may have been pruned)\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "b0db9687-8618-4586-a564-881c8d5edb4b",
          "name": "rollbackWorkflow",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation Rollback($workflowId: Int!, $versionNumber: Int!, $note: String) {\n  rollbackWorkflow(workflowId: $workflowId, versionNumber: $versionNumber, note: $note) {\n    id\n    currentVersionId\n    isPublished\n  }\n}\n",
                "variables": "{\n  \"workflowId\": {{workflowId}},\n  \"versionNumber\": 1,\n  \"note\": \"Back to the first prompt while the classifier is fixed\"\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Publish an earlier version's graph again, as a new version. The draft is not changed.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- The old graph is checked against today's rules, as a publish is, and refused with the same errors as `publishWorkflow` when it no longer passes.\n- Refused when that graph is already the one published now. `note` is optional, at most 500 characters.\n- Takes effect for the next session turn; a conversation paused at `await_reply` or `approval` keeps the version it paused on.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "4618ef34-5409-48b7-ab40-1aee48b2e718",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Rollback($workflowId: Int!, $versionNumber: Int!, $note: String) {\n  rollbackWorkflow(workflowId: $workflowId, versionNumber: $versionNumber, note: $note) {\n    id\n    currentVersionId\n    isPublished\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"versionNumber\": 1,\n  \"note\": \"Back to the first prompt while the classifier is fixed\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"rollbackWorkflow\": {\n      \"id\": 12,\n      \"currentVersionId\": 318,\n      \"isPublished\": true\n    }\n  }\n}"
            },
            {
              "id": "2f0b39c8-729d-48e8-ad3e-7f5aa9091269",
              "name": "BAD_USER_INPUT: That graph is already published",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Rollback($workflowId: Int!, $versionNumber: Int!, $note: String) {\n  rollbackWorkflow(workflowId: $workflowId, versionNumber: $versionNumber, note: $note) {\n    id\n    currentVersionId\n    isPublished\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"versionNumber\": 1,\n  \"note\": \"Back to the first prompt while the classifier is fixed\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Version 1 has the same graph as the version published now; nothing to roll back.\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"rollbackWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "474104ad-07de-4697-aeee-e6f04ab90d77",
              "name": "NOT_FOUND: Version does not exist or was pruned",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Rollback($workflowId: Int!, $versionNumber: Int!, $note: String) {\n  rollbackWorkflow(workflowId: $workflowId, versionNumber: $versionNumber, note: $note) {\n    id\n    currentVersionId\n    isPublished\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"versionNumber\": 1,\n  \"note\": \"Back to the first prompt while the classifier is fixed\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Version 1 of workflow 12 not found (it may have been pruned)\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"rollbackWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Version 1 of workflow 12 not found (it may have been pruned)\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "e338dab5-3bc7-437c-ad8b-717539b96532",
          "name": "restoreWorkflowVersionToDraft",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation RestoreToDraft($workflowId: Int!, $versionNumber: Int!) {\n  restoreWorkflowVersionToDraft(workflowId: $workflowId, versionNumber: $versionNumber) {\n    id\n    version\n    updatedAt\n  }\n}\n",
                "variables": "{\n  \"workflowId\": {{workflowId}},\n  \"versionNumber\": 1\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Copy a version's graph into the draft, replacing it. Nothing is published.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Unpublished edits in the draft are replaced. Edit the restored draft, then call `publishWorkflow`.\n- The graph is checked like an `updateWorkflow` save, so a node config that no longer passes today's rules is refused with `BAD_USER_INPUT`.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "8e083376-e3cd-41f1-a9f2-e8359c47d432",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RestoreToDraft($workflowId: Int!, $versionNumber: Int!) {\n  restoreWorkflowVersionToDraft(workflowId: $workflowId, versionNumber: $versionNumber) {\n    id\n    version\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"versionNumber\": 1\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"restoreWorkflowVersionToDraft\": {\n      \"id\": 12,\n      \"version\": 5,\n      \"updatedAt\": \"2026-10-16T03:20:11.400Z\"\n    }\n  }\n}"
            },
            {
              "id": "5ee5cf9f-2170-4eac-ab02-eee5c1f1b157",
              "name": "NOT_FOUND: Version does not exist or was pruned",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RestoreToDraft($workflowId: Int!, $versionNumber: Int!) {\n  restoreWorkflowVersionToDraft(workflowId: $workflowId, versionNumber: $versionNumber) {\n    id\n    version\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"versionNumber\": 1\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Version 1 of workflow 12 not found (it may have been pruned)\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"restoreWorkflowVersionToDraft\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Version 1 of workflow 12 not found (it may have been pruned)\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "ed0f0da8-e1eb-42c4-a360-699f41d9c522",
              "name": "BAD_USER_INPUT: versionNumber sent as a string",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RestoreToDraft($workflowId: Int!, $versionNumber: Int!) {\n  restoreWorkflowVersionToDraft(workflowId: $workflowId, versionNumber: $versionNumber) {\n    id\n    version\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"workflowId\": 12,\n  \"versionNumber\": \"one\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$versionNumber\\\" got invalid value \\\"one\\\"; Int cannot represent non-integer value: \\\"one\\\"\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 44\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "id": "82299dc2-af35-4d46-a614-b1eb4f76d1f8",
          "name": "nodeConfigSchemas",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "apikey",
              "apikey": [
                { "key": "key", "value": "X-Api-Key", "type": "string" },
                { "key": "value", "value": "{{apiKey}}", "type": "string" },
                { "key": "in", "value": "header", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query NodeSchemas {\n  nodeConfigSchemas {\n    type\n    schema\n  }\n}\n",
                "variables": "{}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "The JSON Schema of every node type's config, for building or validating graphs in your own tools.\n\nCredential: API key. `X-Api-Key: sk_...`, kept on your server only.\n- Accepts an API key or a dashboard JWT. The answer is the same for every workspace.\n- `schema` is a standard JSON Schema (draft 2020-12). One entry per node type that has a config; `START` has none.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "70f1b472-49c4-442c-a4c2-e39581f2f224",
              "name": "Success (one entry of the list shown)",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query NodeSchemas {\n  nodeConfigSchemas {\n    type\n    schema\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"nodeConfigSchemas\": [\n      {\n        \"type\": \"RESPONSE\",\n        \"schema\": {\n          \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n          \"type\": \"object\",\n          \"properties\": {\n            \"maxVisits\": {\n              \"type\": \"number\"\n            },\n            \"messageTemplate\": {\n              \"type\": \"string\"\n            },\n            \"mood\": {\n              \"type\": \"string\"\n            },\n            \"structuredContentTemplate\": {\n              \"type\": \"string\"\n            }\n          },\n          \"additionalProperties\": {}\n        }\n      }\n    ]\n  }\n}"
            },
            {
              "id": "749a716f-bf68-4da9-aa2a-9fb3260890e7",
              "name": "UNAUTHENTICATED: No credential",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query NodeSchemas {\n  nodeConfigSchemas {\n    type\n    schema\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"nodeConfigSchemas\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "27d46e81-5b49-4f9b-a28b-b7435e91b978",
          "name": "workflowRuns",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"workflowRunId\", get(json, \"data.workflowRuns.0.id\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Runs($sessionId: Int!) {\n  workflowRuns(sessionId: $sessionId) {\n    id\n    status\n    workflowId\n    errorMessage\n    totalTokensUsed\n    createdAt\n    completedAt\n  }\n}\n",
                "variables": "{\n  \"sessionId\": {{sessionId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List the runs of one session, newest first, to debug what a workflow did.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- A run is one execution of the graph for one turn. Pass a run's id to `workflowRun(id)` for the full node trace.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "f71b029c-6623-48bc-ad39-9f13146cf389",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Runs($sessionId: Int!) {\n  workflowRuns(sessionId: $sessionId) {\n    id\n    status\n    workflowId\n    errorMessage\n    totalTokensUsed\n    createdAt\n    completedAt\n  }\n}\n",
                    "variables": "{\n  \"sessionId\": 4211\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"workflowRuns\": [\n      {\n        \"id\": 5531,\n        \"status\": \"COMPLETED\",\n        \"workflowId\": 12,\n        \"errorMessage\": null,\n        \"totalTokensUsed\": 412,\n        \"createdAt\": \"2026-10-12T03:15:02.300Z\",\n        \"completedAt\": \"2026-10-12T03:15:05.902Z\"\n      }\n    ]\n  }\n}"
            },
            {
              "id": "250e7fbd-1253-43a7-af6b-10d6fa9474a5",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Runs($sessionId: Int!) {\n  workflowRuns(sessionId: $sessionId) {\n    id\n    status\n    workflowId\n    errorMessage\n    totalTokensUsed\n    createdAt\n    completedAt\n  }\n}\n",
                    "variables": "{\n  \"sessionId\": 4211\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"workflowRuns\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "b4330b56-cf1d-4f6a-abb6-5b62323e686c",
          "name": "workflowRun",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Run($id: Int!) {\n  workflowRun(id: $id) {\n    id\n    status\n    sessionId\n    workflowId\n    errorMessage\n    nodeTrace\n    context\n    resumedFromRunId\n    continuedByRunId\n    totalTokensUsed\n    createdAt\n    completedAt\n  }\n}\n",
                "variables": "{\n  \"id\": {{workflowRunId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Read one run's node trace and context, to see exactly which nodes ran, in order, and why.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `nodeTrace` is a JSON array with one entry per finished node (`nodeId`, `nodeType`, `startedAt`, `finishedAt` and, depending on the node, `outputVar`, `outputValue`, `tokensUsed`, a status and error details). `context` is the run's variables. Secrets and signed URLs are masked on read.\n- A run that stopped at an `await_reply` or `approval` node is `AWAITING_INPUT`; the run that continued it carries its id in `resumedFromRunId`, and the paused run points forward with `continuedByRunId`.\n- Returns `null` (not an error) for an id that does not exist in your workspace.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "194fcd19-e9d1-4317-ad49-de625cdcbb22",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Run($id: Int!) {\n  workflowRun(id: $id) {\n    id\n    status\n    sessionId\n    workflowId\n    errorMessage\n    nodeTrace\n    context\n    resumedFromRunId\n    continuedByRunId\n    totalTokensUsed\n    createdAt\n    completedAt\n  }\n}\n",
                    "variables": "{\n  \"id\": 5531\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"workflowRun\": {\n      \"id\": 5531,\n      \"status\": \"COMPLETED\",\n      \"sessionId\": 4211,\n      \"workflowId\": 12,\n      \"errorMessage\": null,\n      \"nodeTrace\": [\n        {\n          \"nodeId\": \"start\",\n          \"nodeType\": \"start\",\n          \"startedAt\": \"2026-10-12T03:15:02.310Z\",\n          \"finishedAt\": \"2026-10-12T03:15:02.311Z\"\n        },\n        {\n          \"nodeId\": \"classify\",\n          \"nodeType\": \"llm\",\n          \"startedAt\": \"2026-10-12T03:15:02.312Z\",\n          \"finishedAt\": \"2026-10-12T03:15:04.870Z\",\n          \"outputVar\": \"category\",\n          \"outputValue\": \"network\",\n          \"tokensUsed\": 412\n        },\n        {\n          \"nodeId\": \"reply\",\n          \"nodeType\": \"response\",\n          \"startedAt\": \"2026-10-12T03:15:04.871Z\",\n          \"finishedAt\": \"2026-10-12T03:15:05.902Z\"\n        }\n      ],\n      \"context\": {\n        \"userMessage\": \"My laptop cannot connect to the office VPN since this morning.\",\n        \"category\": \"network\"\n      },\n      \"resumedFromRunId\": null,\n      \"continuedByRunId\": null,\n      \"totalTokensUsed\": 412,\n      \"createdAt\": \"2026-10-12T03:15:02.300Z\",\n      \"completedAt\": \"2026-10-12T03:15:05.902Z\"\n    }\n  }\n}"
            },
            {
              "id": "690898b1-9d71-4ead-afc6-902252bc86c3",
              "name": "Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Run($id: Int!) {\n  workflowRun(id: $id) {\n    id\n    status\n    sessionId\n    workflowId\n    errorMessage\n    nodeTrace\n    context\n    resumedFromRunId\n    continuedByRunId\n    totalTokensUsed\n    createdAt\n    completedAt\n  }\n}\n",
                    "variables": "{\n  \"id\": 5531\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"workflowRun\": null\n  }\n}"
            },
            {
              "id": "ecfc9e41-cf5f-41c7-a131-baa12bc3a41f",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Run($id: Int!) {\n  workflowRun(id: $id) {\n    id\n    status\n    sessionId\n    workflowId\n    errorMessage\n    nodeTrace\n    context\n    resumedFromRunId\n    continuedByRunId\n    totalTokensUsed\n    createdAt\n    completedAt\n  }\n}\n",
                    "variables": "{\n  \"id\": 5531\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"workflowRun\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": {\n    \"workflowRun\": null\n  }\n}"
            }
          ]
        },
        {
          "id": "118cd914-0979-46de-ae2e-880bc57eec24",
          "name": "pendingAwaitReplies",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Waiting($sessionId: Int) {\n  pendingAwaitReplies(sessionId: $sessionId) {\n    id\n    sessionId\n    workflowRunId\n    nodeId\n    status\n    matchMode\n    saveAs\n    options {\n      slot\n      id\n      label\n    }\n    expiresAt\n  }\n}\n",
                "variables": "{\n  \"sessionId\": {{sessionId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List the conversations waiting at an await_reply node for the user's answer, newest first.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Pass `sessionId` to check one conversation (is it stuck, or waiting for the user?); omit it for every open wait in the workspace. Only `WAITING` rows are listed.\n- [object Object]\n- `options` is the numbered list the user was shown (empty in `FREE_TEXT` mode). The stored run context is never returned here.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "8291314e-c561-4c77-a761-4e0451b5130e",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Waiting($sessionId: Int) {\n  pendingAwaitReplies(sessionId: $sessionId) {\n    id\n    sessionId\n    workflowRunId\n    nodeId\n    status\n    matchMode\n    saveAs\n    options {\n      slot\n      id\n      label\n    }\n    expiresAt\n  }\n}\n",
                    "variables": "{\n  \"sessionId\": 4211\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"pendingAwaitReplies\": [\n      {\n        \"id\": 207,\n        \"sessionId\": 4211,\n        \"workflowRunId\": 5534,\n        \"nodeId\": \"ask_device\",\n        \"status\": \"WAITING\",\n        \"matchMode\": \"OPTIONS\",\n        \"saveAs\": \"device\",\n        \"options\": [\n          {\n            \"slot\": 1,\n            \"id\": \"laptop\",\n            \"label\": \"Laptop\"\n          },\n          {\n            \"slot\": 2,\n            \"id\": \"desktop\",\n            \"label\": \"Desktop\"\n          }\n        ],\n        \"expiresAt\": \"2026-10-13T03:16:10.000Z\"\n      }\n    ]\n  }\n}"
            },
            {
              "id": "9c1216c4-e906-4bac-ab8f-1f3d67d23abc",
              "name": "BAD_USER_INPUT: Session id sent as a string",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Waiting($sessionId: Int) {\n  pendingAwaitReplies(sessionId: $sessionId) {\n    id\n    sessionId\n    workflowRunId\n    nodeId\n    status\n    matchMode\n    saveAs\n    options {\n      slot\n      id\n      label\n    }\n    expiresAt\n  }\n}\n",
                    "variables": "{\n  \"sessionId\": \"four-two-one-one\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$sessionId\\\" got invalid value \\\"four-two-one-one\\\"; Int cannot represent non-integer value: \\\"four-two-one-one\\\"\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 15\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "id": "9363a211-c5c4-426e-a4c8-5f12e136401c",
          "name": "runWorkflowTask",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"taskSessionId\", get(json, \"data.runWorkflowTask.sessionId\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "apikey",
              "apikey": [
                { "key": "key", "value": "X-Api-Key", "type": "string" },
                { "key": "value", "value": "{{apiKey}}", "type": "string" },
                { "key": "in", "value": "header", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation RunTask($input: RunWorkflowTaskInput!) {\n  runWorkflowTask(input: $input) {\n    accepted\n    sessionId\n    workflowId\n    reusedSession\n    turnCount\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"agentId\": {{agentId}},\n    \"externalConversationId\": \"ticket-1002\",\n    \"variables\": {\n      \"ticketId\": \"T-1002\",\n      \"subject\": \"Cannot print to the 3rd floor printer\",\n      \"reporterRole\": \"staff\"\n    }\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Run an agent's published workflow headlessly (no chat message). Asynchronous; returns once accepted.\n\nCredential: API key. `X-Api-Key: sk_...`, kept on your server only.\n- A successful answer means the task was accepted and queued, never that it succeeded. Read the result with `workflowTaskOutcome` and the returned `sessionId`.\n- `variables` is a flat JSON object merged into the run's context; `externalConversationId` groups repeat calls for one conversation into one session.\n- The agent must be `ACTIVE` and have a workflow attached. Limited to 60 calls per minute per client IP by default.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "4cb54ffb-626e-4df7-a6c5-1c1d09c3c351",
              "name": "Accepted",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RunTask($input: RunWorkflowTaskInput!) {\n  runWorkflowTask(input: $input) {\n    accepted\n    sessionId\n    workflowId\n    reusedSession\n    turnCount\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"externalConversationId\": \"ticket-1002\",\n    \"variables\": {\n      \"ticketId\": \"T-1002\",\n      \"subject\": \"Cannot print to the 3rd floor printer\",\n      \"reporterRole\": \"staff\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"runWorkflowTask\": {\n      \"accepted\": true,\n      \"sessionId\": 4290,\n      \"workflowId\": 12,\n      \"reusedSession\": false,\n      \"turnCount\": 1\n    }\n  }\n}"
            },
            {
              "id": "6d684717-d26d-4767-a891-b84b8e89f69a",
              "name": "BAD_REQUEST: Agent has no workflow",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RunTask($input: RunWorkflowTaskInput!) {\n  runWorkflowTask(input: $input) {\n    accepted\n    sessionId\n    workflowId\n    reusedSession\n    turnCount\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"externalConversationId\": \"ticket-1002\",\n    \"variables\": {\n      \"ticketId\": \"T-1002\",\n      \"subject\": \"Cannot print to the 3rd floor printer\",\n      \"reporterRole\": \"staff\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Agent 7 has no workflow attached — runWorkflowTask requires one\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"runWorkflowTask\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Agent 7 has no workflow attached — runWorkflowTask requires one\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "41324dd9-65b7-477b-ab4a-733efa4de451",
              "name": "NOT_FOUND: Agent not in the key's workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RunTask($input: RunWorkflowTaskInput!) {\n  runWorkflowTask(input: $input) {\n    accepted\n    sessionId\n    workflowId\n    reusedSession\n    turnCount\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"externalConversationId\": \"ticket-1002\",\n    \"variables\": {\n      \"ticketId\": \"T-1002\",\n      \"subject\": \"Cannot print to the 3rd floor printer\",\n      \"reporterRole\": \"staff\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Agent 7 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"runWorkflowTask\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Agent 7 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "22090084-cd51-4d92-ae1a-8000e05682d4",
          "name": "workflowTaskOutcome",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "apikey",
              "apikey": [
                { "key": "key", "value": "X-Api-Key", "type": "string" },
                { "key": "value", "value": "{{apiKey}}", "type": "string" },
                { "key": "in", "value": "header", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query TaskOutcome($sessionId: Int!) {\n  workflowTaskOutcome(sessionId: $sessionId) {\n    sessionId\n    status\n    runs {\n      id\n      status\n      errorMessage\n    }\n    replies {\n      text\n      createdAt\n    }\n  }\n}\n",
                "variables": "{\n  \"sessionId\": {{taskSessionId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Read the outcome of a task started with runWorkflowTask, with the same API key.\n\nCredential: API key. `X-Api-Key: sk_...`, kept on your server only.\n- `status` is the newest run's status: `PENDING` and `RUNNING` mean poll again (with a back-off); `COMPLETED`, `FAILED`, `INTERRUPTED` and `AWAITING_INPUT` are final for now. `null` means the task is still queued.\n- `replies` are what the agent said, oldest first. The run context and node trace are never returned here.\n\nReference: https://wetel.dev/docs/developer-portal/reference/workflows/"
          },
          "response": [
            {
              "id": "d526422d-51ea-4e57-aa53-c73ee8ecaded",
              "name": "Completed",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query TaskOutcome($sessionId: Int!) {\n  workflowTaskOutcome(sessionId: $sessionId) {\n    sessionId\n    status\n    runs {\n      id\n      status\n      errorMessage\n    }\n    replies {\n      text\n      createdAt\n    }\n  }\n}\n",
                    "variables": "{\n  \"sessionId\": 4290\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"workflowTaskOutcome\": {\n      \"sessionId\": 4290,\n      \"status\": \"COMPLETED\",\n      \"runs\": [\n        {\n          \"id\": 5602,\n          \"status\": \"COMPLETED\",\n          \"errorMessage\": null\n        }\n      ],\n      \"replies\": [\n        {\n          \"text\": \"Thanks. Your ticket goes to the L2 queue; we will reply here.\",\n          \"createdAt\": \"2026-10-12T04:10:13.540Z\"\n        }\n      ]\n    }\n  }\n}"
            },
            {
              "id": "604de37d-bd73-4e15-ac7e-7770aee04c52",
              "name": "NOT_FOUND: Not a task session of this key's workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query TaskOutcome($sessionId: Int!) {\n  workflowTaskOutcome(sessionId: $sessionId) {\n    sessionId\n    status\n    runs {\n      id\n      status\n      errorMessage\n    }\n    replies {\n      text\n      createdAt\n    }\n  }\n}\n",
                    "variables": "{\n  \"sessionId\": 4290\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"No workflow task found for session 4290\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"workflowTaskOutcome\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"No workflow task found for session 4290\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Scheduled workflows",
      "description": "Run an agent's published workflow on a cron schedule, with no chat message, and list the schedules.",
      "item": [
        {
          "id": "17cce5d6-f760-43b4-a12b-54caefb11c75",
          "name": "createScheduledWorkflow",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"scheduleId\", get(json, \"data.createScheduledWorkflow.id\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation CreateSchedule($input: CreateScheduledWorkflowInput!) {\n  createScheduledWorkflow(input: $input) {\n    id\n    name\n    agentId\n    cronExpression\n    timezone\n    status\n    nextRunAt\n    variables\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"agentId\": {{agentId}},\n    \"name\": \"Weekday stale-ticket check\",\n    \"cronExpression\": \"0 9 * * 1-5\",\n    \"timezone\": \"Asia/Kuala_Lumpur\",\n    \"variables\": {\n      \"queue\": \"l2\",\n      \"staleAfterHours\": 48\n    }\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Create an ACTIVE schedule that runs an agent's published workflow on a cron expression.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `cronExpression` has exactly 5 fields (minute hour day-of-month month day-of-week); seconds and `@daily`-style aliases are refused. `timezone` defaults to `UTC`.\n- `variables` is a flat JSON object of scalars merged into every run's context, with the same rules as `runWorkflowTask`. Send it through variables, never as an inline literal.\n- `externalConversationIdTemplate` names each fire's session. The default `scheduled:{{scheduleId}}:{{firedAt}}` gives every fire a fresh session; drop `{{firedAt}}` to reuse one session. Only `{{scheduleId}}`, `{{date}}` and `{{firedAt}}` are allowed.\n- After `maxConsecutiveFailures` failed runs in a row (1 to 20, default 3) the schedule turns `AUTO_DISABLED`.\n\nReference: https://wetel.dev/docs/developer-portal/reference/schedules/"
          },
          "response": [
            {
              "id": "c7e0e364-10b4-4f1b-a033-179800b8a203",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateSchedule($input: CreateScheduledWorkflowInput!) {\n  createScheduledWorkflow(input: $input) {\n    id\n    name\n    agentId\n    cronExpression\n    timezone\n    status\n    nextRunAt\n    variables\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"name\": \"Weekday stale-ticket check\",\n    \"cronExpression\": \"0 9 * * 1-5\",\n    \"timezone\": \"Asia/Kuala_Lumpur\",\n    \"variables\": {\n      \"queue\": \"l2\",\n      \"staleAfterHours\": 48\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"createScheduledWorkflow\": {\n      \"id\": 14,\n      \"name\": \"Weekday stale-ticket check\",\n      \"agentId\": 7,\n      \"cronExpression\": \"0 9 * * 1-5\",\n      \"timezone\": \"Asia/Kuala_Lumpur\",\n      \"status\": \"ACTIVE\",\n      \"nextRunAt\": \"2026-10-19T01:00:00.000Z\",\n      \"variables\": {\n        \"queue\": \"l2\",\n        \"staleAfterHours\": 48\n      }\n    }\n  }\n}"
            },
            {
              "id": "cbbd1b2f-9abe-4fa5-a24c-0a47f78977b6",
              "name": "BAD_REQUEST: Cron expression with six fields",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateSchedule($input: CreateScheduledWorkflowInput!) {\n  createScheduledWorkflow(input: $input) {\n    id\n    name\n    agentId\n    cronExpression\n    timezone\n    status\n    nextRunAt\n    variables\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"name\": \"Weekday stale-ticket check\",\n    \"cronExpression\": \"0 9 * * 1-5\",\n    \"timezone\": \"Asia/Kuala_Lumpur\",\n    \"variables\": {\n      \"queue\": \"l2\",\n      \"staleAfterHours\": 48\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"cronExpression must have exactly 5 fields (minute hour day-of-month month day-of-week) — received 6. Seconds-level and @alias schedules are not supported.\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createScheduledWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"cronExpression must have exactly 5 fields (minute hour day-of-month month day-of-week) — received 6. Seconds-level and @alias schedules are not supported.\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "672e2fbd-aad3-4ef9-a0b6-080bcfcc3ad2",
              "name": "BAD_REQUEST: Unknown timezone",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateSchedule($input: CreateScheduledWorkflowInput!) {\n  createScheduledWorkflow(input: $input) {\n    id\n    name\n    agentId\n    cronExpression\n    timezone\n    status\n    nextRunAt\n    variables\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"name\": \"Weekday stale-ticket check\",\n    \"cronExpression\": \"0 9 * * 1-5\",\n    \"timezone\": \"Asia/Kuala_Lumpur\",\n    \"variables\": {\n      \"queue\": \"l2\",\n      \"staleAfterHours\": 48\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"timezone \\\"Asia/Kuala Lumpur\\\" is not a valid IANA timezone (e.g. \\\"UTC\\\", \\\"Asia/Kuala_Lumpur\\\")\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createScheduledWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"timezone \\\"Asia/Kuala Lumpur\\\" is not a valid IANA timezone (e.g. \\\"UTC\\\", \\\"Asia/Kuala_Lumpur\\\")\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "5a92c312-9926-4980-ae35-01a9c2db9313",
              "name": "BAD_REQUEST: Plan limit reached",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateSchedule($input: CreateScheduledWorkflowInput!) {\n  createScheduledWorkflow(input: $input) {\n    id\n    name\n    agentId\n    cronExpression\n    timezone\n    status\n    nextRunAt\n    variables\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"name\": \"Weekday stale-ticket check\",\n    \"cronExpression\": \"0 9 * * 1-5\",\n    \"timezone\": \"Asia/Kuala_Lumpur\",\n    \"variables\": {\n      \"queue\": \"l2\",\n      \"staleAfterHours\": 48\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Creating another scheduled workflow would exceed your plan's limit of 25. Upgrade your plan or delete an existing scheduled workflow.\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createScheduledWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Creating another scheduled workflow would exceed your plan's limit of 25. Upgrade your plan or delete an existing scheduled workflow.\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "8270fcdd-b0a6-4615-a460-b398a4f55bd1",
              "name": "NOT_FOUND: Agent not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateSchedule($input: CreateScheduledWorkflowInput!) {\n  createScheduledWorkflow(input: $input) {\n    id\n    name\n    agentId\n    cronExpression\n    timezone\n    status\n    nextRunAt\n    variables\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"agentId\": 7,\n    \"name\": \"Weekday stale-ticket check\",\n    \"cronExpression\": \"0 9 * * 1-5\",\n    \"timezone\": \"Asia/Kuala_Lumpur\",\n    \"variables\": {\n      \"queue\": \"l2\",\n      \"staleAfterHours\": 48\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Agent 7 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createScheduledWorkflow\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Agent 7 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "f0b285f9-6dda-4aac-aaa8-8c0fb35af204",
          "name": "scheduledWorkflows",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Schedules($first: Int, $after: String) {\n  scheduledWorkflows(first: $first, after: $after) {\n    totalCount\n    edges {\n      node {\n        id\n        name\n        agentId\n        cronExpression\n        timezone\n        status\n        lastRunAt\n        lastRunStatus\n        consecutiveFailureCount\n        nextRunAt\n      }\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n",
                "variables": "{\n  \"first\": 20\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List the workspace's schedules, every status included, ordered by id.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Forward pagination: `first` (1 to 100, default 20) and `after` (a previous page's `pageInfo.endCursor`).\n- `lastRunStatus` is the last fire's run status in lower case (`running`, `completed`, `failed` and so on), or `null` before the first fire. `nextRunAt` is `null` unless the schedule is `ACTIVE`.\n\nReference: https://wetel.dev/docs/developer-portal/reference/schedules/"
          },
          "response": [
            {
              "id": "5bc38386-2394-470c-a4eb-c4af5df0c33b",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Schedules($first: Int, $after: String) {\n  scheduledWorkflows(first: $first, after: $after) {\n    totalCount\n    edges {\n      node {\n        id\n        name\n        agentId\n        cronExpression\n        timezone\n        status\n        lastRunAt\n        lastRunStatus\n        consecutiveFailureCount\n        nextRunAt\n      }\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n",
                    "variables": "{\n  \"first\": 20\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"scheduledWorkflows\": {\n      \"totalCount\": 1,\n      \"edges\": [\n        {\n          \"node\": {\n            \"id\": 14,\n            \"name\": \"Weekday stale-ticket check\",\n            \"agentId\": 7,\n            \"cronExpression\": \"0 9 * * 1-5\",\n            \"timezone\": \"Asia/Kuala_Lumpur\",\n            \"status\": \"ACTIVE\",\n            \"lastRunAt\": \"2026-10-16T01:00:00.412Z\",\n            \"lastRunStatus\": \"completed\",\n            \"consecutiveFailureCount\": 0,\n            \"nextRunAt\": \"2026-10-19T01:00:00.000Z\"\n          }\n        }\n      ],\n      \"pageInfo\": {\n        \"hasNextPage\": false,\n        \"endCursor\": \"MTQ=\"\n      }\n    }\n  }\n}"
            },
            {
              "id": "cc9fd04f-b6d5-4083-a11a-d96536db72d3",
              "name": "BAD_REQUEST: Page size out of range",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Schedules($first: Int, $after: String) {\n  scheduledWorkflows(first: $first, after: $after) {\n    totalCount\n    edges {\n      node {\n        id\n        name\n        agentId\n        cronExpression\n        timezone\n        status\n        lastRunAt\n        lastRunStatus\n        consecutiveFailureCount\n        nextRunAt\n      }\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n",
                    "variables": "{\n  \"first\": 20\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"first must be between 1 and 100\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"scheduledWorkflows\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"first must be between 1 and 100\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "02d4bc52-1ac6-4b75-a6f7-c364e17ab13b",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Schedules($first: Int, $after: String) {\n  scheduledWorkflows(first: $first, after: $after) {\n    totalCount\n    edges {\n      node {\n        id\n        name\n        agentId\n        cronExpression\n        timezone\n        status\n        lastRunAt\n        lastRunStatus\n        consecutiveFailureCount\n        nextRunAt\n      }\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n",
                    "variables": "{\n  \"first\": 20\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"scheduledWorkflows\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Knowledge bases (RAG)",
      "description": "Create knowledge bases, add documents (pasted text or uploaded files), check their status and delete them.",
      "item": [
        {
          "id": "9e03b35a-01f0-4b81-ab2c-eb5609ab8d6b",
          "name": "createKnowledgeBase",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"knowledgeBaseId\", get(json, \"data.createKnowledgeBase.id\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation CreateKb($input: CreateKnowledgeBaseInput!) {\n  createKnowledgeBase(input: $input) {\n    id\n    name\n    description\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"name\": \"IT helpdesk articles\",\n    \"description\": \"How-to articles the helpdesk agent may quote.\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Create an empty knowledge base.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "d21d2bfb-67a6-4920-ac9e-a3665f9a4617",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateKb($input: CreateKnowledgeBaseInput!) {\n  createKnowledgeBase(input: $input) {\n    id\n    name\n    description\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"IT helpdesk articles\",\n    \"description\": \"How-to articles the helpdesk agent may quote.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"createKnowledgeBase\": {\n      \"id\": 5,\n      \"name\": \"IT helpdesk articles\",\n      \"description\": \"How-to articles the helpdesk agent may quote.\"\n    }\n  }\n}"
            },
            {
              "id": "2ea5227e-c66f-41cf-a5ba-2c5d6dca7518",
              "name": "BAD_REQUEST: Plan limit reached",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateKb($input: CreateKnowledgeBaseInput!) {\n  createKnowledgeBase(input: $input) {\n    id\n    name\n    description\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"IT helpdesk articles\",\n    \"description\": \"How-to articles the helpdesk agent may quote.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Creating another knowledge base would exceed your plan's limit of 3. Upgrade your plan or delete an existing knowledge base.\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createKnowledgeBase\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Creating another knowledge base would exceed your plan's limit of 3. Upgrade your plan or delete an existing knowledge base.\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "bf8fae2a-8e47-47aa-a037-e76254cf761c",
          "name": "knowledgeBases",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query ListKbs {\n  knowledgeBases {\n    id\n    name\n    description\n    createdAt\n  }\n}\n",
                "variables": "{}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List the workspace's knowledge bases.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "85963f7f-1edf-4b5d-aa52-66caa07bc3a0",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListKbs {\n  knowledgeBases {\n    id\n    name\n    description\n    createdAt\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"knowledgeBases\": [\n      {\n        \"id\": 5,\n        \"name\": \"IT helpdesk articles\",\n        \"description\": \"How-to articles the helpdesk agent may quote.\",\n        \"createdAt\": \"2026-10-12T04:20:00.000Z\"\n      }\n    ]\n  }\n}"
            },
            {
              "id": "b1535cbb-001e-41a1-ac17-d44ad8716873",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListKbs {\n  knowledgeBases {\n    id\n    name\n    description\n    createdAt\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"knowledgeBases\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "3d8f0672-b5fe-4bf7-a8dc-eeefb5715f45",
          "name": "ingestDocument",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation AddText($input: IngestDocumentInput!) {\n  ingestDocument(input: $input)\n}\n",
                "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": {{knowledgeBaseId}},\n    \"fileName\": \"reset-password.md\",\n    \"text\": \"To reset your password, open the self-service portal, choose Forgot password and follow the code sent to your work phone. Codes expire after 10 minutes.\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Add pasted text as a document. Chunked and embedded at once; returns the number of chunks.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Text only, at most 500 KB. The document is `READY` as soon as this returns.\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "ddfe9622-8181-49a8-ac03-dd91b4cb4ea6",
              "name": "Success (number of chunks created)",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation AddText($input: IngestDocumentInput!) {\n  ingestDocument(input: $input)\n}\n",
                    "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": 5,\n    \"fileName\": \"reset-password.md\",\n    \"text\": \"To reset your password, open the self-service portal, choose Forgot password and follow the code sent to your work phone. Codes expire after 10 minutes.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"ingestDocument\": 1\n  }\n}"
            },
            {
              "id": "8fded3df-ab39-4248-a9fe-5a5f2b8ca276",
              "name": "NOT_FOUND: Knowledge base not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation AddText($input: IngestDocumentInput!) {\n  ingestDocument(input: $input)\n}\n",
                    "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": 5,\n    \"fileName\": \"reset-password.md\",\n    \"text\": \"To reset your password, open the self-service portal, choose Forgot password and follow the code sent to your work phone. Codes expire after 10 minutes.\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Knowledge base 5 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"ingestDocument\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Knowledge base 5 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "9e191152-05d9-4289-a438-b884eb43ee94",
          "name": "requestKnowledgeDocumentUpload",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"uploadUrl\", get(json, \"data.requestKnowledgeDocumentUpload.uploadUrl\"));",
                  "store(\"objectStorageKey\", get(json, \"data.requestKnowledgeDocumentUpload.objectStorageKey\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation RequestUpload($input: RequestKnowledgeDocumentUploadInput!) {\n  requestKnowledgeDocumentUpload(input: $input) {\n    uploadUrl\n    objectStorageKey\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": {{knowledgeBaseId}},\n    \"fileName\": \"vpn-guide.pdf\",\n    \"mimeType\": \"application/pdf\",\n    \"declaredSizeBytes\": 482113\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "File upload, step 1: get a short-lived URL to PUT the file to.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Then upload the bytes yourself, with the same `Content-Type` as `mimeType`: `curl -X PUT -H \"Content-Type: application/pdf\" --data-binary @vpn-guide.pdf \"$UPLOAD_URL\"`. The URL expires after 15 minutes.\n- Allowed `mimeType` values: `application/pdf`, `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX), `text/markdown`, `text/csv`, `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX). At most 20 MB.\n- Keep `objectStorageKey`; step 2 needs it. Limited to 10 calls per minute per client IP.\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "2c6b86d3-793e-4770-ac52-537ec3c5d373",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RequestUpload($input: RequestKnowledgeDocumentUploadInput!) {\n  requestKnowledgeDocumentUpload(input: $input) {\n    uploadUrl\n    objectStorageKey\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": 5,\n    \"fileName\": \"vpn-guide.pdf\",\n    \"mimeType\": \"application/pdf\",\n    \"declaredSizeBytes\": 482113\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"requestKnowledgeDocumentUpload\": {\n      \"uploadUrl\": \"https://storage.example.com/uploads/tenant-3/kb-5/0b7c2f9e-vpn-guide.pdf?X-Signature=example-not-real\",\n      \"objectStorageKey\": \"tenant-3/kb-5/0b7c2f9e-vpn-guide.pdf\"\n    }\n  }\n}"
            },
            {
              "id": "3b0ddc0e-1c95-432f-a792-c97772812e4d",
              "name": "BAD_REQUEST: File type not supported",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RequestUpload($input: RequestKnowledgeDocumentUploadInput!) {\n  requestKnowledgeDocumentUpload(input: $input) {\n    uploadUrl\n    objectStorageKey\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": 5,\n    \"fileName\": \"vpn-guide.pdf\",\n    \"mimeType\": \"application/pdf\",\n    \"declaredSizeBytes\": 482113\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"mimeType must be one of the following values: application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/markdown, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"requestKnowledgeDocumentUpload\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"mimeType must be one of the following values: application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/markdown, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "8d1f740a-8541-4a8b-a845-21635dc5c4fa",
              "name": "BAD_REQUEST: File too large",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RequestUpload($input: RequestKnowledgeDocumentUploadInput!) {\n  requestKnowledgeDocumentUpload(input: $input) {\n    uploadUrl\n    objectStorageKey\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": 5,\n    \"fileName\": \"vpn-guide.pdf\",\n    \"mimeType\": \"application/pdf\",\n    \"declaredSizeBytes\": 482113\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"File size 31457280 bytes exceeds the maximum upload size of 20971520 bytes.\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"requestKnowledgeDocumentUpload\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"File size 31457280 bytes exceeds the maximum upload size of 20971520 bytes.\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "2552b7aa-6e8f-4b20-ac9a-0e4e1d8fc145",
          "name": "confirmKnowledgeDocumentUpload",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"documentId\", get(json, \"data.confirmKnowledgeDocumentUpload.documentId\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation ConfirmUpload($input: ConfirmKnowledgeDocumentUploadInput!) {\n  confirmKnowledgeDocumentUpload(input: $input) {\n    documentId\n    parseStatus\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": {{knowledgeBaseId}},\n    \"objectStorageKey\": \"{{objectStorageKey}}\",\n    \"fileName\": \"vpn-guide.pdf\",\n    \"mimeType\": \"application/pdf\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "File upload, step 2: confirm the upload finished. Parsing starts in the background.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Call it after your `PUT` succeeded. The document starts `PENDING`, then `PARSING`, then `READY` or `FAILED`.\n- Limited to 10 calls per minute per client IP.\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "41943845-cb4a-46a2-afd2-3b78045d3941",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation ConfirmUpload($input: ConfirmKnowledgeDocumentUploadInput!) {\n  confirmKnowledgeDocumentUpload(input: $input) {\n    documentId\n    parseStatus\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": 5,\n    \"objectStorageKey\": \"tenant-3/kb-5/0b7c2f9e-vpn-guide.pdf\",\n    \"fileName\": \"vpn-guide.pdf\",\n    \"mimeType\": \"application/pdf\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"confirmKnowledgeDocumentUpload\": {\n      \"documentId\": 61,\n      \"parseStatus\": \"PENDING\"\n    }\n  }\n}"
            },
            {
              "id": "dc19a410-b061-4b7d-a3f7-a0b4ee627d55",
              "name": "BAD_REQUEST: The PUT did not complete",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation ConfirmUpload($input: ConfirmKnowledgeDocumentUploadInput!) {\n  confirmKnowledgeDocumentUpload(input: $input) {\n    documentId\n    parseStatus\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"knowledgeBaseId\": 5,\n    \"objectStorageKey\": \"tenant-3/kb-5/0b7c2f9e-vpn-guide.pdf\",\n    \"fileName\": \"vpn-guide.pdf\",\n    \"mimeType\": \"application/pdf\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"No file was found at this upload location — the upload may not have completed. Request a new upload URL and try again.\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"confirmKnowledgeDocumentUpload\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"No file was found at this upload location — the upload may not have completed. Request a new upload URL and try again.\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "06550230-d87f-4ee3-a8b5-cbd56004d4ce",
          "name": "knowledgeDocuments",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Documents($knowledgeBaseId: Int!) {\n  knowledgeDocuments(knowledgeBaseId: $knowledgeBaseId) {\n    id\n    fileName\n    mimeType\n    fileSizeBytes\n    parseStatus\n    parseError\n  }\n}\n",
                "variables": "{\n  \"knowledgeBaseId\": {{knowledgeBaseId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List the documents of a knowledge base with their parse status (poll this after an upload).\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `parseStatus` is `PENDING`, `PARSING`, `READY` or `FAILED` (then `parseError` says why). Pasted-text documents are `READY` at once.\n- Do not select `rawText` here; read one document's full text with `knowledgeDocument(id)`.\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "36323d1d-f22b-41fc-af4b-4610de8615a2",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Documents($knowledgeBaseId: Int!) {\n  knowledgeDocuments(knowledgeBaseId: $knowledgeBaseId) {\n    id\n    fileName\n    mimeType\n    fileSizeBytes\n    parseStatus\n    parseError\n  }\n}\n",
                    "variables": "{\n  \"knowledgeBaseId\": 5\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"knowledgeDocuments\": [\n      {\n        \"id\": 61,\n        \"fileName\": \"vpn-guide.pdf\",\n        \"mimeType\": \"application/pdf\",\n        \"fileSizeBytes\": 482113,\n        \"parseStatus\": \"READY\",\n        \"parseError\": null\n      },\n      {\n        \"id\": 60,\n        \"fileName\": \"reset-password.md\",\n        \"mimeType\": \"text/plain\",\n        \"fileSizeBytes\": 160,\n        \"parseStatus\": \"READY\",\n        \"parseError\": null\n      }\n    ]\n  }\n}"
            },
            {
              "id": "fb0f3b75-17c4-4c54-ac17-1174d2f9f9e0",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Documents($knowledgeBaseId: Int!) {\n  knowledgeDocuments(knowledgeBaseId: $knowledgeBaseId) {\n    id\n    fileName\n    mimeType\n    fileSizeBytes\n    parseStatus\n    parseError\n  }\n}\n",
                    "variables": "{\n  \"knowledgeBaseId\": 5\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"knowledgeDocuments\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "b4b6fe3b-aea8-4a8b-a487-07bd7399d1c6",
          "name": "knowledgeDocument",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Document($id: Int!) {\n  knowledgeDocument(id: $id) {\n    id\n    fileName\n    mimeType\n    parseStatus\n    parseError\n    rawText\n    updatedAt\n  }\n}\n",
                "variables": "{\n  \"id\": {{documentId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Read one document with its status and full text.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `rawText` is the pasted text or the text extracted from the file. It is empty while the document is `PENDING` or `PARSING`.\n- Use it to check what the agent can actually quote after a file was parsed (scanned PDFs, for example, can come out empty).\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "0a387b9a-2d05-40cc-a542-9c4f2aeb6756",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Document($id: Int!) {\n  knowledgeDocument(id: $id) {\n    id\n    fileName\n    mimeType\n    parseStatus\n    parseError\n    rawText\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"id\": 61\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"knowledgeDocument\": {\n      \"id\": 61,\n      \"fileName\": \"vpn-guide.pdf\",\n      \"mimeType\": \"application/pdf\",\n      \"parseStatus\": \"READY\",\n      \"parseError\": null,\n      \"rawText\": \"Connecting to the VPN. Install the VPN client from the self-service portal, sign in with your work account and approve the prompt on your phone.\",\n      \"updatedAt\": \"2026-10-12T04:31:09.000Z\"\n    }\n  }\n}"
            },
            {
              "id": "a972ec7c-9213-457f-a4b9-6d39f20f3e76",
              "name": "NOT_FOUND: Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Document($id: Int!) {\n  knowledgeDocument(id: $id) {\n    id\n    fileName\n    mimeType\n    parseStatus\n    parseError\n    rawText\n    updatedAt\n  }\n}\n",
                    "variables": "{\n  \"id\": 61\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Knowledge document 61 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"knowledgeDocument\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Knowledge document 61 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "abb7a15f-4fc3-4983-ac8d-9d10b361f050",
          "name": "resyncKnowledgeDocument",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation Resync($id: Int!) {\n  resyncKnowledgeDocument(id: $id)\n}\n",
                "variables": "{\n  \"id\": {{documentId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Retry a FAILED file upload, or re-chunk and re-embed a READY document from its stored text.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- A `FAILED` upload goes back to `PENDING` and is parsed again in the background; poll `knowledgeDocument` or `knowledgeDocuments`. A `READY` document is re-embedded before this returns.\n- Refused while the document is `PENDING` or `PARSING`. Re-embedding is a metered model call and counts against your plan's chunk quota.\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "2fa29376-41bb-4fa9-ad7a-7cca028d3697",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Resync($id: Int!) {\n  resyncKnowledgeDocument(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 61\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"resyncKnowledgeDocument\": true\n  }\n}"
            },
            {
              "id": "552f60fb-c68a-48b5-a77d-b5d829f8b280",
              "name": "BAD_REQUEST: Still being parsed",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Resync($id: Int!) {\n  resyncKnowledgeDocument(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 61\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Document 61 is already being parsed — wait for it to finish before resyncing.\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"resyncKnowledgeDocument\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Document 61 is already being parsed — wait for it to finish before resyncing.\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "e46e6570-04c7-4f5b-a3ad-7725e70b91a4",
              "name": "NOT_FOUND: Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Resync($id: Int!) {\n  resyncKnowledgeDocument(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 61\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Knowledge document 61 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"resyncKnowledgeDocument\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Knowledge document 61 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "2c5d39d3-13bf-46c5-a3a9-68e8335b63dc",
          "name": "retrieveChunks",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Search($knowledgeBaseId: Int!, $query: String!, $topK: Int) {\n  retrieveChunks(knowledgeBaseId: $knowledgeBaseId, query: $query, topK: $topK) {\n    chunkId\n    documentId\n    score\n    content\n  }\n}\n",
                "variables": "{\n  \"knowledgeBaseId\": {{knowledgeBaseId}},\n  \"query\": \"I forgot my password and the code never arrives\",\n  \"topK\": 3\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Search a knowledge base the way an llm node does, and see which chunks come back.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Returns the `topK` chunks (default 5, at most 20) most similar to `query`, most relevant first. `score` is the cosine similarity (higher is more relevant).\n- Use it to test whether an article will be found for a typical customer question before you rely on it in a workflow. Embedding the query is a metered model call.\n- An unknown knowledge base, or one of another workspace, returns an empty list.\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "62ed68bf-b7e8-40d5-a045-5f1cd7dceab6",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Search($knowledgeBaseId: Int!, $query: String!, $topK: Int) {\n  retrieveChunks(knowledgeBaseId: $knowledgeBaseId, query: $query, topK: $topK) {\n    chunkId\n    documentId\n    score\n    content\n  }\n}\n",
                    "variables": "{\n  \"knowledgeBaseId\": 5,\n  \"query\": \"I forgot my password and the code never arrives\",\n  \"topK\": 3\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"retrieveChunks\": [\n      {\n        \"chunkId\": 812,\n        \"documentId\": 60,\n        \"score\": 0.8132,\n        \"content\": \"To reset your password, open the self-service portal, choose Forgot password and follow the code sent to your work phone. Codes expire after 10 minutes.\"\n      },\n      {\n        \"chunkId\": 845,\n        \"documentId\": 61,\n        \"score\": 0.6017,\n        \"content\": \"Connecting to the VPN. Install the VPN client from the self-service portal, sign in with your work account and approve the prompt on your phone.\"\n      }\n    ]\n  }\n}"
            },
            {
              "id": "e52fd623-82e6-4d79-a232-ce968e91c433",
              "name": "BAD_USER_INPUT: Query missing",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Search($knowledgeBaseId: Int!, $query: String!, $topK: Int) {\n  retrieveChunks(knowledgeBaseId: $knowledgeBaseId, query: $query, topK: $topK) {\n    chunkId\n    documentId\n    score\n    content\n  }\n}\n",
                    "variables": "{\n  \"knowledgeBaseId\": 5\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$query\\\" of required type \\\"String!\\\" was not provided.\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 38\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "id": "0cc16df9-d45f-4f32-affa-531669c113c2",
          "name": "deleteKnowledgeDocument",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation DeleteDocument($id: Int!) {\n  deleteKnowledgeDocument(id: $id)\n}\n",
                "variables": "{\n  \"id\": {{documentId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Delete one document and its chunks, releasing its quota. The knowledge base stays.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "c92a230f-241d-470b-a2a0-2721b7465d21",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation DeleteDocument($id: Int!) {\n  deleteKnowledgeDocument(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 61\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"deleteKnowledgeDocument\": true\n  }\n}"
            },
            {
              "id": "3542ca0f-a6eb-487b-acef-d626590a718d",
              "name": "NOT_FOUND: Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation DeleteDocument($id: Int!) {\n  deleteKnowledgeDocument(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 61\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Knowledge document 61 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"deleteKnowledgeDocument\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Knowledge document 61 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "654fdd00-2606-4603-aded-35d9a5c86a1d",
          "name": "deleteKnowledgeBase",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation DeleteKb($id: Int!) {\n  deleteKnowledgeBase(id: $id)\n}\n",
                "variables": "{\n  \"id\": {{knowledgeBaseId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Delete a knowledge base.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Delete its documents first with `deleteKnowledgeDocument` if you want their quota back; deleting the knowledge base does not delete them.\n\nReference: https://wetel.dev/docs/developer-portal/reference/knowledge/"
          },
          "response": [
            {
              "id": "260c20f3-3f6d-444b-a675-1b8fe4d5d96b",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation DeleteKb($id: Int!) {\n  deleteKnowledgeBase(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 5\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"deleteKnowledgeBase\": true\n  }\n}"
            },
            {
              "id": "5a1d2c64-e4db-4a5d-acf2-71d6af654d55",
              "name": "NOT_FOUND: Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation DeleteKb($id: Int!) {\n  deleteKnowledgeBase(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 5\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Knowledge base 5 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"deleteKnowledgeBase\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Knowledge base 5 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "MCP connectors",
      "description": "Register your own MCP tool server, list the tools it offers, and remove it.",
      "item": [
        {
          "id": "cc05dc02-a57a-45a9-aa16-bfce423c5681",
          "name": "createMcpConnector",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"connectorId\", get(json, \"data.createMcpConnector.id\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation CreateConnector($input: CreateMcpConnectorInput!) {\n  createMcpConnector(input: $input) {\n    id\n    name\n    serverUrl\n    creditsPerCall\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"name\": \"Ticketing tools\",\n    \"serverUrl\": \"https://tools.example.com/mcp\",\n    \"apiKey\": \"example-tool-server-key-not-real\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Register an MCP tool server for your workspace.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `creditsPerCall` is optional: the credits charged for one successful call of any tool on this connector. Omit it for the platform default.\n\nReference: https://wetel.dev/docs/developer-portal/reference/mcp-connectors/"
          },
          "response": [
            {
              "id": "64481c30-c337-4218-af1d-4f0b3407c2f4",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateConnector($input: CreateMcpConnectorInput!) {\n  createMcpConnector(input: $input) {\n    id\n    name\n    serverUrl\n    creditsPerCall\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"Ticketing tools\",\n    \"serverUrl\": \"https://tools.example.com/mcp\",\n    \"apiKey\": \"example-tool-server-key-not-real\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"createMcpConnector\": {\n      \"id\": 4,\n      \"name\": \"Ticketing tools\",\n      \"serverUrl\": \"https://tools.example.com/mcp\",\n      \"creditsPerCall\": null\n    }\n  }\n}"
            },
            {
              "id": "138cc40a-f71f-49f4-af38-4de162abcae5",
              "name": "BAD_USER_INPUT: A required field is missing",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateConnector($input: CreateMcpConnectorInput!) {\n  createMcpConnector(input: $input) {\n    id\n    name\n    serverUrl\n    creditsPerCall\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"Ticketing tools\",\n    \"serverUrl\": \"https://tools.example.com/mcp\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$input\\\" got invalid value { name: \\\"Ticketing tools\\\", serverUrl: \\\"https://tools.example.com/mcp\\\" }; Field \\\"apiKey\\\" of required type \\\"String!\\\" was not provided.\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 26\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            },
            {
              "id": "7b96c40b-0336-45c1-a3e6-6da616fef6c5",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateConnector($input: CreateMcpConnectorInput!) {\n  createMcpConnector(input: $input) {\n    id\n    name\n    serverUrl\n    creditsPerCall\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"Ticketing tools\",\n    \"serverUrl\": \"https://tools.example.com/mcp\",\n    \"apiKey\": \"example-tool-server-key-not-real\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createMcpConnector\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "bf77ba4f-a652-42db-a2f5-01154fdc2b54",
          "name": "mcpConnectors",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query ListConnectors {\n  mcpConnectors {\n    id\n    name\n    serverUrl\n    creditsPerCall\n    createdAt\n  }\n}\n",
                "variables": "{}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List the workspace's MCP connectors, newest first.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n\nReference: https://wetel.dev/docs/developer-portal/reference/mcp-connectors/"
          },
          "response": [
            {
              "id": "15bc05fe-6aa9-4d34-aacd-5f09cd4334ec",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListConnectors {\n  mcpConnectors {\n    id\n    name\n    serverUrl\n    creditsPerCall\n    createdAt\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"mcpConnectors\": [\n      {\n        \"id\": 4,\n        \"name\": \"Ticketing tools\",\n        \"serverUrl\": \"https://tools.example.com/mcp\",\n        \"creditsPerCall\": null,\n        \"createdAt\": \"2026-10-12T04:30:00.000Z\"\n      }\n    ]\n  }\n}"
            },
            {
              "id": "05b7c9ed-3696-429b-a1f5-5ab1b7ab705e",
              "name": "UNAUTHENTICATED: Missing credential",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListConnectors {\n  mcpConnectors {\n    id\n    name\n    serverUrl\n    creditsPerCall\n    createdAt\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"mcpConnectors\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "5bbb8ebb-ce16-4ebe-aa51-8c6e22f2f136",
          "name": "listMcpTools",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Tools($connectorId: Int!) {\n  listMcpTools(connectorId: $connectorId) {\n    name\n    description\n    inputSchema\n  }\n}\n",
                "variables": "{\n  \"connectorId\": {{connectorId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Connect to the server and list its tools. Use it to test a connector before a workflow relies on it.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- This calls your server live with the stored key. A server that cannot be reached, or that refuses the key, answers `INTERNAL_SERVER_ERROR` with a message describing the connection problem.\n- `inputSchema` is the tool's own JSON Schema for its arguments, as your server declares it.\n\nReference: https://wetel.dev/docs/developer-portal/reference/mcp-connectors/"
          },
          "response": [
            {
              "id": "40a4b47a-af40-4abd-a0bf-ef20d4fd2f86",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Tools($connectorId: Int!) {\n  listMcpTools(connectorId: $connectorId) {\n    name\n    description\n    inputSchema\n  }\n}\n",
                    "variables": "{\n  \"connectorId\": 4\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"listMcpTools\": [\n      {\n        \"name\": \"create_ticket\",\n        \"description\": \"Create a ticket in the ticketing system and return its number.\",\n        \"inputSchema\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"subject\": {\n              \"type\": \"string\"\n            },\n            \"level\": {\n              \"type\": \"string\",\n              \"enum\": [\n                \"L1\",\n                \"L2\",\n                \"L3\"\n              ]\n            }\n          },\n          \"required\": [\n            \"subject\",\n            \"level\"\n          ]\n        }\n      }\n    ]\n  }\n}"
            },
            {
              "id": "163deafa-a50a-4758-a344-9877bd3d33bf",
              "name": "NOT_FOUND: Connector not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Tools($connectorId: Int!) {\n  listMcpTools(connectorId: $connectorId) {\n    name\n    description\n    inputSchema\n  }\n}\n",
                    "variables": "{\n  \"connectorId\": 4\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Connector #4 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"listMcpTools\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Connector #4 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "9b960c34-af02-453e-a387-ced720879159",
          "name": "deleteMcpConnector",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation DeleteConnector($id: Int!) {\n  deleteMcpConnector(id: $id)\n}\n",
                "variables": "{\n  \"id\": {{connectorId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Remove an MCP connector. Workflow nodes that use it stop working.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n\nReference: https://wetel.dev/docs/developer-portal/reference/mcp-connectors/"
          },
          "response": [
            {
              "id": "f430ac30-d600-4292-a43e-0d8717e9df43",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation DeleteConnector($id: Int!) {\n  deleteMcpConnector(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 4\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"deleteMcpConnector\": true\n  }\n}"
            },
            {
              "id": "6302a0b5-30ff-4ceb-a82b-3dacebf59e96",
              "name": "NOT_FOUND: Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation DeleteConnector($id: Int!) {\n  deleteMcpConnector(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 4\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Connector #4 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"deleteMcpConnector\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Connector #4 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Custom actions",
      "description": "Register a REST call a workflow can make (URL, method, credential), test it for real, list and delete it.",
      "item": [
        {
          "id": "a53e7b23-36ac-49d8-ae50-a2c01c682709",
          "name": "createCustomAction",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"customActionId\", get(json, \"data.createCustomAction.id\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation CreateAction($input: CreateCustomActionInput!) {\n  createCustomAction(input: $input) {\n    id\n    name\n    method\n    url\n    credentialSecretHeaderName\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"name\": \"create_ticket\",\n    \"description\": \"Create a ticket in the ticketing backend and return its number.\",\n    \"url\": \"https://tickets.example.com/api/tickets\",\n    \"method\": \"POST\",\n    \"bearerToken\": \"example-backend-token-not-real\",\n    \"argsSchema\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"subject\": {\n          \"type\": \"string\"\n        },\n        \"level\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"L1\",\n            \"L2\",\n            \"L3\"\n          ]\n        }\n      },\n      \"required\": [\n        \"subject\",\n        \"level\"\n      ]\n    }\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Register a REST call for workflow action nodes.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- `method` is one of `GET`, `POST`, `PUT`, `PATCH`, `DELETE` (default `POST`).\n- `argsSchema` documents the arguments the call expects; it is not enforced at run time.\n- Limited to 10 calls per minute per client IP.\n\nReference: https://wetel.dev/docs/developer-portal/reference/custom-actions/"
          },
          "response": [
            {
              "id": "0ba557fc-b028-4e6b-afac-da570cb67d4e",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateAction($input: CreateCustomActionInput!) {\n  createCustomAction(input: $input) {\n    id\n    name\n    method\n    url\n    credentialSecretHeaderName\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"create_ticket\",\n    \"description\": \"Create a ticket in the ticketing backend and return its number.\",\n    \"url\": \"https://tickets.example.com/api/tickets\",\n    \"method\": \"POST\",\n    \"bearerToken\": \"example-backend-token-not-real\",\n    \"argsSchema\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"subject\": {\n          \"type\": \"string\"\n        },\n        \"level\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"L1\",\n            \"L2\",\n            \"L3\"\n          ]\n        }\n      },\n      \"required\": [\n        \"subject\",\n        \"level\"\n      ]\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"createCustomAction\": {\n      \"id\": 9,\n      \"name\": \"create_ticket\",\n      \"method\": \"POST\",\n      \"url\": \"https://tickets.example.com/api/tickets\",\n      \"credentialSecretHeaderName\": null\n    }\n  }\n}"
            },
            {
              "id": "acc43734-352a-4caa-a43f-5582f39e623f",
              "name": "BAD_REQUEST: Header name without a secret",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateAction($input: CreateCustomActionInput!) {\n  createCustomAction(input: $input) {\n    id\n    name\n    method\n    url\n    credentialSecretHeaderName\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"create_ticket\",\n    \"description\": \"Create a ticket in the ticketing backend and return its number.\",\n    \"url\": \"https://tickets.example.com/api/tickets\",\n    \"method\": \"POST\",\n    \"bearerToken\": \"example-backend-token-not-real\",\n    \"argsSchema\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"subject\": {\n          \"type\": \"string\"\n        },\n        \"level\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"L1\",\n            \"L2\",\n            \"L3\"\n          ]\n        }\n      },\n      \"required\": [\n        \"subject\",\n        \"level\"\n      ]\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"credentialSecretHeaderName requires bearerToken in the same call — a header name with no secret to send under it has no effect.\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createCustomAction\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"credentialSecretHeaderName requires bearerToken in the same call — a header name with no secret to send under it has no effect.\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "fb431839-ec95-4858-a5fc-36cec951e120",
              "name": "BAD_REQUEST: Unsupported method",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateAction($input: CreateCustomActionInput!) {\n  createCustomAction(input: $input) {\n    id\n    name\n    method\n    url\n    credentialSecretHeaderName\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"name\": \"create_ticket\",\n    \"description\": \"Create a ticket in the ticketing backend and return its number.\",\n    \"url\": \"https://tickets.example.com/api/tickets\",\n    \"method\": \"POST\",\n    \"bearerToken\": \"example-backend-token-not-real\",\n    \"argsSchema\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"subject\": {\n          \"type\": \"string\"\n        },\n        \"level\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"L1\",\n            \"L2\",\n            \"L3\"\n          ]\n        }\n      },\n      \"required\": [\n        \"subject\",\n        \"level\"\n      ]\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"method must be one of the following values: GET, POST, PUT, PATCH, DELETE\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createCustomAction\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"method must be one of the following values: GET, POST, PUT, PATCH, DELETE\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "fbce54ed-e9b3-422c-a7b3-a71c95281c26",
          "name": "customActions",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query ListActions {\n  customActions {\n    id\n    name\n    method\n    url\n    description\n    creditsPerCall\n  }\n}\n",
                "variables": "{}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List the workspace's custom actions.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n\nReference: https://wetel.dev/docs/developer-portal/reference/custom-actions/"
          },
          "response": [
            {
              "id": "366e9167-afb0-49da-a83b-e2ec7ba73f1b",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListActions {\n  customActions {\n    id\n    name\n    method\n    url\n    description\n    creditsPerCall\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"customActions\": [\n      {\n        \"id\": 9,\n        \"name\": \"create_ticket\",\n        \"method\": \"POST\",\n        \"url\": \"https://tickets.example.com/api/tickets\",\n        \"description\": \"Create a ticket in the ticketing backend and return its number.\",\n        \"creditsPerCall\": null\n      }\n    ]\n  }\n}"
            },
            {
              "id": "50439076-6578-4ac1-a8d4-e45f25a38bf7",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListActions {\n  customActions {\n    id\n    name\n    method\n    url\n    description\n    creditsPerCall\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"customActions\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "6abbce26-3ff4-46cf-a8db-2a017fa86b8e",
          "name": "testCustomAction",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation TestAction($input: TestCustomActionInput!) {\n  testCustomAction(input: $input) {\n    outcome\n    httpStatus\n    message\n    responseSnippet\n    durationMs\n    creditsBilled\n  }\n}\n",
                "variables": "{\n  \"input\": {\n    \"id\": {{customActionId}},\n    \"confirmWrite\": true,\n    \"sampleArgs\": {\n      \"subject\": \"Test ticket from the developer portal\",\n      \"level\": \"L1\"\n    }\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Make one real call of a custom action and classify the answer, before a conversation depends on it.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- The call really happens, through the same path a workflow uses. An action whose method is not `GET` needs `confirmWrite: true` and may change data on the target.\n- `sampleArgs` (a flat JSON object) is sent as the body, or as the query string for `GET` and `DELETE`, exactly as written: template syntax such as `{{x}}` is refused.\n- `outcome` tells you what to fix: `CREDENTIAL_REJECTED` (401/403: the stored token or its header is wrong), `REQUEST_REJECTED` (other 4xx), `SERVER_ERROR` (5xx), `TIMEOUT`, `UNREACHABLE`, `BLOCKED` (a private or reserved address), `WRITE_NOT_CONFIRMED`. The response snippet is masked and cut to 500 characters.\n- A successful test is billed like the same call in a workflow (`creditsBilled`); a failed or refused test is free. Limited to 10 calls per minute per client IP.\n\nReference: https://wetel.dev/docs/developer-portal/reference/custom-actions/"
          },
          "response": [
            {
              "id": "e1db36f1-384a-4f59-a122-4f69e7ac265c",
              "name": "OK",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation TestAction($input: TestCustomActionInput!) {\n  testCustomAction(input: $input) {\n    outcome\n    httpStatus\n    message\n    responseSnippet\n    durationMs\n    creditsBilled\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"id\": 9,\n    \"confirmWrite\": true,\n    \"sampleArgs\": {\n      \"subject\": \"Test ticket from the developer portal\",\n      \"level\": \"L1\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"testCustomAction\": {\n      \"outcome\": \"OK\",\n      \"httpStatus\": 200,\n      \"message\": \"The target answered successfully.\",\n      \"responseSnippet\": \"{\\\"ticketNumber\\\":\\\"T-1003\\\"}\",\n      \"durationMs\": 284,\n      \"creditsBilled\": 2\n    }\n  }\n}"
            },
            {
              "id": "5b08cda5-8a5a-4117-a720-c85a952427f8",
              "name": "Write not confirmed (a classified outcome, not an error)",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation TestAction($input: TestCustomActionInput!) {\n  testCustomAction(input: $input) {\n    outcome\n    httpStatus\n    message\n    responseSnippet\n    durationMs\n    creditsBilled\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"id\": 9,\n    \"confirmWrite\": true,\n    \"sampleArgs\": {\n      \"subject\": \"Test ticket from the developer portal\",\n      \"level\": \"L1\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"testCustomAction\": {\n      \"outcome\": \"WRITE_NOT_CONFIRMED\",\n      \"httpStatus\": null,\n      \"message\": \"This action uses POST, so the test call would really be made and may change data on the target. Send confirmWrite: true to run it.\",\n      \"responseSnippet\": null,\n      \"durationMs\": 0,\n      \"creditsBilled\": 0\n    }\n  }\n}"
            },
            {
              "id": "a34fc7fe-148d-4aeb-a105-83629f7c332a",
              "name": "BAD_REQUEST: Template syntax in sampleArgs",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation TestAction($input: TestCustomActionInput!) {\n  testCustomAction(input: $input) {\n    outcome\n    httpStatus\n    message\n    responseSnippet\n    durationMs\n    creditsBilled\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"id\": 9,\n    \"confirmWrite\": true,\n    \"sampleArgs\": {\n      \"subject\": \"Test ticket from the developer portal\",\n      \"level\": \"L1\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"sampleArgs are sent verbatim and may not contain template syntax ({{ }}).\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"testCustomAction\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"sampleArgs are sent verbatim and may not contain template syntax ({{ }}).\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "a2589d33-2dc2-49ad-a2af-d3d430c2dc81",
              "name": "NOT_FOUND: Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation TestAction($input: TestCustomActionInput!) {\n  testCustomAction(input: $input) {\n    outcome\n    httpStatus\n    message\n    responseSnippet\n    durationMs\n    creditsBilled\n  }\n}\n",
                    "variables": "{\n  \"input\": {\n    \"id\": 9,\n    \"confirmWrite\": true,\n    \"sampleArgs\": {\n      \"subject\": \"Test ticket from the developer portal\",\n      \"level\": \"L1\"\n    }\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Custom action #9 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"testCustomAction\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Custom action #9 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "9a775e2b-94d6-40a0-ab80-41dc0b361c94",
          "name": "deleteCustomAction",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation DeleteAction($id: Int!) {\n  deleteCustomAction(id: $id)\n}\n",
                "variables": "{\n  \"id\": {{customActionId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Delete a custom action. Action nodes that use it fail when they run.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Limited to 10 calls per minute per client IP.\n\nReference: https://wetel.dev/docs/developer-portal/reference/custom-actions/"
          },
          "response": [
            {
              "id": "62d33f4a-3e88-4639-a528-47194ff6622d",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation DeleteAction($id: Int!) {\n  deleteCustomAction(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 9\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"deleteCustomAction\": true\n  }\n}"
            },
            {
              "id": "a3ff71e2-c3ab-4805-a9d7-93e4d38bb39f",
              "name": "NOT_FOUND: Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation DeleteAction($id: Int!) {\n  deleteCustomAction(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 9\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Custom action #9 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"deleteCustomAction\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Custom action #9 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Approvals",
      "description": "Read the approvals inbox and approve, reject or cancel requests a workflow raised.",
      "item": [
        {
          "id": "1dbe46f2-a343-4150-a9fc-db7d870d515c",
          "name": "approvals",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"approvalId\", get(json, \"data.approvals.edges.0.node.id\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Inbox($statuses: [ApprovalStatus!], $first: Int) {\n  approvals(statuses: $statuses, first: $first) {\n    edges {\n      node {\n        id\n        status\n        title\n        summary\n        payload\n        editableFields\n        expiresAt\n        workflowRunId\n      }\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n",
                "variables": "{\n  \"statuses\": [\n    \"PENDING\"\n  ],\n  \"first\": 20\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List approval requests, newest first. Without a filter it lists only PENDING requests.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\nWorkspace owner only.\n- Pass `status` for one state or `statuses` for several in one list (for example every decided request). Passing both, or an empty `statuses` list, is a `BAD_REQUEST`.\n- Forward pagination: `first` (default 20, at most 100) and `after` (a previous page's `pageInfo.endCursor`, which walks to older rows). Optional `workflowId` and `agentId` narrow the list.\n- A request past `expiresAt` that has not been swept yet still reads `PENDING` but can no longer be decided.\n- `payload` is the thing being decided and may contain customer data.\n\nReference: https://wetel.dev/docs/developer-portal/reference/approvals/"
          },
          "response": [
            {
              "id": "8ff36793-c358-45e8-ab3e-3afff0b316a6",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Inbox($statuses: [ApprovalStatus!], $first: Int) {\n  approvals(statuses: $statuses, first: $first) {\n    edges {\n      node {\n        id\n        status\n        title\n        summary\n        payload\n        editableFields\n        expiresAt\n        workflowRunId\n      }\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n",
                    "variables": "{\n  \"statuses\": [\n    \"PENDING\"\n  ],\n  \"first\": 20\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"approvals\": {\n      \"edges\": [\n        {\n          \"node\": {\n            \"id\": 118,\n            \"status\": \"PENDING\",\n            \"title\": \"Emergency escalation for ticket T-1001\",\n            \"summary\": \"Severity high, many people affected. Page the on-call lead?\",\n            \"payload\": {\n              \"ticketId\": \"T-1001\",\n              \"severity\": \"high\",\n              \"queue\": \"emergency\"\n            },\n            \"editableFields\": [\n              \"queue\"\n            ],\n            \"expiresAt\": \"2026-10-12T05:15:00.000Z\",\n            \"workflowRunId\": 5530\n          }\n        }\n      ],\n      \"pageInfo\": {\n        \"hasNextPage\": false,\n        \"endCursor\": \"MTE4\"\n      }\n    }\n  }\n}"
            },
            {
              "id": "7e53e9d6-87c7-455e-a8e0-eb73431bac29",
              "name": "BAD_REQUEST: Both status and statuses passed",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Inbox($statuses: [ApprovalStatus!], $first: Int) {\n  approvals(statuses: $statuses, first: $first) {\n    edges {\n      node {\n        id\n        status\n        title\n        summary\n        payload\n        editableFields\n        expiresAt\n        workflowRunId\n      }\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n",
                    "variables": "{\n  \"statuses\": [\n    \"PENDING\"\n  ],\n  \"first\": 20\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Pass either `status` or `statuses`, not both\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"approvals\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Pass either `status` or `statuses`, not both\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "8f74a6d9-716e-4453-a890-f47a151c479d",
              "name": "FORBIDDEN: Caller is a member, not the owner",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Inbox($statuses: [ApprovalStatus!], $first: Int) {\n  approvals(statuses: $statuses, first: $first) {\n    edges {\n      node {\n        id\n        status\n        title\n        summary\n        payload\n        editableFields\n        expiresAt\n        workflowRunId\n      }\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n",
                    "variables": "{\n  \"statuses\": [\n    \"PENDING\"\n  ],\n  \"first\": 20\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Only the owner of this workspace can do this\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"approvals\"\n      ],\n      \"extensions\": {\n        \"code\": \"FORBIDDEN\",\n        \"originalError\": {\n          \"message\": \"Only the owner of this workspace can do this\",\n          \"error\": \"Forbidden\",\n          \"statusCode\": 403\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "4c86645f-fe21-4cac-a637-a32e58b3040e",
              "name": "BAD_USER_INPUT: Unknown status value",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Inbox($statuses: [ApprovalStatus!], $first: Int) {\n  approvals(statuses: $statuses, first: $first) {\n    edges {\n      node {\n        id\n        status\n        title\n        summary\n        payload\n        editableFields\n        expiresAt\n        workflowRunId\n      }\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n    }\n  }\n}\n",
                    "variables": "{\n  \"statuses\": [\n    \"OPEN\"\n  ]\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$statuses\\\" got invalid value \\\"OPEN\\\" at \\\"statuses[0]\\\"; Value \\\"OPEN\\\" does not exist in \\\"ApprovalStatus\\\" enum.\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 13\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "id": "8d8a20e6-6605-4c68-a028-18d67e965683",
          "name": "approval",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query OneApproval($id: ID!) {\n  approval(id: $id) {\n    id\n    status\n    title\n    payload\n    editableFields\n    decidedAt\n    decisionComment\n  }\n}\n",
                "variables": "{\n  \"id\": \"{{approvalId}}\"\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Read one approval request by id.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\nWorkspace owner only.\n\nReference: https://wetel.dev/docs/developer-portal/reference/approvals/"
          },
          "response": [
            {
              "id": "5acbe2c0-ff39-41ea-ad58-b91336b1b463",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query OneApproval($id: ID!) {\n  approval(id: $id) {\n    id\n    status\n    title\n    payload\n    editableFields\n    decidedAt\n    decisionComment\n  }\n}\n",
                    "variables": "{\n  \"id\": \"118\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"approval\": {\n      \"id\": 118,\n      \"status\": \"APPROVED\",\n      \"title\": \"Emergency escalation for ticket T-1001\",\n      \"payload\": {\n        \"ticketId\": \"T-1001\",\n        \"severity\": \"high\",\n        \"queue\": \"emergency\"\n      },\n      \"editableFields\": [\n        \"queue\"\n      ],\n      \"decidedAt\": \"2026-10-12T03:21:44.000Z\",\n      \"decisionComment\": \"Confirmed with the on-call lead.\"\n    }\n  }\n}"
            },
            {
              "id": "53989a2d-3b77-4249-a7ea-97df33e11817",
              "name": "NOT_FOUND: Not in your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query OneApproval($id: ID!) {\n  approval(id: $id) {\n    id\n    status\n    title\n    payload\n    editableFields\n    decidedAt\n    decisionComment\n  }\n}\n",
                    "variables": "{\n  \"id\": \"118\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Approval #118 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"approval\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Approval #118 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "ff6fa826-3019-4f19-ae3a-27bd8647a18a",
          "name": "decideApproval",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation Decide($id: ID!, $decision: ApprovalDecisionChoice!, $comment: String, $editedPayload: JSON) {\n  decideApproval(id: $id, decision: $decision, comment: $comment, editedPayload: $editedPayload) {\n    id\n    status\n    decidedAt\n    editedPayload\n  }\n}\n",
                "variables": "{\n  \"id\": \"{{approvalId}}\",\n  \"decision\": \"APPROVE\",\n  \"comment\": \"Confirmed with the on-call lead.\",\n  \"editedPayload\": {\n    \"queue\": \"emergency-weekend\"\n  }\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Approve or reject a pending request. The paused run resumes asynchronously.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\nWorkspace owner only.\n- `comment` is optional (at most 1,000 characters); the workflow reads it as `approval.comment`.\n- `editedPayload` is honoured on `APPROVE` only. Its keys must all be in the request's `editableFields`. Send it through variables, never as an inline literal.\n- Only one of several simultaneous decisions wins; the others receive `CONFLICT`. Limited to 30 decisions per minute per client IP by default.\n\nReference: https://wetel.dev/docs/developer-portal/reference/approvals/"
          },
          "response": [
            {
              "id": "101704a0-70a1-4b3c-a978-9d9e87f7b94a",
              "name": "Success (the run continues shortly after)",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Decide($id: ID!, $decision: ApprovalDecisionChoice!, $comment: String, $editedPayload: JSON) {\n  decideApproval(id: $id, decision: $decision, comment: $comment, editedPayload: $editedPayload) {\n    id\n    status\n    decidedAt\n    editedPayload\n  }\n}\n",
                    "variables": "{\n  \"id\": \"118\",\n  \"decision\": \"APPROVE\",\n  \"comment\": \"Confirmed with the on-call lead.\",\n  \"editedPayload\": {\n    \"queue\": \"emergency-weekend\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"decideApproval\": {\n      \"id\": 118,\n      \"status\": \"APPROVED\",\n      \"decidedAt\": \"2026-10-12T03:21:44.000Z\",\n      \"editedPayload\": {\n        \"queue\": \"emergency-weekend\"\n      }\n    }\n  }\n}"
            },
            {
              "id": "d322d269-11f9-4b8b-a800-233168c11b23",
              "name": "CONFLICT: Already decided",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Decide($id: ID!, $decision: ApprovalDecisionChoice!, $comment: String, $editedPayload: JSON) {\n  decideApproval(id: $id, decision: $decision, comment: $comment, editedPayload: $editedPayload) {\n    id\n    status\n    decidedAt\n    editedPayload\n  }\n}\n",
                    "variables": "{\n  \"id\": \"118\",\n  \"decision\": \"APPROVE\",\n  \"comment\": \"Confirmed with the on-call lead.\",\n  \"editedPayload\": {\n    \"queue\": \"emergency-weekend\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Approval #118 was already approved by user #3 at 2026-10-12T03:21:44.000Z\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"decideApproval\"\n      ],\n      \"extensions\": {\n        \"code\": \"CONFLICT\",\n        \"status\": 409,\n        \"originalError\": {\n          \"message\": \"Approval #118 was already approved by user #3 at 2026-10-12T03:21:44.000Z\",\n          \"error\": \"Conflict\",\n          \"statusCode\": 409\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "4d8a3f97-4437-4f8e-a29a-9e8cccd64211",
              "name": "CONFLICT: Expired",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Decide($id: ID!, $decision: ApprovalDecisionChoice!, $comment: String, $editedPayload: JSON) {\n  decideApproval(id: $id, decision: $decision, comment: $comment, editedPayload: $editedPayload) {\n    id\n    status\n    decidedAt\n    editedPayload\n  }\n}\n",
                    "variables": "{\n  \"id\": \"118\",\n  \"decision\": \"APPROVE\",\n  \"comment\": \"Confirmed with the on-call lead.\",\n  \"editedPayload\": {\n    \"queue\": \"emergency-weekend\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Approval #118 expired at 2026-10-12T05:15:00.000Z and can no longer be decided\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"decideApproval\"\n      ],\n      \"extensions\": {\n        \"code\": \"CONFLICT\",\n        \"status\": 409,\n        \"originalError\": {\n          \"message\": \"Approval #118 expired at 2026-10-12T05:15:00.000Z and can no longer be decided\",\n          \"error\": \"Conflict\",\n          \"statusCode\": 409\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "67c17b7a-183a-4420-adc0-9490753f2e26",
              "name": "BAD_REQUEST: Edited a key that is not editable",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Decide($id: ID!, $decision: ApprovalDecisionChoice!, $comment: String, $editedPayload: JSON) {\n  decideApproval(id: $id, decision: $decision, comment: $comment, editedPayload: $editedPayload) {\n    id\n    status\n    decidedAt\n    editedPayload\n  }\n}\n",
                    "variables": "{\n  \"id\": \"118\",\n  \"decision\": \"APPROVE\",\n  \"comment\": \"Confirmed with the on-call lead.\",\n  \"editedPayload\": {\n    \"queue\": \"emergency-weekend\"\n  }\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Approval #118 does not allow editing: severity\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"decideApproval\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Approval #118 does not allow editing: severity\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "8af35e3d-065a-463b-ade0-85af42d49d8a",
              "name": "BAD_USER_INPUT: Decision value is not APPROVE or REJECT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Decide($id: ID!, $decision: ApprovalDecisionChoice!, $comment: String, $editedPayload: JSON) {\n  decideApproval(id: $id, decision: $decision, comment: $comment, editedPayload: $editedPayload) {\n    id\n    status\n    decidedAt\n    editedPayload\n  }\n}\n",
                    "variables": "{\n  \"id\": \"118\",\n  \"decision\": \"APPROVED\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$decision\\\" got invalid value \\\"APPROVED\\\"; Value \\\"APPROVED\\\" does not exist in \\\"ApprovalDecisionChoice\\\" enum. Did you mean the enum value \\\"APPROVE\\\"?\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 27\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        },
        {
          "id": "731eac6b-4946-43ca-aeb4-d57974725596",
          "name": "cancelApproval",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation Cancel($id: ID!, $reason: String) {\n  cancelApproval(id: $id, reason: $reason) {\n    id\n    status\n  }\n}\n",
                "variables": "{\n  \"id\": \"{{approvalId}}\",\n  \"reason\": \"Raised by mistake during testing.\"\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Withdraw a pending request. The paused run does not resume.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\nWorkspace owner only.\n- `reason` is optional (at most 1,000 characters).\n\nReference: https://wetel.dev/docs/developer-portal/reference/approvals/"
          },
          "response": [
            {
              "id": "025f2f80-1339-480e-af90-c269e842645e",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Cancel($id: ID!, $reason: String) {\n  cancelApproval(id: $id, reason: $reason) {\n    id\n    status\n  }\n}\n",
                    "variables": "{\n  \"id\": \"118\",\n  \"reason\": \"Raised by mistake during testing.\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"cancelApproval\": {\n      \"id\": 118,\n      \"status\": \"CANCELLED\"\n    }\n  }\n}"
            },
            {
              "id": "fe6e65f6-5d96-43e4-af48-942f19ce45af",
              "name": "CONFLICT: Already decided, expired or cancelled",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation Cancel($id: ID!, $reason: String) {\n  cancelApproval(id: $id, reason: $reason) {\n    id\n    status\n  }\n}\n",
                    "variables": "{\n  \"id\": \"118\",\n  \"reason\": \"Raised by mistake during testing.\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Approval #118 is already approved and cannot be cancelled\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"cancelApproval\"\n      ],\n      \"extensions\": {\n        \"code\": \"CONFLICT\",\n        \"status\": 409,\n        \"originalError\": {\n          \"message\": \"Approval #118 is already approved and cannot be cancelled\",\n          \"error\": \"Conflict\",\n          \"statusCode\": 409\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "API keys",
      "description": "Create, list and revoke named API keys, one per integration or environment.",
      "item": [
        {
          "id": "2d914b10-4242-4f17-aad8-90070deec380",
          "name": "createNamedApiKey",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});",
                  "// Save values for the next requests (into the active environment, else the collection).",
                  "const get = (obj, path) => path.split(\".\").reduce((acc, key) => (acc == null ? undefined : acc[key]), obj);",
                  "const store = (key, value) => {",
                  "  if (value === undefined || value === null) return;",
                  "  if (pm.environment.name) pm.environment.set(key, String(value));",
                  "  else pm.collectionVariables.set(key, String(value));",
                  "};",
                  "store(\"namedApiKeyId\", get(json, \"data.createNamedApiKey.id\"));"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation CreateKey($name: String!, $scopes: [String!]) {\n  createNamedApiKey(name: $name, scopes: $scopes) {\n    id\n    name\n    key\n    warning\n  }\n}\n",
                "variables": "{\n  \"name\": \"helpdesk-sandbox\"\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Create a named API key. The raw key is returned once and cannot be read again.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Store `key` immediately in your server's secret store. Only a SHA-256 hash is kept on the platform side.\n- Keep `id`; it is what `revokeNamedApiKey` takes.\n- `scopes` is optional and adds rights beyond runtime access. The only accepted value today is `templates:hire`, and only a workspace owner may grant a scope. Omit it for a plain runtime key.\n\nReference: https://wetel.dev/docs/developer-portal/reference/api-keys/"
          },
          "response": [
            {
              "id": "d9d68cdd-09bd-433c-ad52-d5b3c82fcbc0",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateKey($name: String!, $scopes: [String!]) {\n  createNamedApiKey(name: $name, scopes: $scopes) {\n    id\n    name\n    key\n    warning\n  }\n}\n",
                    "variables": "{\n  \"name\": \"helpdesk-sandbox\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"createNamedApiKey\": {\n      \"id\": 31,\n      \"name\": \"helpdesk-sandbox\",\n      \"key\": \"sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n      \"warning\": \"Save this key immediately. It will not be shown again. Revoking it does not affect any other named key or the legacy tenant API key.\"\n    }\n  }\n}"
            },
            {
              "id": "f2da74d7-0a1f-4bd8-ad1b-10d3635a8b96",
              "name": "BAD_REQUEST: Unknown scope (sent with scopes [\"admin\"])",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateKey($name: String!, $scopes: [String!]) {\n  createNamedApiKey(name: $name, scopes: $scopes) {\n    id\n    name\n    key\n    warning\n  }\n}\n",
                    "variables": "{\n  \"name\": \"helpdesk-sandbox\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unknown API key scope(s): admin. Allowed: templates:hire.\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createNamedApiKey\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"Unknown API key scope(s): admin. Allowed: templates:hire.\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "fc52994a-04cc-46dd-a08b-d0aa4f035c72",
              "name": "FORBIDDEN: A member (not the owner) asked for a scope",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateKey($name: String!, $scopes: [String!]) {\n  createNamedApiKey(name: $name, scopes: $scopes) {\n    id\n    name\n    key\n    warning\n  }\n}\n",
                    "variables": "{\n  \"name\": \"helpdesk-sandbox\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Only the owner of this workspace can do this\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createNamedApiKey\"\n      ],\n      \"extensions\": {\n        \"code\": \"FORBIDDEN\",\n        \"originalError\": {\n          \"message\": \"Only the owner of this workspace can do this\",\n          \"error\": \"Forbidden\",\n          \"statusCode\": 403\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "00bbfad7-65f6-46f6-a9f2-d5261e40d44a",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation CreateKey($name: String!, $scopes: [String!]) {\n  createNamedApiKey(name: $name, scopes: $scopes) {\n    id\n    name\n    key\n    warning\n  }\n}\n",
                    "variables": "{\n  \"name\": \"helpdesk-sandbox\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"createNamedApiKey\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "2a66f83d-4bf5-4df5-a04d-b1a4a2473347",
          "name": "namedApiKeys",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query ListKeys {\n  namedApiKeys {\n    id\n    name\n    scopes\n    createdAt\n    revokedAt\n    expiresAt\n  }\n}\n",
                "variables": "{}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "List the workspace's named API keys (metadata only, never the key itself).\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Revoked and expired keys are included; filter on `revokedAt` and `expiresAt` for an \"active only\" view.\n\nReference: https://wetel.dev/docs/developer-portal/reference/api-keys/"
          },
          "response": [
            {
              "id": "e77803e4-43d1-44d4-a5e1-cd11a0cdcdb8",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListKeys {\n  namedApiKeys {\n    id\n    name\n    scopes\n    createdAt\n    revokedAt\n    expiresAt\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"namedApiKeys\": [\n      {\n        \"id\": 31,\n        \"name\": \"helpdesk-sandbox\",\n        \"scopes\": null,\n        \"createdAt\": \"2026-10-12T02:40:11.000Z\",\n        \"revokedAt\": null,\n        \"expiresAt\": null\n      },\n      {\n        \"id\": 24,\n        \"name\": \"old-test-key\",\n        \"scopes\": null,\n        \"createdAt\": \"2026-09-02T08:12:45.000Z\",\n        \"revokedAt\": \"2026-09-30T10:01:02.000Z\",\n        \"expiresAt\": null\n      }\n    ]\n  }\n}"
            },
            {
              "id": "c54b04ed-ec3a-4316-a592-47a405c2a49e",
              "name": "UNAUTHENTICATED: Missing credential",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query ListKeys {\n  namedApiKeys {\n    id\n    name\n    scopes\n    createdAt\n    revokedAt\n    expiresAt\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"namedApiKeys\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "a8ca0d03-ae98-4323-ae34-afdb040f293b",
          "name": "revokeNamedApiKey",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "mutation RevokeKey($id: Int!) {\n  revokeNamedApiKey(id: $id)\n}\n",
                "variables": "{\n  \"id\": {{namedApiKeyId}}\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Revoke one named API key. Immediate and permanent; other keys are not affected.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- There is no un-revoke. Create a new key instead.\n\nReference: https://wetel.dev/docs/developer-portal/reference/api-keys/"
          },
          "response": [
            {
              "id": "4dd93546-cb0a-4018-af31-5ca356df5c66",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RevokeKey($id: Int!) {\n  revokeNamedApiKey(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 31\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"revokeNamedApiKey\": true\n  }\n}"
            },
            {
              "id": "90e26ae7-5923-4452-a5c6-4a6c13a57590",
              "name": "NOT_FOUND: Not a key of your workspace",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RevokeKey($id: Int!) {\n  revokeNamedApiKey(id: $id)\n}\n",
                    "variables": "{\n  \"id\": 31\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Named API key #31 not found\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"revokeNamedApiKey\"\n      ],\n      \"extensions\": {\n        \"code\": \"NOT_FOUND\",\n        \"status\": 404,\n        \"originalError\": {\n          \"message\": \"Named API key #31 not found\",\n          \"error\": \"Not Found\",\n          \"statusCode\": 404\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "f14f3fda-ffe5-458a-ac75-b42656998c6e",
              "name": "BAD_USER_INPUT: Id sent as a string",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "mutation RevokeKey($id: Int!) {\n  revokeNamedApiKey(id: $id)\n}\n",
                    "variables": "{\n  \"id\": \"thirty-one\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$id\\\" got invalid value \\\"thirty-one\\\"; Int cannot represent non-integer value: \\\"thirty-one\\\"\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 20\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Workspace and usage",
      "description": "Read your workspace, its plan and this month's model spend, and the usage of one end customer.",
      "item": [
        {
          "id": "8b72b258-f62e-4cdd-a2d5-dba096a78465",
          "name": "myTenant",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query MyWorkspace {\n  myTenant {\n    id\n    name\n    plan\n    isSuspended\n    allowedLlmModels\n    createdAt\n  }\n}\n",
                "variables": "{}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Read the workspace the signed-in user belongs to.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Returns `null` for a user who is not assigned to a workspace yet.\n- `allowedLlmModels` is the workspace's model allowlist: `null` means every model in the catalog, an empty list means none.\n\nReference: https://wetel.dev/docs/developer-portal/reference/usage/"
          },
          "response": [
            {
              "id": "b9b12065-6c24-415f-abcb-2b35555b423b",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query MyWorkspace {\n  myTenant {\n    id\n    name\n    plan\n    isSuspended\n    allowedLlmModels\n    createdAt\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"myTenant\": {\n      \"id\": 3,\n      \"name\": \"Example Support Team\",\n      \"plan\": \"PRO\",\n      \"isSuspended\": false,\n      \"allowedLlmModels\": null,\n      \"createdAt\": \"2026-08-04T02:10:00.000Z\"\n    }\n  }\n}"
            },
            {
              "id": "392c5a26-0898-4f64-aabd-f3573684b9f6",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query MyWorkspace {\n  myTenant {\n    id\n    name\n    plan\n    isSuspended\n    allowedLlmModels\n    createdAt\n  }\n}\n",
                    "variables": "{}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"myTenant\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": {\n    \"myTenant\": null\n  }\n}"
            }
          ]
        },
        {
          "id": "628cd2b2-7ad0-400a-a392-e23b10a25b70",
          "name": "apiUsageSummary",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "bearer",
              "bearer": [
                { "key": "token", "value": "{{jwt}}", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query Usage($yearMonth: String) {\n  apiUsageSummary(yearMonth: $yearMonth) {\n    yearMonth\n    costThisMonthUsd\n    monthlySpendCapUsd\n    creditsUsedThisMonthApprox\n    usageByBucket {\n      bucket\n      callCount\n      costUsd\n      creditsUsed\n    }\n    breakdown {\n      model\n      operation\n      count\n      costUsd\n      creditsUsed\n    }\n  }\n}\n",
                "variables": "{\n  \"yearMonth\": \"2026-09\"\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Model spend for one calendar month, the plan's monthly cap, and a breakdown by model and operation.\n\nCredential: Dashboard JWT. `Authorization: Bearer <jwt>`, from `login` (a person or a one-off script).\n- Covers all model usage of the workspace (sessions, workflow runs, evaluation and the LLM API). It cannot be split by API key; use `customerUsageSummary` for one end customer.\n- `yearMonth` (`YYYY-MM`, UTC) reads a past month; omit it for the current month. Every figure covers that month, whatever the field name says.\n- `usageByBucket` always has the four rows `AI_CREDITS`, `TTS`, `STT` and `AVATAR`, even when a bucket is zero.\n\nReference: https://wetel.dev/docs/developer-portal/reference/usage/"
          },
          "response": [
            {
              "id": "f6d23604-07cd-4253-a5e1-a4d9626cbdc7",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Usage($yearMonth: String) {\n  apiUsageSummary(yearMonth: $yearMonth) {\n    yearMonth\n    costThisMonthUsd\n    monthlySpendCapUsd\n    creditsUsedThisMonthApprox\n    usageByBucket {\n      bucket\n      callCount\n      costUsd\n      creditsUsed\n    }\n    breakdown {\n      model\n      operation\n      count\n      costUsd\n      creditsUsed\n    }\n  }\n}\n",
                    "variables": "{\n  \"yearMonth\": \"2026-09\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"apiUsageSummary\": {\n      \"yearMonth\": \"2026-09\",\n      \"costThisMonthUsd\": 3.4182,\n      \"monthlySpendCapUsd\": 200,\n      \"creditsUsedThisMonthApprox\": 97419,\n      \"usageByBucket\": [\n        {\n          \"bucket\": \"AI_CREDITS\",\n          \"callCount\": 1840,\n          \"costUsd\": 3.2011,\n          \"creditsUsed\": 91231\n        },\n        {\n          \"bucket\": \"TTS\",\n          \"callCount\": 52,\n          \"costUsd\": 0.2171,\n          \"creditsUsed\": 6188\n        },\n        {\n          \"bucket\": \"STT\",\n          \"callCount\": 0,\n          \"costUsd\": 0,\n          \"creditsUsed\": 0\n        },\n        {\n          \"bucket\": \"AVATAR\",\n          \"callCount\": 0,\n          \"costUsd\": 0,\n          \"creditsUsed\": 0\n        }\n      ],\n      \"breakdown\": [\n        {\n          \"model\": \"gemini-2.5-flash\",\n          \"operation\": \"generate\",\n          \"count\": 1712,\n          \"costUsd\": 3.1904,\n          \"creditsUsed\": 90926\n        },\n        {\n          \"model\": \"gemini-embedding-001\",\n          \"operation\": \"embed\",\n          \"count\": 128,\n          \"costUsd\": 0.0107,\n          \"creditsUsed\": 305\n        }\n      ]\n    }\n  }\n}"
            },
            {
              "id": "49a2aed8-b656-40c5-a3ff-8559f82a113d",
              "name": "BAD_REQUEST: Month in the future or badly formatted",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Usage($yearMonth: String) {\n  apiUsageSummary(yearMonth: $yearMonth) {\n    yearMonth\n    costThisMonthUsd\n    monthlySpendCapUsd\n    creditsUsedThisMonthApprox\n    usageByBucket {\n      bucket\n      callCount\n      costUsd\n      creditsUsed\n    }\n    breakdown {\n      model\n      operation\n      count\n      costUsd\n      creditsUsed\n    }\n  }\n}\n",
                    "variables": "{\n  \"yearMonth\": \"2026-09\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"yearMonth must be a past or current month formatted 'YYYY-MM'\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"apiUsageSummary\"\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_REQUEST\",\n        \"originalError\": {\n          \"message\": \"yearMonth must be a past or current month formatted 'YYYY-MM'\",\n          \"error\": \"Bad Request\",\n          \"statusCode\": 400\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "1b1c3612-9173-4f7e-a566-d52acf4d5bd2",
              "name": "UNAUTHENTICATED: Called with an API key instead of a JWT",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query Usage($yearMonth: String) {\n  apiUsageSummary(yearMonth: $yearMonth) {\n    yearMonth\n    costThisMonthUsd\n    monthlySpendCapUsd\n    creditsUsedThisMonthApprox\n    usageByBucket {\n      bucket\n      callCount\n      costUsd\n      creditsUsed\n    }\n    breakdown {\n      model\n      operation\n      count\n      costUsd\n      creditsUsed\n    }\n  }\n}\n",
                    "variables": "{\n  \"yearMonth\": \"2026-09\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Unauthorized\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"apiUsageSummary\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            }
          ]
        },
        {
          "id": "c1f7575b-a63e-4e35-a755-cbe729fef810",
          "name": "customerUsageSummary",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test(\"no GraphQL errors\", function () {",
                  "  pm.expect(json.errors, JSON.stringify(json.errors)).to.be.undefined;",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "x-huat-platform",
                "value": "{{platform}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "auth": {
              "type": "apikey",
              "apikey": [
                { "key": "key", "value": "X-Api-Key", "type": "string" },
                { "key": "value", "value": "{{apiKey}}", "type": "string" },
                { "key": "in", "value": "header", "type": "string" }
              ]
            },
            "body": {
              "mode": "graphql",
              "graphql": {
                "query": "query CustomerUsage($externalCustomerId: String!) {\n  customerUsageSummary(externalCustomerId: $externalCustomerId) {\n    externalCustomerId\n    sessionCount\n    tokensIn\n    tokensOut\n    costUsd\n    creditsUsedApprox\n  }\n}\n",
                "variables": "{\n  \"externalCustomerId\": \"{{clientId}}\"\n}"
              }
            },
            "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] },
            "description": "Tokens, estimated cost and session count across every session of one end customer.\n\nCredential: API key. `X-Api-Key: sk_...`, kept on your server only.\n- `externalCustomerId` is the `clientId` you passed to `sdkStart`. Give each ticket its own `clientId` to read usage per ticket.\n- `costUsd` is an estimate (about 4 characters per token), not a billing figure; the workspace's billed spend is in `apiUsageSummary`.\n- An identifier with no sessions returns zeros, not an error.\n\nReference: https://wetel.dev/docs/developer-portal/reference/usage/"
          },
          "response": [
            {
              "id": "083a63aa-e15e-4e74-a1b1-b0da0d7077ce",
              "name": "Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query CustomerUsage($externalCustomerId: String!) {\n  customerUsageSummary(externalCustomerId: $externalCustomerId) {\n    externalCustomerId\n    sessionCount\n    tokensIn\n    tokensOut\n    costUsd\n    creditsUsedApprox\n  }\n}\n",
                    "variables": "{\n  \"externalCustomerId\": \"ticket-1001\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"data\": {\n    \"customerUsageSummary\": {\n      \"externalCustomerId\": \"ticket-1001\",\n      \"sessionCount\": 2,\n      \"tokensIn\": 1840,\n      \"tokensOut\": 612,\n      \"costUsd\": 0.0021,\n      \"creditsUsedApprox\": 60\n    }\n  }\n}"
            },
            {
              "id": "b5df6617-08cf-477d-a449-71d8b081e7b7",
              "name": "UNAUTHENTICATED: Missing API key",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query CustomerUsage($externalCustomerId: String!) {\n  customerUsageSummary(externalCustomerId: $externalCustomerId) {\n    externalCustomerId\n    sessionCount\n    tokensIn\n    tokensOut\n    costUsd\n    creditsUsedApprox\n  }\n}\n",
                    "variables": "{\n  \"externalCustomerId\": \"ticket-1001\"\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Missing X-Api-Key header\",\n      \"locations\": [\n        {\n          \"line\": 2,\n          \"column\": 3\n        }\n      ],\n      \"path\": [\n        \"customerUsageSummary\"\n      ],\n      \"extensions\": {\n        \"code\": \"UNAUTHENTICATED\",\n        \"originalError\": {\n          \"message\": \"Missing X-Api-Key header\",\n          \"error\": \"Unauthorized\",\n          \"statusCode\": 401\n        }\n      }\n    }\n  ],\n  \"data\": null\n}"
            },
            {
              "id": "81b04570-ef3e-4682-a3d2-d671febb997c",
              "name": "BAD_USER_INPUT: Identifier sent as a number",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "x-huat-platform",
                    "value": "{{platform}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "graphql",
                  "graphql": {
                    "query": "query CustomerUsage($externalCustomerId: String!) {\n  customerUsageSummary(externalCustomerId: $externalCustomerId) {\n    externalCustomerId\n    sessionCount\n    tokensIn\n    tokensOut\n    costUsd\n    creditsUsedApprox\n  }\n}\n",
                    "variables": "{\n  \"externalCustomerId\": 1001\n}"
                  }
                },
                "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                { "key": "Content-Type", "value": "application/json" }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"message\": \"Variable \\\"$externalCustomerId\\\" got invalid value 1001; String cannot represent a non string value: 1001\",\n      \"locations\": [\n        {\n          \"line\": 1,\n          \"column\": 21\n        }\n      ],\n      \"extensions\": {\n        \"code\": \"BAD_USER_INPUT\"\n      }\n    }\n  ]\n}"
            }
          ]
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.wetel.dev/graphql",
      "type": "string"
    },
    { "key": "platform", "value": "customer", "type": "string" },
    {
      "key": "productionBaseUrl",
      "value": "",
      "type": "string",
      "description": "Your production base URL is issued when you go live. Put it in baseUrl of a production copy of the environment."
    }
  ]
}
