{
  "info": {
    "_postman_id": "01cb2928-f05c-4aa3-9f50-3d16497f4611",
    "name": "MakeAutomation Voice AI — Org Operator",
    "description": "Role-specific collection for Organization Operator identities. Sign in with Identity Login, then use identity_jwt for live, capability- and organization-scope-checked tenant operations. Provisioning, lifecycle, invitation/access management, Platform Admin, and infrastructure operations are intentionally excluded.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:3000"
    },
    {
      "key": "identity_email",
      "value": "organization-admin@example.com"
    },
    {
      "key": "identity_password",
      "value": ""
    },
    {
      "key": "identity_jwt",
      "value": ""
    },
    {
      "key": "branch_organization_id",
      "value": ""
    },
    {
      "key": "organization_id",
      "value": ""
    },
    {
      "key": "partner_organization_id",
      "value": ""
    },
    {
      "key": "tenant_id",
      "value": ""
    },
    {
      "key": "agent_id",
      "value": ""
    },
    {
      "key": "call_id",
      "value": ""
    },
    {
      "key": "dest_id",
      "value": ""
    },
    {
      "key": "document_id",
      "value": ""
    },
    {
      "key": "identity_id",
      "value": ""
    },
    {
      "key": "affiliate_id",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Identity Login",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/auth/identity-login",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "auth",
                "identity-login"
              ]
            },
            "description": "Feature-gated individual login for this organization context. Set branch_organization_id to the top-level organization UUID. The test script captures the admin_token cookie into identity_jwt for protected requests.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"{{identity_email}}\",\n  \"password\": \"{{identity_password}}\",\n  \"branch_organization_id\": \"{{branch_organization_id}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "const setCookie = pm.response.headers.get('Set-Cookie') || '';",
                  "const m = setCookie.match(/admin_token=([^;]+)/);",
                  "if (m) { pm.collectionVariables.set('identity_jwt', m[1]); pm.environment.set('identity_jwt', m[1]); }"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Logout",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/auth/logout",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "auth",
                "logout"
              ]
            },
            "description": "Clears session cookies."
          },
          "response": []
        },
        {
          "name": "Forgot Identity Password",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/auth/forgot-password",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "auth",
                "forgot-password"
              ]
            },
            "description": "Always returns a generic response.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"invited@example.com\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Reset Identity Password",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/auth/reset-password",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "auth",
                "reset-password"
              ]
            },
            "description": "In the browser the token is captured from /reset-password#token=...; never place it in a request URL.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"token\": \"paste-fragment-token-here\",\n  \"password\": \"new-12-character-password\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Organization & Tenants",
      "item": [
        {
          "name": "List Organizations",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/organizations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "organizations"
              ]
            },
            "description": "Platform admins receive full organization records. Delegated provisioning admins receive redacted live owner options in exact scope."
          },
          "response": []
        },
        {
          "name": "List Tenants",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/tenants",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "tenants"
              ]
            },
            "description": "Requires staff JWT. Platform Admin sees all tenants with the established full contract. Lifecycle-capable Organization/Partner Admins see active and inactive tenants in live organization scope using the redacted contract, enabling reactivation. Other operators see only active assigned tenants."
          },
          "response": []
        },
        {
          "name": "Get Tenant",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/tenants/{{tenant_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "tenants",
                "{{tenant_id}}"
              ]
            },
            "description": "Requires staff JWT. Platform Admin receives the established full contract. Lifecycle-capable Organization/Partner Admins may fetch inactive tenants through live organization scope and receive the redacted contract; other identities remain active tenant-assignment scoped."
          },
          "response": []
        },
        {
          "name": "Rename Tenant",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/tenants/{{tenant_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "tenants", "{{tenant_id}}"]
            },
            "description": "Rename an in-scope tenant using freshly locked live organization scope. The body must contain only name; slug and portal URL are unchanged.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Acme Corporation\"\n}"
            }
          },
          "response": []
        },
        {
          "name": "Access Tenant API Key (Audited — Do Not Save Response)",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{identity_jwt}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"action\": \"reveal\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/api/tenants/{{tenant_id}}/api-key",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "tenants",
                "{{tenant_id}}",
                "api-key"
              ]
            },
            "description": "No-store, capability- and live-scope-checked action. Set action to reveal or copy. Every successful request commits that exact audit event before returning the key. Never save the response, put keys in URLs, or use this with a client tenant identity."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Tenant Operations",
      "item": [
        {
          "name": "Get Tenant GHL (staff)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/ghl/{{tenant_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "ghl",
                "{{tenant_id}}"
              ]
            },
            "description": "GHL config for one tenant, key masked (hasApiKey). Staff route: admin reaches any tenant; operators only their assigned tenants (403 otherwise). Also accepts an operator JWT as the Bearer token."
          },
          "response": []
        },
        {
          "name": "Update Tenant GHL (staff)",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/ghl/{{tenant_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "ghl",
                "{{tenant_id}}"
              ]
            },
            "description": "Set GHL Location ID and/or PIT token for one tenant. Staff route: admin any tenant, operators assigned tenants only. Writes an audit_logs entry; response never echoes the key. Also accepts an operator JWT as the Bearer token.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"ghlApiKey\": \"\",\n  \"ghlLocationId\": \"\"\n}"
            }
          },
          "response": []
        },
        {
          "name": "List Tenant GHL Custom Fields (staff)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/ghl/{{tenant_id}}/custom-fields?refresh=1",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "ghl",
                "{{tenant_id}}",
                "custom-fields"
              ],
              "query": [
                {
                  "key": "refresh",
                  "value": "1"
                }
              ]
            },
            "description": "Live GHL inventory for an in-scope tenant. refresh=1 bypasses the server cache and calls GHL; do not run during an offline collection audit."
          },
          "response": []
        },
        {
          "name": "Create Tenant GHL Custom Field (staff)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/ghl/{{tenant_id}}/custom-fields",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "ghl",
                "{{tenant_id}}",
                "custom-fields"
              ]
            },
            "description": "Mutating external GHL operation. Requires Edit Custom Fields scope. Replace the conspicuous placeholder only after reviewing the tenant/location.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"POSTMAN REVIEW ONLY - DO NOT CREATE\",\n  \"dataType\": \"TEXT\"\n}"
            }
          },
          "response": []
        },
        {
          "name": "List Agents by Tenant",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents"
              ],
              "query": [
                {
                  "key": "tenant_id",
                  "value": "{{tenant_id}}",
                  "disabled": false
                }
              ]
            },
            "description": "Call/minute summary, daily, and tenant-comparison quantities are cross-cell UUID-deduplicated. Latency, turn, and sentiment metrics are explicitly scoped to each tenant's current canonical cell; see metricScope in the response."
          },
          "response": []
        },
        {
          "name": "Update Agent Prompt",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/prompt",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "prompt"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"system_prompt\": \"Updated prompt text.\"\n}"
            }
          },
          "response": []
        },
        {
          "name": "Get PBX Config",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/pbx",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "pbx"
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "Get PBX Live Status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/pbx/status",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "pbx",
                "status"
              ]
            },
            "description": "Live pbx-edge SIP registration status for this agent (proxies PBX_EDGE_CONTROL_URL/health)."
          },
          "response": []
        },
        {
          "name": "Reconnect PBX Extension",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/pbx/reconnect",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "pbx",
                "reconnect"
              ]
            },
            "description": "Force pbx-edge to retry SIP REGISTER for this agent (POST PBX_EDGE_CONTROL_URL/internal/connections/{id}/reconnect)."
          },
          "response": []
        },
        {
          "name": "Update PBX Config",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/pbx",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "pbx"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{}"
            }
          },
          "response": []
        },
        {
          "name": "Delete PBX Config",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/pbx",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "pbx"
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "List Transfer Destinations",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/transfer-destinations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "transfer-destinations"
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "Create Transfer Destination",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/transfer-destinations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "transfer-destinations"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"label\": \"Sales\",\n  \"phone_number\": \"+14155550100\",\n  \"is_default\": true\n}"
            }
          },
          "response": []
        },
        {
          "name": "Update Transfer Destination",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": false
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/transfer-destinations/{{dest_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "transfer-destinations",
                "{{dest_id}}"
              ]
            },
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"label\": \"Sales Team\"\n}"
            }
          },
          "response": []
        },
        {
          "name": "Delete Transfer Destination",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/transfer-destinations/{{dest_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "transfer-destinations",
                "{{dest_id}}"
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "List Tenant Documents",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/knowledge?tenantId={{tenant_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "knowledge"
              ],
              "query": [
                {
                  "key": "tenantId",
                  "value": "{{tenant_id}}"
                }
              ]
            },
            "description": "List a tenant's knowledge documents."
          },
          "response": []
        },
        {
          "name": "Upload Document",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/knowledge",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "knowledge"
              ]
            },
            "description": "Upload + ingest a PDF/text/markdown document (max 10 MB) for a tenant. Select a file for the `file` field; `tenant_id` is required. Saves document_id on success.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "tenant_id",
                  "type": "text",
                  "value": "{{tenant_id}}"
                },
                {
                  "key": "file",
                  "type": "file",
                  "src": ""
                },
                {
                  "key": "title",
                  "type": "text",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "try { const d = pm.response.json(); if (d && d.id) pm.collectionVariables.set('document_id', d.id); } catch (e) {}"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "Delete Document",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/knowledge/{{document_id}}?tenantId={{tenant_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "knowledge",
                "{{document_id}}"
              ],
              "query": [
                {
                  "key": "tenantId",
                  "value": "{{tenant_id}}"
                }
              ]
            },
            "description": "Delete a tenant's knowledge document (cascades chunks + agent attachments)."
          },
          "response": []
        },
        {
          "name": "Get Agent Attached Documents",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/knowledge",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "knowledge"
              ]
            },
            "description": "Returns { documents, attached } — the tenant's documents plus the IDs attached to this agent."
          },
          "response": []
        },
        {
          "name": "Set Agent Attached Documents",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/agents/{{agent_id}}/knowledge",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "agents",
                "{{agent_id}}",
                "knowledge"
              ]
            },
            "description": "Replace the full set of documents this agent can search. Documents must belong to the agent's tenant.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"document_ids\": [\n    \"{{document_id}}\"\n  ]\n}"
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Calls & Analytics",
      "item": [
        {
          "name": "Analytics",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/analytics",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "analytics"
              ],
              "query": [
                {
                  "key": "tenant_id",
                  "value": "{{tenant_id}}",
                  "disabled": false
                }
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "Search",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/search",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "search"
              ],
              "query": [
                {
                  "key": "q",
                  "value": "acme",
                  "disabled": false
                }
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "Get Call",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/calls/{{call_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "calls",
                "{{call_id}}"
              ]
            },
            "description": "Requires staff JWT or a tenant session owning the call."
          },
          "response": []
        },
        {
          "name": "Get Call Transcript",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/calls/{{call_id}}/transcript",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "calls",
                "{{call_id}}",
                "transcript"
              ]
            },
            "description": "Requires staff JWT or a tenant session owning the call."
          },
          "response": []
        },
        {
          "name": "Get Call Audio",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/calls/{{call_id}}/audio",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "calls",
                "{{call_id}}",
                "audio"
              ]
            },
            "description": "Staff only."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Profile",
      "item": [
        {
          "name": "Get Profile",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/profile",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "profile"
              ]
            },
            "description": "Current staff identity (admin or operator)."
          },
          "response": []
        },
        {
          "name": "Get Profile Affiliate Stats",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{identity_jwt}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/admin/profile/affiliate?affiliateId={{affiliate_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "admin",
                "profile",
                "affiliate"
              ],
              "query": [
                {
                  "key": "affiliateId",
                  "value": "{{affiliate_id}}",
                  "disabled": true
                }
              ]
            },
            "description": "Affiliate stats for the current staff user. Operators get their linked affiliate (404 when none); admins must pass ?affiliateId=. Earnings are estimates."
          },
          "response": []
        }
      ]
    }
  ]
}
