I've been trying to update a trunk with the sip ap...
# ask-ai
e
I've been trying to update a trunk with the sip api with the UpdateSIPInboundTrunk endpoint. I'm passing { "sip_trunk_id": "ST_D7wTpXYYax", "action": { "name": "Inbound Staging trunk", "numbers": { "add": ["+5531984521348"] } } and a valid token on the Authorization header. But I'm getting the following error: { "code": "unknown", "msg": "missing or unsupported update action" }
t
Thanks for reaching out, Lucas. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I can help with that. You're hitting the "missing or unsupported update action" error because the request's
action
field must be one of two wrapped action types:
update
(for partial updates) or
replace
(to fully replace the trunk). Right now your body is missing that wrapper. Try one of these formats: 1) Partial update (recommended — adds the number)
Copy code
{
  "sip_trunk_id": "ST_D7wTpXYYax",
  "action": {
    "update": {
      "name": "Inbound Staging trunk",
      "numbers": {
        "add": [
          "+5531984521348"
        ]
      }
    }
  }
}
2) Replace entire trunk (must include all required fields)
Copy code
{
  "sip_trunk_id": "ST_D7wTpXYYax",
  "action": {
    "replace": {
      "name": "Inbound Staging trunk",
      "numbers": ["+5531984521348"]
      /* include any other required SIPInboundTrunkInfo fields here */
    }
  }
}
If you want, paste the exact request (headers and JSON body) you're sending and I’ll check it and give a ready-to-run cURL example. Sources: SIP APIs | LiveKit docs
e
curl --location 'https://oppy-9z7095df.livekit.cloud/twirp/livekit.SIP/UpdateSIPInboundTrunk' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9' \ --header 'Content-Type: application/json' \ --data '{ "sip_trunk_id": "ST_7wTRXYYaxY", "action": { "update": { "numbers": { "add": [ "+5531984521348" ] } } } }'
t
Thanks — I see the curl you’re sending and the
action.update
wrapper is correct. Two likely issues to check that will fix the request: 1) Remove the tel-style markdown/brackets from the number. Send plain E.164 number strings:
Copy code
"add": ["+5531984521348"]
2) Ensure the JSON body is sent without backslash-escaped underscores or extra quoting the CLI might add. Full working curl example:
Copy code
curl --location '<https://oppy-9z7095df.livekit.cloud/twirp/livekit.SIP/UpdateSIPInboundTrunk>' \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9' \
  --header 'Content-Type: application/json' \
  --data '{
    "sip_trunk_id": "ST_7wTRXYYaxY",
    "action": {
      "update": {
        "numbers": {
          "add": ["+5531984521348"]
        }
      }
    }
  }'
If you still get the same error after using that exact payload, please paste the full error response and confirm: • The token has the required scope for SIP trunk updates. • The trunk ID
ST_7wTRXYYaxY
is correct and active. I’ll continue helping once you confirm or share the updated error.
e
That's not it. I'm still getting the same error
t
Thanks — I hear you’re still getting the same "missing or unsupported update action" error even after using the correct
action.update
payload. Let’s narrow this down. Please provide the following (you can redact secrets like the full token string): 1. The full HTTP response body and status code you get now (paste exact JSON). 2. Confirm the token’s grants/scopes (does it include
sip.admin
?). If you can’t show the token, paste the decoded JWT payload (just the claims). 3. Confirm the trunk ID is correct (
ST_7wTRXYYaxY
) and that the trunk appears in your ListSIPInboundTrunk results. 4. Any other fields you’re attempting to update in the same request. Quick checks you can run now: • Run ListSIPInboundTrunk with the same token to verify the trunk exists. • Try a minimal update that only changes a non-array field, e.g. name:
Copy code
{
  "sip_trunk_id": "ST_7wTRXYYaxY",
  "action": {
    "update": {
      "name": "TestName"
    }
  }
}
If that works but adding
numbers.add
fails, paste the ListSIPInboundTrunk output so I can confirm the numbers field shape. Send the items above and I’ll pinpoint the cause and provide an exact cURL or payload fix. Sources: SIP APIs | LiveKit docs