Pivot roles API
Create, read, or edit your roles using the Pivot API.
Pivot must be running in native users mode.
Get all roles or a get single named role
Returns a list of all roles, or returns a role with a {name}
that you specify.
URL
GET /api/v1/roles/{name}
Success response
Code | Description |
---|---|
200 | OK |
Selected error response
Code | Example body |
---|---|
404 Not Found | ”error": "Not found." |
Sample request
curl --location --request GET 'http://localhost:9095/api/v1/roles' \
--header 'x-imply-api-token:<token>'
Response body
[
{
"name": "string",
"externamName": "string",
"title": "string",
"roleVisibility": "hidden",
"permissions": [
"string"
],
"filterToken": [
{
"name": "string",
"formula": "string",
"combine": "block"
}
]
}
]
Create or update a role by name
Creates or updates a role with a {name}
that you specify.
URL
POST /api/v1/roles/{name}
Request body
curl -X POST --header "Content-Type:application/json" --header "x-imply-api-token:<token>" --data '
{
"role": {
"name": "string",
"externamName": "string",
"title": "string",
"roleVisibility": "hidden",
"permissions": [
"string"
],
"filterToken": [
{
"name": "string",
"formula": "string",
"combine": "block"
}
]
}
}
Success response
Code | Description |
---|---|
200 | OK |
Selected error response
Code | Example body |
---|---|
404 Not Found | ”error": "Not found." |
Response body
[
{
"name": "string",
"externamName": "string",
"title": "string",
"roleVisibility": "hidden",
"permissions": [
"string"
],
"filterToken": [
{
"name": "string",
"formula": "string",
"combine": "block"
}
]
}
]
Delete a role by name
Deletes a role with a {name}
that you specify.
URL
DELETE /api/v1/roles/{name}
Sample request
curl -X DELETE --header "x-imply-api-token:<token>" localhost:9095/api/v1/roles/<roleName>
Success response
Code | Description |
---|---|
200 | OK |
Selected error response
Code | Example body |
---|---|
404 Not Found | ”error": "Not found." |