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

# List campaigns

> # Description

Get the list of all campaigns of the project.

## Response

The response is an array of campaign objects.

```json
[
    {
        "campaign": {
            "createdAt": "string",
            "id": "string",
            "name": "string",
            "language": "string",
            "addUnsubscribeLink": "boolean",
            "anonymizeResponses": "boolean",
            "checkQuotas": "boolean",
            "companyId": "string",
            "expirationDate": "number",
            "projectId": "string",
            "publicUrlHash": "string",
            "twitterUrlHash": "string",
            "linkedInUrlHash": "string",
            "facebookUrlHash": "string",
            "singleResponsePerUser": "boolean",
            "smsHasSurveyLink": "boolean",
            "smsHasUnsubscribeLink": "boolean",
            "smsTemplate": "string",
            "status": "string",
            "emailTemplate": {
                "body": "string",
                "email": "string",
                "replyTo": "string",
                "subject": "string",
            },
            "launchDate": "string",
            "scheduleDate": "string",
            "usesNewTemplate": "boolean",
            "quotas": "object",
            "panel": {
                "name": "string",
                "overQuotaUrl": "string",
                "qualifiedUrl": "string",
                "disqualifiedUrl": "string",
                "singleResponsePerPanelRespondent": "boolean",
                "variables": [
                  "string", "string", ...
                ]
            }
        }
    }
]
```

- `createdAt`: Date of creation of the folder in the format `YYYY-MM-DDTHH:mm:ss.SSSZ`.
- `id`: Id of the campaign created.
- `name`: Name of the campaign.
- `language`: Language code of the campaign.
- `addUnsubscribeLink`: Wether the unsubscribe link is included or not in the emails.
- `anonymizeResponses`: Wether the responses should be anonymized or not. If this option is set to `true`, no personal information is recorded.
- `checkQuotas`: Wether quotas are enabled or not.
- `companyId`: Id of the company owning the campaign.
- `expirationDate`: Unix timestamp (in milliseconds) of the expiration date.
- `projectId`: Id of the project that contains the campaign.
- `publicUrlHash`: Hash of the publick link of the survey.
- `twitterUrlHash`: Hash of the Twitter Url.
- `linkedInUrlHash`: Hash of the LinkedIn Url.
- `facebookUrlHash`: Hash of the Facebook Url.
- `singleResponsePerUser`: Wether we should prevent people from taking the survey more than once or not.
- `smsHasSurveyLink`: Wether the survey link is included in the SMS or not.
- `smsHasUnsubscribeLink`: Wether the unsubscribe link is included or not in the SMS.
- `smsTemplate`: The message of the SMS.
- `status`: Status of the campaign. Possible values are:
    - `draft`
    - `live`
    - `paused`
    - `closed`
    - `scheduled`
- `emailTemplate`
    - `body`: Body of the email.
    - `email`: Sender's email.
    - `replyTo`: Reply to email.
    - `subject`: Subject of the email.
- `launchDate`: Date of launch of the campaign in the format `YYYY-MM-DDTHH:mm:ss.SSSZ`. This field won't be present until you change the status of the campaign to `live`.
- `scheduleDate`: Scheduled date of launch of the campaign in the format `YYYY-MM-DDTHH:mm:ss.SSSZ`. This field won't be present until you schedule your campaign.
- `usesNewTemplate`: Always set to true. Needed for backward compatibility for email and SMS templates.
- `panel`: information about the panel provider:
    - `name`: name of the panel, just for user reference.
    - `overQuotaUrl`: Url to redirect to if the camapaign quotas are exceded.
    - `qualifiedUrl`: Url to redirect to when the user complete the survey successfully.
    - `disqualifiedUrl`: Url to redirect to when the user is disqualified by a screenout rule of the skip logic section.
    - `singleResponsePerPanelRespondent`: disable multiple responses per combination of panel variables, e.g. if someone submit with ID=1234 and name=User1, no one else can submit with those values, but with ID=1234 and name=User2 another user can submit once.
    - `variables`: list of variables that are going to be send by the url query from the panel. In case that a variable `RID` is added the rest of the variables are going to be ignore for the combination for uniqueness check, e.g. if someone submit with RID=1234 and name=User1, no one else can submit with that RID.




## Quotas

Quotas are only available for multiple choice and multiple choice image with single selection questions has the following structure:

```json
{
    "maxQuota": "number",
    "type": "string",
    "limits": {
        "[questionFrontendId]": {
            "isActive": "boolean",
            "nestedQuestions": "array",
            "options": "object",
        }
    }
}
```

