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