After domain is created, you can get your domain details for DNS record. Add a cname record to your DNS provider. If your domain is hosted on Cloudflare, you can use the Cloudflare auth url to add the record with just one click.
import { U301 } from 'u301';
const apiKey = '<YOUR_API_KEY>';
const workspaceId = '<YOUR_WORKSPACE_ID>';
const u301 = new U301({
apiKey,
workspaceId,
});
const details = await u301.domains.getDetails('t.example.com'); // [!code highlight]
console.log(details);Request
| Name | Location | Type | Required | Default | Description |
|---|---|---|---|---|---|
| Authorization | Header | string | Bearer token used for authentication. | ||
| workspaceId | Query | string | Workspace identifier for multi‑tenant routing. | ||
| domain | Path | string | Domain for the short link. |
Response
| Name | Type | Description |
|---|---|---|
domain | string | Domain for the short link. |
isValid | boolean | Whether the domain is valid. |
isArchived | boolean | Whether the domain is archived. |
lastCheckedAt | string | Last checked time. |
randomCodeLength | number | Random code length. |
workspaceId | string | Workspace identifier for multi‑tenant routing. |
homePageRedirectUrl | string | Home page redirect url. |
notFoundPageRedirectUrl | string | Not found page redirect url. |
createdAt | string | Created at time. |
updatedAt | string | Updated at time. |
isPrimary | boolean | Whether the domain is primary. |
isGlobal | boolean | Whether the domain is global. |
dnsSettings | object | DNS settings. |
dnsSettings.cnameValue | string | CNAME value. |
dnsSettings.isHostedOnCloudflare | boolean | Whether the domain is hosted on Cloudflare. |
dnsSettings.baseDomain | string | Base domain. |
dnsSettings.subdomain | string | Subdomain. |
dnsSettings.domainConnectUrl | string | Domain connect url. |
dnsSettings.cloudflareAuthUrl | string | Cloudflare auth url. |
{
"domain": "t.tealight.uk",
"isValid": true,
"isArchived": false,
"lastCheckedAt": "2025-04-25T11:17:15.459Z",
"randomCodeLength": 6,
"workspaceId": "0196684a-3b57-7000-805b-88c32c3c5dc7",
"homePageRedirectUrl": null,
"notFoundPageRedirectUrl": null,
"createdAt": "2025-04-25T11:17:15.459Z",
"updatedAt": null,
"isPrimary": false,
"isGlobal": false,
"dnsSettings": {
"cnameValue": "babbette971.bender.u301.com",
"isHostedOnCloudflare": true,
"baseDomain": "tealight.uk",
"subdomain": "t",
"domainConnectUrl": "api.cloudflare.com/client/v4/dns/domainconnect",
"cloudflareAuthUrl": "https://dash.cloudflare.com/domainconnect/v2/domainTemplates/providers/u301.com/services/bender/apply?key=_dcpubkeyv1&state=814576&providerId=u301.com&domain=tealight.uk&host=t&subdomain=t&cname=babbette971&sig=STzm%2FoxZcwZAp6DxqTbExk2hN2J6Prs784igsPpqL6oudsfTEAkG1bbQ87E8EhnMh4dmXMzPx35bu3y8BQKvD0tHnIXdA6pjeMYDN9dGB2yLrK72b%2BcFz46DY1ZEL24a9y1kesNSG2hv9zHOFU9Cyr2BkVJPte67r4ypnrNN3OuMeXuIMgdkEMbNjTwXpvZLqnz97wgRQNIc5LYpUkicPnXpZdc6bsswhfanlWG44qzlod09S9tErVWHHg1wmY4qdIWy%2Byz%2Fnp6oVFWSCVDoPa42NJT2p1pySqWkyHztQ21ZmYa1qFhcH0TFrXB3GnAi1xIdsdsfGJZ79vwkdRSIZA%3D%3D"
}
}Last updated on