api
I'd be happy to help you with Vercel's API. Vercel provides a comprehensive REST API that gives you full control over the entire Vercel platform.
Vercel REST API Overview
The Vercel REST API allows you to programmatically interact with your Vercel account and services using HTTP requests 1. With this API, you can:
- Deploy new versions of web applications
- Manage custom domains
- Retrieve information about deployments
- Manage secrets and environment variables for projects 1
The API supports any programming language or framework that can send HTTP requests 1.
API Basics
- Base URL: All endpoints are available at
https://api.vercel.com
12 - Protocol: Supports HTTP/1, HTTP/1.1, and HTTP/2 (HTTP/2 is preferred) 12
- Content Type: All requests must use JSON with the
Content-Type: application/json
header 12
Authentication
To use the API, you'll need to authenticate using a Vercel Access Token:
Authorization: Bearer <TOKEN>
Creating an Access Token
- In the upper-right corner of your Vercel dashboard, click your profile picture, then select Settings
- Select Tokens from the sidebar
- Enter a descriptive name for the token
- Choose the scope from the list of Teams in the drop-down menu
- Select an expiration date for the token (recommended for security)
- Click Create Token
- Store the token securely as it won't be shown again 12
Accessing Team Resources
To access resources owned by a team, append the Team ID as a query parameter:
https://api.vercel.com/v6/deployments?teamId=[teamID]
Example API Usage
Here's a simple example of how you might use the API to list your projects:
fetch('https://api.vercel.com/v9/projects', {
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
})
.then(response => response.json())
.then(data => console.log(data));
Would you like me to help you with a specific API endpoint or create a more detailed example for a particular use case?