Add an existing domain to the Vercel platform
POST
https://api.vercel.com/v7/domainsThis endpoint is used for adding a new apex domain name with Vercel for the authenticating user. Note: This endpoint is no longer used for initiating domain transfers from external registrars to Vercel. For this, please use the endpoint Transfer-in a domain.
https://api.vercel.com/v7/domains
const response = await fetch('https://api.vercel.com/v7/domains?teamId=string&slug=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "method": "add", "name": "example.com", "cdnEnabled": "true", "zone": "true" }),});
const data = await response.json();console.log(data);Response
{ "domain": { "boughtAt": "1613602938882", "createdAt": "1613602938882", "creator": { "customerId": "example_id", "email": "user@example.com", "id": "icfg_1234567890", "isDomainReseller": "false", "username": "string" }, "customNameservers": [], "echMode": "auto", "expiresAt": "123", "id": "EmTbe5CEJyTk2yVAHBUWy4A3sRusca3GCwRjTC1bpeVnt1", "intendedNameservers": [], "name": "example.com", "nameservers": [], "renew": "true", "serviceType": "zeit.world", "teamId": "example_id", "transferredAt": "1613602938882", "transferStartedAt": "1613602938882", "userId": "example_id", "verified": "true" }}AuthorizationbearerToken
Default authentication mechanism
400One of the provided values in the request body 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
409The domain is not allowed to be used
410Error