# Auto priority

URL: /docs/developers/questions/priority

Every question has a priority from 1 to 100. The higher it is, the more often Orvelt picks it for a customer. With **Auto** on, Orvelt moves the priority after every answer, toward how much the question still needs answers: questions you already understand well get asked less, and questions with mixed or missing answers get asked more. [How questions are picked](/docs/research/how-questions-are-picked#how-auto-priority-learns) explains what moves it.

## Auto or manual [#auto-or-manual]

### When to leave Auto on [#when-to-leave-auto-on]

Leave it on for almost every question. It spreads your customers' attention across the library without you tuning anything, and it keeps learning as answers age.

### When to pin a priority [#when-to-pin-a-priority]

Turn Auto off when you need a fixed share of answers for a while, for example a question about a new menu during its launch week. Pinning a high priority raises the question's chance of being picked; it never forces it into every response, and it never overrides your plan's limits or the shared answer allowance.

**TypeScript SDK**

```ts
import { questions } from '@orvelt/business';

const result = await questions.update({
  projectId: 'PROJECT_ID',
  questionId: 'QUESTION_ID',
  priority: 80,
  isAutoPriority: false,
});

if (result.error) throw new Error(result.error.message);
```

**Python SDK**

```python
import os
from orvelt_business import Orvelt

with Orvelt(business_api_key=os.environ["ORVELT_BUSINESS_API_KEY"]) as client:
    result = client.questions.update(
        project_id="PROJECT_ID",
        question_id="QUESTION_ID",
        priority=80,
        is_auto_priority=False,
    )
```

Turn Auto back on with `isAutoPriority: true`. Switching modes keeps the current value and does not recalculate it right away: the next scored answer moves it.

## Edit a question [#edit-a-question]

### What happens to old answers [#what-happens-to-old-answers]

`questions.update` changes only `tags`, `isAutoTags`, `priority`, `isAutoPriority`, and `status`. Fields you leave out stay as they are, and you must send at least one. Question wording, answer configuration, and visibility cannot be updated.

### Create a wording version [#create-a-wording-version]

Send different wording to `questions.versions.create`, not to `questions.update`:

**TypeScript SDK**

```ts
import { questions } from '@orvelt/business';

const result = await questions.versions.create({
  projectId: 'PROJECT_ID',
  questionId: 'QUESTION_ID',
  question: 'What would improve your next visit?',
});

if (result.error) throw new Error(result.error.message);
```

**Python SDK**

```python
import os
from orvelt_business import Orvelt

with Orvelt(business_api_key=os.environ["ORVELT_BUSINESS_API_KEY"]) as client:
    result = client.questions.versions.create(
        project_id="PROJECT_ID",
        question_id="QUESTION_ID",
        question="What would improve your next visit?",
    )
```

**REST**

```http
POST /v1/project/PROJECT_ID/questions/QUESTION_ID/versions
x-api-key: YOUR_API_KEY
Content-Type: application/json

{
  "question": "What would improve your next visit?"
}
```

The new version belongs to the same question family and inherits its answer configuration, visibility, and omitted settings. It defaults to an archived draft, leaving the active version published. Send `status: 'active'` to publish it immediately, or activate its returned `question.id` later with `questions.update`. Only one version per family can be active; switching versions does not use another active-question allowance. Reusing earlier wording returns that existing version. Unchanged wording is rejected.

Answers already given, and customers already answering, keep the version they saw. To change the answer type, options, answer settings, or visibility, create a separate question.

## Retire a question [#retire-a-question]

### Archive instead of deleting [#archive-instead-of-deleting]

Set `status: 'archived'`, or call `questions.delete`, which archives too. Orvelt stops asking it, keeps every answer, and still lists it in [`questions.list`](/docs/developers/questions/results#see-your-question-library). Customers already answering it can finish.

**TypeScript SDK**

```ts
import { questions } from '@orvelt/business';

const result = await questions.delete({
  projectId: 'PROJECT_ID',
  questionId: 'QUESTION_ID',
});

if (result.error) throw new Error(result.error.message);
```

**Python SDK**

```python
import os
from orvelt_business import Orvelt

with Orvelt(business_api_key=os.environ["ORVELT_BUSINESS_API_KEY"]) as client:
    result = client.questions.delete(project_id="PROJECT_ID", question_id="QUESTION_ID")
```

Bring it back with `questions.update({ projectId, questionId, status: 'active' })`, within your plan's active-question limit. Archived questions keep their priority and do not move.