# Moving off POST /api/check

> Each check now has its own endpoint. If you call `POST /api/check`, it still works for right to work, and the move is a one-line change.

Base URL: `https://checksharecode.co.uk` · Auth: `authorization: Bearer <key>` · Web version: https://checksharecode.co.uk/docs/guides/moving-off-api-check

- **Today**: Still works, for right to work. Same body, same answers. Right to rent is refused there.
- **Every response**: `Deprecation: @1790812800`. Plus a `Link` header to [the reference](https://checksharecode.co.uk/docs/api/check.md#deprecated), so your logs can find old calls.
- **Turn-off date**: Not set yet. Until then it keeps working. This page will show the date once one is set.

## The change

Right to work keeps the same body, the same responses and the same errors. Only the path changes, for synchronous and asynchronous checks:

Right to work, body unchanged:

```diff
- POST https://checksharecode.co.uk/api/check
+ POST https://checksharecode.co.uk/api/check/right-to-work

- POST https://checksharecode.co.uk/api/check/async
+ POST https://checksharecode.co.uk/api/check/right-to-work/async
```

> **Adding right to rent?** It has only its own endpoint, `POST /api/check/right-to-rent`, with `checker_name` in place of `company_name`, and `checker_type`. See [Right to rent](https://checksharecode.co.uk/docs/api/right-to-rent.md).

## Find calls you missed

### In your code

Every response from the old paths carries a `Deprecation` header. Log it, and old calls show up in your own logs.

Node.js:

```js
const res = await fetch(url, init);
if (res.headers.get('deprecation')) {
  log.warn('deprecated endpoint', { url });
}
```

### In your dashboard

[Usage](https://checksharecode.co.uk/app/usage) lists calls by endpoint for the last 30 days, with the keys that made them, and shows a notice while any key still calls `POST /api/check`. The CSV export there has every request with its endpoint and key prefix.

## Checklist

- Sync calls go to `/api/check/right-to-work`.
- Async calls go to `/api/check/right-to-work/async`.
- Checks are read from the `Location` header, not a URL you build.
- No `Deprecation` header in your logs for a week.

See also: [Webhooks](https://checksharecode.co.uk/docs/webhooks.md) · [Build with an agent](https://checksharecode.co.uk/docs/agents.md)
