Public API
The Cased API allows you to programmatically interact with Cased. All endpoints are available under `https://app.cased.com/api/`.
Authentication
Section titled “Authentication”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
Deployment Events
Section titled “Deployment Events”Create a Deployment Event
Section titled “Create a Deployment Event”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/
Field | Type | Description |
---|---|---|
deployment_request | string | Required. A description of the deployment (e.g., “Production deploy v1.2.3”). |
repository_full_name | string | The 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. |
status | string | The current status of the deployment. Can be one of pending , running , success , failure , or cancelled . Defaults to success . |
external_url | string | An optional URL that links back to your deployment system. |
commit_sha | string | An optional commit SHA for the deployment. |
commit_message | string | An optional commit message for the deployment. |
ref | string | The Git ref that is being deployed (e.g., refs/heads/main ). |
event_metadata | object | An optional JSON object that can be used to store any additional metadata about the deployment. |
Example Request
Section titled “Example Request”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" }'
Example Response
Section titled “Example Response”{ "id": "deployment-event-uuid", "status": "running", "created_at": "2024-01-15T10:30:00Z"}
Agent Sessions
Section titled “Agent Sessions”Create an Agent Session
Section titled “Create an Agent Session”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/
Field | Type | Description |
---|---|---|
prompt | string | Required. Description of the problem or task for the agent (e.g., “Investigate high error rates in production”). |
context | object | An optional JSON object containing additional context about the issue, such as error messages, logs, environment info, or any relevant data. |
Example Request
Section titled “Example Request”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"] } }'
Example Response
Section titled “Example Response”{ "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
.
Workflows
Section titled “Workflows”List Workflows
Section titled “List Workflows”Returns a list of all workflows configured for your organization.
GET /api/v1/workflows/
Query Parameters
Section titled “Query Parameters”Parameter | Type | Description |
---|---|---|
name | string | Filter workflows by name (partial match) |
agent_name | string | Filter by agent name |
repository | string | Filter by repository ID |
page | integer | Page number (default: 1) |
page_size | integer | Number of items per page (default: 20, max: 100) |
Example Request
Section titled “Example Request”curl -X GET "https://app.cased.com/api/v1/workflows/" \ -H "Authorization: Bearer YOUR_API_KEY"
Example Response
Section titled “Example Response”{ "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}
Get Workflow Details
Section titled “Get Workflow Details”Returns details for a specific workflow.
GET /api/v1/workflows/{workflow_id}/
Example Request
Section titled “Example Request”curl -X GET "https://app.cased.com/api/v1/workflows/{workflow_id}/" \ -H "Authorization: Bearer YOUR_API_KEY"
Example Response
Section titled “Example Response”{ "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"}
Trigger a Workflow
Section titled “Trigger a Workflow”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/
Field | Type | Description |
---|---|---|
triggered_by | string | Type of trigger: manual , schedule , or event . Defaults to manual . |
trigger_name | string | Optional name or description for this run. |
context | object | Optional context data for workflows that need specific inputs (e.g., deployment_id, pr_number). |
Example Request
Section titled “Example Request”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" } }'
Example Response
Section titled “Example Response”{ "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.
List Workflow Runs
Section titled “List Workflow Runs”Returns a list of all runs for a specific workflow.
GET /api/v1/workflows/{workflow_id}/runs/
Query Parameters
Section titled “Query Parameters”Parameter | Type | Description |
---|---|---|
status | string | Filter by status: pending , running , completed , failed |
triggered_by | string | Filter by trigger type: manual , schedule , event |
page | integer | Page number (default: 1) |
page_size | integer | Number of items per page (default: 20, max: 100) |
Example Request
Section titled “Example Request”curl -X GET "https://app.cased.com/api/v1/workflows/{workflow_id}/runs/?status=completed" \ -H "Authorization: Bearer YOUR_API_KEY"
Example Response
Section titled “Example Response”{ "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}
Get Workflow Run Details
Section titled “Get Workflow Run Details”Returns details for a specific workflow run.
GET /api/v1/workflows/{workflow_id}/runs/{run_id}/
Example Request
Section titled “Example Request”curl -X GET "https://app.cased.com/api/v1/workflows/{workflow_id}/runs/{run_id}/" \ -H "Authorization: Bearer YOUR_API_KEY"
Example Response
Section titled “Example Response”{ "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"}