Skip to content

Chat with AI about a policy

POST
/v1/policies/{id}/ai-chat
curl --request POST \
--url https://api.varman.io/v1/policies/pol_abc123def456/ai-chat \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-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..." } ] }'

Ask policy-specific questions and request draft improvements while preserving human review before policy changes are applied.

id
required
string

Example

pol_abc123def456

Policy ID

X-Organization-Id
string

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

Media typeapplication/json
object
instructions
required

User instructions about what changes to make to the policy

string

Example

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

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

Array<object>
object
role
string
Allowed values: user assistant
content
string

Example

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

Streaming AI response

Media typetext/event-stream
string

Unauthorized

Policy not found