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

# Update question library item

> # Description

Update name, item, companyId and questionPackage field for the question.

# Params

- `questionId`: Question library id of the item to update
    

# Payload

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

 ```

where:

- `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. Send `null` if you want to remove the current locale value.
    
- `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.
        
- `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. Required when netquestId and netquestName are present in the item.
    

# Response

## 200 OK

> Returns the updated object. 
  

```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 that would be added to 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

Update name, item, companyId and questionPackage field for the question.

# Params

* `questionId`: Question library id of the item to update

# Payload

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

```

where:

* `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. Send `null` if you want to remove the current locale value.

* `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.

* `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. Required when netquestId and netquestName are present in the item.

# Response

## 200 OK

> Returns the updated object.

```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 that would be added to 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 PUT /projects-api/v2/questionsLibrary/update/{questionId}
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/update/{questionId}:
    put:
      summary: Update question library item
      description: >-
        # Description


        Update name, item, companyId and questionPackage field for the question.


        # Params


        - `questionId`: Question library id of the item to update
            

        # Payload


        ```json

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

         ```

        where:


        - `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. Send `null` if you want to
        remove the current locale value.
            
        - `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.
                
        - `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. Required
        when netquestId and netquestName are present in the item.
            

        # Response


        ## 200 OK


        > Returns the updated object. 
          

        ```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 that would be added to 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: >-
        update-question-library-item-put-projects-api-v2-questionslibrary-update-questionid
      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: 100
                  isRequired: true
                  allowNA: false
              locale: spa_es
              questionPackage: new numeric package
      responses:
        '200':
          description: Update question library item response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                _id: 673233def2fd6fc31d81955d
                name: Library question 1
                isDefaultItem: false
                isShared: true
                item:
                  type: input
                  subtype: number
                  position: 1
                  title: <p>Question title</p>
                  config:
                    minValue: 1
                    maxValue: 100
                    isRequired: true
                    allowNA: false
                locale: spa_es
                questionPackage: NEW NUMERIC PACKAGE
                __v: 0
                createdAt: '2024-11-11T16:42:06.329Z'
                updatedAt: '2024-11-11T16:42:06.329Z'
                companyId: null
        '204':
          description: Share library item
        '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.

````