# Api requests

Requests made to the API, with an API key or an OAuth grant's token

Base URL: `https://api.cv-transformer.com/v1`. Endpoints: `GET /api_requests`. Authenticate with the header `Authorization: Bearer YOUR_API_KEY` (see [authentication](https://www.cv-transformer.com/nl/api-reference/authentication.md)).

## The api request object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `integer` | Unique identifier. |
| `api_key_id` | `uuid \| null` | Identifier of the API key that made the request. Either this or `grant_id` is set. References [`api_keys.id`](https://www.cv-transformer.com/nl/api-reference/api_keys.md). |
| `grant_id` | `uuid \| null` | Identifier of the OAuth grant whose token made the request. Either this or `api_key_id` is set. References [`oauth_grants.id`](https://www.cv-transformer.com/nl/api-reference/oauth_grants.md). |
| `created_at` | `timestamp with time zone` | Creation timestamp. |
| `created_on` | `date` | Date on which the request was made. |
| `endpoint` | `text` | API endpoint that was called. |
| `method` | `text` | HTTP method of the request. |
| `search` | `text` | Query string of the request. |
| `status` | `smallint` | HTTP status code of the response. |

```json
{
  "id": 0,
  "api_key_id": "00000000-0000-0000-0000-000000000000",
  "grant_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2026-01-01T12:00:00+00:00",
  "created_on": "2026-01-01",
  "endpoint": "",
  "method": "",
  "search": "",
  "status": 0
}
```

## List api requests

`GET /v1/api_requests` · requires the `organization:read` scope

Filter on any attribute with `column=operator.value` (see [filtering](https://www.cv-transformer.com/nl/api-reference/filtering.md)). Choose columns and embed related resources with `select` (see [selecting](https://www.cv-transformer.com/nl/api-reference/selecting.md)), and sort and paginate with `order`, `limit` and `offset` (see [sorting and pagination](https://www.cv-transformer.com/nl/api-reference/sorting-pagination.md)).

```bash
curl "https://api.cv-transformer.com/v1/api_requests?limit=10&select=*" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Responses:

- `200`: A list of api requests with the selected columns. The `Content-Range` header holds the range returned and the total count, like `0-9/42`.
- `206`: Partial Content
- `400`: The request is malformed, for example an unknown column or an invalid filter.
- `401`: The API key is missing or invalid.
- `403`: The API key doesn't have the scope this request needs.
- `429`: The API key made more requests per minute than its rate limit allows. Retry after the number of seconds in the `Retry-After` header.

Errors have a JSON body with a `message`, `details` and `hint`, and for database errors a `code`. See the [introduction](https://www.cv-transformer.com/nl/api-reference.md) for more on errors. The full API is described by the OpenAPI spec at https://api.cv-transformer.com/v1/openapi.json.
