API ReferenceEndpoints

IAM

Identity and Access Management API

MethodPathDescription
POST/api/v1/iam/{workspace}/roles/{roleId}/assignees/{userId}Assign role to user
DELETE/api/v1/iam/{workspace}/roles/{roleId}/assignees/{userId}Remove role from user
POST/api/v1/iam/{workspace}/roles/{roleId}/assignees/principals/{principalId}Assign role to principal
DELETE/api/v1/iam/{workspace}/roles/{roleId}/assignees/principals/{principalId}Remove role from principal
GET/api/v1/iam/{workspace}/usersList workspace users
GET/api/v1/iam/{workspace}/users/{userId}Get workspace user
GET/api/v1/iam/{workspace}/users/{userId}/rolesGet user roles in workspace
GET/api/v1/iam/{workspace}/users/me/principalGet current user's principal
GET/api/v1/iam/{workspace}/rolesList roles in workspace
GET/api/v1/iam/{workspace}/roles/{roleId}Get role by ID
GET/api/v1/iam/{workspace}/roles/{roleId}/assigneesList role assignees
GET/api/v1/iam/{workspace}/agentsList agents in workspace
GET/api/v1/iam/{workspace}/agents/{agentId}Get agent by ID
GET/api/v1/iam/{workspace}/agents/{agentId}/rolesList agent roles

Assign role to user

POST /api/v1/iam/{workspace}/roles/{roleId}/assignees/{userId}

Assign a role to a user

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
roleIdYesRole ID
userIdYesUser ID

Responses

StatusDescription
200Role assigned successfully
404Role or user not found
409User already has this role

Example Response

{
  "success": true,
  "data": "string"
}

Example

curl -X POST "https://poliglot.io/api/v1/iam/my-workspace/roles/<roleId>/assignees/<userId>" \
  -H "Authorization: Bearer <your-token>"

Remove role from user

DELETE /api/v1/iam/{workspace}/roles/{roleId}/assignees/{userId}

Remove a role assignment from a user

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
roleIdYesRole ID
userIdYesUser ID

Responses

StatusDescription
200Role assignment removed successfully
404Role, user, or assignment not found

Example Response

{
  "success": true,
  "data": "string"
}

Example

curl -X DELETE "https://poliglot.io/api/v1/iam/my-workspace/roles/<roleId>/assignees/<userId>" \
  -H "Authorization: Bearer <your-token>"

Assign role to principal

POST /api/v1/iam/{workspace}/roles/{roleId}/assignees/principals/{principalId}

Assign a role to any principal (user or agent)

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
roleIdYesRole ID
principalIdYesPrincipal ID

Responses

StatusDescription
200Role assigned successfully
404Role or principal not found
409Principal already has this role

Example Response

{
  "success": true,
  "data": "string"
}

Example

curl -X POST "https://poliglot.io/api/v1/iam/my-workspace/roles/<roleId>/assignees/principals/<principalId>" \
  -H "Authorization: Bearer <your-token>"

Remove role from principal

DELETE /api/v1/iam/{workspace}/roles/{roleId}/assignees/principals/{principalId}

Remove a role assignment from any principal (user or agent)

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
roleIdYesRole ID
principalIdYesPrincipal ID

Responses

StatusDescription
200Role assignment removed successfully
404Role, principal, or assignment not found

Example Response

{
  "success": true,
  "data": "string"
}

Example

curl -X DELETE "https://poliglot.io/api/v1/iam/my-workspace/roles/<roleId>/assignees/principals/<principalId>" \
  -H "Authorization: Bearer <your-token>"

List workspace users

GET /api/v1/iam/{workspace}/users

Get all users who are members of this workspace

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug

Query Parameters

NameRequiredTypeDescription
pageNointeger(int32)Page number (1-indexed)
pageSizeNointeger(int32)Page size

Responses

StatusDescription
200Users retrieved successfully
404Workspace not found

Response Shape

FieldTypeDescription
idstring (uuid)
usernamestring
emailstring
firstNamestring
lastNamestring
websitestring
emailVerifiedboolean
createdAtstring (date-time)
updatedAtstring (date-time)

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "username": "string",
    "email": "string",
    "firstName": "string",
    "lastName": "string",
    "website": "string",
    "emailVerified": true,
    "createdAt": "2025-03-28T14:22:03Z",
    "updatedAt": "2025-03-28T14:22:03Z"
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/users" \
  -H "Authorization: Bearer <your-token>"

Get workspace user

GET /api/v1/iam/{workspace}/users/{userId}

Get a specific user in this workspace

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
userIdYesUser ID

Responses

StatusDescription
200User retrieved successfully
404User not found in workspace

Response Shape

FieldTypeDescription
idstring (uuid)
usernamestring
emailstring
firstNamestring
lastNamestring
websitestring
emailVerifiedboolean
createdAtstring (date-time)
updatedAtstring (date-time)

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "username": "string",
    "email": "string",
    "firstName": "string",
    "lastName": "string",
    "website": "string",
    "emailVerified": true,
    "createdAt": "2025-03-28T14:22:03Z",
    "updatedAt": "2025-03-28T14:22:03Z"
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/users/<userId>" \
  -H "Authorization: Bearer <your-token>"

Get user roles in workspace

GET /api/v1/iam/{workspace}/users/{userId}/roles

Get all roles assigned to a user in this workspace

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
userIdYesUser ID

Responses

StatusDescription
200Roles retrieved successfully
404User not found in workspace

Example Response

