---
title: "Create an invitation"
description: "Create and send an invitation to grant access to the Charitips dashboard"
canonical: https://www.charitips.com/docs/api-reference/create-invitation
---

# Create an invitation

`POST /v1/accounts/{accountId}/invite`

Create and send an invitation to grant access to the Charitips dashboard

**Authentication**: Bearer access token.

## Parameters

- `accountId` (string, required)

## Body

- `email` (string, required, email address)
- `firstName` (string, required)
- `lastName` (string, required)
- `phone` (string)
- `role` (object, required) One of `ADMIN`, `MEMBER`, `PAYROLL_MANAGER`.
- `campaignIds` (string[], UUID)

## Response 201

- `userInvitationId` (string, required)
- `firstName` (string, required)
- `lastName` (string, required)
- `email` (string, required)
- `phone` (string)
- `slug` (string, required)
- `status` (UserInvitationStatus, required) One of `PENDING`, `CLAIMED`, `CANCELED`.
- `role` (Role, required) One of `ADMIN`, `MEMBER`, `PAYROLL_MANAGER`.
- `accountId` (string, required)
- `createdAt` (string (date-time), required)
- `updatedAt` (string (date-time), required)

## Errors

- 400 `At least one campaign is required for members`: A MEMBER only sees the campaigns they are given. Send `campaignIds` with at least one campaign of the account, or invite the user as ADMIN or PAYROLL_MANAGER. See https://www.charitips.com/docs/api-reference/create-invitation.md.
- 400 `Invalid campaignIds`: At least one id of `campaignIds` is not a campaign of this account, or an id is repeated. List the account's campaigns and send each id once. See https://www.charitips.com/docs/api-reference/list-campaigns.md.
- 400 `A field is missing, has the wrong type, or is not part of the request schema.`: `message` lists every problem. Unknown fields are rejected, not ignored: remove them rather than sending extra data. See https://www.charitips.com/docs/api-reference/errors.md.
- 401 `Unauthorized`: The access token is missing, expired or invalid. Create a new one with your client id and secret, send it as `Authorization: Bearer <accessToken>`, then retry once. Sandbox tokens only work on api.sandbox.charitips.com. See https://www.charitips.com/docs/get-started/authentication.md.
- 402 `Plan upgrade required`: Your plan does not include this feature. Upgrade the plan from the dashboard, then retry. See https://www.charitips.com/docs/overview/plans.md.
- 403 `Forbidden`: Your credentials cannot perform this action on this resource. An id from another account never answers 403: it is treated as unknown, with a 404 in the path or a 400 `Bad Request` in the body or the query. See https://www.charitips.com/docs/api-reference/errors.md.
- 403 `Account closed`: The account behind these credentials is closed: no token is issued and every call is refused, reads included. Contact Charitips to reopen it. See https://www.charitips.com/docs/api-reference/troubleshooting.md#calls-answer-403-account-not-active-account-not-validated-or-account-closed.
- 404 `Not Found`: No resource with this id on your account and environment. An id that belongs to another account answers 404 too when it is in the path. Ids from the sandbox do not exist in production. See https://www.charitips.com/docs/get-started/sandbox.md.
- 409 `User already exist`: A user with this email already belongs to this account. Update the user instead of inviting them. See https://www.charitips.com/docs/api-reference/update-user.md.
- 409 `Invitation already exist`: A pending invitation already exists for this email on this account. Update it or delete it instead of inviting again. See https://www.charitips.com/docs/api-reference/list-user-invitations.md.

## Example

```bash
curl -X POST https://api.sandbox.charitips.com/v1/accounts/<accountId>/invite \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane.doe@example.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "role": "ADMIN"
  }'
```

```javascript
const response = await fetch('https://api.sandbox.charitips.com/v1/accounts/<accountId>/invite', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CHARITIPS_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "email": "jane.doe@example.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "role": "ADMIN"
  }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const data = await response.json();
```

```python
import os, requests

response = requests.post(
    "https://api.sandbox.charitips.com/v1/accounts/<accountId>/invite",
    headers={"Authorization": f"Bearer {os.environ['CHARITIPS_TOKEN']}"},
    json={
      "email": "jane.doe@example.com",
      "firstName": "Jane",
      "lastName": "Doe",
      "role": "ADMIN"
    },
)
response.raise_for_status()
data = response.json()
```

## Response example (201, placeholder values)

```json
{
  "userInvitationId": "<userInvitationId>",
  "firstName": "<firstName>",
  "lastName": "<lastName>",
  "email": "<email>",
  "phone": "<phone>",
  "slug": "<slug>",
  "status": "PENDING",
  "role": "ADMIN"
}
```
