Create a role

Note: New roles are not associated with any permissions by default. To assign existing permissions to your role, review Associate Permissions with a Role. To create new permissions, review Add API Permissions.

Creates a new role.

post
Header parameters
Brand-URLstringRequired

The brand URL of the request. This is used to identify the brand.

Example: YOUR_BRAND_URL
Auth-KeystringRequired

This is used to authenticate the request. If the request is not authenticated, the server will return a 401 Unauthorized response.

Example: YOUR_AUTH_KEY
Body

This class is used when creating or updating a Role.

codestring · min: 1Required

The code of the Role.

Example: EXAMPLE
namestring · min: 1Required

The name of the Role.

Example: Example
descriptionstring | nullableOptional

The description of the Role.

Example: Description
tagsstring | nullableOptional

The tags of the Role.

Example: #Example
Responses
201
The request was successful.
application/json
post
POST /api/v1/roles HTTP/1.1
Host: protocol.jframework.io
Brand-URL: text
Auth-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 161

{
  "code": "DEVELOPER",
  "name": "Developer",
  "description": "Role for software developers with access to development tools and project resources.",
  "tags": "#it #system"
}
{
  "success": true,
  "statusCode": 200,
  "message": "The request was successful.",
  "data": {
    "id": "sApKpllz4sAplsmzha",
    "parentBrandId": null,
    "guid": "1d069dc3-097c-48da-bbed-edb50f94d66d",
    "code": "EXAMPLE",
    "name": "Example",
    "description": "Description",
    "tags": "#Example",
    "type": "Custom",
    "permissions": [
      "Resource.Action"
    ]
  },
  "errors": []
}

Last updated

Was this helpful?