(domains)
- buyDomain - Purchase a domain
- checkDomainPrice - Check the price for a domain
- checkDomainStatus - Check a Domain Availability
- getDomainTransfer - Get domain transfer info.
- getDomainConfig - Get a Domain's configuration
- getDomain - Get Information for a Single Domain
- getDomains - List all the domains
- createOrTransferDomain - Register or transfer-in a new Domain
- patchDomain - Update or move apex domain
- deleteDomain - Remove a domain by name
Allows to purchase the specified domain.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.buyDomain({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "example.com",
expectedPrice: 10,
renew: true,
country: "US",
orgName: "Acme Inc.",
firstName: "Jane",
lastName: "Doe",
address1: "340 S Lemon Ave Suite 4133",
city: "San Francisco",
state: "CA",
postalCode: "91789",
phone: "+1.4158551452",
email: "[email protected]",
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsBuyDomain } from "@vercel/sdk/funcs/domainsBuyDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsBuyDomain(vercel, {
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "example.com",
expectedPrice: 10,
renew: true,
country: "US",
orgName: "Acme Inc.",
firstName: "Jane",
lastName: "Doe",
address1: "340 S Lemon Ave Suite 4133",
city: "San Francisco",
state: "CA",
postalCode: "91789",
phone: "+1.4158551452",
email: "[email protected]",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.BuyDomainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.BuyDomainResponse>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelRateLimitError | 429 | application/json |
models.SDKError | 4XX, 5XX | */* |
Check the price to purchase a domain and how long a single purchase period is.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.checkDomainPrice({
name: "example.com",
type: "new",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsCheckDomainPrice } from "@vercel/sdk/funcs/domainsCheckDomainPrice.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsCheckDomainPrice(vercel, {
name: "example.com",
type: "new",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.CheckDomainPriceRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.CheckDomainPriceResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Check if a domain name is available for purchase.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.checkDomainStatus({
name: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsCheckDomainStatus } from "@vercel/sdk/funcs/domainsCheckDomainStatus.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsCheckDomainStatus(vercel, {
name: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.CheckDomainStatusRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.CheckDomainStatusResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Fetch domain transfer availability or transfer status if a transfer is in progress.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.getDomainTransfer({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
domain: "example.com",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsGetDomainTransfer } from "@vercel/sdk/funcs/domainsGetDomainTransfer.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsGetDomainTransfer(vercel, {
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
domain: "example.com",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetDomainTransferRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetDomainTransferResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Get a Domain's configuration.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.getDomainConfig({
domain: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsGetDomainConfig } from "@vercel/sdk/funcs/domainsGetDomainConfig.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsGetDomainConfig(vercel, {
domain: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetDomainConfigRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetDomainConfigResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Get information for a single domain in an account or team.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.getDomain({
domain: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsGetDomain } from "@vercel/sdk/funcs/domainsGetDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsGetDomain(vercel, {
domain: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetDomainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetDomainResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Retrieves a list of domains registered for the authenticated user or team. By default it returns the last 20 domains if no limit is provided.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.getDomains({
limit: 20,
since: 1609499532000,
until: 1612264332000,
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsGetDomains } from "@vercel/sdk/funcs/domainsGetDomains.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsGetDomains(vercel, {
limit: 20,
since: 1609499532000,
until: 1612264332000,
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetDomainsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetDomainsResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
This endpoint is used for adding a new apex domain name with Vercel for the authenticating user. Can also be used for initiating a domain transfer request from an external Registrar to Vercel.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.createOrTransferDomain({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "example.com",
method: "transfer-in",
authCode: "fdhfr820ad#@FAdlj$$",
expectedPrice: 8,
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsCreateOrTransferDomain } from "@vercel/sdk/funcs/domainsCreateOrTransferDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsCreateOrTransferDomain(vercel, {
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "example.com",
method: "transfer-in",
authCode: "fdhfr820ad#@FAdlj$$",
expectedPrice: 8,
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.CreateOrTransferDomainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.CreateOrTransferDomainResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Update or move apex domain.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.patchDomain({
domain: "tight-secrecy.info",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
op: "update",
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsPatchDomain } from "@vercel/sdk/funcs/domainsPatchDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsPatchDomain(vercel, {
domain: "tight-secrecy.info",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
op: "update",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.PatchDomainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.PatchDomainResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Delete a previously registered domain name from Vercel. Deleting a domain will automatically remove any associated aliases.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.domains.deleteDomain({
domain: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { domainsDeleteDomain } from "@vercel/sdk/funcs/domainsDeleteDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await domainsDeleteDomain(vercel, {
domain: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.DeleteDomainRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.DeleteDomainResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |