---
title: "Create a new role"
method: POST
path: "/api/roles"
tags: ["Roles & Permissions"]
---

# Create a new role

`POST /api/roles`

## Request

- Base URL: `https://api.sponsorunited.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sponsorunited.com/api/roles`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/sponsorunited/apis/sponsorunited-api/docs/api/roles/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new role with specified permissions and role level

## Request body

- StoreRoleRequest
  - `name` string, required
  - `display_name` string
  - `description` string
  - `permissions` string
  - `role_level` integer

## Response `201`

A new role with its permissions.

- RoleStoreUpdateResource
  - `role` object
    - `id` integer
    - `name` string
    - `display_name` string
    - `description` string
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `permissions` PermissionsGroupedByLabel
      - `Label Name` Permission[]: The name of the label under which several permissions are grouped.
        - `id` integer
        - `name` string
        - `display_name` string
        - `description` string
        - `created_at` string, date-time
        - `updated_at` string, date-time
  - `all_permissions` PermissionsGroupedByLabel
    - `Label Name` Permission[]: The name of the label under which several permissions are grouped.
      - `id` integer
      - `name` string
      - `display_name` string
      - `description` string
      - `created_at` string, date-time
      - `updated_at` string, date-time

---

[API](https://skmtc.dev/sponsorunited/apis/sponsorunited-api.md) - [All operations](https://skmtc.dev/sponsorunited/apis/sponsorunited-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sponsorunited/apis/sponsorunited-api/revisions/cbf1ca5bff8f?raw)
