POST /api/v1/sites
Creates a new site with the specified domain and configuration. Requires the sites:provision:* API scope.
This endpoint is only available with a subscription that includes the Sites API feature.
Authentication
Requires a valid API key with the sites:provision:* scope passed in the Authorization header.
Request Body
The domain of the site to create. The domain will be automatically normalized (lowercased, stripped of protocol/www prefix). Examples: example.com, blog.example.com, 音乐.cn International domain names (IDNs) are supported. URI reserved characters (:, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ;, =) are not allowed.
The timezone for the site. Must be a valid IANA timezone identifier. Examples: America/New_York, Europe/London, Asia/Tokyo
The identifier of the team to create the site under. If not provided, the site will be created under the user’s default team. Note: If using a team-scoped API key, this parameter is ignored and the site is created under the API key’s team.
tracker_script_configuration
Optional configuration for the tracker script. If not provided, default values will be used. Show Tracker Script Configuration Fields
tracker_script_configuration.installation_type
The installation method used. Valid values: manual, wordpress, or null.
tracker_script_configuration.track_404_pages
Enable tracking of 404 error pages.
tracker_script_configuration.hash_based_routing
Enable hash-based routing for single-page applications.
tracker_script_configuration.outbound_links
Enable automatic tracking of outbound link clicks.
tracker_script_configuration.file_downloads
Enable automatic tracking of file downloads.
tracker_script_configuration.revenue_tracking
Enable revenue tracking for goals.
tracker_script_configuration.tagged_events
Enable CSS class-based event tracking.
tracker_script_configuration.form_submissions
Enable automatic tracking of form submissions.
tracker_script_configuration.pageview_props
Enable custom properties on pageviews.
Response
The domain of the created site.
The timezone of the created site.
List of allowed custom event properties for the site. Empty array by default.
tracker_script_configuration
The tracker script configuration for the site. Show Configuration Fields
tracker_script_configuration.id
The unique identifier for this configuration.
tracker_script_configuration.installation_type
The installation method (e.g., manual, wordpress, or null).
tracker_script_configuration.track_404_pages
Whether 404 tracking is enabled.
tracker_script_configuration.hash_based_routing
Whether hash-based routing is enabled.
tracker_script_configuration.outbound_links
Whether outbound link tracking is enabled.
tracker_script_configuration.file_downloads
Whether file download tracking is enabled.
tracker_script_configuration.revenue_tracking
Whether revenue tracking is enabled.
tracker_script_configuration.tagged_events
Whether CSS class-based event tracking is enabled.
tracker_script_configuration.form_submissions
Whether form submission tracking is enabled.
tracker_script_configuration.pageview_props
Whether pageview properties are enabled.
cURL
With Tracker Configuration
200 Response
400 Error - Invalid Domain
400 Error - Invalid Timezone
402 Error - Site Limit Reached
curl -X POST https://plausible.io/api/v1/sites \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "example.com",
"timezone": "America/New_York"
}'