Create a role

Creates a role that is used to assign permissions to users.

SecuritySecretApiKey or JWT
Request
Request Body schema: application/json

Role resource.

name
required
string

Name of the user role.

required
Array of objects (Acl)

Access Control List (ACL) information.

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

Description of the role.

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 role IDs.

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

Name of the user role.

required
Array of objects (Acl)

Access Control List (ACL) information.

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

Description of the role.

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 role IDs.

juniorIds
Array of strings

List of junior role IDs.

usersCount
integer

Number of users assigned to this role.

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 objects

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Enum: "self" "seniorRoles" "juniorRoles"
object

Embedded objects that are requested by the expand query parameter.

juniorRoles
object
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": {
    }
}