---
title: "Update an invitation's role"
url: https://docs.gleap.ai/en/reference/rest-api/update-invitation-role
method: PUT
path: "/invitations/{invitationId}/role"
api: "API Reference"
tag: "Invitation"
operationId: "UpdateInvitationRole"
updatedAt: "2026-11-01T18:40:15.677Z"
language: en
---

# Update an invitation's role

`PUT https://api.gleap.io/v3/invitations/{invitationId}/role`

Change the role an invitation will grant when accepted. Invitations are created with the `user` role, or `AGENT` when the inviter's role could not grant `user`, so this is the way to grant a different role before acceptance. Requires invitation permissions on the project given in the `project` header.

## Authorization

- `Authorization` (header, required): `Bearer <token>`

## Path parameters

- `invitationId` (string, required)

## Headers

- `project` (string, required)

## Request body (`application/json`, required)

- `role` (string, required)

## Example request

```bash
curl --request PUT \
  --url 'https://api.gleap.io/v3/invitations/{invitationId}/role' \
  --header 'Authorization: Bearer <token>' \
  --header 'project: <project>' \
  --header 'Content-Type: application/json' \
  --data '{
  "role": "<role>"
}'
```

## Responses

### 200 (`application/json`)

Ok

- `updatedAt` (string, required)
- `createdAt` (string, required)
- `project` (object)
  - `isValid` (object)
  - `createFromHexString` (object)
  - `createFromTime` (object)
  - `generate` (object)
  - `cacheHexString` (any)
  - `prototype` (string)
- `email` (string)
- `organisation` (object)
  - `isValid` (object)
  - `createFromHexString` (object)
  - `createFromTime` (object)
  - `generate` (object)
  - `cacheHexString` (any)
  - `prototype` (string)
- `role` (string, required)
- `name` (string, required)
- `type` (enum<string>, required): One of: `organisation`, `project`.
- `_id` (string, required)

```json
{
  "updatedAt": "string",
  "createdAt": "string",
  "project": {
    "isValid": {},
    "createFromHexString": {},
    "createFromTime": {},
    "generate": {}
  },
  "email": "string",
  "organisation": {
    "isValid": {},
    "createFromHexString": {},
    "createFromTime": {},
    "generate": {}
  },
  "role": "string",
  "name": "string",
  "type": "organisation",
  "_id": "string"
}
```
