Permissions

Create team role

Changed on

Creates a team-scoped permission role.

post/teams/{key}/roles

Request

  • Base URL
    https://api.session.services
  • Auth
    API key in header x-tenant-id

Path parameters

key, string required

Team identifier (ID or slug)

Request body

object required
name, string required

Role display name

description, string

Optional role description

permissions, string[] required

Non-empty array of permission nodes. Supports wildcard and negation.

Example request

{
  "permissions": [
    "team.read",
    "team.member.write"
  ]
}

Response

OK

object required
role, object required

Team-scoped permission role

Example response

{
  "role": {
    "permissions": [
      "team.read",
      "team.member.write"
    ]
  }
}

Changes

    • breaking

      the permissions request property's minItems was increased to 1

    • breaking

      the name request property's minLength was increased from 0 to 1

    • breaking

      added the pattern ^-?(?:\*|(?:[a-z][a-z0-9-]*)(?:\.[a-z][a-z0-9-]*)*(?:\.\*|\.bypass|\.[a-z]{3}_[0-9a-z]{26})?)$ to the request property permissions/items

    3 more changes in this revision