## Get Campaigns

This endpoint retrieves a list of all campaigns.

**API Call Sample:**

```shell curl
curl -i -X GET \
  -u '<username>:<password>' \
  'https://asia.stage.rubyplay.io/api/v1/campaign?type=FREE_ROUNDS&name=New%20Year%20Promo&externalCampaignId=New%20Year%20Promo&startDateFrom=2025-04-16&startDateTo=2029-05-16&gameId=rp_140&status=UPCOMING&paging.pageNumber=1&paging.pageSize=10&paging.sortBy=id&paging.order=ASCENDING'
```

```json 200 application/json
{
  "content": [
    {
      "id": 7,
      "type": "FREE_ROUNDS",
      "disabledAt": "2022-02-23T22:22:22Z",
      "status": "UPCOMING",
      "strategy": "FIRST_N_PLAYERS",
      "name": "New Year Promo",
      "externalCampaignId": "New Year Promo",
      "currencyCode": "UAH",
      "bet": 2.5,
      "betNumber": 77,
      "gameId": "rp_140",
      "gameIds": [
        "rp_140"
      ],
      "startDateTime": "2022-02-21T22:22:22Z",
      "endDateTime": "2022-02-22T22:22:22Z",
      "eligiblePlayersNumber": 777,
      "accomplishedPlayersNumber": 555,
      "roundsGiven": 100,
      "roundsPlayed": 55,
      "optOutPlayersNumber": 5
    }
  ],
  "total": 150,
  "_metadata": {
    "pagingInfo": {
      "pageNumber": 1,
      "pageSize": 10,
      "sortBy": "id",
      "order": "ASCENDING"
    },
    "totalNumberOfElements": 250
  }
}
```

```json 400 application/json
{
  "code": "REQUEST_NOT_VALID",
  "message": "Input param is not valid.",
  "timestamp": "2026-01-25T14:30:00Z",
  "path": "/api/v1/campaign"
}
```

```json 401 application/json
{
  "code": "NOT_AUTHORIZED",
  "message": "Authentication failed",
  "timestamp": "2026-01-25T14:30:00Z",
  "path": "/api/v1/campaign"
}
```

```json 403 application/json
{
  "code": "INSUFFICIENT_SCOPE",
  "message": "Insufficient scope to access this resource. Required: campaign:get",
  "timestamp": "2026-01-25T14:30:00Z",
  "path": "/api/v1/campaign"
}
```

```json 500 application/json
{
  "code": "UNKNOWN_ERROR",
  "message": "Something went wrong",
  "timestamp": "2026-01-25T14:30:00Z",
  "path": "/api/v1/campaign"
}
```

```json 504 application/json
{
  "code": "TIMEOUT",
  "message": "The server did not respond within the expected time",
  "timestamp": "2026-01-25T14:30:00Z",
  "path": "/api/v1/campaign"
}
```

**Query Parameters:**

```json
{
  "$ref": "#/components/schemas/CampaignFilterDto",
  "components": {
    "schemas": {
      "PagingInfo": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32",
            "default": 1,
            "description": "Page number",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "format": "int32",
            "default": 50,
            "description": "Page size",
            "example": 10
          },
          "sortBy": {
            "type": "string",
            "default": "id",
            "description": "Field to sort by",
            "example": "id"
          },
          "order": {
            "type": "string",
            "default": "ASCENDING",
            "description": "Sort order. Parameter for pagination. Possible values: ASCENDING, DESCENDING",
            "example": "ASCENDING"
          }
        }
      },
      "CampaignFilterDto": {
        "properties": {
          "type": {
            "type": "string",
            "default": "FREE_ROUNDS",
            "description": "Default value FREE_ROUNDS if absent. Possible values: FREE_ROUNDS, AWARDED_FEATURE",
            "enum": [
              "FREE_ROUNDS",
              "AWARDED_FEATURE"
            ],
            "example": "FREE_ROUNDS"
          },
          "name": {
            "type": "string",
            "description": "Campaign name",
            "example": "New Year Promo"
          },
          "externalCampaignId": {
            "type": "string",
            "description": "External campaign ID.",
            "example": "New Year Promo"
          },
          "startDateFrom": {
            "type": "string",
            "format": "date",
            "description": "Filters results to include items with a start date on or after this value.",
            "example": "2025-04-16"
          },
          "startDateTo": {
            "type": "string",
            "format": "date",
            "description": "Filters results to include items with a start date on or before this value.",
            "example": "2029-05-16"
          },
          "gameId": {
            "type": "string",
            "description": "Game ID.",
            "example": "rp_140"
          },
          "status": {
            "type": "string",
            "description": "Possible values: UPCOMING, ONGOING, ENDED, DISABLED",
            "enum": [
              "UPCOMING",
              "ONGOING",
              "ENDED",
              "DISABLED"
            ],
            "example": "UPCOMING"
          },
          "paging": {
            "$ref": "#/components/schemas/PagingInfo"
          }
        }
      }
    }
  }
}
```

**Response Schema:**

