This endpoint is responsible for handling accounts.
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
_allAccountsMeta.page | int | page number, starting from zero |
---|---|---|
_allAccountsMeta.perPage | int | number of items returned per |
_allAccountsMeta.sortField | str | field used to sort the returned items, defaults to id |
_allAccountsMeta.sortOrder | str | asc or desc, defaults to asc |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "{
allAccounts {
id
account_tag
tenant
name
type
balance
linked_accounts {
account_tag
name
type
balance
}
max_pending_transactions
notification_email
notification_mobile
carrier_tags
carrier_tags_override
pricelist_tags
tags
}
meta: _allAccountsMeta(page: 0, perPage: 10, sortField: "id", sortOrder: "asc") {
count
}
}" }
EOF
allAccounts.id | objectid | Unique identifyer of the account |
---|---|---|
allAccounts.account_tag | string | Identifyer of the account in the specified tenant |
allAccounts.tenant | string | The associated tenant of the account |
allAccounts.type | AccountType | The type of the account (PREPAID / POSTPAID) |
allAccounts.balance | BigInt | The balance of the account |
allAccounts.active | boolean | Is the account active? Default to true |
allAccounts.max_pending_transactions | Int | The maximum number of active calls the account can make and recieve (outbound and inbound) |
allAccounts.name | string | Descriptive name of the account |
allAccounts.notification_email | string | The email the alerts should be sent to |
allAccounts.notification_mobile | string | The mobile phone an SMS alert should be sent to |
allAccounts.carrier_tags | array | List of preferred carriers for this account (prepended to the LCR for example) |
allAccounts.carrier_tags_override | array | List of carriers to force (other LCR carriers for example are ignored) |
allAccounts.customer_tag | string | A customer id this account is associated with |
allAccounts.linked_accounts | array | A list of parent accounts |
allAccounts.pricelist_tags | array | A list of pricelists to apply to this account traffic |
allAccounts.tags | array | A list of tags for labeling accounts |
allAccounts.pending_transactions | AccountTransaction | The list of current pending transactions for this account |
meta.count | int | Number of accounts |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"allAccounts": [
{
"id": "ac8606db-89a7-45ae-9c63-808d6313e2b1",
"account_tag": "100",
"tenant": "alex",
"name": "My first account",
"type": "POSTPAID",
"balance": 1000,
"linked_accounts": [],
"max_pending_transactions": 10,
"notification_email": "alex@canyan.io",
"notification_mobile": "00385911231234",
"carrier_tags": null,
"carrier_tags_override": null,
"pricelist_tags": [
"pricelist2"
],
"tags": null
},
{
"id": "b76e706a-5e33-4d5e-baf8-822c90ee3db5",
"account_tag": "101",
"tenant": "alex",
"name": "My second account",
"type": "PREPAID",
"balance": 100,
"linked_accounts": [],
"max_pending_transactions": 2,
"notification_email": "alex@canyan.io",
"notification_mobile": "00385911231234",
"carrier_tags": null,
"carrier_tags_override": null,
"pricelist_tags": [
"pricelist1"
],
"tags": null
}
],
"meta": {
"count": 2
}
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
allAccounts.filter.id | id | id of the account to fetch |
---|---|---|
allAccounts.filter.ids | array | array of ids to fetch |
allAccounts.filter.tenant | string | filter account by tenant |
allAccounts.filter.account_tag | string | filter account by account id |
allAccounts.filter.customer_tag | str | filter account by customer id |
allAccounts.filter.type | AccountType | Get specific type of account (PREPAID / POSTPAID) |
allAccounts.filter.active | boolean | filter by active accounts |
allAccounts.filter.with_pending_transactions | boolean | list of account with active transactions |
allAccounts.filter.with_long_runing_transactions | boolean | list of account with active and long transactions (> 3 hours) |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "{
allAccounts(filter: {
tenant:"alex", active:true
}) {
id
account_tag
tenant
name
type
balance
max_pending_transactions
notification_email
notification_mobile
carrier_tags
carrier_tags_override
pricelist_tags
tags
}
}"
}
EOF
allAccounts.id | objectid | Unique identifyer of the account |
---|---|---|
allAccounts.account_tag | string | Identifyer of the account in the specified tenant |
allAccounts.tenant | string | The associated tenant of the account |
allAccounts.type | AccountType | The type of the account (PREPAID / POSTPAID) |
allAccounts.balance | BigInt | The balance of the account |
allAccounts.active | boolean | Is the account active? Default to true |
allAccounts.max_pending_transactions | Int | The maximum number of active calls the account can make and recieve (outbound and inbound) |
allAccounts.name | string | Descriptive name of the account |
allAccounts.notification_email | string | The email the alerts should be sent to |
allAccounts.notification_mobile | string | The mobile phone an SMS alert should be sent to |
allAccounts.carrier_tags | array | List of preferred carriers for this account (prepended to the LCR for example) |
allAccounts.carrier_tags_override | array | List of carriers to force (other LCR carriers for example are ignored) |
allAccounts.customer_tag | string | A customer id this account is associated with |
allAccounts.linked_accounts | array | A list of parent accounts |
allAccounts.pricelist_tags | array | A list of pricelists to apply to this account traffic |
allAccounts.tags | array | A list of tags for labeling accounts |
allAccounts.pending_transactions | AccountTransaction | The list of current pending transactions for this account |
meta.count | int | Number of accounts |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"allAccounts": [
{
"id": "ac8606db-89a7-45ae-9c63-808d6313e2b1",
"account_tag": "100",
"tenant": "alex",
"name": "My first account",
"type": "POSTPAID",
"balance": 1000,
"max_pending_transactions": 10,
"notification_email": "alex@canyan.io",
"notification_mobile": "00385911231234",
"carrier_tags": null,
"carrier_tags_override": null,
"pricelist_tags": [
"pricelist2"
],
"tags": null
}
]
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
createAccount.id | objectid | Unique identifyer of the account (if not provided an uuid4 will be generated automatically - best option) |
---|---|---|
createAccount.account_tag | string | Identifyer of the account in the specified tenant |
createAccount.tenant | string | The associated tenant of the account |
createAccount.type | AccountType | The type of the account (PREPAID / POSTPAID) |
createAccount.balance | BigInt | The balance of the account |
createAccount.active | boolean | Is the account active? Default to true |
createAccount.max_pending_transactions | Int | The maximum number of active calls the account can make and recieve (outbound and inbound) |
createAccount.name | string | Descriptive name of the account |
createAccount.notification_email | string | The email the alerts should be sent to |
createAccount.notification_mobile | string | The mobile phone an SMS alert should be sent to |
createAccount.carrier_tags | array | List of preferred carriers for this account (prepended to the LCR for example) |
createAccount.carrier_tags_override | array | List of carriers to force (other LCR carriers for example are ignored) |
createAccount.customer_tag | string | A customer id this account is associated with |
createAccount.linked_accounts | array | A list of parent accounts |
createAccount.pricelist_tags | array | A list of pricelists to apply to this account traffic |
createAccount.tags | array | A list of tags for labeling accounts |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "mutation {
createAccount(
tenant: "alex",
account_tag: "100",
type: POSTPAID,
balance: 1000,
max_pending_transactions: 10,
name: "My first account",
notification_mobile: "00385911231234",
notification_email: "alex@canyan.io",
active: true,
pricelist_tags: ["pricelist2"]
) {
id
account_tag
tenant
name
type
balance
linked_accounts {
account_tag
name
type
balance
}
max_pending_transactions
notification_email
notification_mobile
carrier_tags
carrier_tags_override
pricelist_tags
tags
}
}"
}
EOF
createAccount.id | objectid | Unique identifyer of the account |
---|---|---|
createAccount.account_tag | string | Identifyer of the account in the specified tenant |
createAccount.tenant | string | The associated tenant of the account |
createAccount.type | AccountType | The type of the account (PREPAID / POSTPAID) |
createAccount.balance | BigInt | The balance of the account |
createAccount.active | boolean | Is the account active? Default to true |
createAccount.max_pending_transactions | Int | The maximum number of active calls the account can make and recieve (outbound and inbound) |
createAccount.name | string | Descriptive name of the account |
createAccount.notification_email | string | The email the alerts should be sent to |
createAccount.notification_mobile | string | The mobile phone an SMS alert should be sent to |
createAccount.carrier_tags | array | List of preferred carriers for this account (prepended to the LCR for example) |
createAccount.carrier_tags_override | array | List of carriers to force (other LCR carriers for example are ignored) |
createAccount.customer_tag | string | A customer id this account is associated with |
createAccount.linked_accounts | array | A list of parent accounts |
createAccount.pricelist_tags | array | A list of pricelists to apply to this account traffic |
createAccount.tags | array | A list of tags for labeling accounts |
createAccount.pending_transactions | AccountTransaction | The list of current pending transactions for this account |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"createAccount": {
"id": "ac8606db-89a7-45ae-9c63-808d6313e2b1",
"account_tag": "100",
"tenant": "alex",
"name": "My first account",
"type": "POSTPAID",
"balance": 1000,
"linked_accounts": [],
"max_pending_transactions": 10,
"notification_email": "alex@canyan.io",
"notification_mobile": "00385911231234",
"carrier_tags": null,
"carrier_tags_override": null,
"pricelist_tags": [
"pricelist2"
],
"tags": null
}
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
updateAccount.id | objectid | Unique identifyer of the account |
---|---|---|
updateAccount.account_tag | string | Identifyer of the account in the specified tenant |
updateAccount.tenant | string | The associated tenant of the account |
updateAccount.type | AccountType | The type of the account (PREPAID / POSTPAID) |
updateAccount.balance | BigInt | The balance of the account |
updateAccount.active | boolean | Is the account active? Default to true |
updateAccount.max_pending_transactions | Int | The maximum number of active calls the account can make and recieve (outbound and inbound) |
updateAccount.name | string | Descriptive name of the account |
updateAccount.notification_email | string | The email the alerts should be sent to |
updateAccount.notification_mobile | string | The mobile phone an SMS alert should be sent to |
updateAccount.carrier_tags | array | List of preferred carriers for this account (prepended to the LCR for example) |
updateAccount.carrier_tags_override | array | List of carriers to force (other LCR carriers for example are ignored) |
updateAccount.customer_tag | string | A customer id this account is associated with |
updateAccount.linked_accounts | array | A list of parent accounts |
updateAccount.pricelist_tags | array | A list of pricelists to apply to this account traffic |
updateAccount.tags | array | A list of tags for labeling accounts |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "mutation {
updateAccount(
tenant: "alex",
account_tag: "100",
type: PREPAID,
balance: 10,
max_pending_transactions: 2,
name: "My updated account",
notification_mobile: "00385911231234",
notification_email: "alex@canyan.io",
active: true,
pricelist_tags: ["pricelist1"]
) {
id
account_tag
tenant
name
type
balance
max_pending_transactions
notification_email
notification_mobile
carrier_tags
carrier_tags_override
pricelist_tags
tags
}
}"
}
EOF
updateAccount.id | objectid | Unique identifyer of the account |
---|---|---|
updateAccount.account_tag | string | Identifyer of the account in the specified tenant |
updateAccount.tenant | string | The associated tenant of the account |
updateAccount.type | AccountType | The type of the account (PREPAID / POSTPAID) |
updateAccount.balance | BigInt | The balance of the account |
updateAccount.active | boolean | Is the account active? Default to true |
updateAccount.max_pending_transactions | Int | The maximum number of active calls the account can make and recieve (outbound and inbound) |
updateAccount.name | string | Descriptive name of the account |
updateAccount.notification_email | string | The email the alerts should be sent to |
updateAccount.notification_mobile | string | The mobile phone an SMS alert should be sent to |
updateAccount.carrier_tags | array | List of preferred carriers for this account (prepended to the LCR for example) |
updateAccount.carrier_tags_override | array | List of carriers to force (other LCR carriers for example are ignored) |
updateAccount.customer_tag | string | A customer id this account is associated with |
updateAccount.linked_accounts | array | A list of parent accounts |
updateAccount.pricelist_tags | array | A list of pricelists to apply to this account traffic |
updateAccount.tags | array | A list of tags for labeling accounts |
updateAccount.pending_transactions | AccountTransaction | The list of current pending transactions for this account |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"updateAccount": {
"id": "ac8606db-89a7-45ae-9c63-808d6313e2b1",
"account_tag": "100",
"tenant": "alex",
"name": "My updated account",
"type": "PREPAID",
"balance": 10,
"max_pending_transactions": 2,
"notification_email": "alex@canyan.io",
"notification_mobile": "00385911231234",
"carrier_tags": null,
"carrier_tags_override": null,
"pricelist_tags": [
"pricelist1"
],
"tags": null
}
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
deleteAccount.id | identifyer | Unique identifyer of the account |
---|---|---|
deleteAccount.account_tag | string | The id of the account for the defined tenant |
deleteAccount.tenant | string | The tenant of the account |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "mutation {
deleteAccount(
tenant: "alex",
account_tag: "100"
) {
id
account_tag
tenant
name
type
balance
max_pending_transactions
notification_email
notification_mobile
carrier_tags
carrier_tags_override
pricelist_tags
tags
}
}"
}
EOF
deleteAccount.id | objectid | Unique identifyer of the account |
---|---|---|
deleteAccount.account_tag | string | Identifyer of the account in the specified tenant |
deleteAccount.tenant | string | The associated tenant of the account |
deleteAccount.type | AccountType | The type of the account (PREPAID / POSTPAID) |
deleteAccount.balance | BigInt | The balance of the account |
deleteAccount.active | boolean | Is the account active? Default to true |
deleteAccount.max_pending_transactions | Int | The maximum number of active calls the account can make and recieve (outbound and inbound) |
deleteAccount.name | string | Descriptive name of the account |
deleteAccount.notification_email | string | The email the alerts should be sent to |
deleteAccount.notification_mobile | string | The mobile phone an SMS alert should be sent to |
deleteAccount.carrier_tags | array | List of preferred carriers for this account (prepended to the LCR for example) |
deleteAccount.carrier_tags_override | array | List of carriers to force (other LCR carriers for example are ignored) |
deleteAccount.customer_tag | string | A customer id this account is associated with |
deleteAccount.linked_accounts | array | A list of parent accounts |
deleteAccount.pricelist_tags | array | A list of pricelists to apply to this account traffic |
deleteAccount.tags | array | A list of tags for labeling accounts |
deleteAccount.pending_transactions | AccountTransaction | The list of current pending transactions for this account |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"deleteAccount": {
"id": "ac8606db-89a7-45ae-9c63-808d6313e2b1",
"account_tag": "100",
"tenant": "alex",
"name": "My updated account",
"type": "PREPAID",
"balance": 10,
"max_pending_transactions": 2,
"notification_email": "alex@canyan.io",
"notification_mobile": "00385911231234",
"carrier_tags": null,
"carrier_tags_override": null,
"pricelist_tags": [
"pricelist1"
],
"tags": null
}
}
}