Goals

Goals

Get goals of the account environment

get

Return the list of the goals of the account environment

Authorizations
Path parameters
account_idstringRequired

The ID of the account

account_environment_idstringRequired

The ID of the environment

Query parameters
_pageintegerOptional

Index of the page

Example: 0
_max_per_pageintegerOptional

Number of items per page

Example: 10
Responses
200

Success

application/json
Responseall of
get
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

post

Create a goal

Authorizations
Path parameters
account_idstringRequired

The ID of the account

account_environment_idstringRequired

The ID of the environment

Body
all ofOptional
Responses
201

Created

application/json
Responseall of
post
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"
}

Get one goal

get

Return one goal by its id

Authorizations
Path parameters
account_idstringRequired

The ID of the account

account_environment_idstringRequired

The ID of the environment

goal_idstringRequired

The ID of the goal

Responses
200

Success

application/json
Responseall of
get
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

delete

Delete a goal by its id.

Authorizations
Path parameters
account_idstringRequired

The ID of the account

account_environment_idstringRequired

The ID of the environment

goal_idstringRequired

The ID of the goal

Responses
204

Deleted

No content

delete
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 a goal

patch

Update goal informations - You can set only the properies you want to update in the request body.

Authorizations
Path parameters
account_idstringRequired

The ID of the account

account_environment_idstringRequired

The ID of the environment

goal_idstringRequired

The ID of the goal

Body
idstringRead-onlyOptional

ID of the goal

labelstringRequired

Label of the goal

operatorstring · enumOptional

Operator of the goal (for pageview, screenview types)

Possible values:
valuestringOptional

Value of the goal (for pageview, screenview types)

Responses
200

Updated

application/json
Responseall of
patch
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"
}

Was this helpful?