# Requests & Responses

:::info

The SecuriThings API is a REST API. It uses standard HTTP methods, resource-oriented URLs, and JSON
for both requests and responses.

:::

## Base URL

All requests go to `https://api.securithings.com`. The API version is part of the path, and all
current endpoints are under `/v1`.

## Responses

- All responses are returned in `application/json` format.
- Successful responses will be 200, 201 or 204 (if there is no resource to return).
- Errors are communicated using HTTP status codes. See [Errors](/guides/errors).
- All timestamps are in UTC, in ISO 8601 format.

## Collections

Endpoints that return a collection of resources return a JSON object with a field named after the
resource, containing an array of resource objects. For devices the field is `devices`, for sites it
is `sites`, and so on.

Alongside it, `total` is the number of resources that match your query, which is not necessarily the
number returned in this response. Use it to page through results, as described in
[Pagination & Filtering](/guides/pagination-and-filtering).

For example, requesting the first two devices out of three that match:

```bash
curl "https://api.securithings.com/v1/devices?limit=2" \
     -H "Accept: application/json" \
     -H "Authorization: Bearer <token>"
```

```json
{
  "devices": [
    {
      "id": "1",
      ...
    },
    {
      "id": "2",
      ...
    }
  ],
  "total": 3
}
```

The response contains two devices because `limit=2` was requested, while `total` reports that three
devices match the query overall.
