See the following API reference documentation for how to use Vercel REST API to create integrations:
- Creating a Project Environment Variable
- Forwarding Logs using Log Drains
- Create an Access Token
- Interacting with Teams
- Interacting with Configurations
- Interacting with Vercel Projects
When you create an integration, you define a redirect URL that can have query parameters attached.
One of these parameters is the
code parameter. This short-lived parameter is valid for 30 minutes and can be exchanged once for a long-lived access token using the following API endpoint:
Pass the following values to the request body in the form of
ID of your application.
Secret of your application.
The code you received.
The Redirect URL you configured on the Integration Console.
The response of your
code exchange request includes a
team_id property. If
team_id is not null, you know that this integration was installed on a team.
If your integration is installed on a team, append the
teamId query parameter to each API request. See Accessing Resources Owned by a Team for more details.
Each installation of your integration is stored and tracked as a configuration.
Sometimes it makes sense to fetch the configuration in order to get more insights about the current scope or the projects your integration has access to.
To see which endpoints are available, see the Configurations documentation for more details.
When integration configurations are disabled:
- Any API requests will fail with a
403HTTP status code and a
- We continue to send
integration-configuration.removedwebhooks, as these will allow the integration configuration to operate correctly when re-activated. All other webhook delivery will be paused
- Log drains will not receive any logs
Deployments made with Vercel are grouped into Projects. This means that each deployment is assigned a name and is grouped into a project with other deployments using that same name.
Using the Vercel REST API, you can modify Projects that the Integration has access to. Here are some examples:
When building a Vercel Integration, you may want to expose an API token or a configuration URL for deployments within a Project.
You can do so by Creating a Project Environment Variable using the API.
When creating integrations the following scopes can be updated within the Integration Console:
domainwhen updating the domain of a project.
Interact with the installation of your integration
Interact with deployments
Verify deployments with Checks
Create and manage Edge Configs and their tokens
Access project details and settings
Create and manage integration-owned project environment variables
Create and manage all account project environment variables
Access team details
Get information about the current user
Create and manage log drains to forward logs
Manage and interact with domains and certificates. Write permissions are required for both
Interact with an installation of your integration.
Interact with deployments.
Verify deployments with Checks.
Create and manage Edge Configs and their tokens.
Access project details and settings.
Create and manage integration-owned project environment variables.
Create and manage all account project environment variables.
Get information about the current user.
Create and manage log drains to forward logs.
Manage and interact with domains and certificates.
As the Vercel REST API evolves, you'll need to update your scopes based on your integration's endpoint usage.
Additions and upgrades always require a review and confirmation. To ensure this, every affected user and team owner will be informed through email to undergo this process. Please make sure you provide a meaningful, short, and descriptive note for your changes.
Scope removals and downgrades won't require user confirmation and will be applied immediately to confirmed scopes and pending requested scope changes.
User and Teams will always confirm all pending changes with one confirmation. That means that if you have requested new scopes multiple times over the past year, the users will see a summary of all pending changes with their respective provided note.
Once a user confirms these changes, scopes get directly applied to the installation. You will also get notified through the new
When using the Vercel REST API with Integrations, you might come across some errors which you can address immediately.
To avoid CORS issues, make sure you only interact with the Vercel REST API on the server side.
Since the token grants access to resources of the Team or Personal Account, you should never expose it on the client side.
For more information on using CORS with Vercel, see How can I enable CORS on Vercel?.