Codebase Deploys API
The Deploys API from Codebase — 5 operation(s) for deploys.
The Deploys API from Codebase — 5 operation(s) for deploys.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/codebase-design:codebase-design-deploys-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Codebase Design Deploys API
version: 1.0.0
contact:
email: admin@aipowergrid.io
description: 'Operations tagged Deploys across 2 of this provider''s published API definitions: codebase-design-openapi.json, codebase-design-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: http://localhost:3001
description: Current
- url: https://dev.codebase.design
description: Development
- url: https://staging.codebase.design
description: Staging
- url: https://codebase.design
description: Production
security:
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: Deploys
paths:
/api/v1/deploys:
post:
summary: Deploy a project
description: Deploy a built project to Vercel, Netlify, first-party Codebase hosting, DigitalOcean App Platform, or GitHub Pages.
tags:
- Deploys
security:
- ApiKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- projectId
- provider
properties:
projectId:
type: string
provider:
type: string
enum:
- vercel
- netlify
- codebase
- digitalocean
- github-pages
name:
type: string
description: Optional deploy name
target:
type: object
description: Provider-specific target. DigitalOcean requires appId; GitHub Pages requires repository in owner/repo form and optionally branch/path.
additionalProperties: true
responses:
'200':
description: Deploy initiated with a third-party provider
content:
application/json:
schema:
type: object
properties:
deployId:
type: string
provider:
type: string
status:
type: string
url:
type: string
'202':
description: Codebase publish accepted. The build and upload run in the background; poll the poll path until status is ready (with url) or error (with code and message).
content:
application/json:
schema:
type: object
properties:
deployId:
type: string
provider:
type: string
enum:
- codebase
status:
type: string
enum:
- building
poll:
type: string
example: /api/v1/deploys/codebase/cb-proj-1-1700000000000
'400':
$ref: '#/components/responses/BadRequest'
'409':
description: A publish of this project is already running (code PUBLISH_IN_PROGRESS, with its deployId and poll path), or the site was taken down.
'422':
description: The project cannot be published as a static site (code NEXT_SERVER_FEATURES).
x-codeSamples:
- lang: TypeScript
label: TypeScript
source: "// Auth: X-API-Key header.\nconst apiKey = process.env.CODEBASE_API_KEY!;\n\nconst res = await fetch('https://codebase.design/api/v1/deploys', {\n method: 'POST',\n headers: {\n 'X-API-Key': apiKey,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"projectId\": \"string\",\n \"provider\": \"vercel\",\n \"name\": \"string\",\n \"target\": {}\n })\n});\n\nif (!res.ok) throw new Error(`${res.status} ${await res.text()}`);\nconst data = await res.json();\nconsole.log(data);"
- lang: Python
label: Python
source: "import os\nimport requests\n\napi_key = os.environ['CODEBASE_API_KEY']\n\nresponse = requests.post(\n 'https://codebase.design/api/v1/deploys',\n headers={\n 'X-API-Key': api_key,\n 'Content-Type': 'application/json',\n },\n json={\n \"projectId\": \"string\",\n \"provider\": \"vercel\",\n \"name\": \"string\",\n \"target\": {}\n }\n)\nresponse.raise_for_status()\nprint(response.json())"
- lang: Rust
label: Rust
source: "// Cargo.toml:\n// reqwest = { version = \"0.12\", features = [\"json\"] }\n// serde_json = \"1\"\n// tokio = { version = \"1\", features = [\"full\"] }\n\nuse std::env;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n let api_key = env::var(\"CODEBASE_API_KEY\")?;\n let client = reqwest::Client::new();\n\n let res = client\n .post(\"https://codebase.design/api/v1/deploys\")\n .header(\"X-API-Key\", api_key)\n .header(\"Content-Type\", \"application/json\")\n .json(&serde_json::json!({\n \"projectId\": \"string\",\n \"provider\": \"vercel\",\n \"name\": \"string\",\n \"target\": {}\n }))\n .send()\n .await?;\n\n let data: serde_json::Value = res.json().await?;\n println!(\"{:#?}\", data);\n Ok(())\n}"
operationId: postApiV1Deploys
x-operation-id-source: derived
servers:
- url: http://localhost:3001
description: Current
- url: http://localhost:3001
description: Local development
- url: https://dev.codebase.design
description: Development
- url: https://staging.codebase.design
description: Staging
- url: https://codebase.design
description: Production
/api/v1/deploys/{provider}/{deployId}:
get:
summary: Get deploy status
tags:
- Deploys
security:
- ApiKeyAuth: []
parameters:
- in: path
name: provider
required: true
schema:
type: string
enum:
- vercel
- netlify
- codebase
- digitalocean
- github-pages
- in: path
name: deployId
required: true
schema:
type: string
responses:
'200':
description: Deploy status. A Codebase publish reads building until it is ready (url, plus listing for a Base app) or error (code such as BUILD_FAILED, LAUNCH_CHECKS_FAILED or interrupted, and a readable message).
content:
application/json:
schema:
type: object
properties:
deployId:
type: string
status:
type: string
enum:
- queued
- building
- ready
- error
url:
type: string
code:
type: string
message:
type: string
'404':
$ref: '#/components/responses/NotFound'
x-codeSamples:
- lang: TypeScript
label: TypeScript
source: "// Auth: X-API-Key header.\nconst apiKey = process.env.CODEBASE_API_KEY!;\n\nconst res = await fetch('https://codebase.design/api/v1/deploys/vercel/YOUR_DEPLOYID', {\n method: 'GET',\n headers: {\n 'X-API-Key': apiKey,\n 'Content-Type': 'application/json',\n }\n});\n\nif (!res.ok) throw new Error(`${res.status} ${await res.text()}`);\nconst data = await res.json();\nconsole.log(data);"
- lang: Python
label: Python
source: "import os\nimport requests\n\napi_key = os.environ['CODEBASE_API_KEY']\n\nresponse = requests.get(\n 'https://codebase.design/api/v1/deploys/vercel/YOUR_DEPLOYID',\n headers={\n 'X-API-Key': api_key,\n 'Content-Type': 'application/json',\n }\n)\nresponse.raise_for_status()\nprint(response.json())"
- lang: Rust
label: Rust
source: "// Cargo.toml:\n// reqwest = { version = \"0.12\", features = [\"json\"] }\n// serde_json = \"1\"\n// tokio = { version = \"1\", features = [\"full\"] }\n\nuse std::env;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n let api_key = env::var(\"CODEBASE_API_KEY\")?;\n let client = reqwest::Client::new();\n\n let res = client\n .get(\"https://codebase.design/api/v1/deploys/vercel/YOUR_DEPLOYID\")\n .header(\"X-API-Key\", api_key)\n .header(\"Content-Type\", \"application/json\")\n .send()\n .await?;\n\n let data: serde_json::Value = res.json().await?;\n println!(\"{:#?}\", data);\n Ok(())\n}"
operationId: getApiV1DeploysByProviderByDeployId
x-operation-id-source: derived
servers:
- url: http://localhost:3001
description: Current
- url: http://localhost:3001
description: Local development
- url: https://dev.codebase.design
description: Development
- url: https://staging.codebase.design
description: Staging
- url: https://codebase.design
description: Production
/api/v1/deploys/{deployId}/rollback:
post:
summary: Roll a Codebase-hosted site back to an earlier deploy
description: Re-points the project's hosted site at the files of an earlier ready Codebase deploy of the same project (one still kept by retention) and records the rollback as a new deploy.
tags:
- Deploys
security:
- ApiKeyAuth: []
parameters:
- in: path
name: deployId
required: true
schema:
type: string
responses:
'200':
description: Site now serves the earlier deploy
content:
application/json:
schema:
type: object
properties:
deployId:
type: string
rolledBackFrom:
type: string
status:
type: string
url:
type: string
'404':
$ref: '#/components/responses/NotFound'
'409':
description: The deploy did not finish, its files were pruned, or the site was taken down (see code).
x-codeSamples:
- lang: TypeScript
label: TypeScript
source: "// Auth: X-API-Key header.\nconst apiKey = process.env.CODEBASE_API_KEY!;\n\nconst res = await fetch('https://codebase.design/api/v1/deploys/YOUR_DEPLOYID/rollback', {\n method: 'POST',\n headers: {\n 'X-API-Key': apiKey,\n 'Content-Type': 'application/json',\n }\n});\n\nif (!res.ok) throw new Error(`${res.status} ${await res.text()}`);\nconst data = await res.json();\nconsole.log(data);"
- lang: Python
label: Python
source: "import os\nimport requests\n\napi_key = os.environ['CODEBASE_API_KEY']\n\nresponse = requests.post(\n 'https://codebase.design/api/v1/deploys/YOUR_DEPLOYID/rollback',\n headers={\n 'X-API-Key': api_key,\n 'Content-Type': 'application/json',\n }\n)\nresponse.raise_for_status()\nprint(response.json())"
- lang: Rust
label: Rust
source: "// Cargo.toml:\n// reqwest = { version = \"0.12\", features = [\"json\"] }\n// serde_json = \"1\"\n// tokio = { version = \"1\", features = [\"full\"] }\n\nuse std::env;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n let api_key = env::var(\"CODEBASE_API_KEY\")?;\n let client = reqwest::Client::new();\n\n let res = client\n .post(\"https://codebase.design/api/v1/deploys/YOUR_DEPLOYID/rollback\")\n .header(\"X-API-Key\", api_key)\n .header(\"Content-Type\", \"application/json\")\n .send()\n .await?;\n\n let data: serde_json::Value = res.json().await?;\n println!(\"{:#?}\", data);\n Ok(())\n}"
operationId: postApiV1DeploysByDeployIdRollback
x-operation-id-source: derived
servers:
- url: http://localhost:3001
description: Current
- url: http://localhost:3001
description: Local development
- url: https://dev.codebase.design
description: Development
- url: https://staging.codebase.design
description: Staging
- url: https://codebase.design
description: Production
/api/v1/projects/{projectId}/deploys:
get:
summary: List a project's deploys
description: Newest first. The Codebase deploy the hosted site currently serves has live set to true.
tags:
- Deploys
security:
- ApiKeyAuth: []
parameters:
- in: path
name: projectId
required: true
schema:
type: string
- in: query
name: limit
schema:
type: integer
minimum: 1
maximum: 50
default: 20
responses:
'200':
description: Deploy history
'404':
$ref: '#/components/responses/NotFound'
x-codeSamples:
- lang: TypeScript
label: TypeScript
source: "// Auth: X-API-Key header.\nconst apiKey = process.env.CODEBASE_API_KEY!;\n\nconst res = await fetch('https://codebase.design/api/v1/projects/YOUR_PROJECTID/deploys?limit=20', {\n method: 'GET',\n headers: {\n 'X-API-Key': apiKey,\n 'Content-Type': 'application/json',\n }\n});\n\nif (!res.ok) throw new Error(`${res.status} ${await res.text()}`);\nconst data = await res.json();\nconsole.log(data);"
- lang: Python
label: Python
source: "import os\nimport requests\n\napi_key = os.environ['CODEBASE_API_KEY']\n\nresponse = requests.get(\n 'https://codebase.design/api/v1/projects/YOUR_PROJECTID/deploys?limit=20',\n headers={\n 'X-API-Key': api_key,\n 'Content-Type': 'application/json',\n }\n)\nresponse.raise_for_status()\nprint(response.json())"
- lang: Rust
label: Rust
source: "// Cargo.toml:\n// reqwest = { version = \"0.12\", features = [\"json\"] }\n// serde_json = \"1\"\n// tokio = { version = \"1\", features = [\"full\"] }\n\nuse std::env;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n let api_key = env::var(\"CODEBASE_API_KEY\")?;\n let client = reqwest::Client::new();\n\n let res = client\n .get(\"https://codebase.design/api/v1/projects/YOUR_PROJECTID/deploys?limit=20\")\n .header(\"X-API-Key\", api_key)\n .header(\"Content-Type\", \"application/json\")\n .send()\n .await?;\n\n let data: serde_json::Value = res.json().await?;\n println!(\"{:#?}\", data);\n Ok(())\n}"
operationId: getApiV1ProjectsByProjectIdDeploys
x-operation-id-source: derived
servers:
- url: http://localhost:3001
description: Current
- url: http://localhost:3001
description: Local development
- url: https://dev.codebase.design
description: Development
- url: https://staging.codebase.design
description: Staging
- url: https://codebase.design
description: Production
/api/v1/projects/{projectId}/site:
delete:
summary: Unpublish a Codebase-hosted site
description: Takes the hosted site offline (its address answers 404). Deploy files are kept, so a rollback or a new deploy brings it back. Gallery listings are managed separately under /api/v1/gallery.
tags:
- Deploys
security:
- ApiKeyAuth: []
parameters:
- in: path
name: projectId
required: true
schema:
type: string
responses:
'200':
description: Site unpublished (unpublished is false when it was not live).
'404':
$ref: '#/components/responses/NotFound'
x-codeSamples:
- lang: TypeScript
label: TypeScript
source: "// Auth: X-API-Key header.\nconst apiKey = process.env.CODEBASE_API_KEY!;\n\nconst res = await fetch('https://codebase.design/api/v1/projects/YOUR_PROJECTID/site', {\n method: 'DELETE',\n headers: {\n 'X-API-Key': apiKey,\n 'Content-Type': 'application/json',\n }\n});\n\nif (!res.ok) throw new Error(`${res.status} ${await res.text()}`);\nconst data = await res.json();\nconsole.log(data);"
- lang: Python
label: Python
source: "import os\nimport requests\n\napi_key = os.environ['CODEBASE_API_KEY']\n\nresponse = requests.delete(\n 'https://codebase.design/api/v1/projects/YOUR_PROJECTID/site',\n headers={\n 'X-API-Key': api_key,\n 'Content-Type': 'application/json',\n }\n)\nresponse.raise_for_status()\nprint(response.json())"
- lang: Rust
label: Rust
source: "// Cargo.toml:\n// reqwest = { version = \"0.12\", features = [\"json\"] }\n// serde_json = \"1\"\n// tokio = { version = \"1\", features = [\"full\"] }\n\nuse std::env;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n let api_key = env::var(\"CODEBASE_API_KEY\")?;\n let client = reqwest::Client::new();\n\n let res = client\n .delete(\"https://codebase.design/api/v1/projects/YOUR_PROJECTID/site\")\n .header(\"X-API-Key\", api_key)\n .header(\"Content-Type\", \"application/json\")\n .send()\n .await?;\n\n let data: serde_json::Value = res.json().await?;\n println!(\"{:#?}\", data);\n Ok(())\n}"
operationId: deleteApiV1ProjectsByProjectIdSite
x-operation-id-source: derived
servers:
- url: http://localhost:3001
description: Current
- url: http://localhost:3001
description: Local development
- url: https://dev.codebase.design
description: Development
- url: https://staging.codebase.design
description: Staging
- url: https://codebase.design
description: Production
components:
responses:
BadRequest:
description: Invalid request parameters
content:
application/json:
schema:
type: object
properties:
error:
type: string
NotFound:
description: Resource not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
description: Revocable API key (cb_live_... or cb_test_...)
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: OAuth2 access token
x-refined-from:
- codebase-design-openapi.json
- codebase-design-openapi.yml