Goals API Documentation Overview
The Goals API lets you define and manage conversion goals for your projects.
Goals are the primary metrics used to measure the success of experiments — such as completed purchases, signups, form submissions, or any user-defined custom events.
Use these endpoints to:
Create or delete project-level goals.
Fetch goal details.
Define and retrieve custom events tied to goals.
All operations in this API require valid OAuth authentication and are scoped at the project level.
Base URL
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 |
Best Practices
Always validate your payload against the API schema.
Use descriptive goal names for clarity in reports.
Store returned IDs (goal_id, event_id) securely for reuse in other endpoints.
Pre-requisites
Before working with the Goals API, ensure that you have the following information and understand the key identifiers used across all endpoints.
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 |
URL Match Types
When defining URLs for goal conditions (like goal_url or in url.match_type), these values control how the API interprets and matches the URL.
Value | Goal Type |
1 | SIMPLE_MATCH |
2 | EXACT_MATCH |
3 | PATTERN_MATCH |
4 | REGEX_MATCH |
5 | CONTAINS_MATCH |
6 | STARTS_WITH |
7 | ENDS_WITH |
8 | DOMAIN |
10 | URL_GROUP_MATCH |