Skip to main content
POST
/
websites
/
create
Create Project
curl --request POST \
  --url https://api.example.com/websites/create \
  --header 'Content-Type: application/json' \
  --data '
{
  "organizationId": "<string>",
  "domain": "<string>",
  "name": "<string>",
  "timezone": "<string>",
  "publicAccess": true
}
'
{
  "id": "<string>",
  "domain": "<string>",
  "name": "<string>",
  "organizationId": "<string>",
  "timezone": "<string>",
  "publicAccess": true,
  "trackingStatus": "<string>",
  "createdAt": "<string>"
}

Authentication

Requires either:
  • Session authentication (browser)
  • API key with organization scope and create permission

Request Body

organizationId
string
required
Organization ID to create the website under
domain
string
required
Website domain (e.g., example.com or app.example.com)
name
string
Display name for the website. Defaults to domain if not provided
timezone
string
IANA timezone identifier (e.g., America/New_York). Defaults to UTC
publicAccess
boolean
Make analytics dashboard publicly accessible. Defaults to false

Response

Returns the created website object.
id
string
Unique website identifier (use as clientId in tracking script)
domain
string
Website domain
name
string
Display name
organizationId
string
Parent organization ID
timezone
string
IANA timezone identifier
publicAccess
boolean
Public dashboard access flag
trackingStatus
string
Initial tracking status (typically setup_required)
createdAt
string
ISO 8601 timestamp of creation

Example Request

curl -X POST https://api.databuddy.cc/websites/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "organizationId": "org_abc123",
    "domain": "example.com",
    "name": "My Website",
    "timezone": "America/Los_Angeles"
  }'

Example Response

{
  "id": "web_new456",
  "organizationId": "org_abc123",
  "domain": "example.com",
  "name": "My Website",
  "timezone": "America/Los_Angeles",
  "publicAccess": false,
  "trackingStatus": "setup_required",
  "createdAt": "2024-03-01T16:45:00Z"
}

Next Steps

After creating a website:
  1. Install the tracking script using the returned id as your clientId
  2. See SDK Installation for implementation details

Build docs developers (and LLMs) love