> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List

> Used to get a list of previously created campaigns. All campaigns may be returned or lists of campaign of a certain type if criteria are provided.

## OpenAPI

````json POST /list/campaign
{
  "openapi": "3.1.0",
  "info": {
    "title": "external-api",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.eu.xtremepush.com/api/external"
    }
  ],
  "paths": {
    "/list/campaign": {
      "post": {
        "summary": "List",
        "description": "Used to get a list of previously created campaigns. All campaigns may be returned or lists of campaign of a certain type if criteria are provided.",
        "operationId": "campaign-list",
        "deprecated": "false",
        "requestBody": {
          "required": "true",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apptoken"
                ],
                "properties": {
                  "apptoken": {
                    "type": "string",
                    "description": "Your App token"
                  },
                  "order": {
                    "type": "array",
                    "description": "Order the list in either ascending or descending order based on any of the attributes, eg. `[\"id ASC\", \"endtime\"]` or `[\"id DESC\", \"endtime\"]`",
                    "items": {
                      "type": "string"
                    }
                  },
                  "select": {
                    "type": "array",
                    "description": "Select what attributes to return, eg. `[\"id\", \"title\", \"text\"]`",
                    "items": {
                      "type": "string"
                    }
                  },
                  "condition": {
                    "type": "string",
                    "format": "json",
                    "description": "Filter the campaigns based on some criteria, eg. `[ [\"active\", \"=\" , 1] ]`"
                  },
                  "limit": {
                    "type": "integer",
                    "format": "int32",
                    "description": "Used with *offset* for pagination, eg. `\"limit\": 50, \"offset\": 0` returns a max of 50 results starting at position 0"
                  },
                  "offset": {
                    "type": "integer",
                    "format": "int32",
                    "description": "Used with *limit* for pagination"
                  }
                }
              },
              "examples": {
                "Get all campaigns paginated": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "limit": "50",
                    "offset": "0"
                  }
                },
                "Get all live campaigns": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "condition": [
                      [
                        "active",
                        "=",
                        "1"
                      ]
                    ],
                    "limit": "50",
                    "offset": "0"
                  }
                },
                "Get all automated campaigns": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "condition": [
                      [
                        "trigger",
                        ">",
                        "0"
                      ]
                    ],
                    "limit": "50",
                    "offset": "0"
                  }
                },
                "Get the most recently created campaign": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "order": [
                      "id DESC"
                    ],
                    "limit": "1",
                    "offset": "0"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "true",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "200",
                      "default": "0"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "CAMPAIGN_ID"
                          },
                          "project_id": {
                            "type": "string",
                            "example": "PROJECT_ID"
                          },
                          "category_id": {},
                          "type": {
                            "type": "integer",
                            "example": "2",
                            "default": "0"
                          },
                          "trigger": {
                            "type": "integer",
                            "example": "2",
                            "default": "0"
                          },
                          "send_type": {
                            "type": "integer",
                            "example": "2",
                            "default": "0"
                          },
                          "active": {
                            "type": "integer",
                            "example": "0",
                            "default": "0"
                          },
                          "title": {
                            "type": "string",
                            "example": "Inactive users onsite"
                          },
                          "ab": {
                            "type": "integer",
                            "example": "0",
                            "default": "0"
                          },
                          "languages_multi": {
                            "type": "integer",
                            "example": "1",
                            "default": "0"
                          },
                          "inbox": {
                            "type": "integer",
                            "example": "0",
                            "default": "0"
                          },
                          "email": {
                            "type": "integer",
                            "example": "0",
                            "default": "0"
                          },
                          "broadcast": {
                            "type": "integer",
                            "example": "0",
                            "default": "0"
                          },
                          "target_applications": {},
                          "timezone": {
                            "type": "string",
                            "example": "Europe/London"
                          },
                          "labels": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "integer",
                                  "example": "637",
                                  "default": "0"
                                },
                                "name": {
                                  "type": "string",
                                  "example": "Tests"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "true",
                      "code": "200",
                      "data": [
                        {
                          "id": "CAMPAIGN_ID",
                          "project_id": "PROJECT_ID",
                          "type": "2",
                          "trigger": "2",
                          "send_type": "2",
                          "active": "0",
                          "title": "Inactive users onsite",
                          "ab": "0",
                          "languages_multi": "1",
                          "inbox": "0",
                          "email": "0",
                          "broadcast": "0",
                          "timezone": "Europe/London",
                          "labels": [
                            {
                              "id": "637",
                              "name": "Tests"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "false",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "400",
                      "default": "0"
                    },
                    "message": {
                      "type": "string",
                      "example": "General error information"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "false",
                      "code": "400",
                      "message": "General error information",
                      "errors": [
                        {
                          "text": [
                            "Detailed information about the specific error"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Campaign Methods"
        ]
      }
    }
  }
}
````

