# Questions

## Create a question

`client.Questions.New(ctx, body) (*QuestionUnion, error)`

**post** `/v5/questions`

Create a new question owned by the caller's account.

The question is one of six types selected by the required `question_type`
discriminator (categorical, rating, number, free_text, form, or timestamp),
and each type carries its own `configuration` block; `name` and `prompt`
are required for every type. Questions are the reusable units that are grouped
into question sets and referenced by rubrics, so create them before assembling
a question set. The created question is scoped to the caller's account and
records the creating identity. The question type and its configuration are set
at creation time and cannot be changed afterward through the update endpoint.

### Parameters

- `body QuestionNewParams`

  - `Question param.Field[QuestionNewParamsQuestionUnion]`

    - `type QuestionNewParamsQuestionCategorical struct{…}`

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

      - `Name string`

      - `Prompt string`

        user-facing question prompt

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

        Conditions for the question to be shown

      - `QuestionType string`

        - `const QuestionNewParamsQuestionCategoricalQuestionTypeCategorical QuestionNewParamsQuestionCategoricalQuestionType = "categorical"`

    - `type QuestionNewParamsQuestionRating struct{…}`

      - `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)

      - `Name string`

      - `Prompt string`

        user-facing question prompt

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

        Conditions for the question to be shown

      - `QuestionType string`

        - `const QuestionNewParamsQuestionRatingQuestionTypeRating QuestionNewParamsQuestionRatingQuestionType = "rating"`

    - `type QuestionNewParamsQuestionNumber struct{…}`

      - `Name string`

      - `Prompt string`

        user-facing question prompt

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

      - `QuestionType string`

        - `const QuestionNewParamsQuestionNumberQuestionTypeNumber QuestionNewParamsQuestionNumberQuestionType = "number"`

    - `type QuestionNewParamsQuestionFreeText struct{…}`

      - `Name string`

      - `Prompt string`

        user-facing question prompt

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

        Conditions for the question to be shown

      - `Configuration FreeTextQuestionConfiguration`

        - `MaxLength int64`

          Maximum characters allowed

        - `MinLength int64`

          Minimum characters required

      - `QuestionType string`

        - `const QuestionNewParamsQuestionFreeTextQuestionTypeFreeText QuestionNewParamsQuestionFreeTextQuestionType = "free_text"`

    - `type QuestionNewParamsQuestionForm struct{…}`

      - `Configuration FormQuestionConfiguration`

        - `FormSchema map[string, any]`

          The JSON schema of the desired form object

      - `Name string`

      - `Prompt string`

        user-facing question prompt

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

        Conditions for the question to be shown

      - `QuestionType string`

        - `const QuestionNewParamsQuestionFormQuestionTypeForm QuestionNewParamsQuestionFormQuestionType = "form"`

    - `type QuestionNewParamsQuestionTimestamp struct{…}`

      - `Name string`

      - `Prompt string`

        user-facing question prompt

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

        Conditions for the question to be shown

      - `Configuration TimestampQuestionConfiguration`

        - `Multi bool`

          Whether to allow multiple timestamps

      - `QuestionType string`

        - `const QuestionNewParamsQuestionTimestampQuestionTypeTimestamp QuestionNewParamsQuestionTimestampQuestionType = "timestamp"`

### 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"),
  )
  question, err := client.Questions.New(context.TODO(), sgpdev.QuestionNewParams{
    OfCategorical: &sgpdev.QuestionNewParamsQuestionCategorical{
      Configuration: sgpdev.CategoricalQuestionConfigurationParam{
        Choices: []string{"string"},
      },
      Name: "name",
      Prompt: "prompt",
      QuestionType: "categorical",
    },
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", question)
}
```

#### Response

```json
{
  "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"
}
```