- `maxQuota`: The overall quota
- `type`: Type of quota. Possible values are:
    - `percent`
    - `quantity`
- `limits`
    - `isActive`: Wether the quota is active in the question with id equal to `questionFrontendId` or not.
    - `nestedQuestions`: This field is only present if there are nested quotas present. It is an array of ids of the nested questions.

> Note: `questionFrontendId` can also be `conceptTestId`.

## Options

Options is an object with the following structure

```json
{
    "[optionFrontendId]": {
        "percent": "number",
        "quantity": "number"
    }
}
```

- `percent`: Available quota percentage for this item. It can also be null if this field is not filled.
- `quantity`: Available quota quantity for this item. It can also be null if this field is not filled.

> Note: When there are nested quotas, `optionFrontendId` will be like `"optionFrontendId1-optionFrontendId2-optionFrontendId3"`. That is, the ids of the options nested separated by a dash.

# Description

Get the list of all campaigns of the project.

## Response

The response is an array of campaign objects.

```json theme={null}
[
    {
        "campaign": {
            "createdAt": "string",
            "id": "string",
            "name": "string",
            "language": "string",
            "addUnsubscribeLink": "boolean",
            "anonymizeResponses": "boolean",
            "checkQuotas": "boolean",
            "companyId": "string",
            "expirationDate": "number",
            "projectId": "string",
            "publicUrlHash": "string",
            "twitterUrlHash": "string",
            "linkedInUrlHash": "string",
            "facebookUrlHash": "string",
            "singleResponsePerUser": "boolean",
            "smsHasSurveyLink": "boolean",
            "smsHasUnsubscribeLink": "boolean",
            "smsTemplate": "string",
            "status": "string",
            "emailTemplate": {
                "body": "string",
                "email": "string",
                "replyTo": "string",
                "subject": "string",
            },
            "launchDate": "string",
            "scheduleDate": "string",
            "usesNewTemplate": "boolean",
            "quotas": "object",
            "panel": {
                "name": "string",
                "overQuotaUrl": "string",
                "qualifiedUrl": "string",
                "disqualifiedUrl": "string",
                "singleResponsePerPanelRespondent": "boolean",
                "variables": [
                  "string", "string", ...
                ]
            }
        }
    }
]
```

* `createdAt`: Date of creation of the folder in the format `YYYY-MM-DDTHH:mm:ss.SSSZ`.
* `id`: Id of the campaign created.
* `name`: Name of the campaign.
* `language`: Language code of the campaign.
* `addUnsubscribeLink`: Wether the unsubscribe link is included or not in the emails.
* `anonymizeResponses`: Wether the responses should be anonymized or not. If this option is set to `true`, no personal information is recorded.
* `checkQuotas`: Wether quotas are enabled or not.
* `companyId`: Id of the company owning the campaign.
* `expirationDate`: Unix timestamp (in milliseconds) of the expiration date.
* `projectId`: Id of the project that contains the campaign.
* `publicUrlHash`: Hash of the publick link of the survey.
* `twitterUrlHash`: Hash of the Twitter Url.
* `linkedInUrlHash`: Hash of the LinkedIn Url.
* `facebookUrlHash`: Hash of the Facebook Url.
* `singleResponsePerUser`: Wether we should prevent people from taking the survey more than once or not.
* `smsHasSurveyLink`: Wether the survey link is included in the SMS or not.
* `smsHasUnsubscribeLink`: Wether the unsubscribe link is included or not in the SMS.
* `smsTemplate`: The message of the SMS.
* `status`: Status of the campaign. Possible values are:
  * `draft`
  * `live`
  * `paused`
  * `closed`
  * `scheduled`
* `emailTemplate`
  * `body`: Body of the email.
  * `email`: Sender's email.
  * `replyTo`: Reply to email.
  * `subject`: Subject of the email.
