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/.

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

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/

Body

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.

Example Request

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"
}'

Example Response

{
"id": "deployment-event-uuid",
"status": "running",
"created_at": "2024-01-15T10:30:00Z"
}

Agent Sessions

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/

Body

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.

Example Request

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"]
}
}'

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.