> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/tposs/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/tposs/latest/api-reference/rest/api.md).

# REST API

TPOSS REST API enables secure, RESTful access to subscriber management, charging accounts, balances, sessions, and event data. It provides support for JSON requests and responses, advanced filtering, and sorting.

## Query parameters

Each endpoint requires the `ApiKey` query parameter, which is described in the [API overview](https://docs.cennso.com/components/tposs/latest/api-reference/api.md#authentication) document. Some of the endpoints additionally support the following query parameters:

- `Limit`
- `Offset`
- `Sort`
- `Filter`
- `Fields` 

These parameters work the same way as the [JSON-RPC 2.0 API parameters](https://docs.cennso.com/components/tposs/latest/api-reference/rpc/overview.md#api-parameters).

The session list endpoints support one more query parameter - `IncludeAffectedCount`. If it is set to `true`, the response contains the `TotalEntriesAffectedByFilter` field with the total number of sessions matched by the given filter, regardless of the `Limit` and `Offset` values. By default, it is set to `false`.

## Common error scenarios

If a request fails, the response body contains the `ErrorCode` and `ErrorMessage` fields. For example:

```json
{
  "ErrorCode": -33333,
  "ErrorMessage": "Not authenticated"
}
```

Despite each endpoint may have its own set of possible errors, all the endpoints share common error scenarios:

- `401 Not authenticated` - the request does not contain the `ApiKey` query parameter, or its value can't be verified
- `400 Bad request` - the request contains an invalid list query, for example, an unknown field in the `Filter` or `Sort` parameter.
- `404 Not found` - the object addressed by the request does not exist. The returned error code depends on the object type. For example, the `-31401` error code is returned for a subscriber, and the `-31601` error code is returned for a CDR.

All the possible errors related to a particular endpoint are described in the API specification below.

**OpenAPI specification:** [rest-api-specs-v1.json](https://docs.cennso.com/api/spec/components/tposs/latest/assets/rest-api-specs-v1.json?form=bundled&kind=openapi)