* `launchDate`: Date of launch of the campaign in the format `YYYY-MM-DDTHH:mm:ss.SSSZ`. This field won't be present until you change the status of the campaign to `live`.
* `scheduleDate`: Scheduled date of launch of the campaign in the format `YYYY-MM-DDTHH:mm:ss.SSSZ`. This field won't be present until you schedule your campaign.
* `usesNewTemplate`: Always set to true. Needed for backward compatibility for email and SMS templates.
* `panel`: information about the panel provider:
  * `name`: name of the panel, just for user reference.
  * `overQuotaUrl`: Url to redirect to if the camapaign quotas are exceded.
  * `qualifiedUrl`: Url to redirect to when the user complete the survey successfully.
  * `disqualifiedUrl`: Url to redirect to when the user is disqualified by a screenout rule of the skip logic section.
  * `singleResponsePerPanelRespondent`: disable multiple responses per combination of panel variables, e.g. if someone submit with ID=1234 and name=User1, no one else can submit with those values, but with ID=1234 and name=User2 another user can submit once.
  * `variables`: list of variables that are going to be send by the url query from the panel. In case that a variable `RID` is added the rest of the variables are going to be ignore for the combination for uniqueness check, e.g. if someone submit with RID=1234 and name=User1, no one else can submit with that RID.

## Quotas

Quotas are only available for multiple choice and multiple choice image with single selection questions has the following structure:

```json theme={null}
{
    "maxQuota": "number",
    "type": "string",
    "limits": {
        "[questionFrontendId]": {
            "isActive": "boolean",
            "nestedQuestions": "array",
            "options": "object",
        }
    }
}
```

* `maxQuota`: The overall quota
* `type`: Type of quota. Possible values are:
  * `percent`
  * `quantity`
* `limits`
  * `isActive`: Wether the quota is active in the question with id equal to `questionFrontendId` or not.
  * `nestedQuestions`: This field is only present if there are nested quotas present. It is an array of ids of the nested questions.

> Note: `questionFrontendId` can also be `conceptTestId`.

## Options

Options is an object with the following structure

```json theme={null}
{
    "[optionFrontendId]": {
        "percent": "number",
        "quantity": "number"
    }
}
```

* `percent`: Available quota percentage for this item. It can also be null if this field is not filled.
* `quantity`: Available quota quantity for this item. It can also be null if this field is not filled.

> Note: When there are nested quotas, `optionFrontendId` will be like `"optionFrontendId1-optionFrontendId2-optionFrontendId3"`. That is, the ids of the options nested separated by a dash.

##### Query Parameters

| Parameter | Description                                 | Required | Example |
| --------- | ------------------------------------------- | -------- | ------- |
| `filter`  | Filter to query the campaigns by project id | No       | —       |


## OpenAPI

````yaml GET /campaigns-service/v1/campaigns
openapi: 3.0.3
info:
  title: SightX API
  version: 1.0.0
  description: >-
    SightX REST API documentation. Most responses are JSON; some export
    endpoints return files. API access is a paid add-on — contact
    sales@sightx.io for details.
servers:
  - url: https://auth.admin.sightx.io
    description: Authentication (Production)
  - url: https://auth.staging-admin.sightx.io
    description: Authentication (Staging)
security:
  - AuthorizationHeader: []
