Skip to content

List Calls

GET
/v1/calls
curl --request GET \
--url 'https://api.customer.onsim.uk/v1/calls?from=2026-04-15T12%3A00%3A00Z&to=2026-04-15T12%3A00%3A00Z&direction=inbound&outcome=answered' \
--header 'x-api-key: <x-api-key>'
from
required
string format: date-time

The list has the Calls that start at this time or later.

to
required
string format: date-time

The list has the Calls that start before this time. It is 31 days after from at most.

direction
string
Allowed values: inbound outbound internal

Only the Calls of this direction.

outcome
string
Allowed values: answered missed abandoned unanswered

Only the Calls of this outcome. It is the outcome of the Call, not of one party.

extension
string
>= 1 characters

Only the Calls that involve this extension, as the caller or as the party of a Leg.

number
string
>= 1 characters

Only the Calls that involve this phone number, as the caller or as the party of a Leg. Give it in any usual form: +442079460123, 020 7946 0123 or 442079460123. A number with no country code is a UK number. Encode a + as %2B.

OK

Media typeapplication/json
Array<object>

One conversation as the caller lives it, from the first ring to the last hang-up, with every Leg that it takes.

object
id
required

The ID of the Call. It can hold @ and :, so encode it in a path.

string
direction
required

inbound: from outside to you. outbound: from you to outside. internal: between two of your extensions.

string
Allowed values: inbound outbound internal
outcome
required

answered: a person speaks to the caller. missed: an inbound Call rings a User or a Hunt Group, and nobody answers. abandoned: the caller of an inbound Call hangs up in an IVR, before anything rings. unanswered: nobody answers an outbound or an internal Call.

string
Allowed values: answered missed abandoned unanswered
from
required

Who makes the Call.

object
extension

The extension, for a party of your own: a User, a Hunt Group or an IVR. Look it up in their lists to learn which, and its name.

string
number

The digits of a phone number, for an outside party. withheld when the party hides it. A feature code such as *40 is here too.

string
account

The name of one of your own lines that has no extension, such as a SIM in a router. app.onsim shows it in the Account column of its logs.

string
answered_by

The first person who speaks to the caller. Only an answered Call has it.

object
extension

The extension, for a party of your own: a User, a Hunt Group or an IVR. Look it up in their lists to learn which, and its name.

string
number

The digits of a phone number, for an outside party. withheld when the party hides it. A feature code such as *40 is here too.

string
account

The name of one of your own lines that has no extension, such as a SIM in a router. app.onsim shows it in the Account column of its logs.

string
started_at
required

When the Call starts.

string format: date-time
ended_at
required

When the Call ends.

string format: date-time
charge

What we charge for the Call. A Call has none when none of its Legs has a charge.

object
amount
required

The sum of the charges of all Legs of the Call, with the duplicates and the artefacts.

number
currency
required

The currency of amount, as an ISO 4217 code, such as GBP.

string
legs
required

The Legs of the Call, as a tree. The first is the start of the Call.

Array<object>

One step of a Call that tries to reach one party. Legs nest: the Leg that causes another is its parent.

object
id
required

The ID of the Leg. It holds spaces, so encode it in a path.

string
call_id

The ID of the call that this Leg comes from, only when it is not the id of the Call. An attended transfer joins a second call into the Call. Use this ID to get the Recording of the Leg.

string
party
required

Who the Leg tries to reach.

object
extension

The extension, for a party of your own: a User, a Hunt Group or an IVR. Look it up in their lists to learn which, and its name.

string
number

The digits of a phone number, for an outside party. withheld when the party hides it. A feature code such as *40 is here too.

string
account

The name of one of your own lines that has no extension, such as a SIM in a router. app.onsim shows it in the Account column of its logs.

string
outcome
required

How the Leg ends. answered means that the Leg connects, also to an IVR or a mailbox. It does not mean that a person speaks: the outcome of the Call says that. voicemail: voicemail takes the Leg. busy: the phone is busy. answered_elsewhere: another phone of the same ring takes the call. unreachable: the phone is offline. unanswered: every other end.

string
Allowed values: answered voicemail busy answered_elsewhere unreachable unanswered
started_at
required

When the Leg starts. For a ring that nobody answers, this is when the phone starts to ring.

string format: date-time
answered_at

When the Leg connects. A Leg that nobody answers has none.

string format: date-time
passed_on_at

When a Leg under this one takes the call over. The part of this Leg ends here. A Leg that keeps the call has none.

string format: date-time
ended_at
required

When the Leg closes. A Leg that passes the call on stays open to the end of the Call, so do not use ended_at less started_at as its length. The part of the Leg is from answered_at to passed_on_at, or to ended_at when it has no passed_on_at.

string format: date-time
recorded
required

True when the Leg has a Recording.

boolean
charge

What we charge for the Leg. A Leg has none when the call record has no amount. A duplicate and an artefact have their own charge. To get the charge of one step, add the charges of the duplicates and artefacts next to its Leg.

object
amount
required

The money that we charge. 0 when the tariff rates the use at no cost.

number
currency
required

The currency of amount, as an ISO 4217 code, such as GBP.

string
quantity

The units that we bill, after the tariff rounds them. For data, the tariff rounds up to the next 20 KiB.

integer
used_quantity

The units that we measure, before the tariff rounds them. Only a Leg has it: a Data Session gives the same value as bytes. A Leg that passes the call on stays bridged to the end of the Call, and we measure that time too.

integer
unit
required

The unit of quantity and used_quantity: seconds for a Leg, kib for a Data Session.

