---
title: "Create a role"
method: POST
path: "/v0.1/merchants/{merchant_code}/roles"
tags: ["Roles"]
---

# Create a role

`POST /v0.1/merchants/{merchant_code}/roles`

Create a custom role for the merchant. Roles are defined by the set of permissions that they grant to the members that they are assigned to.

## Path parameters

- `merchant_code` string, required

## Request body

- object
  - `name` string, required — User-defined name of the role.
  - `permissions` string[], required — User's permissions.
  - `metadata` Metadata — Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object.
  - `description` string — User-defined description of the role.

## Response `201`

Returns the Role object after successful custom role creation.

- Role — A custom role that can be used to assign set of permissions to members.
  - `id` string, required — Unique identifier of the role.
  - `name` string, required — User-defined name of the role.
  - `description` string — User-defined description of the role.
  - `permissions` string[], required — List of permission granted by this role.
  - `is_predefined` boolean, required — True if the role is provided by SumUp.
  - `metadata` Metadata — Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object.
  - `created_at` string, date-time, required — The timestamp of when the role was created.
  - `updated_at` string, date-time, required — The timestamp of when the role was last updated.

## Other responses

- `400` — Invalid request.
- `404` — Merchant not found.

## Changes

- **2026-07-10** `c75ca16e1e44` — 2 info
  - the security scope `roles.write` was added to the endpoint's security scheme `oauth2`
  - the security scope `user.subaccounts` was added to the endpoint's security scheme `oauth2`
- **2026-03-11** `cd79d83b07e0` — 2 info
  - media type `application/json` was changed to a more specific media type `application/problem+json` for the response status `400`
  - media type `application/json` was changed to a more specific media type `application/problem+json` for the response status `404`
- **2025-12-11** `b8fb7c9463b8` — 2 info
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `404`
- **2025-03-26** `80a17713e7a8` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/sumup/apis/sumup-rest-api/changes/v0.1/merchants/:merchant_code/roles/post.md)

---

[API](https://skmtc.dev/sumup/apis/sumup-rest-api.md) · [All operations](https://skmtc.dev/sumup/apis/sumup-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sumup/sumup-rest-api/revisions/b050b86c35d1/schema)
