Role
Operations about roles
Returns all roles grouped by type (global and project). Set withUsageCount to include how many users and projects use each role.
falsePossible values: Operation successful.
The request is invalid or provides malformed data.
Unauthorized
Forbidden
GET /api/v1/roles HTTP/1.1
X-N8N-API-KEY: YOUR_API_KEY
Accept: */*
{
"global": [
{
"slug": "text",
"displayName": "text",
"description": "text",
"systemRole": true,
"roleType": "global",
"scopes": [
"text"
],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"licensed": true,
"usedByUsers": 1,
"usedByProjects": 1
}
],
"project": [
{
"slug": "text",
"displayName": "text",
"description": "text",
"systemRole": true,
"roleType": "project",
"scopes": [
"text"
],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"licensed": true,
"usedByUsers": 1,
"usedByProjects": 1
}
]
}Creates a custom role. Set roleType to global for an instance-wide role or project for a project role.
Operation successful.
The request is invalid or provides malformed data.
Unauthorized
Forbidden
Unsupported media type.
POST /api/v1/roles HTTP/1.1
X-N8N-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 82
{
"displayName": "text",
"description": "text",
"roleType": "project",
"scopes": [
"text"
]
}{
"slug": "text",
"displayName": "text",
"description": "text",
"systemRole": true,
"roleType": "project",
"scopes": [
"text"
],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}Returns a single role with its scopes. Set withUsageCount to include how many users and projects use the role.
The slug of the role.
falsePossible values: Operation successful.
The request is invalid or provides malformed data.
Unauthorized
Forbidden
The specified resource was not found.
GET /api/v1/roles/{roleSlug} HTTP/1.1
X-N8N-API-KEY: YOUR_API_KEY
Accept: */*
{
"slug": "text",
"displayName": "text",
"description": "text",
"systemRole": true,
"roleType": "project",
"scopes": [
"text"
],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"licensed": true,
"usedByUsers": 1,
"usedByProjects": 1
}Replaces a custom role's display name, description, and scopes. System roles cannot be updated.
The slug of the role.
Operation successful.
The request is invalid or provides malformed data.
Unauthorized
Forbidden
The specified resource was not found.
Unsupported media type.
PUT /api/v1/roles/{roleSlug} HTTP/1.1
X-N8N-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 61
{
"displayName": "text",
"description": "text",
"scopes": [
"text"
]
}{
"slug": "text",
"displayName": "text",
"description": "text",
"systemRole": true,
"roleType": "project",
"scopes": [
"text"
],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}Deletes a custom role. System roles cannot be deleted. A role with users assigned cannot be deleted unless reassignRoleSlug is set to move those users to another role first.
The slug of the role.
Operation successful.
The request is invalid or provides malformed data.
Unauthorized
Forbidden
The specified resource was not found.
DELETE /api/v1/roles/{roleSlug} HTTP/1.1
X-N8N-API-KEY: YOUR_API_KEY
Accept: */*
{
"slug": "text",
"displayName": "text",
"description": "text",
"systemRole": true,
"roleType": "project",
"scopes": [
"text"
],
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}Last updated
Was this helpful?