• iOS
  • Android
  • Windows
  • Web
  • Cordova
  • Unity
  • Adobe Air
  • Dashboard
  • API
  • Guides
  • FAQ
  • API > In-App Campaigns API

    GET - List In-App campaigns

    The list endpoint allows you to get an In-App campaign list.

    Request structure


    The In-App campaigns API exposes a GET endpoint at: https://api.batch.com/1.1/BATCH_API_KEY/in-app-campaigns/list

    Here are examples of valid cURL, PHP or Python requests syntax:

    curl -X GET "https://api.batch.com/1.1/BATCH_API_KEY/in-app-campaigns/list" \
    -H "Content-Type: application/json" \
    -H "X-Authorization: BATCH_REST_API_KEY"
    use GuzzleHttp\Client;
    $client = new Client();
    $response = $client->request("GET", "https://api.batch.com/1.1/BATCH_API_KEY/in-app-campaigns/list", [
        "headers" => [
            "Content-Type" => "application/json",
            "X-Authorization" => "BATCH_REST_API_KEY"
    import requests, json
    response = requests.request("GET", "https://api.batch.com/1.1/BATCH_API_KEY/in-app-campaigns/list", 
            'Content-Type': 'application/json'
            'X-Authorization': 'BATCH_REST_API_KEY'

    Get parameters

    fromInteger - Optional, Default : 0
    Value used for pagination : it indicates the offset of the first In-App campaign to be returned. In-App campaigns are ordered by creation date (from the most recent to the oldest).
    limitInteger - Optional, Default : 10, Max : 100
    Value that indicates the number of campaigns to be returned per API call.
    liveBoolean - Optional
    Allows to filter according to the campaign LIVE state. `true` will only return running or completed campaigns, whereas `false` will only return stopped and draft campaigns.
    from_apiBoolean - Optional
    Allows to filter according to the way that campaigns have been created. `true` will only return campaigns created with the API. `false` value will only return campaigns created from the dashboard. If you want all campaigns, omit this parameter.

    Here is an example of a valid CURL CLI request, which would return 5 live (running or completed) In-App campaigns created from the api, starting from the 10th campaign :

    curl -H "Content-Type: application/json" -H "X-Authorization: BATCH_REST_API_KEY" -X GET 


    In order to authenticate with the API, you need to provide your company REST API Key as the value of the X-Authorization header.



    If the GET to the API endpoint is successfull you will receive an HTTP 200 confirmation and information on your campaigns. The endpoint only returns basic information about campaigns. If you need more information about a campaign, use the GET endpoint using the campaign_token.

            "campaign_token": "70448bafec76439d534ec98ea7ab712c",
            "from_api": true,
            "dev_only": false,
            "created_date": "2018-08-13T10:11:38",
            "name": "In-App campaign name 1",
            "live": false,
            "end_date": "2018-10-31T17:30:00",
            "trigger": {
                "capping": 10,
                "when": "next_session",
                "grace_period": {
                    "every": 2,
                    "unit": "HOURS"
            "query": {
                "$or": [
                        "isNear(45.7583907,4.8347867,30km)": true
                        "countForLabel(e.label_data, 'example')": 0
            "campaign_token": "70448bafec76439d534ec98ea7ab712c",
            "from_api": true,
            "dev_only": false,
            "created_date": "2018-08-13T10:11:38",
            "name": "In-App campaign name 2",
            "live": false,
            "end_date": "2018-02-29T17:30:00",
            "trigger": {
                "when": "now",
                "grace_period": {
                    "every": 4,
                    "unit": "DAYS"


    If the GET data does not meet the API requirements you will receive an actionable error message. Contact us at support@batch.com if you need further support.

    • MALFORMED_PARAMETER (Http status code: 400, Error code: 31)
    • AUTHENTICATION_INVALID (Http status code: 401, Error code: 10)
    • ROUTE_NOT_FOUND (Http status code: 404, Error code: 20)
    • SERVER_ERROR (Http status code: 500, Error code: 0)