Skip to main content
Manage your deployed applications programmatically. Create projects, list deployments, and delete resources.

List Projects

Get all projects for your organization.
Endpoint
GET /projects/v1
Response
{
  "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.
Endpoint
POST /projects/v1
JSON
{
  "name": "my-new-app",
  "sourceType": "github",
  "githubRepo": "owner/repo",
  "githubBranch": "main",
  "framework": "nextjs"
}
For Thurgood-created apps:
JSON
{
  "name": "my-thurgood-app",
  "sourceType": "thurgood",
  "thurgoodSessionId": "session_abc123"
}

Get Project

Get details for a specific project.
Endpoint
GET /projects/v1/:id
Response
{
  "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.
Endpoint
DELETE /projects/v1/:id
Query parameters:
ParameterTypeDefaultDescription
deleteDeploymentsbooleantrueAlso delete all deployments for this project
Response
{
  "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.
Endpoint
DELETE /deployments/v1/by-repo
JSON
{
  "gitRepo": "owner/repo"
}
For Thurgood sandbox deployments:
JSON
{
  "gitRepo": "thurgood:sbx_abc123xyz"
}
Response
{
  "status": "deleted",
  "message": "Deployments deleted successfully",
  "deploymentsDeleted": 2
}

Environment Variables

Manage environment variables for a project.

List Environment Variables

Endpoint
GET /projects/v1/:id/env-vars

Set Environment Variables

Endpoint
POST /projects/v1/:id/env-vars
JSON
{
  "envVars": [
    {
      "key": "DATABASE_URL",
      "value": "postgres://...",
      "environment": "production",
      "isSecret": true
    }
  ]
}

Deployments

List Deployments

Endpoint
GET /deployments/v1

Create Deployment

Endpoint
POST /deployments/v1
JSON
{
  "projectId": "proj_abc123",
  "name": "my-deployment",
  "gitRepo": "owner/repo",
  "branch": "main",
  "framework": "nextjs"
}

Delete Deployment

Endpoint
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' });