{
  "success": true,
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "uri": "string",
      "label": "string",
      "description": "string",
      "matrixId": "550e8400-e29b-41d4-a716-446655440000",
      "createdAt": "2025-03-28T14:22:03Z",
      "updatedAt": "2025-03-28T14:22:03Z"
    }
  ]
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/users/<userId>/roles" \
  -H "Authorization: Bearer <your-token>"

Get current user's principal

GET /api/v1/iam/{workspace}/users/me/principal

Get the principal (workspace membership) for the currently authenticated user

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug

Responses

StatusDescription
200Principal retrieved successfully
404User is not a member of this workspace

Response Shape

FieldTypeDescription
idstring (uuid)
workspaceIdstring (uuid)
typestring
actor``
createdAtstring (date-time)

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
    "type": "USER",
    "actor": "...",
    "createdAt": "2025-03-28T14:22:03Z"
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/users/me/principal" \
  -H "Authorization: Bearer <your-token>"

List roles in workspace

GET /api/v1/iam/{workspace}/roles

Get all roles defined in this workspace, optionally filtered by assignee

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug

Query Parameters

NameRequiredTypeDescription
assigneeNostring(uuid)Filter by user ID (returns only roles assigned to this user)
principalNostring(uuid)Filter by principal ID (returns only roles assigned to this principal)
pageNointeger(int32)Page number (1-indexed)
pageSizeNointeger(int32)Page size

Responses

StatusDescription
200Roles retrieved successfully
404Workspace not found

Response Shape

FieldTypeDescription
idstring (uuid)
uristring
labelstring
descriptionstring
matrixIdstring (uuid)
createdAtstring (date-time)
updatedAtstring (date-time)

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "uri": "string",
    "label": "string",
    "description": "string",
    "matrixId": "550e8400-e29b-41d4-a716-446655440000",
    "createdAt": "2025-03-28T14:22:03Z",
    "updatedAt": "2025-03-28T14:22:03Z"
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/roles" \
  -H "Authorization: Bearer <your-token>"

Get role by ID

GET /api/v1/iam/{workspace}/roles/{roleId}

Get a specific role by its ID

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
roleIdYesRole ID

Responses

StatusDescription
200Role retrieved successfully
404Role not found

Response Shape

FieldTypeDescription
idstring (uuid)
uristring
labelstring
descriptionstring
matrixIdstring (uuid)
createdAtstring (date-time)
updatedAtstring (date-time)

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "uri": "string",
    "label": "string",
    "description": "string",
    "matrixId": "550e8400-e29b-41d4-a716-446655440000",
    "createdAt": "2025-03-28T14:22:03Z",
    "updatedAt": "2025-03-28T14:22:03Z"
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/roles/<roleId>" \
  -H "Authorization: Bearer <your-token>"

List role assignees

GET /api/v1/iam/{workspace}/roles/{roleId}/assignees

Get all principals (users and agents) assigned to a specific role

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
roleIdYesRole ID

Responses

StatusDescription
200Assignees retrieved successfully
404Role not found

Example Response

{
  "success": true,
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
      "type": "USER",
      "actor": "...",
      "createdAt": "2025-03-28T14:22:03Z"
    }
  ]
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/roles/<roleId>/assignees" \
  -H "Authorization: Bearer <your-token>"

List agents in workspace

GET /api/v1/iam/{workspace}/agents

Get all agents defined in matrix specs for this workspace

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug

Query Parameters

NameRequiredTypeDescription
pageNointeger(int32)Page number (1-indexed)
pageSizeNointeger(int32)Page size

Responses

StatusDescription
200Agents retrieved successfully
404Workspace not found

Response Shape

FieldTypeDescription
idstring (uuid)
uristring
labelstring
descriptionstring
matrixIdstring (uuid)
createdAtstring (date-time)
updatedAtstring (date-time)

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "uri": "string",
    "label": "string",
    "description": "string",
    "matrixId": "550e8400-e29b-41d4-a716-446655440000",
    "createdAt": "2025-03-28T14:22:03Z",
    "updatedAt": "2025-03-28T14:22:03Z"
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/agents" \
  -H "Authorization: Bearer <your-token>"

Get agent by ID

GET /api/v1/iam/{workspace}/agents/{agentId}

Get a specific agent by its ID

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
agentIdYesAgent ID

Responses

StatusDescription
200Agent retrieved successfully
404Agent not found

Response Shape

FieldTypeDescription
idstring (uuid)
uristring
labelstring
descriptionstring
matrixIdstring (uuid)
createdAtstring (date-time)
updatedAtstring (date-time)

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "uri": "string",
    "label": "string",
    "description": "string",
    "matrixId": "550e8400-e29b-41d4-a716-446655440000",
    "createdAt": "2025-03-28T14:22:03Z",
    "updatedAt": "2025-03-28T14:22:03Z"
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/agents/<agentId>" \
  -H "Authorization: Bearer <your-token>"

List agent roles

GET /api/v1/iam/{workspace}/agents/{agentId}/roles

Get all roles assigned to an agent. Agent roles are spec-driven (defined via iam:hasRole in matrix spec)

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
agentIdYesAgent ID

Responses

StatusDescription
200Roles retrieved successfully
404Agent not found

Example Response

{
  "success": true,
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "uri": "string",
      "label": "string",
      "description": "string",
      "matrixId": "550e8400-e29b-41d4-a716-446655440000",
      "createdAt": "2025-03-28T14:22:03Z",
      "updatedAt": "2025-03-28T14:22:03Z"
    }
  ]
}

Example

curl -X GET "https://poliglot.io/api/v1/iam/my-workspace/agents/<agentId>/roles" \
  -H "Authorization: Bearer <your-token>"

On this page