# Base URL and versioning

## Base URL

```text
https://api.rephut.com/v1
```

All endpoints are under this URL, for example `https://api.rephut.com/v1/me`. Use HTTPS. Any other path on this host returns a JSON `404 not_found`. A path that exists, called with a method it doesn't support, returns `405 method_not_allowed` with an `Allow` header; paths that support `GET` also accept `HEAD`.

## Versioning

The version is the first part of the path, `/v1`. Within `v1` we only add things, so a correct integration keeps working:

- new endpoints;
- new optional request fields;
- new response fields;
- new error codes, event types and status values.

Build your integration so that unknown fields, codes and values don't break it. Rely on `code` and on `status` and `kind` values, never on `error` messages or fields ending in `Label`, which are English text and may change. If a breaking change is ever needed, it will come as a new version (`/v2`), announced in the [Changelog](https://docs.rephut.com/developers/changelog).

## OpenAPI document

[https://api.rephut.com/v1/openapi.json](https://api.rephut.com/v1/openapi.json) describes every endpoint, request and response schema and webhook (OpenAPI 3.1). It is public and needs no key. Use it to generate a client or to load the API into tools such as Postman.
