Update a custom environment
PATCH
/__remote/api.vercel.com/v9/projects/{idOrName}/custom-environments/{environmentSlugOrId}Update a custom environment for the project. Must not be named 'Production' or 'Preview'.
/__remote/api.vercel.com/v9/projects/{idOrName}/custom-environments/{environmentSlugOrId}
const response = await fetch('/__remote/api.vercel.com/v9/projects/idOrName/custom-environments/environmentSlugOrId?teamId=string&slug=string', { method: 'PATCH', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "slug": "string", "description": "string", "branchMatcher": { "type": "equals", "pattern": "string" } }),});
const data = await response.json();console.log(data);Response
{ "branchMatcher": { "pattern": "string", "type": "endsWith" }, "createdAt": "123", "currentDeploymentAliases": [], "description": "string", "domains": [ { "apexName": "Example Name", "createdAt": "123", "customEnvironmentId": "example_id", "gitBranch": "string", "name": "Example Name", "projectId": "example_id", "redirect": "string", "redirectStatusCode": "301", "updatedAt": "123", "verification": [ { "domain": "string", "reason": "Customer requested refund", "type": "string", "value": "string" } ], "verified": "false" } ], "id": "icfg_1234567890", "slug": "string", "type": "development", "updatedAt": "123"}AuthorizationbearerToken
Default authentication mechanism
200Success
400One of the provided values in the request body is invalid.
One of the provided values in the request query is invalid.
401The request is not authorized.
402The account is missing a payment so payment method must be updated
403You do not have permission to access this resource.
404Error
410Error
500Error