Skip to main content

Create Website

Create a new website to start tracking analytics data. Websites can be owned by a user or a team.

Endpoint

POST /api/websites

Headers

Authorization
string
required
Bearer token for authentication

Request Body

name
string
required
Website name (max 100 characters)
domain
string
required
Website domain (max 500 characters)
shareId
string
Optional share ID for public analytics sharing (max 50 characters)
teamId
string
Team UUID if creating a team website. Omit for personal website.
id
string
Optional custom UUID for the website. Generated automatically if not provided.
In CLOUD_MODE, free accounts are limited to 3 websites. Team websites require team creation permissions.

Response

id
string
Website UUID
name
string
Website name
domain
string
Website domain
shareId
string
Public share ID (if provided)
userId
string
Owner user UUID (null for team websites)
teamId
string
Team UUID (null for personal websites)
createdBy
string
UUID of user who created the website
createdAt
string
ISO 8601 timestamp of creation

Example Request

curl -X POST https://your-umami-instance.com/api/websites \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My New Website",
    "domain": "example.com",
    "shareId": "public123"
  }'

Example Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "My New Website",
  "domain": "example.com",
  "shareId": "public123",
  "userId": "660e8400-e29b-41d4-a716-446655440001",
  "teamId": null,
  "createdBy": "660e8400-e29b-41d4-a716-446655440001",
  "createdAt": "2024-03-15T09:20:00.000Z"
}

Creating a Team Website

To create a website owned by a team, include the teamId parameter:
curl
curl -X POST https://your-umami-instance.com/api/websites \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Team Website",
    "domain": "team.example.com",
    "teamId": "880e8400-e29b-41d4-a716-446655440003"
  }'
You must have permission to create websites for the specified team. Team managers and owners can create team websites.

Build docs developers (and LLMs) love