API Reference
Links
Conversions
Customers
Domains
Create a domain
Create a domain for the authenticated workspace.
POST
/
domains
Copy
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)
Copy
{
"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
Default authentication mechanism
Body
application/json
Response
201
application/json
The domain was created.
The response is of type object
.
Copy
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)
Copy
{
"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>"
}
}
Assistant
Responses are generated using AI and may contain mistakes.