Skip to main content
POST
/
custom_role
Create Custom Role
curl --request POST \
  --url https://api.partoo.co/v2/custom_role \
  --header 'Content-Type: application/json' \
  --header 'x-APIKey: <api-key>' \
  --data '
{
  "name": "My Custom Role",
  "api_id": "my_custom_role",
  "permissions": [
    "business_edit",
    "business_edit_name",
    "review_read"
  ],
  "description": "This Custom Role is just an example for our API documentation",
  "org_id": 42
}
'
{
  "status": "success",
  "api_id": "my_custom_role"
}

Authorizations

x-APIKey
string
header
required

The authentication system on Partoo API is using API Key that should be put in the header of the request (the name of the header is x-APIKey). An api_key is linked to a user. This user's role will give you different access level to the API features.

Body

application/json

Custom role creation payload.

name
string
required

Name of the Custom Role. Cannot contain any of the following characters: ,;/\|<>.

Required string length: 1 - 100
Example:

"My Custom Role"

api_id
string
required

Unique identifier. Cannot contain any of the following characters: ,;/\|<>.

Required string length: 1 - 100
Example:

"my_custom_role"

permissions
string[]
required

List of permission names. (Use GET /api/v2/permissions to get a list of all available permissions for your organization.)

Example:
[
"business_edit",
"business_edit_name",
"review_read"
]
description
string

Description of the Custom Role. Cannot contain any of the following characters: ,;/\|<>.

Required string length: 1 - 200
Example:

"This Custom Role is just an example for our API documentation"

org_id
integer | null

Organization ID (optional). Specify if you have access to more than one organization.

Example:

42

Response

OK

Response returned when a custom role is successfully created.

status
enum<string>

Request status

Available options:
success
api_id
string

API identifier of the created custom role.

Example:

"my_custom_role"