string
Allowed values: seconds kib
destination

What the tariff rates the use as. A Leg to one of your extensions has none.

object
prefix
required

The entry that the tariff matches: a prefix of the dialled number, such as 447968, or a data zone, such as MXGDATAZ1GBR.

string
description
required

The name of that entry in the tariff, such as UK - Mobile - T-Mobile or Mobile Data (UK). It says why the price is what it is.

string
country

The country of that entry, as an ISO 3166-1 alpha-3 code, such as GBR. For a Leg, it is the country of the dialled number, not of the caller.

string
unlinked

Only on a Leg whose place in the Call is not known. It is next to the first Leg, not under the Leg that caused it.

boolean
duplicate_of

Only on a duplicate: the ID of the Leg that it duplicates. A call between two of your accounts has two legs. One is on the account that dials, and one is on the account that the call reaches. The Leg is the one that the call reaches. The duplicate is next to it, with no Legs under it. It has the charge of the account that dials. Its outcome is the outcome of the account that dials, so it can read answered in a missed Call. Leave out the duplicates to show each step one time. A duplicate can have a Recording of the same conversation.

string
artefact_of

Only on an artefact: the ID of the IVR Leg that it is next to. An IVR makes an extra leg on its own account, with a withheld caller. It shows no step of its own, but it can have a charge. The artefact is next to the IVR Leg, with no Legs under it. Leave out the artefacts to show each step one time.

string
legs
required
Array<object> recursive
Example
[
{
"direction": "inbound",
"outcome": "answered",
"legs": [
{
"outcome": "answered",
"charge": {
"unit": "seconds"
},
"unlinked": true
}
]
}
]
Link
string

Only when the window has more Calls than one answer holds. It gives the request for the next ones, as <?from=...&to=...>; rel="next".

The request is not valid

Media typeapplication/problem+json

An error, as RFC 9457 Problem Details.

object
type
required

A URI that names the kind of error. It is also a page of the docs.

string
title
required

A short summary of the kind of error.

string
status
required

The HTTP status.

integer
detail

What went wrong in this request.

string
errors

Each parameter that is not valid. Only an invalid-request error has it.

Array<object>
object
field
required

The parameter that is not valid.

string
detail
required

Why it is not valid.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": [
{
"field": "example",
"detail": "example"
}
]
}

The API key is missing or not valid, or: This request is not permitted

Media typeapplication/problem+json

An error, as RFC 9457 Problem Details.

object
type
required

A URI that names the kind of error. It is also a page of the docs.

string
title
required

A short summary of the kind of error.

string
status
required

The HTTP status.

integer
detail

What went wrong in this request.

string
errors

Each parameter that is not valid. Only an invalid-request error has it.

Array<object>
object
field
required

The parameter that is not valid.

string
detail
required

Why it is not valid.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": [
{
"field": "example",
"detail": "example"
}
]
}

The request is too large

Media typeapplication/problem+json

An error, as RFC 9457 Problem Details.

object
type
required

A URI that names the kind of error. It is also a page of the docs.

string
title
required

A short summary of the kind of error.

string
status
required

The HTTP status.

integer
detail

What went wrong in this request.

string
errors

Each parameter that is not valid. Only an invalid-request error has it.

Array<object>
object
field
required

The parameter that is not valid.

string
detail
required

Why it is not valid.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": [
{
"field": "example",
"detail": "example"
}
]
}

Too many requests, or: The daily quota is used up

Media typeapplication/problem+json

An error, as RFC 9457 Problem Details.

object
type
required

A URI that names the kind of error. It is also a page of the docs.

string
title
required

A short summary of the kind of error.

string
status
required

The HTTP status.

integer
detail

What went wrong in this request.

string
errors

Each parameter that is not valid. Only an invalid-request error has it.

Array<object>
object
field
required

The parameter that is not valid.

string
detail
required

Why it is not valid.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": [
{
"field": "example",
"detail": "example"
}
]
}

The request failed

Media typeapplication/problem+json

An error, as RFC 9457 Problem Details.

object
type
required

A URI that names the kind of error. It is also a page of the docs.

string
title
required

A short summary of the kind of error.

string
status
required

The HTTP status.

integer
detail

What went wrong in this request.

string
errors

Each parameter that is not valid. Only an invalid-request error has it.

Array<object>
object
field
required

The parameter that is not valid.

string
detail
required

Why it is not valid.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": [
{
"field": "example",
"detail": "example"
}
]
}

Your records are not available now

Media typeapplication/problem+json

An error, as RFC 9457 Problem Details.

object
type
required

A URI that names the kind of error. It is also a page of the docs.

string
title
required

A short summary of the kind of error.

string
status
required

The HTTP status.

integer
detail

What went wrong in this request.

string
errors

Each parameter that is not valid. Only an invalid-request error has it.

Array<object>
object
field
required

The parameter that is not valid.

string
detail
required

Why it is not valid.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": [
{
"field": "example",
"detail": "example"
}
]
}

The request took too long

Media typeapplication/problem+json

An error, as RFC 9457 Problem Details.

object
type
required

A URI that names the kind of error. It is also a page of the docs.

string
title
required

A short summary of the kind of error.

string
status
required

The HTTP status.

integer
detail

What went wrong in this request.

string
errors

Each parameter that is not valid. Only an invalid-request error has it.

Array<object>
object
field
required

The parameter that is not valid.

string
detail
required

Why it is not valid.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": [
{
"field": "example",
"detail": "example"
}
]
}