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
| Parameter | Type | Required | Description |
|---|---|---|---|
:team_id | UUID | Yes | The ID of the team. |
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Name of the role. |
permissions | Array | Yes | Array of valid system permission slugs. |
description | String | No | Description 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": [
"integrations.read",
"sources.read",
"logs.read"
],
"managed": false
}
}
