Documentation · API reference
POST
/api/v1/team/invitationsPost invitation
This page as Markdown, or in an AI chatMore ways to read this page
# Post invitation
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/post-team-invitations
`POST /api/v1/team/invitations`
## What to send
`Invite`
- `email` (string, needed)
- `may_visitors` (boolean)
- `role` (string, needed): `admin` or `viewer`. An owner is made by handing the account over.
- `sites` (list of string or null): Site ids or names. `null` is every site.
## The answer
201, `Invited`
- `emailed` (boolean, needed): Whether it was also sent by email.
- `invitation` (InvitationView, needed)
- `link` (string, needed): The link, shown once: tidekeeper keeps only a hash of it.
## Asking
```sh
curl -X POST https://tidekeeper.eu/api/v1/team/invitations \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email": "…", "role": "…"}'
```
What to send
Invite
- stringneeded
- may_visitors
- boolean
- role
- stringneeded`admin` or `viewer`. An owner is made by handing the account over.
- sites
- list of string or nullSite ids or names. `null` is every site.
The answer
Status 201
Invited
- emailed
- booleanneededWhether it was also sent by email.
- invitation
- InvitationViewneeded
- link
- stringneededThe link, shown once: tidekeeper keeps only a hash of it.
Asking
curl -X POST https://tidekeeper.eu/api/v1/team/invitations \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"email": "…", "role": "…"}'
const answer = await fetch("https://tidekeeper.eu/api/v1/team/invitations", { method: "POST", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({"email": "…", "role": "…"}), }).then((r) => r.json());