# Delete an option of a draft question

Remove one answer option from a question of a draft.

`DELETE /supplier-assessment-templates/{templateId}/questions/{questionId}/options/{optionId}`

Scope `supplier_template:write` | Plan **Growth+**

Remove one answer option from a question of a draft. The draft's `revision` is required, as an `If-Match` header or as `{"revision": N}` in an optional body of at most 4 KiB (otherwise 400 VALIDATION_FAILED). A choice question must keep two options (409 OPTION_MINIMUM_REACHED), and an option that another question's gating rule depends on cannot be deleted (409 OPTION_REFERENCED, the dependants are in `error.args.dependents`). Structural write: 30 per token and hour. Requires the supplier_template:write scope (or a signed-in Owner, Manager or Contributor session).

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `templateId` | string | yes | Questionnaire document id (`satpl_...`), or `satpl_builtin_supplier_security_privacy_v1` for the built-in one. |
| `questionId` | string | yes | Question id, as returned in `sections[].questions[].questionId`. |
| `optionId` | string | yes | Option id, as returned in `questions[].options[].optionId`. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `If-Match` | string | no | The draft revision as `W/"<revision>"`, from the ETag header. Wins over a `revision` in the body. A write on an older revision fails with 409 STALE_REVISION. pattern `^W/"[0-9]+"$` |

## Request body

- `revision`: optional integer minimum 0

## Returns

Status 204 with no response body.

## Errors

| Status | Code | Retry | Meaning |
|---|---|---|---|
| 400 | `VALIDATION_FAILED` | no | The JSON body does not match the request schema, or the revision is missing where required. code VALIDATION_FAILED. |
| 401 | `INVALID_TOKEN` | no | Missing (UNAUTHORIZED) or invalid, expired or revoked (INVALID_TOKEN) token. |
| 402 | `FEATURE_GATED` | no | The tenant plan does not include supply chain security. code FEATURE_GATED; args.feature, args.minTier, args.minTierName. |
| 403 | `INSUFFICIENT_SCOPE` | no | The token lacks supplier_template:write (INSUFFICIENT_SCOPE), has no accountable person (FORBIDDEN: this principal cannot edit questionnaires), or the target is the built-in questionnaire (BUILTIN_IMMUTABLE). |
| 404 | `QUESTION_NOT_FOUND` | no | Unknown questionnaire (NOT_FOUND), question (QUESTION_NOT_FOUND) or option (OPTION_NOT_FOUND). |
| 409 | `OPTION_MINIMUM_REACHED` | no | Everything in EditConflict, plus OPTION_MINIMUM_REACHED (a choice question keeps two options) and OPTION_REFERENCED (another question's gating rule depends on the option; args.dependents lists them). |
| 429 | `RATE_LIMITED` | yes | Too many failed authentication attempts from this address, or the token used its hourly write budget (30 structural, 120 field edits). code RATE_LIMITED; wait Retry-After seconds, also in error.args.retryAfterSeconds. |
| 500 | `DB_ERROR` | no | Unexpected server error. code DB_ERROR; quote error.id to support. |
| 503 | `BILLING_UNAVAILABLE` | yes | Billing is temporarily unavailable, so the plan could not be checked. code BILLING_UNAVAILABLE. Retry later. |

## Example

### curl

```bash
curl -X DELETE "https://api.autociso.io/api/v1/supplier-assessment-templates/<templateId>/questions/<questionId>/options/<optionId>" \
  -H "Authorization: Bearer <your-api-token>"
```

### Python

```python
import requests

response = requests.delete(
    "https://api.autociso.io/api/v1/supplier-assessment-templates/<templateId>/questions/<questionId>/options/<optionId>",
    headers={"Authorization": "Bearer <your-api-token>"},
)
print(response.status_code)
```

### JavaScript

```javascript
const response = await fetch("https://api.autociso.io/api/v1/supplier-assessment-templates/<templateId>/questions/<questionId>/options/<optionId>", {
  method: "DELETE",
  headers: { "Authorization": "Bearer <your-api-token>" },
});
console.log(response.status);
```
