Claude
Skills
Sign in
Back

vercel

Included with Lifetime
$97 forever

Vercel API for deployments. Use when user mentions "Vercel", "vercel.app", "vercel.com", shares a Vercel link, "deploy", or asks about hosting.

Backend & APIs

What this skill does


## Troubleshooting

If requests fail, run `zero doctor check-connector --env-name VERCEL_TOKEN` or `zero doctor check-connector --url https://api.vercel.com/v2/user --method GET`

## User

### Get Current User

```bash
curl -s "https://api.vercel.com/v2/user" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### List Auth Tokens

```bash
curl -s "https://api.vercel.com/v6/user/tokens" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

## Projects

### List Projects

```bash
curl -s "https://api.vercel.com/v10/projects" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Get Project

```bash
curl -s "https://api.vercel.com/v9/projects/<project-name>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

Use project name or ID.

### Create Project

```bash
curl -s -X POST "https://api.vercel.com/v11/projects" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"name\": \"my-new-project\", \"framework\": \"nextjs\"}"
```

Only `name` is required. Optional: `framework`, `buildCommand`, `outputDirectory`, `rootDirectory`, `installCommand`.

### Update Project

```bash
curl -s -X PATCH "https://api.vercel.com/v9/projects/<project-name>" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"buildCommand\": \"next build\", \"outputDirectory\": \".next\"}"
```

### Delete Project

```bash
curl -s -X DELETE "https://api.vercel.com/v9/projects/<project-name>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

Returns 204 on success. Permanently deletes the project and all its deployments.

### Pause Project

```bash
curl -s -X POST "https://api.vercel.com/v1/projects/<project-id>/pause" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Unpause Project

```bash
curl -s -X POST "https://api.vercel.com/v1/projects/<project-id>/unpause" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

## Deployments

### List Deployments

```bash
curl -s "https://api.vercel.com/v6/deployments?limit=10" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

Params: `limit`, `projectId`, `state` (BUILDING/READY/ERROR/QUEUED/CANCELED), `target` (production/preview), `until` (pagination timestamp).

### List Deployments for a Project

```bash
curl -s "https://api.vercel.com/v6/deployments?projectId=<project-name>&limit=10" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Get Deployment

```bash
curl -s "https://api.vercel.com/v13/deployments/<deployment-id>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Get Build Logs

```bash
curl -s "https://api.vercel.com/v3/deployments/<deployment-id>/events?limit=-1" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

Use `limit=-1` to get all log events.

### Get Runtime Logs

```bash
curl -s "https://api.vercel.com/v1/projects/<project-id>/deployments/<deployment-id>/runtime-logs" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Create Deployment (Redeploy)

```bash
curl -s -X POST "https://api.vercel.com/v13/deployments" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"name\": \"my-project\", \"deploymentId\": \"<prev-deployment-id>\", \"target\": \"production\"}"
```

### Promote to Production (Rollback)

```bash
curl -s -X POST "https://api.vercel.com/v10/projects/<project-id>/promote/<deployment-id>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Cancel Deployment

Only works for BUILDING or QUEUED deployments.

```bash
curl -s -X PATCH "https://api.vercel.com/v12/deployments/<deployment-id>/cancel" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Delete Deployment

```bash
curl -s -X DELETE "https://api.vercel.com/v13/deployments/<deployment-id>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### List Deployment Aliases

```bash
curl -s "https://api.vercel.com/v2/deployments/<deployment-id>/aliases" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

## Domains

### List Domains

```bash
curl -s "https://api.vercel.com/v5/domains" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Get Domain

```bash
curl -s "https://api.vercel.com/v5/domains/<domain>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Get Domain Config

```bash
curl -s "https://api.vercel.com/v6/domains/<domain>/config" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Add Domain

```bash
curl -s -X POST "https://api.vercel.com/v7/domains" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"name\": \"example.com\"}"
```

### Update Domain

```bash
curl -s -X PATCH "https://api.vercel.com/v3/domains/<domain>" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"op\": \"update\", \"redirectTarget\": \"www.example.com\"}"
```

### Delete Domain

```bash
curl -s -X DELETE "https://api.vercel.com/v6/domains/<domain>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

## Project Domains

### List Project Domains

```bash
curl -s "https://api.vercel.com/v9/projects/<project-name>/domains" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Add Domain to Project

```bash
curl -s -X POST "https://api.vercel.com/v10/projects/<project-name>/domains" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"name\": \"example.com\"}"
```

### Verify Project Domain

```bash
curl -s -X POST "https://api.vercel.com/v9/projects/<project-name>/domains/<domain>/verify" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Update Project Domain

```bash
curl -s -X PATCH "https://api.vercel.com/v9/projects/<project-name>/domains/<domain>" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"redirect\": \"www.example.com\", \"redirectStatusCode\": 301}"
```

### Remove Domain from Project

```bash
curl -s -X DELETE "https://api.vercel.com/v9/projects/<project-name>/domains/<domain>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

## DNS Records

### List DNS Records

```bash
curl -s "https://api.vercel.com/v5/domains/<domain>/records" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Create DNS Record

```bash
curl -s -X POST "https://api.vercel.com/v2/domains/<domain>/records" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"name\": \"www\", \"type\": \"CNAME\", \"value\": \"cname.vercel-dns.com\"}"
```

### Delete DNS Record

```bash
curl -s -X DELETE "https://api.vercel.com/v2/domains/<domain>/records/<record-id>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

## Environment Variables

### List Project Env Vars

```bash
curl -s "https://api.vercel.com/v10/projects/<project-name>/env" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Get Env Var

```bash
curl -s "https://api.vercel.com/v1/projects/<project-name>/env/<env-id>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
```

### Create Env Var

```bash
curl -s -X POST "https://api.vercel.com/v10/projects/<project-name>/env" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"key\": \"MY_VAR\", \"value\": \"my-value\", \"type\": \"encrypted\", \"target\": [\"production\", \"preview\", \"development\"]}"
```

`type`: `plain`, `encrypted`, `secret`, `sensitive`. `target`: `production`, `preview`, `development`.

### Update Env Var

```bash
curl -s -X PATCH "https://api.vercel.com/v9/projects/<project-name>/env/<env-id>" \
  --header "Authorization: Bearer $VERCEL_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"value\": \"new-value\", \"target\": [\"production\"]}"
```

### Delete Env Var

```bash
curl -s -X DELETE "https://api.vercel.com/v9/projects/<project-name>/env/<env-id>" \
  --header "Authorization: Bearer $VERCEL_TOKEN"
``
Files: 1
Size: 14.9 KB
Complexity: 18/100
Category: Backend & APIs

Related in Backend & APIs