> ## 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.

# Bulk add items to Question Library

> # Description

Add multiple survey items to the question library.

# Payload

The endpoint receives an array with the multiple items to be added to the library.

```json
[
  {
    "item": {
        "type": "string",
        "subtype": "string",
        "frontendId": "number",
        "position": "number",
        "title": "string",
        "config": "object",
        "netquestId": "string",
        "netquestName": "string"
    },
    "name": "string",
    "questionPackage": "string",
    "locale": "string",
    "companyId": "string"
  }
]

 ```

- `name`: Item name that appears in the library. Required.
    
- `item`: See below for more information. Required
    
- `questionPackage`: Question package. Optional.
    
- `locale`: If present, the question will only be available to add if the project uses the same locale. Optional.
    
- `companyId`: Company the item is gonna belong to. If not present it will be created as a default item (usable by every user). Optional.
    

## Item

The item is the question to be added:

```json
{
    "type": "string",
    "subtype": "string",
    "config": {
        "isRequired": "boolean",
        "allowNA": "boolean",
        "minValue": "number",
        "maxValue": "number",
        "allowMultipleSelection": "boolean",
        "minResponses": "number",
        "maxResponses": "number"
    },
    "position": "number",
    "title": "string",
    "options": "array",
    "netquestId": "string",
    "netquestName": "string"
}

 ```

- `type`: The type of the item. Required. Possible values are:
    
    - `multiple:` Multiple choice question.
        
    - `input:` Numeric question.
        
- `subtype`: The subtype of the item. Required:
    
    - `text:` Only valid when type is multiple.
        
    - `number:` Only valid when type is input.
        
- `config:` Object containing item configurations.
    
    - `isRequired`: Whether the item is required or not. Required.
        
    - `allowNA`: Whether the item accepts N/A as an answer or not. Required.
        
    - `minValue`: Minimum value allowed for the answer of the question. Required for type: input, subtype: number.
        
    - `maxValue`: Maximum value allowed for the answer of the question. Required for type: input, subtype: number.
        
    - `allowMultipleSelection`: Whether or not the question allows to select multiple options. Required for type: multiple, subtype: text.
        
    - `minResponses`: Minimum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1. Required for type: multiple, subtype: text.
        
    - `maxResponses`: Maximum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1. Required for type: multiple, subtype: text.
        
    - `displayAs`: Value to determine how the item is going to be visualized in the survey. Supported values: `dropdown`or `list`. Required for type: multiple, subtype: text.
        
- `position`: The position of the item. Not in use. Required
    
- `title`: The title of the question.
    
- `netquestId`: Netquest identifier. Optional.
    
- `netquestName:` Netquest url variable name. Optional.
    

For each type of item, there can be more specific properties.

## Options

Options is an array of objects containing the options for the multiple choice question. It has the following structure:

```json
[
    {
        "label": "string",
        "position": "number",
        "netquestOptionValue": "string"
    }
]

 ```

- `label`: The label of the option. Required.
    
- `position`: The position of the option relative to the item. Required.
    
- `netquestOptionValue`: The value used to map to the question option when the answer for the question is passed as an url variable. Optional.
    

# Response

## 200 OK

> Array of created items 
  

```json
{
    "item": {
        "type": "string",
        "subtype": "string",
        "frontendId": "number",
        "position": "number",
        "title": "string",
        "config": "object"
    },
    "name": "string",
    "questionPackage": "string",
    "locale": "string",
    "companyId": "string",
    "isDefaultItem": "boolean",
    "isShared": "boolean"
}

 ```

where:

- `name`: Item name that appears in the library.
    
- `item`: See below for more information.
    
- `questionPackage`: Question package.
    
- `locale`: If present, the question will only be available to add if the project uses the same locale.
    
- `companyId`: Company the item is gonna belong to. If not present it will be created as a default item (usable by every user).
    
- `isDefaultItem`: Item is a default one or not.
    
- `isShared`: Item is shared for that company.
    

## Item

The item is the question to would be added in the project:

