Skip to content

Public API

The Cased API allows you to programmatically interact with Cased. All endpoints are available under `https://app.cased.com/api/`.

All requests to the Cased API must be authenticated with an API key. You can create an API key in your organization’s settings.

The API key must be included in the Authorization header of your request:

Authorization: Bearer YOUR_API_KEY


Notifies Cased that a deployment has occurred. This will trigger a new agent session in Mission Control to monitor the deployment.

POST /api/v1/deployments/

FieldTypeDescription
deployment_requeststringRequired. A description of the deployment (e.g., “Production deploy v1.2.3”).
repository_full_namestringThe full name of the repository that is being deployed (e.g., “my-org/my-repo”). Required if you have more than one project in your organization.
statusstringThe current status of the deployment. Can be one of pending, running, success, failure, or cancelled. Defaults to success.
external_urlstringAn optional URL that links back to your deployment system.
commit_shastringAn optional commit SHA for the deployment.
commit_messagestringAn optional commit message for the deployment.
refstringThe Git ref that is being deployed (e.g., refs/heads/main).
event_metadataobjectAn optional JSON object that can be used to store any additional metadata about the deployment.
Terminal window
curl -X POST https://app.cased.com/api/v1/deployments/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"deployment_request": "Deploying version 2.5.1 to production",
"repository_full_name": "your-org/your-repo",
"status": "running",
"external_url": "https://github.com/your-org/your-repo/actions/runs/12345",
"commit_sha": "f2c1c6a",
"ref": "refs/heads/main"
}'
{
"id": "deployment-event-uuid",
"status": "running",
"created_at": "2024-01-15T10:30:00Z"
}

Creates a new AI agent session to analyze problems, investigate issues, or perform tasks. This will start an agent that can help troubleshoot problems, analyze logs, or provide insights.

POST /api/v1/agent/sessions/

FieldTypeDescription
promptstringRequired. Description of the problem or task for the agent (e.g., “Investigate high error rates in production”).
contextobjectAn optional JSON object containing additional context about the issue, such as error messages, logs, environment info, or any relevant data.
Terminal window
curl -X POST https://app.cased.com/api/v1/agent-sessions/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Investigate why our API response times increased 300% in the last hour",
"context": {
"service": "user-api",
"environment": "production",
"error_rate": "15%",
"avg_response_time": "2.3s",
"logs": ["2024-01-15 10:45:23 ERROR Database connection timeout", "2024-01-15 10:46:01 WARN High memory usage detected"]
}
}'
{
"session_id": "agent-session-uuid",
"status": "active",
"created_at": "2024-01-15T10:45:00Z",
"url": "/agents/agent-session-uuid"
}

The agent will immediately start analyzing the problem based on your prompt and context. You can monitor the agent’s progress and interact with it through the Cased web interface using the returned url.


Returns a list of all workflows configured for your organization.

GET /api/v1/workflows/

ParameterTypeDescription
namestringFilter workflows by name (partial match)
agent_namestringFilter by agent name
repositorystringFilter by repository ID
pageintegerPage number (default: 1)
page_sizeintegerNumber of items per page (default: 20, max: 100)
Terminal window
curl -X GET "https://app.cased.com/api/v1/workflows/" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"workflows": [
{
"id": "workflow-uuid",
"name": "Infrastructure Cost Analysis",
"agent_name": "infra_cost",
"description": "Analyzes infrastructure costs and provides optimization recommendations",
"status": "active"
}
],
"count": 1,
"next": null,
"previous": null
}

Returns details for a specific workflow.

GET /api/v1/workflows/{workflow_id}/

Terminal window
curl -X GET "https://app.cased.com/api/v1/workflows/{workflow_id}/" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "workflow-uuid",
"name": "Infrastructure Cost Analysis",
"agent_name": "infra_cost",
"description": "Analyzes infrastructure costs and provides optimization recommendations",
"instruction": "Analyze AWS costs and identify optimization opportunities...",
"status": "active",
"created_at": "2024-01-10T09:00:00Z",
"updated_at": "2024-01-15T14:30:00Z"
}

Runs a workflow with its pre-configured instructions. Workflows are designed to perform specific tasks like cost analysis, security reviews, or compliance checks.

POST /api/v1/workflows/{workflow_id}/runs/

FieldTypeDescription
triggered_bystringType of trigger: manual, schedule, or event. Defaults to manual.
trigger_namestringOptional name or description for this run.
contextobjectOptional context data for workflows that need specific inputs (e.g., deployment_id, pr_number).
Terminal window
curl -X POST "https://app.cased.com/api/v1/workflows/{workflow_id}/runs/" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"triggered_by": "manual",
"trigger_name": "Weekly cost review",
"context": {
"environment": "production",
"time_range": "last_7_days"
}
}'
{
"id": "workflow-run-uuid",
"workflow": "workflow-uuid",
"workflow_name": "Infrastructure Cost Analysis",
"triggered_by": "manual",
"trigger_name": "Weekly cost review",
"status": "running",
"session_id": "agent-session-uuid",
"started_at": "2024-01-15T15:00:00Z",
"created_at": "2024-01-15T15:00:00Z"
}

The workflow will run with its pre-configured instructions, using any provided context for variable substitution. The session_id links to the agent session where you can monitor progress.

Returns a list of all runs for a specific workflow.

GET /api/v1/workflows/{workflow_id}/runs/

ParameterTypeDescription
statusstringFilter by status: pending, running, completed, failed
triggered_bystringFilter by trigger type: manual, schedule, event
pageintegerPage number (default: 1)
page_sizeintegerNumber of items per page (default: 20, max: 100)
Terminal window
curl -X GET "https://app.cased.com/api/v1/workflows/{workflow_id}/runs/?status=completed" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"workflow_runs": [
{
"id": "workflow-run-uuid",
"workflow": "workflow-uuid",
"workflow_name": "Infrastructure Cost Analysis",
"triggered_by": "schedule",
"trigger_name": "Daily run",
"status": "completed",
"session_id": "agent-session-uuid",
"started_at": "2024-01-15T00:00:00Z",
"ended_at": "2024-01-15T00:15:00Z",
"created_at": "2024-01-15T00:00:00Z"
}
],
"count": 1,
"next": null,
"previous": null
}

Returns details for a specific workflow run.

GET /api/v1/workflows/{workflow_id}/runs/{run_id}/

Terminal window
curl -X GET "https://app.cased.com/api/v1/workflows/{workflow_id}/runs/{run_id}/" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "workflow-run-uuid",
"workflow": "workflow-uuid",
"workflow_name": "Infrastructure Cost Analysis",
"triggered_by": "manual",
"trigger_name": "Cost investigation",
"status": "completed",
"session_id": "agent-session-uuid",
"started_at": "2024-01-15T10:00:00Z",
"ended_at": "2024-01-15T10:12:00Z",
"artifacts": {
"session_id": "agent-session-uuid"
},
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:12:00Z"
}