# Invitations

Invite people to a Pro organization by email.

Invitations are a Pro feature. They require [organizations](/docs/organizations/) and a working [mail](/docs/mail/) setup when you run in production.

To invite someone, an org owner or admin may post:

```sh
curl -X POST http://127.0.0.1:3000/api/orgs/{id}/invitations \
  -H "Authorization: Bearer crt_…" \
  -H "Content-Type: application/json" \
  -d '{"email":"ada@example.com","role":"member"}'
```

Charter stores a hashed token and queues an email with an accept link. The invitee then posts `POST /api/orgs/invitations/accept` with `token`, and optionally `name` and `password` when they do not already have an account.

## Turn it on or off

Invitations are on by default when organizations are on. Disable them with:

```sh
CHARTER_DISABLE_INVITATIONS=1
# or
charter serve --no-invitations
```

## Create and accept

1. An org owner or admin calls `POST /api/orgs/{id}/invitations` with `email` and optional `role` (`admin` or `member`).
2. Charter stores a hashed token and queues an email with an accept link.
3. The invitee posts `POST /api/orgs/invitations/accept` with `token`, and optionally `name` and `password` when they do not already have an account.

You may resend with `POST /api/orgs/{id}/invitations/{invitationId}/resend`. Revoke with `DELETE /api/orgs/{id}/invitations/{invitationId}`.

> [!WARNING]
> In production, if invitations are enabled, `MAIL_MAILER` must be `smtp` with a valid `MAIL_FROM_ADDRESS`, or `charter serve` will refuse to start.

## Next steps

Configure the outbound transport on [Mail](/docs/mail/), or point people at [SSO](/docs/sso/) when the organization should sign in through OpenID Connect instead.
