BoldSales

API Documentation

Create a role

post/api/v1/roles

Creates a new role and returns the created role's ID upon a successful API call.

Code snippet

curl -X 'POST' \
  'https://{yourdomain}/api/v1/roles' \
  -H 'accept: text/plain; x-api-version=1.0' \
  -H 'x-api-key: {your API key}' \
  -H 'Content-Type: application/json-patch+json; x-api-version=1.0' \
  -d '{
    "data": {
      "name": "Product Owner",
      "description": "Acts as the bridge between stakeholders and the development team",
      "reportingRole": {
        "id": 572
      }
    }
  }'

Request body

namestringRequiredSpecifies a unique name for the new role. This field is mandatory and helps in identifying the role.
descriptionstringA brief summary of the role's purpose or responsibilities.

reportingRoleobject

Existing role to which this new role reports, creating a hierarchy.

idintegerUnique identifier of the existing role.

Example response

201 Created

{
  "message": "Role created successfully.",
  "data": {
    "id": 101
  }
}