Create a Role

Create a role to be used when assigning permissions to users.

SecuritySecretApiKey or JWT
Request
Request Body schema: application/json

Role resource.

name
required
string

Role name.

required
Array of objects (Acl)
Array
required
object

Scope of the API key.

permissions
required
Array of strings <operationId>

If you are creating a restricted API key, use this field to specify individual permissions. Use the wildcard character * to provide full access.

description
string

Role description.

allowedIps
Array of strings or null <ip> (AllowedIps)

List of IP addresses that are permitted access. Private subnets are prohibited. To remove restrictions, set this value to null.

juniorIds
Array of strings

List of junior roles identifiers.

Responses
201

Role created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
name
required
string

Role name.

required
Array of objects (Acl)
Array
required
object

Scope of the API key.

permissions
required
Array of strings <operationId>

If you are creating a restricted API key, use this field to specify individual permissions. Use the wildcard character * to provide full access.

id
string <= 50 characters

Unique resource ID. Defaults to UUID v4.

description
string

Role description.

allowedIps
Array of strings or null <ip> (AllowedIps)

List of IP addresses that are permitted access. Private subnets are prohibited. To remove restrictions, set this value to null.

seniorIds
Array of strings

List of senior roles identifiers.

juniorIds
Array of strings

List of junior roles identifiers.

usersCount
integer

Number of users with this role assigned.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

Array of Self (object) or SeniorRolesLink (object) or JuniorRolesLink (object) non-empty

Links related to a resource.

Array (non-empty)
Any of:
href
required
string

Link URL.

rel
required
string

Type of link.

Value: "self"
Array of JuniorRolesEmbed (object) non-empty

Embedded objects that are requested by the expand query parameter.

Array (non-empty)
Any of:

Junior roles collection.

juniors
Array of objects (Role)
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data sent.

post/roles
Request samples
application/json
{
  • "name": "string",
  • "description": "string",
  • "acl": [
    ],
  • "allowedIps": [
    ],
  • "juniorIds": [
    ]
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "name": "string",
  • "description": "string",
  • "acl": [
    ],
  • "allowedIps": [
    ],
  • "seniorIds": [
    ],
  • "juniorIds": [
    ],
  • "usersCount": 0,
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ],
  • "_embedded": [
    ]
}