# Domains (*domains*) ### Available Operations * [list](#list) - Retrieve a list of domains * [create](#create) - Create a domain * [delete](#delete) - Delete a domain * [update](#update) - Update a domain * [setPrimary](#setprimary) - Set a domain as primary * [transfer](#transfer) - Transfer a domain ## list Retrieve a list of domains associated with the authenticated workspace. ### Example Usage ```typescript import { Dub } from "dub"; const dub = new Dub({ token: "DUB_API_KEY", }); async function run() { const result = await dub.domains.list({}); // Handle the result console.log(result) } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.ListDomainsRequest](../../models/operations/listdomainsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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. | ### Response **Promise\<[components.DomainSchema[]](../../models/.md)\>** ### Errors | Error Object | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | | errors.Unauthorized | 401 | application/json | | errors.Forbidden | 403 | application/json | | errors.NotFound | 404 | application/json | | errors.Conflict | 409 | application/json | | errors.InviteExpired | 410 | application/json | | errors.UnprocessableEntity | 422 | application/json | | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4xx-5xx | */* | ## create Create a domain for the authenticated workspace. ### Example Usage ```typescript import { Dub } from "dub"; const dub = new Dub({ token: "DUB_API_KEY", }); async function run() { const result = await dub.domains.create({ slug: "acme.com", }); // Handle the result console.log(result) } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.CreateDomainRequestBody](../../models/operations/createdomainrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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. | ### Response **Promise\<[components.DomainSchema](../../models/components/domainschema.md)\>** ### Errors | Error Object | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | | errors.Unauthorized | 401 | application/json | | errors.Forbidden | 403 | application/json | | errors.NotFound | 404 | application/json | | errors.Conflict | 409 | application/json | | errors.InviteExpired | 410 | application/json | | errors.UnprocessableEntity | 422 | application/json | | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4xx-5xx | */* | ## delete Delete a domain from a workspace. It cannot be undone. This will also delete all the links associated with the domain. ### Example Usage ```typescript import { Dub } from "dub"; const dub = new Dub({ token: "DUB_API_KEY", }); async function run() { const result = await dub.domains.delete("acme.com"); // Handle the result console.log(result) } run(); ``` ### Parameters | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `slug` | *string* | :heavy_check_mark: | The domain name. | [object Object] | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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. | | ### Response **Promise\<[operations.DeleteDomainResponseBody](../../models/operations/deletedomainresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | | errors.Unauthorized | 401 | application/json | | errors.Forbidden | 403 | application/json | | errors.NotFound | 404 | application/json | | errors.Conflict | 409 | application/json | | errors.InviteExpired | 410 | application/json | | errors.UnprocessableEntity | 422 | application/json | | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4xx-5xx | */* | ## update Update a domain for the authenticated workspace. ### Example Usage ```typescript import { Dub } from "dub"; const dub = new Dub({ token: "DUB_API_KEY", }); async function run() { const result = await dub.domains.update("acme.com", {}); // Handle the result console.log(result) } run(); ``` ### Parameters | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `slug` | *string* | :heavy_check_mark: | The domain name. | [object Object] | | `requestBody` | [operations.UpdateDomainRequestBody](../../models/operations/updatedomainrequestbody.md) | :heavy_minus_sign: | N/A | | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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. | | ### Response **Promise\<[components.DomainSchema](../../models/components/domainschema.md)\>** ### Errors | Error Object | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | | errors.Unauthorized | 401 | application/json | | errors.Forbidden | 403 | application/json | | errors.NotFound | 404 | application/json | | errors.Conflict | 409 | application/json | | errors.InviteExpired | 410 | application/json | | errors.UnprocessableEntity | 422 | application/json | | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4xx-5xx | */* | ## setPrimary Set a domain as primary for the authenticated workspace. ### Example Usage ```typescript import { Dub } from "dub"; const dub = new Dub({ token: "DUB_API_KEY", }); async function run() { const result = await dub.domains.setPrimary("acme.com"); // Handle the result console.log(result) } run(); ``` ### Parameters | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `slug` | *string* | :heavy_check_mark: | The domain name. | [object Object] | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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. | | ### Response **Promise\<[components.DomainSchema](../../models/components/domainschema.md)\>** ### Errors | Error Object | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | | errors.Unauthorized | 401 | application/json | | errors.Forbidden | 403 | application/json | | errors.NotFound | 404 | application/json | | errors.Conflict | 409 | application/json | | errors.InviteExpired | 410 | application/json | | errors.UnprocessableEntity | 422 | application/json | | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4xx-5xx | */* | ## transfer Transfer a domain to another workspace within the authenticated account. ### Example Usage ```typescript import { Dub } from "dub"; const dub = new Dub({ token: "DUB_API_KEY", }); async function run() { const result = await dub.domains.transfer("acme.com", { newWorkspaceId: "", }); // Handle the result console.log(result) } run(); ``` ### Parameters | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `slug` | *string* | :heavy_check_mark: | The domain name. | [object Object] | | `requestBody` | [operations.TransferDomainRequestBody](../../models/operations/transferdomainrequestbody.md) | :heavy_minus_sign: | N/A | | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | 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. | | ### Response **Promise\<[components.DomainSchema](../../models/components/domainschema.md)\>** ### Errors | Error Object | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | | errors.Unauthorized | 401 | application/json | | errors.Forbidden | 403 | application/json | | errors.NotFound | 404 | application/json | | errors.Conflict | 409 | application/json | | errors.InviteExpired | 410 | application/json | | errors.UnprocessableEntity | 422 | application/json | | errors.RateLimitExceeded | 429 | application/json | | errors.InternalServerError | 500 | application/json | | errors.SDKError | 4xx-5xx | */* |