---
title: "Update a user invitation"
description: "Update an invitation."
canonical: https://www.charitips.com/docs/api-reference/update-user-invitation
---

# Update a user invitation

`PATCH /v1/user-invitations/{userInvitationId}`

Update an invitation.

**Authentication**: Bearer access token.

## Parameters

- `userInvitationId` (string, required)

## Body

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

## Response 200

- `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 `Only members can be assigned campaigns`: `campaignIds` only apply to the MEMBER role, and the check reads the role saved before this call. Set `role` to MEMBER in a first update, then send `campaignIds`, or leave `campaignIds` out. See https://www.charitips.com/docs/concepts/account-hierarchy.md#dashboards-and-users.
- 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 `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.
- 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.
- 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.

## Example

```bash
curl -X PATCH https://api.sandbox.charitips.com/v1/user-invitations/<userInvitationId> \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "donor@example.com",
    "firstName": "<firstName>"
  }'
```

```javascript
const response = await fetch('https://api.sandbox.charitips.com/v1/user-invitations/<userInvitationId>', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.CHARITIPS_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "email": "donor@example.com",
    "firstName": "<firstName>"
  }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const data = await response.json();
```

```python
import os, requests

response = requests.patch(
    "https://api.sandbox.charitips.com/v1/user-invitations/<userInvitationId>",
    headers={"Authorization": f"Bearer {os.environ['CHARITIPS_TOKEN']}"},
    json={
      "email": "donor@example.com",
      "firstName": "<firstName>"
    },
)
response.raise_for_status()
data = response.json()
```

## Response example (200, placeholder values)

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