Endpoint and Authentication

Please refer to the API overview section to get the API endpoint, query format and authentication process.

This section of the documentation shows how to list, create and manage labels. Labels are separated into categories. The currently supported categories for labels are: segments, campaigns, funnels and locations.

Funnel Labels

List

GET /api/funnel_labels

Response

Status: 200 OK

{
  "success": true,
  "result": [
    {
      "name": "iOS",
      "targets": 3,
      "created_at": "2018-01-07T19:33:21.894Z"
    },
    {
      "name": "Android",
      "targets": 5,
      "created_at": "2018-01-07T19:34:26.163Z"
    },
    {
      "name": "Other label",
      "targets": 1,
      "created_at": "2018-01-04T10:51:38.402Z"
    },
  ]
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Create

POST /api/funnel_labels

Body Parameters

Property Type Description Default
name string A name for your label, to show on labelled targets (can include spaces) required

Example

{
    "name": "iOS",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "iOS",
    "targets": 0,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Update

PUT /api/funnel_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to rename required

Body Parameters

Property Type Description Default
new_name string The new name for your label required

Example

{
    "new_name": "Android",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Funnel label not found"
}

Delete

DELETE /api/funnel_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to delete required

Response

Status: 204 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Funnel label not found"
}

Segment Labels

List

GET /api/segment_labels

Response

Status: 200 OK

{
  "success": true,
  "result": [
    {
      "name": "iOS",
      "targets": 3,
      "created_at": "2018-01-07T19:33:21.894Z"
    },
    {
      "name": "Android",
      "targets": 5,
      "created_at": "2018-01-07T19:34:26.163Z"
    },
    {
      "name": "Other label",
      "targets": 1,
      "created_at": "2018-01-04T10:51:38.402Z"
    },
  ]
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Create

POST /api/segment_labels

Body Parameters

Property Type Description Default
name string A name for your label, to show on labelled targets (can include spaces) required

Example

{
    "name": "iOS",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "iOS",
    "targets": 0,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Update

PUT /api/segment_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to rename required

Body Parameters

Property Type Description Default
new_name string The new name for your label required

Example

{
    "new_name": "Android",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Segment label not found"
}

Delete

DELETE /api/segment_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to delete required

Response

Status: 204 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Segment label not found"
}

Location Labels

List

GET /api/location_labels

Response

Status: 200 OK

{
  "success": true,
  "result": [
    {
      "name": "iOS",
      "targets": 3,
      "created_at": "2018-01-07T19:33:21.894Z"
    },
    {
      "name": "Android",
      "targets": 5,
      "created_at": "2018-01-07T19:34:26.163Z"
    },
    {
      "name": "Other label",
      "targets": 1,
      "created_at": "2018-01-04T10:51:38.402Z"
    },
  ]
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Create

POST /api/location_labels

Body Parameters

Property Type Description Default
name string A name for your label, to show on labelled targets (can include spaces) required

Example

{
    "name": "iOS",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "iOS",
    "targets": 0,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Update

PUT /api/location_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to rename required

Body Parameters

Property Type Description Default
new_name string The new name for your label required

Example

{
    "new_name": "Android",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Location label not found"
}

Delete

DELETE /api/location_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to delete required

Response

Status: 204 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Location label not found"
}

Campaign Labels

List

GET /api/campaign_labels

Query Parameters

Property Type Description Default
app_identifier string If provided, the targets property will contain the number of campaigns for this application that contain each label. -

Response

Status: 200 OK

{
  "success": true,
  "result": [
    {
      "name": "iOS",
      "targets": 3,
      "created_at": "2018-01-07T19:33:21.894Z"
    },
    {
      "name": "Android",
      "targets": 5,
      "created_at": "2018-01-07T19:34:26.163Z"
    },
    {
      "name": "Other label",
      "targets": 1,
      "created_at": "2018-01-04T10:51:38.402Z"
    },
  ]
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Create

POST /api/campaign_labels

Body Parameters

Property Type Description Default
name string A name for your label, to show on labelled targets (can include spaces) required

Example

{
    "name": "iOS",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "iOS",
    "targets": 0,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Update

PUT /api/campaign_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to rename required

Body Parameters

Property Type Description Default
new_name string The new name for your label required

Example

{
    "new_name": "Android",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Campaign label not found"
}

Delete

DELETE /api/campaign_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to delete required

Response

Status: 204 OK

{
  "success": true,
  "result": {
    "name": "Android",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Campaign label not found"
}

Event Labels

List

GET /api/event_labels

Response

Status: 200 OK

{
  "success": true,
  "result": [
    {
      "name": "Event label 1",
      "targets": 3,
      "created_at": "2018-01-07T19:33:21.894Z"
    },
    {
      "name": "Event label 1",
      "targets": 5,
      "created_at": "2018-01-07T19:34:26.163Z"
    },
    {
      "name": "Other label",
      "targets": 1,
      "created_at": "2018-01-04T10:51:38.402Z"
    },
  ]
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Create

POST /api/event_labels

Body Parameters

Property Type Description Default
name string A name for your label, to show on labelled targets (can include spaces) required

Example

{
    "name": "Some event label",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "Some event label",
    "targets": 0,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Entity not found"
}

Update

PUT /api/event_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to rename required

Body Parameters

Property Type Description Default
new_name string The new name for your label required

Example

{
    "new_name": "New label",
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "name": "New label",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Event label not found"
}

Delete

DELETE /api/event_labels/name

Query Parameters

Property Type Description Default
name string The name of the label you want to delete required

Response

Status: 204 OK

{
  "success": true,
  "result": {
    "name": "Label",
    "targets": 3,
    "created_at": "2018-01-07T19:33:21.894Z"
  }
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Event label not found"
}