---
notionId: "a8c57db974324527b71b14ccdb6e9ffd"
product: "developer"
cluster: "apis"
intent: "developer.call-channels"
docSlug: "call-channels"
task: "Call Channels in the API"
title: "Call Channels in the API | VirtualPBX"
meta_description: "The Channels API lists the calls that are active for an account, a user, or a device. Each active channel has a call id. With that id, a request can run a"
answer: "The Channels API lists the calls that are active for an account, a user, or a device. Each active channel has a call id. With that id, a request can run a short list of commands on the channel, including hangup, transfer, and playing media. Use the list request that matches the owner you care about, then send the command to the call id the API returned."
audience: "user"
updated: "2022-12-06"
legacy: ["call-channels"]
headings: [{"depth":2,"text":"About Call Channels","id":"about-call-channels"},{"depth":3,"text":"List Channels for User","id":"list-channels-for-user"},{"depth":3,"text":"API","id":"api"},{"depth":3,"text":"CURL Example","id":"curl-example"},{"depth":3,"text":"List Channels for Device","id":"list-channels-for-device"},{"depth":3,"text":"API","id":"api-1"},{"depth":3,"text":"CURL Example","id":"curl-example-1"},{"depth":3,"text":"Fetch a channel's details","id":"fetch-a-channels-details"},{"depth":3,"text":"API","id":"api-2"},{"depth":3,"text":"CURL Example","id":"curl-example-2"},{"depth":3,"text":"Execute an application against a Channel","id":"execute-an-application-against-a-channel"},{"depth":3,"text":"Transfer","id":"transfer"}]
lint: []
---

## About Call Channels

The Channels API allows queries to find active channels for an account, a user, or a device. Given a call-id for a channel, a limited set of commands can be executed against that channel (such as hangup, transfer, or play media).

### List Channels for User

### API

/v2/accounts/\{ACCOUNT\_ID\}/users/\{USER\_ID\}/channels

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/users/{{user_id}}/channels</code></pre>

### CURL Example

<pre tabindex="0"><code class="language-javascript">curl --location -g --request GET 'https://public-api.virtualpbx.com:8443/v2/accounts/{ACCOUNT_ID}/users/{USER_ID}/channels' \
--header 'X-Auth-Token: {AUTH_TOKEN}' \
--header 'Content-Type: application/json'</code></pre>

### List Channels for Device

### API

/v2/accounts/\{ACCOUNT\_ID\}/devices/\{DEVICE\_ID\}/channels

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{ACCOUNT_ID}/devices/{DEVICE_ID}/channels</code></pre>

### CURL Example

<pre tabindex="0"><code class="language-javascript">curl --location -g --request GET 'https://public-api.virtualpbx.com:8443/v2/accounts/{ACCOUNT_ID}/devices/{DEVICE_ID}/channels' \
--header 'X-Auth-Token: {AUTH_TOKEN}' \
--header 'Content-Type: application/json'</code></pre>

### Fetch a channel's details

### API

GET /v2/accounts/\{ACCOUNT\_ID\}/channels/\{UUID\}

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{ACCOUNT_ID}/channels/{UUID}</code></pre>

### CURL Example

<pre tabindex="0"><code class="language-javascript">curl --location -g --request GET 'https://public-api.virtualpbx.com:8443/v2/accounts/{ACCOUNT_ID}/channels/{UUID}' \
--header 'X-Auth-Token: {AUTH_TOKEN}' \
--header 'Content-Type: application/json'</code></pre>

### Execute an application against a Channel

POST /v2/accounts/\{ACCOUNT\_ID\}/channels/\{UUID\}

Shell

<pre tabindex="0"><code class="language-json">curl -v -X POST \
    -H &quot;Content-Type: application/json&quot; \
    -H &quot;X-Auth-Token: {AUTH_TOKEN}&quot; \
    -d '{&quot;data&quot;: {&quot;action&quot;: &quot;transfer&quot;, &quot;target&quot;: &quot;345&quot;, &quot;takeback_dtmf&quot;: &quot;*1&quot;, &quot;moh&quot;: &quot;media_id&quot; }}' \
    https://api.virtualpbx.net/v2/accounts/{ACCOUNT_ID}/channels/{UUID}</code></pre>

Available `action` values are `transfer`, `hangup`, `break`, `callflow`, and `intercept`.

### Transfer

Shell

<pre tabindex="0"><code class="language-json">curl --location -g --request POST 'https://public-api.virtualpbx.com:8443/v2/accounts/{ACCOUNT_ID}/channels/{UUID}' \
--header 'X-Auth-Token: {AUTH_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
  &quot;data&quot;: {
    &quot;enabled&quot;: true,
    &quot;reties&quot;: 4
  }
}'</code></pre>

<div class="table-scroll" tabindex="0"><table><tr><th>Key</th><th>Description</th><th>Type</th><th>Default</th></tr><tr><td><code>leg</code></td><td>Defines which leg of the call to take action against</td><td>`string('self'</td><td>'bleg')`</td></tr><tr><td><code>target</code></td><td>Extension/DID to transfer the <code>{UUID}</code></td><td><code>string()</code></td><td></td></tr><tr><td><code>transfer-type</code></td><td>What type of transfer to perform</td><td>`string('attended'</td><td>'blind')`</td></tr><tr><td><code>moh</code></td><td>Music on hold to play while transferring</td><td><code>string()</code></td><td></td></tr></table></div>
