{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/callnode-io/json-schema/callnode-io-sip-trunk-schema.json",
  "title": "SipTrunk",
  "description": "A saved SIP trunk — egress (outbound BYOC), ingress (inbound from your PBX/SBC), or both.",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/callnode-io-openapi.yml#/components/schemas/SipTrunk",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "description": "1–64 characters. Unique across your active trunks."
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "disabled"
      ]
    },
    "egressEnabled": {
      "type": "boolean",
      "description": "Whether outbound (BYOC) delivery to `egressHost` is enabled."
    },
    "egressHost": {
      "type": [
        "string",
        "null"
      ],
      "description": "Hostname or IP of your SIP endpoint for outbound delivery. Null for an ingress-only trunk."
    },
    "egressPort": {
      "type": "integer",
      "default": 5060
    },
    "egressTransport": {
      "type": "string",
      "enum": [
        "udp",
        "tcp",
        "tls"
      ]
    },
    "ingressEnabled": {
      "type": "boolean",
      "description": "Whether inbound calls from `allowedIps` are accepted."
    },
    "allowedIps": {
      "type": "array",
      "description": "Public IPv4 addresses your PBX/SBC sends from — the accepted ingress source IPs.",
      "items": {
        "type": "string"
      }
    },
    "defaultPhoneNumberId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The id of one of your numbers — the default agent for ingress calls that do not match one of your own DIDs."
    },
    "outboundCliNumberId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The id of one of your numbers, presented as caller ID on outbound (termination) calls when the INVITE's From is not itself one of your numbers — the normal case for a registration trunk, whose From carries its auth username. A From that IS one of your live numbers always wins, so a multi-number PBX can still present per-call caller ID."
    },
    "monthlyFeeApplies": {
      "type": "boolean",
      "description": "True when this trunk is beyond your plan's included count and is billed the additional-trunk fee."
    },
    "nextBillingDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "registration": {
      "type": "object",
      "description": "Registration-trunk settings, for a PBX with no static public IP. Never\ncontains the password or its digest.\n",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether this trunk authenticates by registration rather than by source IP."
        },
        "username": {
          "type": [
            "string",
            "null"
          ],
          "description": "The SIP username your PBX registers with."
        },
        "domain": {
          "type": "string",
          "description": "SIP domain / digest realm."
        },
        "server": {
          "type": "string",
          "description": "Host and port your PBX registers to."
        },
        "transport": {
          "type": "string",
          "enum": [
            "tls"
          ],
          "description": "Registration trunks are TLS-only."
        },
        "passwordSetAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "registered": {
          "type": "boolean",
          "description": "True when your PBX is registered right now."
        },
        "lastRegisteredAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastRegisteredIp": {
          "type": [
            "string",
            "null"
          ],
          "description": "The address your PBX last registered from."
        }
      }
    },
    "sipPassword": {
      "type": "string",
      "description": "Present ONLY on the response that mints it — creating a registration\ntrunk, enabling registration, or rotating credentials. It cannot be\nretrieved afterwards; store it immediately.\n"
    },
    "sipPasswordNotice": {
      "type": "string",
      "description": "Human-readable reminder that accompanies `sipPassword`."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}