Domains

List domains

All domains you can create links on: the automatic default, U2L's first-party short domains, your claimed subdomains, and your custom domains. Domains are added and verified in the dashboard, not via the API.

GET https://u2l.ai/api/v1/domains

Authorizations

Authorizationstringrequired

Bearer authentication header of the form Bearer <token>, where <token> is your U2L API key (u2l_live_...). Create one in the dashboard under Settings > API.

Response 200

domainsobject[]
domains[].domainstring
domains[].typestring

default is the automatic choice; trust-based (u2l.ai) accepts trusted destinations only. One of: default, trust-based, standard, subdomain, custom.

domains[].verifiedboolean
domains[].placementstring

Placement rule, when applicable (automatic or trusted-only).

Errors

401 Missing or invalid API key.
429 Rate limit exceeded. Check X-RateLimit-Reset for when the window resets.

See Rate Limits & Errors for the error envelope and per-plan limits.

curl https://u2l.ai/api/v1/domains \
  -H "Authorization: Bearer u2l_live_your_api_key"
const response = await fetch("https://u2l.ai/api/v1/domains", {
  headers: {
    "Authorization": "Bearer u2l_live_your_api_key",
  },
});

const data = await response.json();
console.log(data);
import requests

response = requests.get(
    "https://u2l.ai/api/v1/domains",
    headers={"Authorization": "Bearer u2l_live_your_api_key"},
)

print(response.json())
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://u2l.ai/api/v1/domains", nil)
	req.Header.Set("Authorization", "Bearer u2l_live_your_api_key")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()

	data, _ := io.ReadAll(res.Body)
	fmt.Println(string(data))
}
{
  "domains": [
    {
      "domain": "auto",
      "type": "default",
      "verified": true,
      "placement": "automatic"
    },
    {
      "domain": "u2l.ai",
      "type": "trust-based",
      "verified": true,
      "placement": "trusted-only"
    },
    {
      "domain": "u.gy",
      "type": "standard",
      "verified": true
    },
    {
      "domain": "links.acme.com",
      "type": "custom",
      "verified": true
    }
  ]
}