---
title: "Create a role"
type: reference
method: POST
path: /rest-api/roles.do
tag: "Users"
---

# Create a role

`POST https://YOUR-NETWORK-DOMAIN/rest-api/roles.do`

Adds a role built on one of the static roles 'staticRoles' lists -- the static role decides which permissions the new role can hold at all and which console the accounts holding it enter, and it cannot be changed afterwards. 'copyFrom' starts the new role from another role's permissions and admin console pages instead of from nothing; without it the role starts with no permissions and is given the User Roles & Permissions page, as the console does. A role built on ADMIN needs the Create ADMIN-based role permission. Requires the Admin Roles & Permissions or User Roles & Permissions console permission.

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `name` | string | yes | `Campaign manager` | The role's name, as the console shows it |
| `staticRole` | string | yes | `NETWORK_MANAGER` | The static role to build on: its id, or its name as 'staticRoles' spells it |
| `copyFrom` | integer | no | `4` | Start from this role's permissions and admin console pages |

## Responses

- `200` — {success, id, name, staticRole, identity, manageable}
- `400` — The name is blank or taken, the static role is unknown or deprecated, or 'copyFrom' names no role
- `401` — Authentication error
- `403` — The caller may not build a role on that static role, or may not copy that one

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/roles.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'name=Campaign manager' \
  --data-urlencode 'staticRole=NETWORK_MANAGER' \
  --data-urlencode 'copyFrom=4'
```

Source: https://epom.com/ad-server/docs/api/users/post-roles