Documentation · API reference
POST
/api/v1/sites-offeredTake a site another account offered
This page as Markdown, or in an AI chatMore ways to read this page
Take a site another account offered, with the code its owner was given.
# Take a site another account offered
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/post-sites-offered
`POST /api/v1/sites-offered`
Take a site another account offered, with the code its owner was given.
## What to send
`TakeSite`
- `code` (string, needed)
## The answer
200, `SiteRef`: A site by both of its names: the one the API takes and the one people read.
- `id` (string, needed)
- `name` (string, needed)
## Asking
```sh
curl -X POST https://tidekeeper.eu/api/v1/sites-offered \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"code": "…"}'
```
What to send
TakeSite
- code
- stringneeded
The answer
Status 200
SiteRef A site by both of its names: the one the API takes and the one people read.
- id
- stringneeded
- name
- stringneeded
Asking
curl -X POST https://tidekeeper.eu/api/v1/sites-offered \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"code": "…"}'
const answer = await fetch("https://tidekeeper.eu/api/v1/sites-offered", { method: "POST", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({"code": "…"}), }).then((r) => r.json());