```json
{
    "type": "string",
    "subtype": "string",
    "config": {
        "isRequired": "boolean",
        "allowNA": "boolean",
        "minValue": "number",
        "maxValue": "number",
        "allowMultipleSelection": "boolean",
        "minResponses": "number",
        "maxResponses": "number"
    },
    "position": "number",
    "title": "string",
    "options": "array",
    "netquestId": "string",
    "netquestName": "string"
}

 ```

- `type`: The type of the item. Required. Possible values are:
    
    - `multiple:` Multiple choice question.
        
    - `input:` Numeric question.
        
- `subtype`: The subtype of the item. Required:
    
    - `text:` Only valid when type is multiple.
        
    - `number:` Only valid when type is input.
        
- `config:` Object containing item configurations.
    
    - `isRequired`: Whether the item is required or not.
        
    - `allowNA`: Whether the item accepts N/A as an answer or not.
        
    - `minValue`: Minimum value allowed for the answer of the question.
        
    - `maxValue`: Maximum value allowed for the answer of the question.
        
    - `allowMultipleSelection`: Whether or not the question allows to select multiple options.
        
    - `minResponses`: Minimum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1.
        
    - `maxResponses`: Maximum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1.
        
- `position`: The position of the item. Not in use.
    
- `title`: The title of the question.
    
- `netquestId`: Netquest identifier.
    
- `netquestName:` Netquest url variable name.
    

## Options

Options is an array of objects containing the options for the multiple choice question:

```json
[
    {
        "label": "string",
        "position": "number",
        "netquestOptionValue": "string"
    }
]

 ```

- `label`: The label of the option.
    
- `position`: The position of the option relative to the item.
    
- `netquestOptionValue`: The value used to map to the question option when the answer for the question is passed as an url variable.
    

## 401 Unauthorized

> The user is not authorized 
  

## 403 Forbidden

> The user doesn't have enough privileges to use this endpoint 
  
> The company is not enabled to perform this action 
  

## 500 Internal Server Error

> Error occurred while processing the request.

# Description

Add multiple survey items to the question library.

# Payload

The endpoint receives an array with the multiple items to be added to the library.

```json theme={null}
[
  {
    "item": {
        "type": "string",
        "subtype": "string",
        "frontendId": "number",
        "position": "number",
        "title": "string",
        "config": "object",
        "netquestId": "string",
        "netquestName": "string"
    },
    "name": "string",
    "questionPackage": "string",
    "locale": "string",
    "companyId": "string"
  }
]

```

* `name`: Item name that appears in the library. Required.

* `item`: See below for more information. Required

* `questionPackage`: Question package. Optional.

* `locale`: If present, the question will only be available to add if the project uses the same locale. Optional.

* `companyId`: Company the item is gonna belong to. If not present it will be created as a default item (usable by every user). Optional.

## Item

The item is the question to be added:

```json theme={null}
{
    "type": "string",
    "subtype": "string",
    "config": {
        "isRequired": "boolean",
        "allowNA": "boolean",
        "minValue": "number",
        "maxValue": "number",
        "allowMultipleSelection": "boolean",
        "minResponses": "number",
        "maxResponses": "number"
    },
    "position": "number",
    "title": "string",
    "options": "array",
    "netquestId": "string",
    "netquestName": "string"
}

```

* `type`: The type of the item. Required. Possible values are:

  * `multiple:` Multiple choice question.

  * `input:` Numeric question.

* `subtype`: The subtype of the item. Required:

  * `text:` Only valid when type is multiple.

  * `number:` Only valid when type is input.

* `config:` Object containing item configurations.

  * `isRequired`: Whether the item is required or not. Required.

  * `allowNA`: Whether the item accepts N/A as an answer or not. Required.

  * `minValue`: Minimum value allowed for the answer of the question. Required for type: input, subtype: number.

  * `maxValue`: Maximum value allowed for the answer of the question. Required for type: input, subtype: number.

  * `allowMultipleSelection`: Whether or not the question allows to select multiple options. Required for type: multiple, subtype: text.

  * `minResponses`: Minimum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1. Required for type: multiple, subtype: text.

  * `maxResponses`: Maximum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1. Required for type: multiple, subtype: text.

  * `displayAs`: Value to determine how the item is going to be visualized in the survey. Supported values: `dropdown`or `list`. Required for type: multiple, subtype: text.

