Roles

Updates a custom role's name, description, or permissions and returns the updated role.

Providing permissions replaces the role's permission list and changes the access granted to members assigned to that role. Omitted fields remain unchanged.

patch/v0.1/merchants/{merchant_code}/roles/{role_id}

Request

  • Base URL
    https://api.sumup.com
  • URL
    https://api.sumup.com/v0.1/merchants/{merchant_code}/roles/{role_id}
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: https://api.sumup.com/authorize
      Token URL: https://api.sumup.com/token scopes: user.subaccounts, roles.write

Path parameters

merchant_codestring required
Example:MK10CL2A

Short unique identifier for the merchant.

role_idstring required
Example:role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP

The ID of the role to retrieve.

Request body

namestring

User-defined name of the role.

permissionsstring[]

User's permissions.

descriptionstring

User-defined description of the role.

Example request

{
  "name": "Senior Shop Manager III",
  "permissions": [
    "catalog_edit",
    "taxes_access",
    "members_edit"
  ]
}

Response

Returns the updated Role object if the update succeeded.

idstring required

Unique identifier of the role.

namestring required

User-defined name of the role.

descriptionstring

User-defined description of the role.

permissionsstring[] required

List of permission granted by this role.

is_predefinedboolean required

True if the role is provided by SumUp.

metadataMetadata

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_atstring date-time required

The timestamp of when the role was created.

updated_atstring date-time required

The timestamp of when the role was last updated.

Example response

{
  "id": "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP",
  "name": "Senior Shop Manager II",
  "description": "Manges the shop and the employees.",
  "permissions": [],
  "is_predefined": true,
  "metadata": {},
  "created_at": "2023-01-20T15:16:17Z",
  "updated_at": "2023-01-20T15:16:17Z"
}

Changes

    • breaking

      the request property's minItems was increased to 1

    • info

      the security scope roles.write was added to the endpoint's security scheme oauth2

    • info

      the security scope user.subaccounts was added to the endpoint's security scheme oauth2