Skip to content

AI Assistant Endpoints

The AI Assistant API provides endpoints for interacting with the AI-powered chat interface to query identity data and get intelligent insights.

Base URL

All endpoints are relative to /api/v1/ai.


Chat

Send a message to the AI assistant and receive a response.

http
POST /api/v1/ai/chat

Request Body

json
{
  "message": "Show me all privileged accounts that haven't been used in 90 days",
  "history": [
    {
      "role": "user",
      "content": "Previous message"
    },
    {
      "role": "assistant",
      "content": "Previous response"
    }
  ],
  "stream": true
}

Request Parameters

ParameterTypeDescription
messagestringThe user's question or query
historyarrayPrevious conversation messages for context
streambooleanEnable streaming responses (recommended: true)

Response (Non-Streaming)

json
{
  "response": "I found 15 privileged accounts that haven't been used...",
  "tools_used": ["query_accounts"],
  "status": "complete"
}

Response (Streaming)

When stream: true, the response is delivered as Server-Sent Events (SSE):

event: content
data: {"text": "I found "}

event: content
data: {"text": "15 privileged accounts..."}

event: tool_results
data: {"tools": ["query_accounts"], "count": 15}

event: status
data: {"status": "complete"}

event: [DONE]
data: {}

SSE Event Types

EventDescription
contentText content being streamed
tool_resultsTools used and their results
statusProgress updates
warningWarnings (e.g., data limits reached)
[DONE]Completion signal

Query Capabilities

The AI assistant can query the following data types when the corresponding features are enabled:

Identity Data (identity_data feature)

ToolDescription
query_accountsSearch and filter accounts
query_groupsSearch and filter groups
query_ownersSearch and filter owners
query_applicationsSearch and filter applications

Configuration (configuration feature)

ToolDescription
query_campaign_rulesSearch campaign rules
query_policiesSearch policies
query_rolesSearch roles

Campaigns (campaigns feature)

ToolDescription
list_campaignsList active campaigns
query_approvalsQuery approval status
query_complianceQuery compliance metrics

Example Queries

Security Questions

json
{
  "message": "Find accounts with high threat levels and no MFA",
  "stream": true
}

Access Control

json
{
  "message": "Which users have access to critical applications?",
  "stream": true
}

Compliance

json
{
  "message": "Show me accounts with policy violations",
  "stream": true
}

Analytics

json
{
  "message": "What department has the most inactive accounts?",
  "stream": true
}

Conversation Context

The AI maintains conversation context through the history parameter:

json
{
  "message": "Which of these are in the Finance department?",
  "history": [
    {
      "role": "user",
      "content": "Show me privileged accounts"
    },
    {
      "role": "assistant",
      "content": "I found 50 privileged accounts..."
    }
  ],
  "stream": true
}

Access Control

AI features are controlled by:

  1. Master Toggle - Global AI enable/disable
  2. Feature Permissions - Granular control per feature group
  3. User Role - Scoped access for Reviewers and Auditors

Administrators have full access when AI is enabled. Reviewers and Auditors access AI features within their configured scope.


Error Responses

Status CodeDescription
400Bad Request - Invalid message format
401Unauthorized - Authentication required
403Forbidden - AI features disabled or insufficient permissions
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Error Response Format

json
{
  "error": {
    "code": "AI_DISABLED",
    "message": "AI features are not enabled for this tenant"
  }
}

Rate Limiting

AI requests are rate-limited to prevent abuse. If you receive a 429 response, wait before retrying.


Hydden Documentation and Training Hub