Skip to main content
POST
/
v1
/
policies
/
{id}
/
ai-chat
Chat with AI about a policy
curl --request POST \
  --url http://localhost:3333/v1/policies/{id}/ai-chat \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "instructions": "Update the data retention section to specify a 7-year retention period",
  "chatHistory": [
    {
      "role": "user",
      "content": "Update the data retention policy"
    },
    {
      "role": "assistant",
      "content": "I can help with that..."
    }
  ]
}
'
"<string>"

Authorizations

X-API-Key
string
header
required

API key for authentication

Headers

X-Organization-Id
string

Organization ID (required for session auth, optional for API key auth)

Path Parameters

id
string
required

Policy ID

Example:

"pol_abc123def456"

Body

application/json
instructions
string
required

User instructions about what changes to make to the policy

Example:

"Update the data retention section to specify a 7-year retention period"

chatHistory
object[]

Chat history for context (array of messages with role and content)

Example:
[
{
"role": "user",
"content": "Update the data retention policy"
},
{
"role": "assistant",
"content": "I can help with that..."
}
]

Response

Streaming AI response

The response is of type string.