* `position`: The position of the item. Not in use. Required

* `title`: The title of the question.

* `netquestId`: Netquest identifier. Optional.

* `netquestName:` Netquest url variable name. Optional.

For each type of item, there can be more specific properties.

## Options

Options is an array of objects containing the options for the multiple choice question. It has the following structure:

```json theme={null}
[
    {
        "label": "string",
        "position": "number",
        "netquestOptionValue": "string"
    }
]

```

* `label`: The label of the option. Required.

* `position`: The position of the option relative to the item. Required.

* `netquestOptionValue`: The value used to map to the question option when the answer for the question is passed as an url variable. Optional.

# Response

## 200 OK

> Array of created items

```json theme={null}
{
    "item": {
        "type": "string",
        "subtype": "string",
        "frontendId": "number",
        "position": "number",
        "title": "string",
        "config": "object"
    },
    "name": "string",
    "questionPackage": "string",
    "locale": "string",
    "companyId": "string",
    "isDefaultItem": "boolean",
    "isShared": "boolean"
}

```

where:

* `name`: Item name that appears in the library.

* `item`: See below for more information.

* `questionPackage`: Question package.

* `locale`: If present, the question will only be available to add if the project uses the same locale.

* `companyId`: Company the item is gonna belong to. If not present it will be created as a default item (usable by every user).

* `isDefaultItem`: Item is a default one or not.

* `isShared`: Item is shared for that company.

## Item

The item is the question to would be added in the project:

```json theme={null}
{
    "type": "string",
    "subtype": "string",
    "config": {
        "isRequired": "boolean",
        "allowNA": "boolean",
        "minValue": "number",
        "maxValue": "number",
        "allowMultipleSelection": "boolean",
        "minResponses": "number",
        "maxResponses": "number"
    },
    "position": "number",
    "title": "string",
    "options": "array",
    "netquestId": "string",
    "netquestName": "string"
}

```

* `type`: The type of the item. Required. Possible values are:

  * `multiple:` Multiple choice question.

  * `input:` Numeric question.

* `subtype`: The subtype of the item. Required:

  * `text:` Only valid when type is multiple.

  * `number:` Only valid when type is input.

* `config:` Object containing item configurations.

  * `isRequired`: Whether the item is required or not.

  * `allowNA`: Whether the item accepts N/A as an answer or not.

  * `minValue`: Minimum value allowed for the answer of the question.

  * `maxValue`: Maximum value allowed for the answer of the question.

  * `allowMultipleSelection`: Whether or not the question allows to select multiple options.

  * `minResponses`: Minimum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1.

  * `maxResponses`: Maximum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1.

* `position`: The position of the item. Not in use.

* `title`: The title of the question.

* `netquestId`: Netquest identifier.

* `netquestName:` Netquest url variable name.

## Options

Options is an array of objects containing the options for the multiple choice question:

```json theme={null}
[
    {
        "label": "string",
        "position": "number",
        "netquestOptionValue": "string"
    }
]

```

* `label`: The label of the option.

* `position`: The position of the option relative to the item.

* `netquestOptionValue`: The value used to map to the question option when the answer for the question is passed as an url variable.

## 401 Unauthorized

> The user is not authorized

## 403 Forbidden

> The user doesn't have enough privileges to use this endpoint

> The company is not enabled to perform this action

## 500 Internal Server Error

> Error occurred while processing the request.


## OpenAPI

