Save system and record type permissions atomically
Configurable CRM record contract. Record references contain both typeId and recordId. Workspace scope comes from authentication. Decimal values are strings. Writes require their documented revision and idempotency preconditions; pending results refer to a durable operation.
Requires: role management: create access to users for a new role, edit access for an existing one.
Authorization
apiKeyAuth API key authentication. Create an API key in your user profile and include it in the x-api-key header.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://customermates.com/api/v1/roles/save" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "description": "string", "permissions": [ { "resource": "dataModel", "actions": [ "create" ] } ], "recordGrants": [ { "typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7", "actions": [ "create" ] } ], "expectedRevision": 9007199254740991, "idempotencyKey": "stringst" }'{
"role": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"isSystemRole": true,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"permissions": [
{
"id": "string",
"resource": "dataModel",
"action": "create"
}
],
"recordGrants": [
{
"typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
"actions": [
"create"
]
}
]
},
"schemaRevision": 9007199254740991
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}