Goals
Goals
Return the list of the goals of the account environment
Prefix the token with 'Bearer ' to indicate it is a bearer token
The ID of the account
The ID of the environment
Index of the page
0Number of items per page
10Success
Not Found
GET /v1/accounts/{account_id}/account_environments/{account_environment_id}/goals HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Accept: */*
{
"current_item_count": 1,
"current_page": 0,
"total_count": 1,
"items_per_page": 10,
"last_page": 1,
"items": [
{
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
}
]
}Create a goal
Prefix the token with 'Bearer ' to indicate it is a bearer token
The ID of the account
The ID of the environment
Created
Validation errors
POST /v1/accounts/{account_id}/account_environments/{account_environment_id}/goals HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 74
{
"type": "transaction",
"label": "text",
"operator": "contains",
"value": "text"
}{
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
}Return one goal by its id
Prefix the token with 'Bearer ' to indicate it is a bearer token
The ID of the account
The ID of the environment
The ID of the goal
Success
Not Found
GET /v1/accounts/{account_id}/account_environments/{account_environment_id}/goals/{goal_id} HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Accept: */*
{
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
}Delete a goal by its id.
Prefix the token with 'Bearer ' to indicate it is a bearer token
The ID of the account
The ID of the environment
The ID of the goal
Deleted
Not Found
Conflict - Impossible to delete a goal linked to multiple campaigns
DELETE /v1/accounts/{account_id}/account_environments/{account_environment_id}/goals/{goal_id} HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Accept: */*
No content
Update goal informations - You can set only the properies you want to update in the request body.
Prefix the token with 'Bearer ' to indicate it is a bearer token
The ID of the account
The ID of the environment
The ID of the goal
ID of the goal
Label of the goal
Operator of the goal (for pageview, screenview types)
Value of the goal (for pageview, screenview types)
Updated
Validation errors
PATCH /v1/accounts/{account_id}/account_environments/{account_environment_id}/goals/{goal_id} HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 53
{
"label": "text",
"operator": "contains",
"value": "text"
}{
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
}Last updated
Was this helpful?

