Endpoint and Authentication

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

List all segments

GET /api/segments?app=app_identifier

Query parameters

Property Type Description Default
app_identifier string The app for which you are requesting the list of segments. If omitted, the API returns all segments for all allowed apps -

Response

Status: 200 OK

{
  "success": true,
  "result": [
    {
      "identifier": "FASEGMT_ABCDEF",
      "name": "My Segment",
      "description": "",
      "app": "FAAPPLI_123456",
      "state": {
        "details": 1,
        "preview": 1
      },
      "segment_conf": {
        "operator": "AND",
        "blocks": [{
          "operator": "OR",
          "filters": [{
            "value": "activity",
            "options": [{
              "value": "last_app_usage",
              "options": [{
                "value": "happened"
              }, {
                "value": 9
              }]
            }]
          }]
        }]
      },
      "preview": {
        "people_number": 645,
        "people_percent": 0.42857,
        "push_percent": 0.5
      },
      "eligible_for_ab_testing": true,
      "snapshot_at": "2017-04-27T20:58:23.374Z"
    }
  ]
}

Status: 404 not found

{
    "status": "not_found",
    "success": false,
    "error_message": "Couldn't find App"
}