Domains
Create a domain
API Reference
Links
Analytics
Conversions [BETA]
Domains
Create a domain
Create a domain for the authenticated workspace.
POST
/
domains
import { Dub } from "dub";
const dub = new Dub({
token: "DUB_API_KEY",
});
async function run() {
const result = await dub.domains.create();
// Handle the result
console.log(result);
}
run();
{
"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",
"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
.
Was this page helpful?
import { Dub } from "dub";
const dub = new Dub({
token: "DUB_API_KEY",
});
async function run() {
const result = await dub.domains.create();
// Handle the result
console.log(result);
}
run();
{
"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",
"createdAt": "<string>",
"updatedAt": "<string>",
"registeredDomain": {
"id": "<string>",
"createdAt": "<string>",
"expiresAt": "<string>"
}
}