# REST API

> Base URL, authentication, versioning and the OpenAPI document every page here is generated from.

Source: https://docs.okyc.stream/reference/api

|                |                                                                                                                                                                |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Base URL       | `https://api.okyc.stream/v1`                                                                                                                                   |
| Authentication | `Authorization: Bearer sk_test_…` or `sk_live_…`                                                                                                               |
| Content type   | `application/json`                                                                                                                                             |
| Versioning     | The current version is shown on each endpoint page. The `OKYC-Version` header is reserved for pinning a version; today every request uses the current version. |
| Errors         | [One JSON shape](https://docs.okyc.stream/backend/errors.md); every code is in the [error reference](https://docs.okyc.stream/reference/errors.md).                                                                  |
| Retries        | Send an [`Idempotency-Key`](https://docs.okyc.stream/backend/idempotency.md) on `POST`.                                                                                                   |

The endpoint pages are generated from [`openapi.json`](https://docs.okyc.stream/openapi.json) (OpenAPI 3.1), which is itself generated
from the API's route definitions — so they always match the running API. Import it into Postman, Insomnia or a
code generator.

| Resource                                   |                                                                     |
| ------------------------------------------ | ------------------------------------------------------------------- |
| [Sessions](https://docs.okyc.stream/reference/api/sessions.md)        | Create, list, retrieve, decide, cancel sessions; evidence; erasure. |
| [Checks](https://docs.okyc.stream/reference/api/checks.md)            | Direct checks without a hosted flow.                                |
| [Reference data](https://docs.okyc.stream/reference/api/reference.md) | Country capabilities and document types.                            |
| [Workflows](https://docs.okyc.stream/reference/api/workflows.md)      | Published workflows (read-only).                                    |
| [Webhooks](https://docs.okyc.stream/reference/api/webhooks.md)        | Webhook endpoints and events.                                       |
| [Schemas](https://docs.okyc.stream/reference/api/schemas.md)          | Shared objects.                                                     |
