Manage your deployed applications programmatically. Create projects, list deployments, and delete resources.
List Projects
Get all projects for your organization.
{
"projects": [
{
"id": "proj_abc123",
"name": "my-app",
"slug": "my-app",
"sourceType": "github",
"githubRepo": "owner/repo",
"framework": "nextjs",
"productionDeployment": {
"id": "deploy_xyz",
"status": "running",
"url": "https://my-app-abc123.case.systems"
},
"createdAt": "2024-01-15T10:30:00Z"
}
]
}
Create Project
Create a new project for deployments.
{
"name": "my-new-app",
"sourceType": "github",
"githubRepo": "owner/repo",
"githubBranch": "main",
"framework": "nextjs"
}
For Thurgood-created apps:
{
"name": "my-thurgood-app",
"sourceType": "thurgood",
"thurgoodSessionId": "session_abc123"
}
Get Project
Get details for a specific project.
{
"project": {
"id": "proj_abc123",
"name": "my-app",
"slug": "my-app",
"sourceType": "github",
"githubRepo": "owner/repo",
"githubBranch": "main",
"framework": "nextjs",
"buildCommand": "npm run build",
"installCommand": "npm install",
"startCommand": "npm start",
"rootDirectory": "./",
"autoDeployEnabled": true,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-16T14:20:00Z"
},
"envVars": [...],
"domains": [...],
"deployments": [...]
}
Delete Project
Delete a project and all its deployments.
Query parameters:
| Parameter | Type | Default | Description |
|---|
deleteDeployments | boolean | true | Also delete all deployments for this project |
{
"id": "proj_abc123",
"status": "deleted",
"message": "Project deleted successfully",
"deploymentsDeleted": 3
}
This action is permanent. All deployments associated with the project will be stopped and removed from AWS.
Delete Deployments by Repository
For legacy deployments not associated with a project, you can delete all deployments for a specific git repository.
DELETE /deployments/v1/by-repo
{
"gitRepo": "owner/repo"
}
For Thurgood sandbox deployments:
{
"gitRepo": "thurgood:sbx_abc123xyz"
}
{
"status": "deleted",
"message": "Deployments deleted successfully",
"deploymentsDeleted": 2
}
Environment Variables
Manage environment variables for a project.
List Environment Variables
GET /projects/v1/:id/env-vars
Set Environment Variables
POST /projects/v1/:id/env-vars
{
"envVars": [
{
"key": "DATABASE_URL",
"value": "postgres://...",
"environment": "production",
"isSecret": true
}
]
}
Deployments
List Deployments
Create Deployment
{
"projectId": "proj_abc123",
"name": "my-deployment",
"gitRepo": "owner/repo",
"branch": "main",
"framework": "nextjs"
}
Delete Deployment
DELETE /deployments/v1/:id
Stops and removes a single deployment.
SDK Examples
import { CaseDevClient } from '@casedev/sdk';
const client = new CaseDevClient({ apiKey: 'sk_case_...' });
// List projects
const { projects } = await client.projects.list();
// Get project details
const project = await client.projects.get('proj_abc123');
// Delete a project
await client.projects.delete('proj_abc123');
// Delete deployments by repository
await client.deployments.deleteByRepo({ gitRepo: 'owner/repo' });