For Developers

Create Team Role

POST https://ed.link/api/v2/teams/:team_id/roles

Creates a new custom role with the designated permissions.

Permissions

Requires the team_roles.create system permission.

Parameters

ParameterTypeRequiredDescription
:team_idUUIDYesThe ID of the team.

Request Body

PropertyTypeRequiredDescription
nameStringYesName of the role.
permissionsArrayYesArray of valid system permission slugs.
descriptionStringNoDescription of the role.

Sample Request

const response = await axios.post(
    `https://ed.link/api/v2/teams/${team_id}/roles`,
    {
        name: 'Support Specialist',
        description: 'Read-only access to logs and integrations',
        permissions: ['integrations.read', 'sources.read', 'logs.read']
    },
    {
        headers: {
            authorization: `Bearer ${user_session_token}`,
            'content-type': 'application/json'
        }
    }
);

Sample Response

{
    "$data": {
        "id": "3b7d4bad-9bdd-2b0d-7b3d-cb6d9b1deb4d",
        "name": "Support Specialist",
        "permissions": [
            {
                "permission": "integrations.read",
                "mode": "all",
                "target_ids": []
            },
            { "permission": "sources.read", "mode": "all", "target_ids": [] },
            { "permission": "logs.read", "mode": "all", "target_ids": [] }
        ]
    }
}