Skip to content
You are reading the unreleased documentation. No version is released yet, and these pages describe code that is not in a release.

Roles (admin API)

Admin routes of the roles module. Every route needs a staff session and the permission named on it; send X-Resolve-Locale: false to receive every locale of a translatable field for editing.

List all roles

Responses:

  • 200: Roles retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Create new role

Request body: CreateRoleDto.

Responses:

  • 201: Role created.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Update role permissions

Parameters:

  • id in path (string, required).

Request body: UpdateRolePermissionsDto.

Responses:

  • 200: Role permissions updated.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Role not found.
  • name (string, max length 50, required).
  • description (string, max length 255, optional).
  • permissions ("admin_users:view", "admin_users:create", "admin_users:update", "admin_users:delete", "admin_users:manage", "analytics:view", "analytics:create", "analytics:update", "analytics:delete", "analytics:manage", "assets:view", "assets:create", "assets:update", "assets:delete", "assets:manage", "audit_log:view", "audit_log:create", "audit_log:update", "audit_log:delete", "audit_log:manage", "campaigns:view", "campaigns:create", "campaigns:update", "campaigns:delete", "campaigns:manage", "carriers:view", "carriers:create", "carriers:update", "carriers:delete", "carriers:manage", "categories:view", "categories:create", "categories:update", "categories:delete", "categories:manage", "checkout:view", "checkout:create", "checkout:update", "checkout:delete", "checkout:manage", "cms:view", "cms:create", "cms:update", "cms:delete", "cms:manage", "customers:view", "customers:create", "customers:update", "customers:delete", "customers:manage", "geo:view", "geo:create", "geo:update", "geo:delete", "geo:manage", "gift_cards:view", "gift_cards:create", "gift_cards:update", "gift_cards:delete", "gift_cards:manage", "inventory:view", "inventory:create", "inventory:update", "inventory:delete", "inventory:manage", "license:view", "license:create", "license:update", "license:delete", "license:manage", "notifications:view", "notifications:create", "notifications:update", "notifications:delete", "notifications:manage", "orders:view", "orders:create", "orders:update", "orders:delete", "orders:manage", "payment_methods:view", "payment_methods:create", "payment_methods:update", "payment_methods:delete", "payment_methods:manage", "products:view", "products:create", "products:update", "products:delete", "products:manage", "promotions:view", "promotions:create", "promotions:update", "promotions:delete", "promotions:manage", "returns:view", "returns:create", "returns:update", "returns:delete", "returns:manage", "reviews:view", "reviews:create", "reviews:update", "reviews:delete", "reviews:manage", "search:view", "search:create", "search:update", "search:delete", "search:manage", "seo:view", "seo:create", "seo:update", "seo:delete", "seo:manage", "settings:view", "settings:create", "settings:update", "settings:delete", "settings:manage", "shipping:view", "shipping:create", "shipping:update", "shipping:delete", "shipping:manage", "storefront_config:view", "storefront_config:create", "storefront_config:update", "storefront_config:delete", "storefront_config:manage", required).
  • permissions ("admin_users:view", "admin_users:create", "admin_users:update", "admin_users:delete", "admin_users:manage", "analytics:view", "analytics:create", "analytics:update", "analytics:delete", "analytics:manage", "assets:view", "assets:create", "assets:update", "assets:delete", "assets:manage", "audit_log:view", "audit_log:create", "audit_log:update", "audit_log:delete", "audit_log:manage", "campaigns:view", "campaigns:create", "campaigns:update", "campaigns:delete", "campaigns:manage", "carriers:view", "carriers:create", "carriers:update", "carriers:delete", "carriers:manage", "categories:view", "categories:create", "categories:update", "categories:delete", "categories:manage", "checkout:view", "checkout:create", "checkout:update", "checkout:delete", "checkout:manage", "cms:view", "cms:create", "cms:update", "cms:delete", "cms:manage", "customers:view", "customers:create", "customers:update", "customers:delete", "customers:manage", "geo:view", "geo:create", "geo:update", "geo:delete", "geo:manage", "gift_cards:view", "gift_cards:create", "gift_cards:update", "gift_cards:delete", "gift_cards:manage", "inventory:view", "inventory:create", "inventory:update", "inventory:delete", "inventory:manage", "license:view", "license:create", "license:update", "license:delete", "license:manage", "notifications:view", "notifications:create", "notifications:update", "notifications:delete", "notifications:manage", "orders:view", "orders:create", "orders:update", "orders:delete", "orders:manage", "payment_methods:view", "payment_methods:create", "payment_methods:update", "payment_methods:delete", "payment_methods:manage", "products:view", "products:create", "products:update", "products:delete", "products:manage", "promotions:view", "promotions:create", "promotions:update", "promotions:delete", "promotions:manage", "returns:view", "returns:create", "returns:update", "returns:delete", "returns:manage", "reviews:view", "reviews:create", "reviews:update", "reviews:delete", "reviews:manage", "search:view", "search:create", "search:update", "search:delete", "search:manage", "seo:view", "seo:create", "seo:update", "seo:delete", "seo:manage", "settings:view", "settings:create", "settings:update", "settings:delete", "settings:manage", "shipping:view", "shipping:create", "shipping:update", "shipping:delete", "shipping:manage", "storefront_config:view", "storefront_config:create", "storefront_config:update", "storefront_config:delete", "storefront_config:manage", required).