Voice APIManaging Inbound Call Queue

Managing Inbound Call Queue

Tạ Quốc Thắng·6/2/2026

API Queue Inbound

General authentication: All APIs use Kong dual-auth : Header Authorization(API key) is required. Header X-Tenant-IDinjected by Kong — if testing internally without going through Kong, omit this header, the backend will resolve tenantId based on the Authorization key. Do not use JWT ( x-access-token) in this flow.


GET /v1/queues/inbound

Retrieve the list of all inbound queues for the tenant. Supports pagination.

Authentication: Header X-Api-Key(scope: queue). Kong dual-auth: prioritize X-Tenant-IDheader, fallback to query DB based on the Authorization key.

Base URL: Dev: https://xapi-dev.alohub.vn |  Prod: https://xapi.alohub.vn

Parameters

Parameters

Location

Required

Type

Description

Example

page

query

No

number

Page, starting from 0 (default: 0)

0

size

query

No

number

Number of records per page (default: 20)

20

Request Body

Sample code

curl -X GET "https://xapi.alohub.vn/v1/queues/inbound" \
  -H "X-Api-Key: sk_live_xxx" \
  -H "X-Tenant-ID: 20260310"

# Phân trang
curl -X GET "https://xapi.alohub.vn/v1/queues/inbound?page=0&size=10" \
  -H "X-Api-Key: sk_live_xxx" \
  -H "X-Tenant-ID: 20260310"
const axios = require('axios');
const response = await axios.get(
  '{{host}}/api/v1/queues/inbound?page=0&size=20',
  { headers: { 'Authorization': '{{api-key}}', 'X-Tenant-ID': '{{tenant-id}}', 'Content-Type': 'application/json' } }
);
console.log(response.data);
import requests

params = {"page": "0", "size": "20"}
headers = {"Authorization": "{{api-key}}", "X-Tenant-ID": "{{tenant-id}}", "Content-Type": "application/json"}
response = requests.get(
    '{{host}}/api/v1/queues/inbound',
    headers=headers, params=params
)
print(response.json())

Response 200

{
  "success": "1",
  "error_code": "SUCCESS",
  "totalRecord": 3,
  "data": [
    {
      "callinId": 1001226,
      "callinName": "test",
      "strategy": 1,
      "musicinQueue": "waiting.wav",
      "timeWait": "120",
      "agentSelector": null,
      "nguongRanhRoi": null,
      "callinNumber": null
    }
  ]
}

Response Fields

Field

Type

Description

success

string

"1" = success

totalRecord

number

Total number of queues

data[].callinId

number

Queue ID — used as {id} in GET detail and PUT update

data[].callinName

string

Queue name

data[].strategy

number

null

1=normal, 2=VIP, 3=blacklist, 4=divert, 99=temporarily locked

data[].musicinQueue

string

null

Hold music file name (music on hold)

data[].timeWait

string

null

Maximum wait time (seconds)

data[].agentSelector

string

null

Agent selection algorithm

data[].nguongRanhRoi

string

null

Announce position: 0=off, 1=on

data[].callinNumber

string

null

Phone number of the queue

Error Codes

HTTP

error_code

Description

FE handling

401

UNAUTHORIZED

Missing or incorrect API key

Redirect to re-enter key

403

INSUFFICIENT_SCOPE

Key does not have scope queue

Show message

404

NOT_FOUND

Not found

Show message

429

RATE_LIMIT_EXCEEDED

Exceeded request limit

Retry after Retry-After seconds

500

FAIL

System error

General error toast

Rate Limit Headers

Header

Description

X-RateLimit-Limit-Tenant

Tenant limit/10s

X-RateLimit-Remaining-Tenant

Remaining tenant/10s

X-RateLimit-Limit-Route

Route limit/10s

X-RateLimit-Remaining-Route

Remaining route/10s

Retry-After

Seconds to wait when receiving 429


GET /v1/queues/inbound/{id}

Retrieve details of 1 inbound queue. Backend checks ownership: the queue must belong to the tenant of the auth header.

Authentication: Header X-Api-Key(scope: queue). Kong dual-auth: prioritize X-Tenant-IDheader, fallback to query DB based on the Authorization key.

Base URL: Dev: https://xapi-dev.alohub.vn |  Prod: https://xapi.alohub.vn

Parameters

Parameters

Location

Required

Type

Description

Example

{id}

path

Yes

number

callinId (obtained from GET /v1/queues/inbound)

1001226

Request Body

Sample code

curl -X GET "https://xapi.alohub.vn/v1/queues/inbound/1001226" \
  -H "X-Api-Key: sk_live_xxx" \
  -H "X-Tenant-ID: 20260310"
const axios = require('axios');
const response = await axios.get(
  '{{host}}/api/v1/queues/inbound/{{id}}',
  { headers: { 'Authorization': '{{api-key}}', 'X-Tenant-ID': '{{tenant-id}}', 'Content-Type': 'application/json' } }
);
console.log(response.data);
import requests

headers = {"Authorization": "{{api-key}}", "X-Tenant-ID": "{{tenant-id}}", "Content-Type": "application/json"}
response = requests.get(
    '{{host}}/api/v1/queues/inbound/{{id}}',
    headers=headers
)
print(response.json())

