## List questions

`client.Questions.List(ctx, query) (*CursorPage[QuestionUnion], error)`

**get** `/v5/questions`

Return a paginated list of the caller's account's questions.

Archived questions are excluded by default; set `include_archived` to true
to include them alongside active ones. Pass `ids` to restrict the result to
a specific set of question IDs. Results are paginated through the standard
pagination parameters. Use this to discover existing questions before adding
them to a question set, or to audit which questions have been archived.

### Parameters

- `query QuestionListParams`

  - `EndingBefore param.Field[string]`

  - `IDs param.Field[[]string]`

  - `IncludeArchived param.Field[bool]`

  - `Limit param.Field[int64]`

  - `SortBy param.Field[string]`

  - `SortOrder param.Field[SortOrder]`

  - `StartingAfter param.Field[string]`

### Returns

- `type QuestionUnion interface{…}`

  - `type CategoricalQuestion struct{…}`

    - `ID string`

      Unique identifier of the entity

    - `Configuration CategoricalQuestionConfiguration`

      - `Choices []string`

        Categorical answer choices (must contain at least one entry)

      - `Dropdown bool`

        Whether the question is displayed as a dropdown in the UI.

      - `Multi bool`

        Whether the question allows multiple answers.

    - `CreatedAt Time`

      ISO-timestamp when the entity was created

    - `CreatedBy Identity`

      The identity that created the entity.

      - `ID string`

      - `Type IdentityType`

        - `const IdentityTypeUser IdentityType = "user"`

        - `const IdentityTypeServiceAccount IdentityType = "service_account"`

      - `Object IdentityObject`

        - `const IdentityObjectIdentity IdentityObject = "identity"`

    - `Name string`

    - `Prompt string`

      user-facing question prompt

    - `ArchivedAt Time`

      ISO-timestamp when the entity was archived

    - `Conditions []map[string, any]`

      Conditions for the question to be shown

    - `Object CategoricalQuestionObject`

      - `const CategoricalQuestionObjectQuestion CategoricalQuestionObject = "question"`

    - `QuestionType CategoricalQuestionQuestionType`

      - `const CategoricalQuestionQuestionTypeCategorical CategoricalQuestionQuestionType = "categorical"`

  - `type RatingQuestion struct{…}`

    - `ID string`

      Unique identifier of the entity

    - `Configuration RatingQuestionConfiguration`

      - `MaxLabel string`

        Label shown for the maximum rating

      - `MinLabel string`

        Label shown for the minimum rating

      - `Steps int64`

        Number of discrete points on the scale (e.g., 5 for a 1–5 scale)

    - `CreatedAt Time`

      ISO-timestamp when the entity was created

    - `CreatedBy Identity`

      The identity that created the entity.

    - `Name string`

    - `Prompt string`

      user-facing question prompt

    - `ArchivedAt Time`

      ISO-timestamp when the entity was archived

    - `Conditions []map[string, any]`

      Conditions for the question to be shown

    - `Object RatingQuestionObject`

      - `const RatingQuestionObjectQuestion RatingQuestionObject = "question"`

    - `QuestionType RatingQuestionQuestionType`

      - `const RatingQuestionQuestionTypeRating RatingQuestionQuestionType = "rating"`

  - `type NumberQuestion struct{…}`

    - `ID string`

      Unique identifier of the entity

    - `CreatedAt Time`

      ISO-timestamp when the entity was created

    - `CreatedBy Identity`

      The identity that created the entity.

    - `Name string`

    - `Prompt string`

      user-facing question prompt

    - `ArchivedAt Time`

      ISO-timestamp when the entity was archived

    - `Conditions []map[string, any]`

      Conditions for the question to be shown

    - `Configuration NumberQuestionConfiguration`

      - `Max float64`

        Maximum value for the number

      - `Min float64`

        Minimum value for the number

    - `Object NumberQuestionObject`

      - `const NumberQuestionObjectQuestion NumberQuestionObject = "question"`

    - `QuestionType NumberQuestionQuestionType`

      - `const NumberQuestionQuestionTypeNumber NumberQuestionQuestionType = "number"`

  - `type FreeTextQuestion struct{…}`

    - `ID string`

      Unique identifier of the entity

    - `CreatedAt Time`

      ISO-timestamp when the entity was created

    - `CreatedBy Identity`

      The identity that created the entity.

    - `Name string`

    - `Prompt string`

      user-facing question prompt

    - `ArchivedAt Time`

      ISO-timestamp when the entity was archived

    - `Conditions []map[string, any]`

      Conditions for the question to be shown

    - `Configuration FreeTextQuestionConfiguration`

      - `MaxLength int64`

        Maximum characters allowed

      - `MinLength int64`

        Minimum characters required

    - `Object FreeTextQuestionObject`

      - `const FreeTextQuestionObjectQuestion FreeTextQuestionObject = "question"`

    - `QuestionType FreeTextQuestionQuestionType`

      - `const FreeTextQuestionQuestionTypeFreeText FreeTextQuestionQuestionType = "free_text"`

  - `type FormQuestion struct{…}`

    - `ID string`

      Unique identifier of the entity

    - `Configuration FormQuestionConfiguration`

      - `FormSchema map[string, any]`

        The JSON schema of the desired form object

    - `CreatedAt Time`

      ISO-timestamp when the entity was created

    - `CreatedBy Identity`

      The identity that created the entity.

    - `Name string`

    - `Prompt string`

      user-facing question prompt

    - `ArchivedAt Time`

      ISO-timestamp when the entity was archived

    - `Conditions []map[string, any]`

      Conditions for the question to be shown

    - `Object FormQuestionObject`

      - `const FormQuestionObjectQuestion FormQuestionObject = "question"`

    - `QuestionType FormQuestionQuestionType`

      - `const FormQuestionQuestionTypeForm FormQuestionQuestionType = "form"`

  - `type TimestampQuestion struct{…}`

    - `ID string`

      Unique identifier of the entity

    - `CreatedAt Time`

      ISO-timestamp when the entity was created

    - `CreatedBy Identity`

      The identity that created the entity.

    - `Name string`

    - `Prompt string`

      user-facing question prompt

    - `ArchivedAt Time`

      ISO-timestamp when the entity was archived

    - `Conditions []map[string, any]`

      Conditions for the question to be shown

    - `Configuration TimestampQuestionConfiguration`

      - `Multi bool`

        Whether to allow multiple timestamps

    - `Object TimestampQuestionObject`

      - `const TimestampQuestionObjectQuestion TimestampQuestionObject = "question"`

    - `QuestionType TimestampQuestionQuestionType`

      - `const TimestampQuestionQuestionTypeTimestamp TimestampQuestionQuestionType = "timestamp"`

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  page, err := client.Questions.List(context.TODO(), sgpdev.QuestionListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "configuration": {
        "choices": [
          "string"
        ],
        "dropdown": true,
        "multi": true
      },
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "type": "user",
        "object": "identity"
      },
      "name": "name",
      "prompt": "prompt",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "conditions": [
        {
          "foo": "bar"
        }
      ],
      "object": "question",
      "question_type": "categorical"
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}
```
