For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Getting Started
    • Welcome
    • Architecture
    • Installation
    • Authentication
    • Quick Start
    • Support
  • Core Concepts
    • Guardrails
    • AI BOM
    • Red Teaming
    • Compliance
    • Audit Logs
  • Integrations
    • GitHub
    • GitLab
    • Azure DevOps
    • Bitbucket
    • Jira
    • LiteLLM
  • Usage Guides
    • Organization
    • Guardrails Setup
    • Policies
    • Scans
    • Red Team
    • Dashboards
  • Code Examples
    • cURL
    • Python
    • Node.js
    • API Patterns
On this page
  • cURL Examples
  • Evaluate Guardrails
  • Create Guardrail
  • Run Scan
  • Get Audit Logs
  • Generate Report
  • Tips
  • Next Steps
Code Examples

cURL Examples

Was this page helpful?
Edit this page
Previous

Python Examples

Next
Built with

cURL Examples

Common GovernanceAI API calls using cURL.

Evaluate Guardrails

$curl -X POST https://api.governanceai.com/v1/guardrails/evaluate \
> -H "Authorization: Bearer $GOVERNANCEAI_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "messages": [
> {
> "role": "user",
> "content": "What is the capital of France?"
> }
> ],
> "context": {
> "org_id": "org_123",
> "user_id": "user_456"
> }
> }'

Create Guardrail

$curl -X POST https://api.governanceai.com/v1/guardrails \
> -H "Authorization: Bearer $GOVERNANCEAI_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "Block PII",
> "rule_type": "block_pii",
> "severity": "high"
> }'

Run Scan

$curl -X POST https://api.governanceai.com/v1/scans \
> -H "Authorization: Bearer $GOVERNANCEAI_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "scan_type": "code_scan",
> "repositories": ["repo_123"]
> }'

Get Audit Logs

$curl -H "Authorization: Bearer $GOVERNANCEAI_API_KEY" \
> 'https://api.governanceai.com/v1/audit/logs?start_date=2024-01-01'

Generate Report

$curl -X POST https://api.governanceai.com/v1/reports/generate \
> -H "Authorization: Bearer $GOVERNANCEAI_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "type": "compliance",
> "frameworks": ["SOC2"],
> "format": "pdf"
> }' \
> --output report.pdf

Tips

  • Use -H for headers
  • Use -d for JSON body
  • Set Content-Type: application/json
  • Always include Authorization header
  • Use $GOVERNANCEAI_API_KEY environment variable
  • Use --output to save response to file

Next Steps

  • Python Examples - Python code
  • Node.js Examples - JavaScript code
  • API Patterns - Common patterns