Response 200

{
  "callinId": 1001226,
  "callinName": "test",
  "strategy": 1,
  "musicinQueue": "waiting.wav",
  "timeWait": "120",
  "agentSelector": null,
  "nguongRanhRoi": null,
  "callinNumber": null
}

Response Fields

Field

Type

Description

callinId

number

Queue ID

callinName

string

Queue name

strategy

number

null

1=normal, 2=VIP, 3=blacklist, 4=divert, 99=temporarily locked

musicinQueue

string

null

Hold music file name

timeWait

string

null

Maximum wait time (seconds)

agentSelector

string

null

Agent selection algorithm

nguongRanhRoi

string

null

Announce position: 0=off, 1=on

callinNumber

string

null

Phone number of the queue

Error Codes

HTTP

error_code

Description

FE handling

401

UNAUTHORIZED

Missing or incorrect API key

Redirect to re-enter key

403

INSUFFICIENT_SCOPE

Key does not have scope queue

Show message

404

NOT_FOUND

Not found

Show message

429

RATE_LIMIT_EXCEEDED

Exceeded request limit

Retry after Retry-After seconds

500

FAIL

System error

General error toast

Rate Limit Headers

Header

Description

X-RateLimit-Limit-Tenant

Tenant limit/10s

X-RateLimit-Remaining-Tenant

Remaining tenant/10s

X-RateLimit-Limit-Route

Route limit/10s

X-RateLimit-Remaining-Route

Remaining route/10s

Retry-After

Seconds to wait when receiving 429


PUT /v1/queues/inbound/{id}

Update inbound queue configuration. All fields are optional — at least 1 field is required. Strategy must be an integer in the set {1,2,3,4,99}.

Authentication: Header X-Api-Key(scope: queue). Kong dual-auth: prioritize X-Tenant-IDheader, fallback to query DB based on the Authorization key.

Base URL: Dev: https://xapi-dev.alohub.vn |  Prod: https://xapi.alohub.vn

Parameters

Parameters

Location

Required

Type

Description

Example

{id}

path

Yes

number

callinId

1001226

Request Body

{
  "moh_file_id": "waiting.wav",
  "max_wait_sec": "180",
  "strategy": 1,
  "announce_position": "1"
}

Field

Required

Description

moh_file_id

No

Hold music file name

max_wait_sec

No

Maximum wait time (string number, unit in seconds)

strategy

No

Management type: 1/2/3/4/99 — must be an integer, use dropdown

announce_position

No

"0" = turn off announce position, "1" = turn on

Sample code

curl -X PUT "https://xapi.alohub.vn/v1/queues/inbound/1001226" \
  -H "X-Api-Key: sk_live_xxx" \
  -H "X-Tenant-ID: 20260310" \
  -H "Content-Type: application/json" \
  -d '{"strategy":1}'

# Update nhiều field
curl -X PUT "https://xapi.alohub.vn/v1/queues/inbound/1001226" \
  -H "X-Api-Key: sk_live_xxx" \
  -H "X-Tenant-ID: 20260310" \
  -H "Content-Type: application/json" \
  -d '{"moh_file_id":"waiting.wav","max_wait_sec":"180","strategy":1}'
const axios = require('axios');
const response = await axios.put(
  '{{host}}/api/v1/queues/inbound/{{id}}',
  {
  "moh_file_id": "waiting.wav",
  "max_wait_sec": "180",
  "strategy": 1,
  "announce_position": "1"
},
  { headers: { 'Authorization': '{{api-key}}', 'X-Tenant-ID': '{{tenant-id}}', 'Content-Type': 'application/json' } }
);
console.log(response.data);
import requests

headers = {"Authorization": "{{api-key}}", "X-Tenant-ID": "{{tenant-id}}", "Content-Type": "application/json"}
payload = {
    "moh_file_id": "waiting.wav",
    "max_wait_sec": "180",
    "strategy": 1,
    "announce_position": "1"
}
response = requests.put(
    '{{host}}/api/v1/queues/inbound/{{id}}',
    json=payload,
    headers=headers
)
print(response.json())

Response 200

{
  "success": "1",
  "error_code": "SUCCESS",
  "error_message": "Inbound queue updated successfully"
}

Response Fields

Field

Type

Description

success

string

"1" = success

error_code

string

SUCCESS when updated successfully

error_message

string

Result description

Error Codes

HTTP

error_code

Description

FE handling

401

UNAUTHORIZED

Missing or incorrect API key

Redirect to re-enter key

403

INSUFFICIENT_SCOPE

Key does not have scope queue

Show message

400

INVALID_INPUT

Incorrect input

Show specific error

404

NOT_FOUND

Not found

Show message

429

RATE_LIMIT_EXCEEDED

Exceeded request limit

Retry after Retry-After seconds

500

FAIL

System error

General error toast

Rate Limit Headers

Header

Description

X-RateLimit-Limit-Tenant

Tenant limit/10s

X-RateLimit-Remaining-Tenant

Remaining tenant/10s

X-RateLimit-Limit-Route

Route limit/10s

X-RateLimit-Remaining-Route

Remaining route/10s

Retry-After

Seconds to wait when receiving 429


Was this article helpful?
Updated: 6/2/2026
để chuyển bài