A/B & Split URL API Overview
The A/B Testing API lets you programmatically create, manage, and publish experiments for your websites — supporting both Visual A/B Tests (same page with different variation content) and Split URL Tests (variations hosted on different URLs).
Use this API to:
Create and configure experiments
Manage variations and traffic allocation
Attach and update goals
Configure or edit audience targeting
Publish, pause, or update live experiments
This API is part of the PageSense Experimentation suite and complements the Goals API and Audience API.'
Base URL
https://pagesense.zoho.com/pagesense/rest/v1/
Authentication
All Goals API endpoints require a valid OAuth 2.0 access token. Include the token in your request headers as shown below:
Authorization: Zoho-oauthtoken {access_token}
Request & Response Format
Content-Type: application/json
Accepted Methods: GET, POST, DELETE
Response Format: JSON
A typical API response includes the following top-level fields:
Copied{
"status_code": "10000",
"projectgoals": {},
"status_string": "Operation completed successfully"
"timeTakenToProcessTheResult": "<time in ms>"
}Errors follow this pattern:
Copied{
"status_code": <error code>,
"message": "error"
}HTTP Status Codes
Code | Meaning |
200 | Request successful |
201 | Resource created successfully |
400 | Bad request (missing or invalid parameters) |
401 | Unauthorized (invalid or expired token) |
404 | Resource not found |
429 | Too many requests (rate limit exceeded) |
500 | Internal server error |
Pre-requisites
Before creating or managing A/B experiments, ensure you have:
A valid OAuth 2.0 access token.
portal_name and project_linkname — used in every endpoint path.
Active tracking scripts installed on your website.
Valid URLs for variations (mandatory for Split URL tests).
Experiment Types
Visual A/B Test:
Variations are created within the PageSense editor — same URL, different DOM/content changes.Split URL Test:
Variations point to distinct URLs (e.g., /landing-A vs /landing-B). Ideal for comparing completely different layouts or flows.
Note: The APIs are shared across both types. The variation creation payload (experiment_type) defines which mode applies.
Value | Experiment Type |
1 | A/B test |
2 | Split URL Test |
GOAL Types
Each goal in PageSense is identified by a numeric goal_type representing the type of conversion being tracked.
Value | Goal Type |
1 | PAGE_VISIT_GOAL |
2 | LINK_CLICK_GOAL |
3 | FORM_SUBMIT_GOAL |
4 | ELEMENT_CLICK_GOAL |
5 | ENGAGEMENT_GOAL |
6 | CUSTOM_EVENT_GOAL |
7 | REVENUE_GOAL |
8 | TIME_SPENT_GOAL |
9 | PAGE_VIEW_VIRTUAL_GOAL |
10 | FULLSTACK_CUSTOM_EVENT_GOAL |
Experiment Status
Status | Value | Description |
DRAFT | 1 | Experiment created but not published. |
RUNNING | 2 | The Experiment is live and receiving traffic. |
PAUSED | 3 | Experiment temporarily stopped; data collection paused. |
SCHEDULED | 6 | The Experiment is scheduled to start at a particular time. |
Common Parameters
Parameter | Type | Description |
portal_name | string | Portal identifier in the path. |
project_linkname | string | Unique link name for the project. |
experiment_key | string | Unique identifier for the experiment. |
variation_id | integer | Unique ID for a variation in an experiment. |
goal_id | integer | ID of the goal to be attached or removed. |