paths:
  /campaigns-service/v1/campaigns:
    get:
      summary: List campaigns
      description: >-
        # Description


        Get the list of all campaigns of the project.


        ## Response


        The response is an array of campaign objects.


        ```json

        [
            {
                "campaign": {
                    "createdAt": "string",
                    "id": "string",
                    "name": "string",
                    "language": "string",
                    "addUnsubscribeLink": "boolean",
                    "anonymizeResponses": "boolean",
                    "checkQuotas": "boolean",
                    "companyId": "string",
                    "expirationDate": "number",
                    "projectId": "string",
                    "publicUrlHash": "string",
                    "twitterUrlHash": "string",
                    "linkedInUrlHash": "string",
                    "facebookUrlHash": "string",
                    "singleResponsePerUser": "boolean",
                    "smsHasSurveyLink": "boolean",
                    "smsHasUnsubscribeLink": "boolean",
                    "smsTemplate": "string",
                    "status": "string",
                    "emailTemplate": {
                        "body": "string",
                        "email": "string",
                        "replyTo": "string",
                        "subject": "string",
                    },
                    "launchDate": "string",
                    "scheduleDate": "string",
                    "usesNewTemplate": "boolean",
                    "quotas": "object",
                    "panel": {
                        "name": "string",
                        "overQuotaUrl": "string",
                        "qualifiedUrl": "string",
                        "disqualifiedUrl": "string",
                        "singleResponsePerPanelRespondent": "boolean",
                        "variables": [
                          "string", "string", ...
                        ]
                    }
                }
            }
        ]

        ```


        - `createdAt`: Date of creation of the folder in the format
        `YYYY-MM-DDTHH:mm:ss.SSSZ`.

        - `id`: Id of the campaign created.

        - `name`: Name of the campaign.

        - `language`: Language code of the campaign.

        - `addUnsubscribeLink`: Wether the unsubscribe link is included or not
        in the emails.

        - `anonymizeResponses`: Wether the responses should be anonymized or
        not. If this option is set to `true`, no personal information is
        recorded.

        - `checkQuotas`: Wether quotas are enabled or not.

        - `companyId`: Id of the company owning the campaign.

        - `expirationDate`: Unix timestamp (in milliseconds) of the expiration
        date.

        - `projectId`: Id of the project that contains the campaign.

        - `publicUrlHash`: Hash of the publick link of the survey.

        - `twitterUrlHash`: Hash of the Twitter Url.

        - `linkedInUrlHash`: Hash of the LinkedIn Url.

        - `facebookUrlHash`: Hash of the Facebook Url.

        - `singleResponsePerUser`: Wether we should prevent people from taking
        the survey more than once or not.

        - `smsHasSurveyLink`: Wether the survey link is included in the SMS or
        not.

        - `smsHasUnsubscribeLink`: Wether the unsubscribe link is included or
        not in the SMS.

        - `smsTemplate`: The message of the SMS.

        - `status`: Status of the campaign. Possible values are:
            - `draft`
            - `live`
            - `paused`
            - `closed`
            - `scheduled`
        - `emailTemplate`
            - `body`: Body of the email.
            - `email`: Sender's email.
            - `replyTo`: Reply to email.
            - `subject`: Subject of the email.
        - `launchDate`: Date of launch of the campaign in the format
        `YYYY-MM-DDTHH:mm:ss.SSSZ`. This field won't be present until you change
        the status of the campaign to `live`.

        - `scheduleDate`: Scheduled date of launch of the campaign in the format
        `YYYY-MM-DDTHH:mm:ss.SSSZ`. This field won't be present until you
        schedule your campaign.

        - `usesNewTemplate`: Always set to true. Needed for backward
        compatibility for email and SMS templates.

        - `panel`: information about the panel provider:
            - `name`: name of the panel, just for user reference.
            - `overQuotaUrl`: Url to redirect to if the camapaign quotas are exceded.
            - `qualifiedUrl`: Url to redirect to when the user complete the survey successfully.
            - `disqualifiedUrl`: Url to redirect to when the user is disqualified by a screenout rule of the skip logic section.
            - `singleResponsePerPanelRespondent`: disable multiple responses per combination of panel variables, e.g. if someone submit with ID=1234 and name=User1, no one else can submit with those values, but with ID=1234 and name=User2 another user can submit once.
            - `variables`: list of variables that are going to be send by the url query from the panel. In case that a variable `RID` is added the rest of the variables are going to be ignore for the combination for uniqueness check, e.g. if someone submit with RID=1234 and name=User1, no one else can submit with that RID.




        ## Quotas


        Quotas are only available for multiple choice and multiple choice image
        with single selection questions has the following structure:


        ```json

        {
            "maxQuota": "number",
            "type": "string",
            "limits": {
                "[questionFrontendId]": {
                    "isActive": "boolean",
                    "nestedQuestions": "array",
                    "options": "object",
                }
            }
        }

        ```


        - `maxQuota`: The overall quota

        - `type`: Type of quota. Possible values are:
            - `percent`
            - `quantity`
        - `limits`
            - `isActive`: Wether the quota is active in the question with id equal to `questionFrontendId` or not.
            - `nestedQuestions`: This field is only present if there are nested quotas present. It is an array of ids of the nested questions.

        > Note: `questionFrontendId` can also be `conceptTestId`.


        ## Options


        Options is an object with the following structure


        ```json

        {
            "[optionFrontendId]": {
                "percent": "number",
                "quantity": "number"
            }
        }

        ```


        - `percent`: Available quota percentage for this item. It can also be
        null if this field is not filled.

        - `quantity`: Available quota quantity for this item. It can also be
        null if this field is not filled.


        > Note: When there are nested quotas, `optionFrontendId` will be like
        `"optionFrontendId1-optionFrontendId2-optionFrontendId3"`. That is, the
        ids of the options nested separated by a dash.
      operationId: list-campaigns-get-campaigns-service-v1-campaigns
      parameters:
        - name: filter
          in: query
          required: false
          description: Filter to query the campaigns by project id
          schema:
            type: string
      responses:
        '200':
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://campaigns.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````