Back to API Overview

Web address API

Your web address on Serenities: check one is free and reserve it.

3 endpoints

Endpoints

POST
/api/v1/subdomain/checkAvailability

Check whether a name is free to claim as this workspace's own address, <name>.serenitiesai.com. Param: subdomain (3 to 63 characters: lowercase letters, numbers and hyphens, not starting or ending with a hyphen, no two hyphens in the 3rd and 4th places). Claims nothing. Returns { available } and, when it is not free, reason ("reserved": a name Serenities keeps; "taken": someone already has it; "dns_exists": it is already in use). A few checks a minute per workspace: past that the answer is to wait a minute, so check only names the person suggested. If the check cannot run just now, the answer says so: try again in a minute, never tell the person the name is free.

Parameters

subdomainstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/subdomain/checkAvailability \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "subdomain": "example"
}'
POST
/api/v1/subdomain/reserve

Claim a name as this workspace's own address, <name>.serenitiesai.com. One name per account: once claimed it stays, and a second claim is refused. Param: subdomain (3 to 63 characters: lowercase letters, numbers and hyphens, not starting or ending with a hyphen, no two hyphens in the 3rd and 4th places; names Serenities keeps, like "admin" or "www", are refused). Call it ONLY when the person asked for this exact name, after subdomain_checkAvailability said it is free; repeat the name back to them first. Refused for someone not allowed to publish the workspace's sites. Returns { subdomain }, the saved name. Act only on what the person named or picked.

Parameters

subdomainstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/subdomain/reserve \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "subdomain": "example"
}'
POST
/api/v1/subdomain/getUserSubdomain

Read this workspace's own address name (the <name> of <name>.serenitiesai.com), or null when it has none yet. Takes no params. Returns the name or null.

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/subdomain/getUserSubdomain \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{}'