API Reference

Programmatically manage your deployments, projects, and domains using the CupaDev REST API.

Authentication

All API requests require authentication using an API token.

Getting Your API Token

  1. Go to your account settings
  2. Navigate to API Tokens section
  3. Click "Generate New Token"
  4. Give it a descriptive name
  5. Copy and store it securely

Using the Token

Include your token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN

Base URL

All API endpoints are relative to:

https://api.cupadev.com/v1

Endpoints

Projects

GET/projects

List all projects

curl -X GET https://api.cupadev.com/v1/projects \
  -H "Authorization: Bearer YOUR_TOKEN"
GET/projects/:id

Get a single project

curl -X GET https://api.cupadev.com/v1/projects/abc123 \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/projects

Create a new project

curl -X POST https://api.cupadev.com/v1/projects \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-project",
    "framework": "nextjs",
    "gitUrl": "https://github.com/user/repo"
  }'

Deployments

GET/projects/:id/deployments

List all deployments for a project

curl -X GET https://api.cupadev.com/v1/projects/abc123/deployments \
  -H "Authorization: Bearer YOUR_TOKEN"
POST/projects/:id/deployments

Trigger a new deployment

curl -X POST https://api.cupadev.com/v1/projects/abc123/deployments \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "branch": "main",
    "target": "production"
  }'
GET/deployments/:id

Get deployment status

curl -X GET https://api.cupadev.com/v1/deployments/dep_abc123 \
  -H "Authorization: Bearer YOUR_TOKEN"

Domains

POST/projects/:id/domains

Add a custom domain

curl -X POST https://api.cupadev.com/v1/projects/abc123/domains \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "example.com"
  }'
DELETE/domains/:id

Remove a domain

curl -X DELETE https://api.cupadev.com/v1/domains/dom_abc123 \
  -H "Authorization: Bearer YOUR_TOKEN"

Environment Variables

POST/projects/:id/env

Add environment variable

curl -X POST https://api.cupadev.com/v1/projects/abc123/env \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "API_KEY",
    "value": "secret123",
    "target": ["production", "preview"]
  }'

Response Format

All responses are returned in JSON format:

Success Response

{
  "data": {
    "id": "abc123",
    "name": "my-project",
    "status": "ready"
  }
}

Error Response

{
  "error": {
    "code": "unauthorized",
    "message": "Invalid API token"
  }
}

Rate Limiting

API requests are rate limited to prevent abuse:

  • Free tier: 100 requests per hour
  • Pro tier: 1,000 requests per hour
  • Enterprise: Custom limits

Rate limit headers:

X-RateLimit-Limit: 100X-RateLimit-Remaining: 95X-RateLimit-Reset: 1640000000

Official SDKs

Use our official SDKs for easier integration:

Node.js / TypeScript

npm install @cupadev/sdk

Full TypeScript support with auto-completion

Python

pip install cupadev

Pythonic API client with async support