Create Experiment β€” API Reference

Method -: POST 

https://www.pagesense.zoho.com/pagesense/rest/v1/portal/{portal_name}/experiments

Scope Required

PageSense.experiments.CREATE

Description

Creates a new A/B or Split URL experiment under a specified project.
This endpoint initializes an experiment shell containing metadata such as display name, experiment URL, and type. Once created, you can add variations, goals, audiences, and publish the experiment using other APIs.


Request 

URL parameters 

  • portal_name (path) β€” your portal identifier.


Request field mapping

display_name (String) : Human-readable name of the experiment. 
experiment_url (String) : Base URL of the page under test. For Split URL experiments, each variation will point to a unique URL.
experiment_type (Integer) : Type of experiment to create. 
redirect_params (Boolean) : If true, query parameters will be preserved when redirecting visitors to variations.
project_linkname (String) : Unique identifier for the project under which this experiment is created.
 

Request body (JSON)

Copiedcurl -X POST "https://www.pagesense.zoho.com/pagesense/rest/v1/portal/my-portal/experiments" \
-H "Authorization: Zoho-oauthtoken {access_token}
-H "Content-Type: application/json" \
-d '{
	"experiment": {
		"display_name": "Homepage Redesign A/B Test",
		"experiment_url": "https://example.com/home",
		"experiment_type": 1,
		"redirect_params": true,
		"project_linkname": "main-website"
	}
}'

Response field mapping

status_code (String) : Internal API status code. "10000" indicates success.
status_string (String) : Human-readable message.
experiments (Array) : Contains the experiment(s) processed.
experiment_key (String) : Unique key identifying the experiment.
experiment_id (String) : Numeric ID of the created experiment.
display_name (String) : Experiment name, as provided.
project_linkname(String) : The associated project identifier.
linkname (String) : System-generated slug for the experiment.
success (Boolean) : Indicates successful creation.
count (Integer) : Number of experiments processed (usually 1).

Notes & Best Practices 

  • Experiment naming: Keep names descriptive and short; this name will appear in reports and dashboards.

  • Experiment type immutability: Once created, experiment_type cannot be changed. Delete and recreate if necessary.

  • Redirect handling: For Split URL experiments, set redirect_params: true to retain query strings or UTM parameters between variations.

  • Experiment key storage: Store experiment_key securely β€” it’s required for updating variations, goals, and publishing.

Sample Response

Copied{
	"status_code": "10000",
	"status_string": "All resource were processed successfully.",
	"timeTakenToProcessTheRequest": "488 ms",
	"experiments": [{
		"experiment_key": "abc123",
		"experiment_id": 2000000123456,
		"display_name": "Homepage Redesign A/B Test",
		"project_linkname": "main-website",
		"success": true,
		"linkname": "homepage-redesign-ab-test"
	}],
	"count": 1
}