---
title: "Add a role"
description: "Add a role, with its permissions in the same call."
canonical: "https://grid82.com/docs/builder-api/roles/create"
updated: "2026-11-13"
---

# Add a role

`POST https://studio.grid82.app/v1/apps/{appId}/roles`

Add a role, with its permissions in the same call.

Without `tables` it reaches no table; `tables` takes the shape shown in `roles.setPermissions`. Other roles are untouched. Returns the role and its `revision`; check what it allows with `rules.simulate`, without adding anyone.

Requires the `schema:write` scope. Operation `roles.create`. MCP tool `roles_create`. CLI: `grid82 roles create` (`npx grid82`).

## Path parameters

| Name    | Type   | Required | Description |
| ------- | ------ | -------- | ----------- |
| `appId` | string | yes      |             |

## Headers

| Name              | Type   | Required | Description                                                                                                                                                                                                                                                        |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Idempotency-Key` | string | no       | Any unique string. Sending the same key with the same request again returns the first response (marked `Idempotency-Replayed: true`) instead of running it twice. Reusing it for a different request is refused with 409. Kept for 24 hours. Up to 255 characters. |

## Request body

| Field         | Type                | Required | Description           |
| ------------- | ------------------- | -------- | --------------------- |
| `name`        | string              | yes      | Up to 120 characters. |
| `description` | string              | no       | Up to 500 characters. |
| `tables`      | "\*" or object      | no       |                       |
| `interface`   | "assigned" or "own" | no       |                       |
| `automations` | "none" or "own"     | no       |                       |

**Authorizations**

- `Authorization` (bearer, in header, required)

## Response

**201**: Success

- `data` (`object`, required)
- `data.role` (`object`, required)
- `data.role.id` (`string`, required, pattern: `^[a-z][a-z0-9_]{0,62}$`)
- `data.role.name` (`string`, required, length: `1–120 chars`)
- `data.role.description` (`string`, length: `≤ 500 chars`)
- `data.role.assistantMonthlyCredits` (`integer`, range: `0–10000000`)
- `data.role.interface` (`enum<string>`, one of: `assigned, own`)
- `data.role.automations` (`enum<string>`, one of: `none, own`)
- `data.revision` (`string`, required)

```json
{
  "data": {
    "role": {
      "id": "<string>",
      "name": "<string>",
      "description": "<string>",
      "assistantMonthlyCredits": 123,
      "interface": "assigned",
      "automations": "none"
    },
    "revision": "<string>"
  }
}
```

**4XX**: Refused

- `error` (`object`, required)
- `error.code` (`enum<string>`, required, one of: `not_found, forbidden, unauthenticated, validation_failed, conflict, rate_limited, payment_required, not_implemented, internal`)
- `error.message` (`string`, required)
- `error.details` (`Record<string, unknown>`)

```json
{
  "error": {
    "code": "not_found",
    "message": "<string>",
    "details": {}
  }
}
```

**Example request**

```bash
curl --request POST \
  --url 'https://studio.grid82.app/v1/apps/<appId>/roles' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>"
}'
```
