Roles & Permissions
Roles & Permissions
GET /api/v1/permissions
Get Permissions
getPermissions returns all available permissions
Response
Type: []Permission
| Field | Type | Description |
|---|---|---|
id | uuid.UUID | |
created_at | time.Time | |
updated_at | time.Time | |
name | string | e.g., “models:read”, “workflows:execute” |
description | string | |
resource | string | e.g., “models”, “datasets”, “workflows” |
action | string | e.g., “read”, “write”, “delete”, “execute” |
Example
curl -X GET \
-H "Authorization: Bearer <token>" \
https://api.seeme.ai/api/v1/permissionsGET /api/v1/roles
Get Roles
getRoles returns all available roles
Response
Type: []Role
| Field | Type | Description |
|---|---|---|
id | uuid.UUID | |
created_at | time.Time | |
updated_at | time.Time | |
name | string | |
description | string | |
slug | string | e.g., “org_admin”, “project_editor” |
scope | string | “system”, “organization”, “team”, “project” |
organization_id | string | NULL = system role, else org-specific |
is_system | bool | System roles cannot be deleted |
permissions | datatypes.JSON | Array of permission names: [“models:read”, “models:write”] |
permission_list | []string | For API responses (optional) |
Example
curl -X GET \
-H "Authorization: Bearer <token>" \
https://api.seeme.ai/api/v1/rolesPOST /api/v1/roles
Create Role
createRole creates a new custom role for an organization
Request Body
Type: CreateRoleRequest
Response
Type: Role
| Field | Type | Description |
|---|---|---|
id | uuid.UUID | |
created_at | time.Time | |
updated_at | time.Time | |
name | string | |
description | string | |
slug | string | e.g., “org_admin”, “project_editor” |
scope | string | “system”, “organization”, “team”, “project” |
organization_id | string | NULL = system role, else org-specific |
is_system | bool | System roles cannot be deleted |
permissions | datatypes.JSON | Array of permission names: [“models:read”, “models:write”] |
permission_list | []string | For API responses (optional) |
Example
curl -X POST \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{}' \
https://api.seeme.ai/api/v1/rolesGET /api/v1/roles/{id}
Get Role By I D
getRoleByID returns a specific role
Parameters
| Name | In | Type | Required |
|---|---|---|---|
id | path | string | true |
Response
Type: Role
| Field | Type | Description |
|---|---|---|
id | uuid.UUID | |
created_at | time.Time | |
updated_at | time.Time | |
name | string | |
description | string | |
slug | string | e.g., “org_admin”, “project_editor” |
scope | string | “system”, “organization”, “team”, “project” |
organization_id | string | NULL = system role, else org-specific |
is_system | bool | System roles cannot be deleted |
permissions | datatypes.JSON | Array of permission names: [“models:read”, “models:write”] |
permission_list | []string | For API responses (optional) |
Example
curl -X GET \
-H "Authorization: Bearer <token>" \
https://api.seeme.ai/api/v1/roles/{id}PUT /api/v1/roles/{id}
Update Role
updateRole updates a role’s permissions and details
Parameters
| Name | In | Type | Required |
|---|---|---|---|
id | path | string | true |
Request Body
Type: UpdateRoleRequest
Response
Type: Role
| Field | Type | Description |
|---|---|---|
id | uuid.UUID | |
created_at | time.Time | |
updated_at | time.Time | |
name | string | |
description | string | |
slug | string | e.g., “org_admin”, “project_editor” |
scope | string | “system”, “organization”, “team”, “project” |
organization_id | string | NULL = system role, else org-specific |
is_system | bool | System roles cannot be deleted |
permissions | datatypes.JSON | Array of permission names: [“models:read”, “models:write”] |
permission_list | []string | For API responses (optional) |
Example
curl -X PUT \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{}' \
https://api.seeme.ai/api/v1/roles/{id}DELETE /api/v1/roles/{id}
Delete Role
deleteRole deletes a custom role (not system roles)
Parameters
| Name | In | Type | Required |
|---|---|---|---|
id | path | string | true |
Example
curl -X DELETE \
-H "Authorization: Bearer <token>" \
https://api.seeme.ai/api/v1/roles/{id}