## 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"
}
```

## Get a question

`client.Questions.Get(ctx, questionID) (*QuestionUnion, error)`

**get** `/v5/questions/{question_id}`

Retrieve a single question in the caller's account by its ID.

Both active and archived questions are returned; the archived state is
conveyed by the `archived_at` field on the response. The lookup is scoped to
the caller's account, and a question that does not exist within that account
results in a not-found error.

### Parameters

- `questionID 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"),
  )
  question, err := client.Questions.Get(context.TODO(), "question_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", question)
}
```

#### Response

```json
{
  "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"
}
```

## Update a question

`client.Questions.Update(ctx, questionID, body) (*QuestionUnion, error)`

**patch** `/v5/questions/{question_id}`

Update a question's display name.

Only the `name` is mutable through this endpoint; a question's type, prompt,
and type-specific configuration are fixed at creation and cannot be changed
here. Updating an archived question is rejected with a client error, so restore
it first if it needs to be edited. The update is scoped to the caller's account.

### Parameters

- `questionID string`

- `body QuestionUpdateParams`

  - `Name param.Field[string]`

    Display name for the question

### 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"),
  )
  question, err := client.Questions.Update(
    context.TODO(),
    "question_id",
    sgpdev.QuestionUpdateParams{
      Name: "x",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", question)
}
```

#### Response

```json
{
  "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"
}
```

## Archive a question

`client.Questions.Archive(ctx, questionID) (*QuestionUnion, error)`

**delete** `/v5/questions/{question_id}`

Soft-delete a question by setting its `archived_at` timestamp.

This is not a permanent delete: the row is retained and can be brought back
with the restore endpoint. Once archived, the question is excluded from list
results by default (unless `include_archived` is set) and can no longer be
updated until it is restored. The archived question is returned in the
response with its `archived_at` populated.

### Parameters

- `questionID 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"),
  )
  question, err := client.Questions.Archive(context.TODO(), "question_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", question)
}
```

#### Response

```json
{
  "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"
}
```

## Restore an archived question

`client.Questions.Restore(ctx, questionID) (*QuestionUnion, error)`

**post** `/v5/questions/{question_id}/restore`

Restore a previously archived question, reversing an archive.

This clears the question's `archived_at` timestamp, returning it to the
active state so it reappears in default listings and becomes editable again.
It is the inverse of the archive (DELETE) operation and is intended for
questions that were archived by mistake or are needed again.

### Parameters

- `questionID 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"),
  )
  question, err := client.Questions.Restore(context.TODO(), "question_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", question)
}
```

#### Response

```json
{
  "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"
}
```

## Domain Types

### Categorical Question

- `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"`

### Categorical Question Configuration

- `type CategoricalQuestionConfiguration struct{…}`

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

### Form Question

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

    - `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 FormQuestionObject`

    - `const FormQuestionObjectQuestion FormQuestionObject = "question"`

  - `QuestionType FormQuestionQuestionType`

    - `const FormQuestionQuestionTypeForm FormQuestionQuestionType = "form"`

### Form Question Configuration

- `type FormQuestionConfiguration struct{…}`

  - `FormSchema map[string, any]`

    The JSON schema of the desired form object

### Free Text Question

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

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

  - `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"`

### Free Text Question Configuration

- `type FreeTextQuestionConfiguration struct{…}`

  - `MaxLength int64`

    Maximum characters allowed

  - `MinLength int64`

    Minimum characters required

### Number Question

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

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

  - `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"`

### Number Question Configuration

- `type NumberQuestionConfiguration struct{…}`

  - `Max float64`

    Maximum value for the number

  - `Min float64`

    Minimum value for the number

### Question

- `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"`

### Rating Question

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

    - `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 RatingQuestionObject`

    - `const RatingQuestionObjectQuestion RatingQuestionObject = "question"`

  - `QuestionType RatingQuestionQuestionType`

    - `const RatingQuestionQuestionTypeRating RatingQuestionQuestionType = "rating"`

### Rating Question Configuration

- `type RatingQuestionConfiguration struct{…}`

  - `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)

### Timestamp Question

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

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

  - `Configuration TimestampQuestionConfiguration`

    - `Multi bool`

      Whether to allow multiple timestamps

  - `Object TimestampQuestionObject`

    - `const TimestampQuestionObjectQuestion TimestampQuestionObject = "question"`

  - `QuestionType TimestampQuestionQuestionType`

    - `const TimestampQuestionQuestionTypeTimestamp TimestampQuestionQuestionType = "timestamp"`

### Timestamp Question Configuration

- `type TimestampQuestionConfiguration struct{…}`

  - `Multi bool`

    Whether to allow multiple timestamps