````yaml POST /projects-api/v2/questionsLibrary/bulk
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:
  /projects-api/v2/questionsLibrary/bulk:
    post:
      summary: Bulk add items to Question Library
      description: >-
        # Description


        Add multiple survey items to the question library.


        # Payload


        The endpoint receives an array with the multiple items to be added to
        the library.


        ```json

        [
          {
            "item": {
                "type": "string",
                "subtype": "string",
                "frontendId": "number",
                "position": "number",
                "title": "string",
                "config": "object",
                "netquestId": "string",
                "netquestName": "string"
            },
            "name": "string",
            "questionPackage": "string",
            "locale": "string",
            "companyId": "string"
          }
        ]

         ```

        - `name`: Item name that appears in the library. Required.
            
        - `item`: See below for more information. Required
            
        - `questionPackage`: Question package. Optional.
            
        - `locale`: If present, the question will only be available to add if
        the project uses the same locale. Optional.
            
        - `companyId`: Company the item is gonna belong to. If not present it
        will be created as a default item (usable by every user). Optional.
            

        ## Item


        The item is the question to be added:


        ```json

        {
            "type": "string",
            "subtype": "string",
            "config": {
                "isRequired": "boolean",
                "allowNA": "boolean",
                "minValue": "number",
                "maxValue": "number",
                "allowMultipleSelection": "boolean",
                "minResponses": "number",
                "maxResponses": "number"
            },
            "position": "number",
            "title": "string",
            "options": "array",
            "netquestId": "string",
            "netquestName": "string"
        }

         ```

        - `type`: The type of the item. Required. Possible values are:
            
            - `multiple:` Multiple choice question.
                
            - `input:` Numeric question.
                
        - `subtype`: The subtype of the item. Required:
            
            - `text:` Only valid when type is multiple.
                
            - `number:` Only valid when type is input.
                
        - `config:` Object containing item configurations.
            
            - `isRequired`: Whether the item is required or not. Required.
                
            - `allowNA`: Whether the item accepts N/A as an answer or not. Required.
                
            - `minValue`: Minimum value allowed for the answer of the question. Required for type: input, subtype: number.
                
            - `maxValue`: Maximum value allowed for the answer of the question. Required for type: input, subtype: number.
                
            - `allowMultipleSelection`: Whether or not the question allows to select multiple options. Required for type: multiple, subtype: text.
                
            - `minResponses`: Minimum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1. Required for type: multiple, subtype: text.
                
            - `maxResponses`: Maximum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1. Required for type: multiple, subtype: text.
                
            - `displayAs`: Value to determine how the item is going to be visualized in the survey. Supported values: `dropdown`or `list`. Required for type: multiple, subtype: text.
                
        - `position`: The position of the item. Not in use. Required
            
        - `title`: The title of the question.
            
        - `netquestId`: Netquest identifier. Optional.
            
        - `netquestName:` Netquest url variable name. Optional.
            

        For each type of item, there can be more specific properties.


        ## Options


        Options is an array of objects containing the options for the multiple
        choice question. It has the following structure:


        ```json

        [
            {
                "label": "string",
                "position": "number",
                "netquestOptionValue": "string"
            }
        ]

         ```

        - `label`: The label of the option. Required.
            
        - `position`: The position of the option relative to the item. Required.
            
        - `netquestOptionValue`: The value used to map to the question option
        when the answer for the question is passed as an url variable. Optional.
            

        # Response


        ## 200 OK


        > Array of created items 
          

        ```json

        {
            "item": {
                "type": "string",
                "subtype": "string",
                "frontendId": "number",
                "position": "number",
                "title": "string",
                "config": "object"
            },
            "name": "string",
            "questionPackage": "string",
            "locale": "string",
            "companyId": "string",
            "isDefaultItem": "boolean",
            "isShared": "boolean"
        }

         ```

        where:


        - `name`: Item name that appears in the library.
            
        - `item`: See below for more information.
            
        - `questionPackage`: Question package.
            
        - `locale`: If present, the question will only be available to add if
        the project uses the same locale.
            
        - `companyId`: Company the item is gonna belong to. If not present it
        will be created as a default item (usable by every user).
            
        - `isDefaultItem`: Item is a default one or not.
            
        - `isShared`: Item is shared for that company.
            

        ## Item


        The item is the question to would be added in the project:


        ```json

        {
            "type": "string",
            "subtype": "string",
            "config": {
                "isRequired": "boolean",
                "allowNA": "boolean",
                "minValue": "number",
                "maxValue": "number",
                "allowMultipleSelection": "boolean",
                "minResponses": "number",
                "maxResponses": "number"
            },
            "position": "number",
            "title": "string",
            "options": "array",
            "netquestId": "string",
            "netquestName": "string"
        }

         ```

        - `type`: The type of the item. Required. Possible values are:
            
            - `multiple:` Multiple choice question.
                
            - `input:` Numeric question.
                
        - `subtype`: The subtype of the item. Required:
            
            - `text:` Only valid when type is multiple.
                
            - `number:` Only valid when type is input.
                
        - `config:` Object containing item configurations.
            
            - `isRequired`: Whether the item is required or not.
                
            - `allowNA`: Whether the item accepts N/A as an answer or not.
                
            - `minValue`: Minimum value allowed for the answer of the question.
                
            - `maxValue`: Maximum value allowed for the answer of the question.
                
            - `allowMultipleSelection`: Whether or not the question allows to select multiple options.
                
            - `minResponses`: Minimum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1.
                
            - `maxResponses`: Maximum amount of options that can be selected. If `allowMultipleSelection` is false this value should always be 1.
                
        - `position`: The position of the item. Not in use.
            
        - `title`: The title of the question.
            
        - `netquestId`: Netquest identifier.
            
        - `netquestName:` Netquest url variable name.
            

        ## Options


        Options is an array of objects containing the options for the multiple
        choice question:


        ```json

        [
            {
                "label": "string",
                "position": "number",
                "netquestOptionValue": "string"
            }
        ]

         ```

        - `label`: The label of the option.
            
        - `position`: The position of the option relative to the item.
            
        - `netquestOptionValue`: The value used to map to the question option
        when the answer for the question is passed as an url variable.
            

        ## 401 Unauthorized


        > The user is not authorized 
          

        ## 403 Forbidden


        > The user doesn't have enough privileges to use this endpoint 
          
        > The company is not enabled to perform this action 
          

        ## 500 Internal Server Error


        > Error occurred while processing the request.
      operationId: >-
        bulk-add-items-to-question-library-post-projects-api-v2-questionslibrary-bulk
      parameters:
        - name: Authorization
          in: header
          required: true
          description: Authorization token
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              - name: Library question 1
                item:
                  type: input
                  subtype: number
                  position: 1
                  title: <p>Question title</p>
                  config:
                    minValue: 1
                    maxValue: 10
                    isRequired: true
                    allowNA: false
                locale: spa_es
                questionPackage: numeric package
              - name: Library question 2
                item:
                  type: multiple
                  subtype: text
                  position: 1
                  title: <p>Question title 2</p>
                  config:
                    isRequired: true
                    allowNA: false
                    allowMultipleSelection: true
                    minResponses: 1
                    maxResponses: 3
                    displayAs: list
                  options:
                    - label: Option 1
                      position: 1
                    - label: Option 2
                      position: 2
                    - label: Option 3
                      position: 3
                    - label: Option 4
                      position: 4
                locale: spa_es
                questionPackage: multiple choice package
      responses:
        '200':
          description: Bulk add items to Question Library response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                - name: Library question 1
                  isDefaultItem: true
                  isShared: false
                  item:
                    type: input
                    subtype: number
                    position: 1
                    title: <p>Question title</p>
                    config:
                      minValue: 1
                      maxValue: 10
                      isRequired: true
                      allowNA: false
                  locale: spa_es
                  questionPackage: NUMERIC PACKAGE
                  _id: 672e7c9726573a37f1d6a14f
                  __v: 0
                  createdAt: '2024-11-08T21:03:19.608Z'
                  updatedAt: '2024-11-08T21:03:19.608Z'
                - name: Library question 2
                  isDefaultItem: true
                  isShared: false
                  item:
                    type: multiple
                    subtype: text
                    position: 1
                    title: <p>Question title 2</p>
                    config:
                      isRequired: true
                      allowNA: false
                      allowMultipleSelection: true
                      minResponses: 1
                      maxResponses: 3
                    options:
                      - label: Option 1
                        position: 1
                      - label: Option 2
                        position: 2
                      - label: Option 3
                        position: 3
                      - label: Option 4
                        position: 4
                  locale: spa_es
                  questionPackage: MULTIPLE CHOICE PACKAGE
                  _id: 672e7c9726573a37f1d6a150
                  __v: 0
                  createdAt: '2024-11-08T21:03:19.609Z'
                  updatedAt: '2024-11-08T21:03:19.609Z'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://sx-projects.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````