Roles

Resource Fields

Name Type Read-only Description
title string
type string OWNER, ADMIN, AGENT, COLLABORATOR, CUSTOMER
is_system boolean
agent_case_access string SELF, TEAMS, ALL

Only applicable for the role type OWNER, ADMIN, AGENT, COLLABORATOR

Default: ALL
created_at timestamp ISO-8601 Format
updated_at timestamp ISO-8601 Format

Metadata




 
 




Actions

Retrieve all roles

GET /api/v1/roles.json

Information

Allowed for Collaborators, Agents, Admins & Owners
Scope users
Ordered by id (ascending)

Response

{
    "status": 200,
    "data": [
        {
            "id": 1,
            "title": "Administrator",
            "type": "ADMIN",
            "is_system": true,
            "agent_case_access": "ALL",
            "created_at": "2015-07-24T04:21:36+05:00",
            "updated_at": "2015-07-24T04:21:36+05:00",
            "resource_type": "role",
            "resource_url": "https://brewfictus.kayako.com/api/v1/roles/1"
        }
    ],
    "resource": "role",
    "offset": 0,
    "limit": 10,
    "total_count": 1
}

Retrieve a role

GET /api/v1/roles/:id.json

Information

Allowed for Collaborators, Agents, Admins & Owners
Scope users

Response

{
    "status": 200,
    "data": {
        "id": 1,
        "title": "Administrator",
        "type": "ADMIN",
        "is_system": true,
        "agent_case_access": "ALL",
        "created_at": "2015-07-24T04:21:36+05:00",
        "updated_at": "2015-07-24T04:21:36+05:00",
        "resource_type": "role",
        "resource_url": "https://brewfictus.kayako.com/api/v1/roles/1"
    },
    "resource": "role"
}

Add a role

POST /api/v1/roles.json

Information

Allowed for Admins & Owners
Scope configuration

Parameters

Name Type Mandatory Description
title string
type string ADMIN, AGENT
agent_case_access string SELF, TEAMS, ALL

Default: ALL

Response

{
    "status": 201,
    "data": {
        "id": 5,
        "title": "Manager",
        "type": "AGENT",
        "is_system": true,
        "agent_case_access": "ALL",
        "created_at": "2015-07-24T05:46:45+05:00",
        "updated_at": "2015-07-24T05:46:45+05:00",
        "resource_type": "role",
        "resource_url": "https://brewfictus.kayako.com/api/v1/roles/5"
    },
    "resource": "role"
}

Update a role

PUT /api/v1/roles/:id.json

Information

Allowed for Admins & Owners
Scope configuration

Parameters

Name Type Mandatory Description
title string
agent_case_access string SELF, TEAMS, ALL

Response

{
    "status": 200,
    "data": {
        "id": 1,
        "title": "Floor Manager",
        "type": "ADMIN",
        "is_system": true,
        "agent_case_access": "ALL",
        "created_at": "2015-07-24T04:21:36+05:00",
        "updated_at": "2015-07-24T05:49:22+05:00",
        "resource_type": "role",
        "resource_url": "https://brewfictus.kayako.com/api/v1/roles/1"
    },
    "resource": "role"
}

Delete a role

DELETE /api/v1/roles/:id.json

Information

Allowed for Admins & Owners
Scope configuration

Response

{
    "status": 200
}

Delete roles

DELETE /api/v1/roles.json

Information

Allowed for Admins & Owners
Scope configuration

Parameters

Name Type Mandatory Description
ids string
comma separated phrases

Response

{
    "status": 200,
    "total_count": 2
}

Permissions

RESOURCE FIELDS

Name Type Read-only Description
name string
value boolean
created_at timestamp
ISO-8601 Format
updated_at timestamp
ISO-8601 Format

Retrieve all permissions

GET /api/v1/roles/:id/permissions.json

Information

Allowed for Customers, Collaborators, Agents, Admins & Owners
Scope configuration
Ordered by id (ascending)

Customers can view their own permissions.

Response

    {
        "status": 200,
        "data": [
            {
    "id": 177,

    "name": "address.manage",
    "value": true,
    "created_at": "2016-04-22T08:51:23+00:00",
    "updated_at": "2016-04-22T08:51:23+00:00",

    "resource_type": "permission"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/roles/1/permissions/177"

}
        ],
        "resource": "permission",
        "total_count": 1
    }

Update permissions

PUT /api/v1/roles/:id/permissions.json

Information

Allowed for Admins & Owners
Scope configuration

Parameters

Name Type Mandatory Description
permission
We accept the key-value pair to add a field value.

Example: ['team.member.create' => 0 or 1, 'team.member.delete' => 0 or 1]

Response

{
    "status": 200,
    "total_count": 2
}