Legacy roles

Use the following endpoints to programmatically manage legacy roles.

LEGACY ROLES

This page describes the legacy permissions model. Workato is replacing legacy roles with the new permissions model, which uses environment roles and project roles. You can migrate legacy roles using the Role migration API or the in-app migration wizard. Refer to the New permissions model documentation for more information.

Rate limits

The legacy roles resource has the following rate limit:

Quick reference

TypeResourceDescription
GET/api/rolesList custom roles.
PUT/api/roles/:role_idUpdates a custom role's project privileges.
POST/api/roles/:role_id/copyMakes a copy of a custom role.

List custom roles

Lists all custom roles.

shell
GET /api/roles

Query parameters

NameTypeDescription
per_pageinteger
optional
The number of custom roles to retrieve.
pageinteger
optional
The page number. If the total number of custom roles exceed the page limit, subsequent records can be retrieved by calling the next page.

Sample request

shell
curl  -X GET https://www.workato.com/api/roles \
      -H 'Authorization: Bearer <api_token>'

Response

json
[
    {
        "id": 478,
        "name": "Developer role",
        "inheritable": false,
        "folder_ids": [],
        "created_at": "2020-05-20T11:54:31.706-07:00",
        "updated_at": "2020-05-20T11:54:31.706-07:00",
        "privileges": {
            "Recipes": [ ... ],
            "Folders": [ ... ],
            ...
        }
    },
    {
        "id": 446,
        "name": "Non-developer role",
        "inheritable": false,
        "folder_ids": [],
        "created_at": "2020-04-12T08:40:11.240-07:00",
        "updated_at": "2020-04-12T08:40:11.240-07:00",
        "privileges": {
            "Recipes": [ ... ],
            "Folders": [ ... ],
            ...
        }
    }
]

Update a custom role

Updates the projects accessible to a custom collaborator role. You can set the privilege to all projects or specific projects by their folder IDs. The folder IDs can be obtained with the GET folders API endpoint.

shell
PUT /api/roles/:id

Path parameters

NameTypeDescription
idinteger
required
The ID of the custom role.

Request body

NameTypeDescription
all_foldersstring
required
Either "true" or "false". Must be "false" if "folder_ids" is specified.
folder_idsarray
Array of project IDs.

Sample request

shell
curl  -X PUT https://www.workato.com/api/roles/490 \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \
      -d  '{
            "all_folders": "false",
            "folder_ids": [1232, 1224]
          }'

Response

json
{
    "id": 45899,
    "name": "Marketing Recipe Operator",
    "inheritable": false,
    "folder_ids": [
        1232,
        1224
    ],
    "created_at": "2022-12-26T02:26:04.582-08:00",
    "updated_at": "2022-12-26T02:37:04.124-08:00",
    "privileges": {
        "Recipes": [
            "read",
            "create",
            "update",
            "run",
            "read_run_history"
        ]
    }
}

Copy a custom role

Creates a copy of a custom collaborator role with the ability to change the folders accessible by the role. The folder IDs can be obtained with the GET folders API endpoint.

shell
POST /api/roles/:id/copy

Path parameters

NameTypeDescription
idinteger
required
The ID of the custom role.

Request body

NameTypeDescription
namestring
required
Name of the custom role.
folder_idsarray
Array of project IDs.

Sample request

shell
curl  -X POST https://www.workato.com/api/roles/490/copy \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \
      -d  '{
            "name": "Finance team developer",
            "folder_ids": ["1232", "1224"]
          }'

Response

json
{
    "id": 546,
    "name": "Finance team developer",
    "inheritable": false,
    "folder_ids": ["1232", "1224"],
    "created_at": "2020-08-14T07:23:19.599-07:00",
    "updated_at": "2020-08-14T07:23:19.599-07:00"
}

Last updated: