POST
/
domains
from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.domains.create(request={
        "slug": "acme.com",
        "expired_url": "https://acme.com/expired",
        "not_found_url": "https://acme.com/not-found",
        "placeholder": "https://dub.co/help/article/what-is-dub",
    })

    assert res is not None

    # Handle response
    print(res)
{
  "id": "<string>",
  "slug": "acme.com",
  "verified": false,
  "primary": false,
  "archived": false,
  "placeholder": "https://dub.co/help/article/what-is-dub",
  "expiredUrl": "https://acme.com/expired",
  "notFoundUrl": "https://acme.com/not-found",
  "assetLinks": null,
  "appleAppSiteAssociation": null,
  "logo": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "registeredDomain": {
    "id": "<string>",
    "createdAt": "<string>",
    "expiresAt": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json

Response

201
application/json

The domain was created.

The response is of type object.