POST
/
domains
/
{slug}
/
primary
curl --request POST \
  --url https://api.dub.co/domains/{slug}/primary \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "slug": "acme.com",
  "verified": true,
  "primary": true,
  "archived": true,
  "placeholder": "https://dub.co/help/article/what-is-dub",
  "expiredUrl": "https://acme.com/expired",
  "target": "https://acme.com/landing",
  "type": "redirect",
  "clicks": 123
}

Authorizations

Authorization
string
headerrequired

Default authentication mechanism

Path Parameters

slug
string
required

The domain name.

Query Parameters

workspaceId
string
required

The ID of the workspace.

projectSlug
string
deprecated

The slug of the project. This field is deprecated – use workspaceId instead.

Response

200 - application/json
id
string
required

The unique identifier of the domain.

slug
string
required

The domain name.

verified
boolean
default: falserequired

Whether the domain is verified.

primary
boolean
default: falserequired

Whether the domain is the primary domain for the workspace.

archived
boolean
default: falserequired

Whether the domain is archived.

placeholder
string
default: https://dub.co/help/article/what-is-dubrequired

Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.

expiredUrl
string | null
required

The URL to redirect to when a link under this domain has expired.

target
string | null
required

The page your users will get redirected to when they visit your domain.

type
enum<string>
required

The type of redirect to use for this domain.

Available options:
redirect,
rewrite
clicks
number
default: 0required

The number of clicks on the domain.