# CREATE ROLE


> Create a custom role that carries platform privileges and data grants.

Create a custom role to give a team scoped data access on top of a preset role. Only Admins can create roles. To set which role a custom role inherits from, follow `CREATE ROLE` with [GRANT ROLE](/sql-reference/motherduck-sql-reference/access-control/grant-role/). See [Roles and access control](/concepts/roles-and-access-control/) for the model.

:::note
Custom roles are available on the Enterprise plan.
:::

## Syntax

```sql
CREATE ROLE [ IF NOT EXISTS ] <role_name>;
```

Creating a role that already exists returns an error. Use `IF NOT EXISTS` to silence that error.

## Parameters

| Parameter | Description | Required |
|-----------|-------------|----------|
| `<role_name>` | Name of the role. Must be at least three characters, start with a letter, and contain only letters, numbers, hyphens, and underscores. Names are case-insensitive and stored in lowercase. `admin`, `builder`, and `explorer` are reserved. | Yes |
| `IF NOT EXISTS` | Skip creation without an error if a role with this name already exists. | No |

## Examples

### Create a role

```sql
CREATE ROLE finance;
```

### Create a role and set its parent

A new custom role has no platform privileges until it inherits from a preset or another custom role.

```sql
CREATE ROLE finance;
GRANT ROLE explorer TO ROLE finance;
```

### Create a role only if it does not exist

```sql
CREATE ROLE IF NOT EXISTS finance;
```

## Related

- [Roles and access control](/concepts/roles-and-access-control/)
- [DROP ROLE](/sql-reference/motherduck-sql-reference/access-control/drop-role/)
- [GRANT ROLE](/sql-reference/motherduck-sql-reference/access-control/grant-role/)
- [Manage roles and access](/key-tasks/managing-organizations/managing-roles/)


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fmotherduck-sql-reference%2Faccess-control%2Fcreate-role%2F&page_title=CREATE%20ROLE&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