```json
{
  "$ref": "#/components/schemas/SearchResultCampaignViewDtoLong",
  "components": {
    "schemas": {
      "CampaignViewDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "ID of campaign.",
            "example": 7
          },
          "type": {
            "type": "string",
            "default": "FREE_ROUNDS",
            "description": "Possible values: FREE_ROUNDS, AWARDED_FEATURE",
            "enum": [
              "FREE_ROUNDS",
              "AWARDED_FEATURE"
            ],
            "example": "FREE_ROUNDS"
          },
          "disabledAt": {
            "type": "string",
            "format": "date-time",
            "description": "Campaign deactivation time in UTC. Stored with second precision.",
            "example": "2022-02-23T22:22:22Z"
          },
          "status": {
            "type": "string",
            "description": "Possible values: UPCOMING, ONGOING, ENDED, DISABLED.",
            "enum": [
              "UPCOMING",
              "ONGOING",
              "ENDED",
              "DISABLED"
            ],
            "example": "UPCOMING"
          },
          "strategy": {
            "type": "string",
            "deprecated": true,
            "description": "PLAYER_LIST or FIRST_N_PLAYERS.",
            "enum": [
              "PLAYER_LIST",
              "FIRST_N_PLAYERS"
            ],
            "example": "FIRST_N_PLAYERS"
          },
          "name": {
            "type": "string",
            "description": "Campaign name",
            "example": "New Year Promo"
          },
          "externalCampaignId": {
            "type": "string",
            "description": "External campaign ID",
            "example": "New Year Promo"
          },
          "currencyCode": {
            "type": "string",
            "description": "ISO 4217 3-letter currency code.",
            "example": "UAH"
          },
          "bet": {
            "type": "number",
            "description": "Size of a single bet in major currency units, e.g. 1.00 for 1 EUR. For free rounds will be any supported game bet. For awarded features will be the actual cost of the feature e.g. 1 EUR x 50 Multiplier = 50 EUR.",
            "example": 2.5
          },
          "betNumber": {
            "type": "integer",
            "format": "int32",
            "description": "Number of free bets/features for each participating player.",
            "example": 77
          },
          "gameId": {
            "type": "string",
            "deprecated": true,
            "description": "Game ID - DEPRECATED: Use gameIds field instead. This field will be removed in future API versions.",
            "example": "rp_140"
          },
          "gameIds": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A list of game IDs.",
              "example": "rp_140"
            },
            "uniqueItems": true
          },
          "startDateTime": {
            "type": "string",
            "format": "date-time",
            "description": "Campaign start time in UTC. Stored with second precision.",
            "example": "2022-02-21T22:22:22Z"
          },
          "endDateTime": {
            "type": "string",
            "format": "date-time",
            "description": "Campaign end time in UTC. Stored with second precision.",
            "example": "2022-02-22T22:22:22Z"
          },
          "eligiblePlayersNumber": {
            "type": "integer",
            "format": "int32",
            "description": "Maximum number of players that are eligible for this campaign (only for FIRST_N_PLAYERS)",
            "example": 777
          },
          "accomplishedPlayersNumber": {
            "type": "integer",
            "format": "int32",
            "description": "Number of players that either accepted this campaign or were added to it explicitly (PLAYER_LIST strategy).",
            "example": 555
          },
          "roundsGiven": {
            "type": "integer",
            "format": "int32",
            "description": "Total number of free bets given in the campaign.",
            "example": 100
          },
          "roundsPlayed": {
            "type": "integer",
            "format": "int32",
            "description": "Total number of free bets made in the campaign.",
            "example": 55
          },
          "optOutPlayersNumber": {
            "type": "integer",
            "format": "int32",
            "description": "Number of players that declined participation in the promotion.",
            "example": 5
          }
        }
      },
      "PagingInfo": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32",
            "default": 1,
            "description": "Page number",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "format": "int32",
            "default": 50,
            "description": "Page size",
            "example": 10
          },
          "sortBy": {
            "type": "string",
            "default": "id",
            "description": "Field to sort by",
            "example": "id"
          },
          "order": {
            "type": "string",
            "default": "ASCENDING",
            "description": "Sort order. Parameter for pagination. Possible values: ASCENDING, DESCENDING",
            "example": "ASCENDING"
          }
        }
      },
      "PagingMetadata": {
        "type": "object",
        "properties": {
          "pagingInfo": {
            "$ref": "#/components/schemas/PagingInfo",
            "description": "Current pagination parameters including page size and offset"
          },
          "totalNumberOfElements": {
            "type": "integer",
            "format": "int64",
            "description": "Total number of elements across all pages",
            "example": 250
          }
        }
      },
      "SearchResultCampaignViewDtoLong": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "description": "List of results matching the search criteria",
            "items": {
              "$ref": "#/components/schemas/CampaignViewDto"
            }
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total number of items available (not just in this page)",
            "example": 150
          },
          "_metadata": {
            "$ref": "#/components/schemas/PagingMetadata",
            "description": "Pagination metadata including current page information"
          }
        }
      }
    }
  }
}
```