Skip to main content
POST
/
api
/
v1
/
roles
Create Role
curl --request POST \
  --url https://api.member.dev/api/v1/roles \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '
{
  "name": "<string>",
  "slug": "<string>",
  "team_id": "<string>"
}
'
{
  "data": {
    "attributes": {
      "name": "<string>",
      "slug": "<string>",
      "is_system": false,
      "team_id": "<string>"
    },
    "id": "<string>",
    "type": "<string>",
    "links": {
      "self": "<string>"
    },
    "meta": {},
    "relationships": {}
  },
  "included": [
    "<unknown>"
  ],
  "links": {
    "self": "<string>"
  },
  "meta": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/vnd.api+json

Schema for client-submitted role creation.

is_system is intentionally absent — system roles are seeded, not minted via the API. Unknown fields are forbidden (extra="forbid") so callers receive a 422 rather than a silent discard on typos, which mirrors PermissionAssignRequest and makes the API surface more honest.

name
string
required
slug
string
required
team_id
string | null

Response

Successful Response

data
JsonApiResource[RoleAttributes] · object
required
included
any[] | null
meta
Meta · object