# Email a team invitation.

> Hosted dashboard only.
> https://koi.dog/docs/api/workspace-team/invite-workspace-teammate/

`POST /api/v1/workspace-team/invitations` · Key: `session only`

Owners and admins may invite an email address to their current workspace. A team invitation expires in seven days. Use a Clerk session token at `https://app.koi.dog/api/v1` with `Origin: https://app.koi.dog`.

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Retry the same request with the same key. [Retry rules](https://koi.dog/docs/api/#retries). |

## Body.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | `string` | yes | The address of the teammate to invite into the current workspace. 1 to 254 characters. |

## Response.

200 OK · JSON object

- **422 validation_failed**: Each schema error appears in `details`.

## Request.

```sh
# Requires a Clerk dashboard session token.
curl -X POST https://app.koi.dog/api/v1/workspace-team/invitations \
    -H "Authorization: Bearer $KOIDOG_CLERK_SESSION" \
    -H "Origin: https://app.koi.dog" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{
      "email": "teammate@example.com"
    }'
```

```js
// Requires a Clerk dashboard session token.
const res = await fetch("https://app.koi.dog/api/v1/workspace-team/invitations", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_CLERK_SESSION}`,
    Origin: "https://app.koi.dog",
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    email: "teammate@example.com",
  }),
});
console.log(await res.json());
```

```python
import os
import uuid

import requests

# Requires a Clerk dashboard session token.
r = requests.post(
    "https://app.koi.dog/api/v1/workspace-team/invitations",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_CLERK_SESSION']}",
        "Origin": "https://app.koi.dog",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "email": "teammate@example.com",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "id": "string",
  "email": "string",
  "createdAt": "2026-01-01T00:00:00Z",
  "expiresAt": "2026-01-01T00:00:00Z",
  "state": "sending"
}
```
