{
  "info": {
    "name": "Boni Voice API - Indian DID and Inbound Routing",
    "description": "Public-safe early access collection for Boni Voice. Examples use dummy IDs and example numbers only. Do not put production API keys, real caller numbers, SIP credentials, recordings, customer data, or long-lived recording URLs into this collection. Webhook receivers should verify X-Boni-Event-Id, X-Boni-Timestamp, X-Boni-Signature-Version, and X-Boni-Signature.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://voice.boni.one/v1"
    },
    {
      "key": "api_key",
      "value": "vp_test_example_replace_me"
    },
    {
      "key": "number_id",
      "value": "num_demo_001"
    },
    {
      "key": "call_id",
      "value": "call_demo_001"
    },
    {
      "key": "webhook_endpoint_id",
      "value": "wh_demo_001"
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-API-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{api_key}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Account",
      "item": [
        {
          "name": "Get tenant profile",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/me",
            "description": "Returns the authenticated tenant, plan, limits, and enabled features."
          }
        }
      ]
    },
    {
      "name": "Numbers and Routes",
      "item": [
        {
          "name": "List assigned numbers",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/numbers?limit=20",
            "description": "Lists approved numbers assigned to the tenant."
          }
        },
        {
          "name": "Inspect one number",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/numbers/{{number_id}}",
            "description": "Inspects number status, capabilities, and current assignment."
          }
        },
        {
          "name": "Request an Indian business number",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/number-requests",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"country\": \"IN\",\n  \"useCase\": \"Inbound voice AI demo for an approved business workflow\",\n  \"preferredRegion\": \"Bengaluru\",\n  \"routeIntent\": \"webhook\",\n  \"monthlyExpectedMinutes\": 500\n}"
            },
            "description": "Assisted/KYC-gated request for a new Indian business number."
          }
        },
        {
          "name": "Replace inbound route",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/numbers/{{number_id}}/route",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"primary\": {\n    \"type\": \"control_webhook\",\n    \"url\": \"https://example.com/voice/decision\",\n    \"timeoutMs\": 2000\n  },\n  \"fallback\": [\n    {\n      \"type\": \"phone_number\",\n      \"phoneNumber\": \"+910000000003\",\n      \"timeoutSeconds\": 20\n    }\n  ],\n  \"events\": {\n    \"webhookEndpointId\": \"{{webhook_endpoint_id}}\",\n    \"subscribedEvents\": [\n      \"call.inbound.received\",\n      \"call.answered\",\n      \"call.completed\"\n    ]\n  },\n  \"recording\": {\n    \"enabled\": true\n  },\n  \"metadata\": {\n    \"environment\": \"demo\"\n  }\n}"
            },
            "description": "Idempotently replaces the inbound route for a number. URL targets must be public internet destinations and are screened for SSRF/private network risks."
          }
        }
      ]
    },
    {
      "name": "Calls",
      "item": [
        {
          "name": "Search call logs",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/calls?limit=20",
            "description": "Returns recent call logs and lifecycle state."
          }
        },
        {
          "name": "Inspect one call",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/calls/{{call_id}}",
            "description": "Returns one call timeline, route, recordings, transcripts, and events when enabled."
          }
        },
        {
          "name": "Transfer active call",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "demo-transfer-001"
              }
            ],
            "url": "{{base_url}}/calls/{{call_id}}/actions/transfer",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"target\": {\n    \"type\": \"sip_uri\",\n    \"sipUri\": \"sip:agent@example.com\"\n  }\n}"
            },
            "description": "Moves an active call to another target."
          }
        },
        {
          "name": "Hang up active call",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/calls/{{call_id}}/actions/hangup",
            "description": "Ends an active call.",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "demo-hangup-001"
              }
            ]
          }
        }
      ]
    },
    {
      "name": "Webhooks and Usage",
      "item": [
        {
          "name": "Create webhook endpoint",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/webhook-endpoints",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://example.com/voice/events\",\n  \"events\": [\n    \"call.inbound.received\",\n    \"call.answered\",\n    \"call.completed\",\n    \"recording.available\"\n  ],\n  \"enabled\": true\n}"
            },
            "description": "Registers an event webhook endpoint. The URL must be public HTTPS and will receive HMAC-signed events with X-Boni-* signature headers."
          }
        },
        {
          "name": "Usage summary",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/usage?from=2026-05-01&to=2026-05-31",
            "description": "Returns usage grouped by number, event type, unit, and billing window."
          }
        }
      ]
    }
  ]
}
