# Update Q&A item

URL: /en/docs/api/v1/knowledge-base/id/patch
Last Updated: 2026-07-30T21:15:30.109Z

## Description
No description available.

## Available Actions
- Execute PATCH request
- View request parameters
- View response schema
- Get code examples
- Navigate to related topics
- View step-by-step instructions
- Get best practices

## Content
### PATCH /api/v1/knowledge-base/{id}

**Update Q&A item**

Update a knowledge base Q&A item. When `locale` is omitted or resolves to the tenant default locale, base item fields are updated. When `locale` is a non-default enabled language, only localized `question`, `answer`, and `answer_md` content is updated; shared fields such as `tags` and `access_level` remain controlled by the base item. Send `intent=delete_translation` with a non-default locale to remove that localized content.

**Authentication:** Bearer token (`Authorization: Bearer <token>`)

**Path parameters:**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | Yes | Q&A item ID |

**Header parameters:**

| Name | Type | Required | Description |
|---|---|---|---|
| `x-locale` | KnowledgeBaseLocale (enum: en \| de \| fr) | No | Alternative locale selector when `locale` is not present in the query string or body. |

**Request body** (`application/json`) - required:

- `question` (string): Updated question text
- `answer` (string): Updated answer text
- `answer_md` (string): Updated markdown answer content
- `tags` (array of string): Tags for the base item. Ignored for non-default locale updates.
- `access_level` (enum: public | restricted | internal | requires_nda): Access level for the base item. Ignored for non-default locale updates.
- `locale` (KnowledgeBaseLocale (enum: en | de | fr))
- `intent` (enum: delete_translation): Delete localized content for the selected non-default locale.
- `variant_options` (array of string): Variant option IDs to assign this Q&A item to. Replaces all existing assignments. Only accepted on default-locale updates; supplying it on a non-default-locale (translation) update returns 400 with error `variant_options_default_locale_only`. Unknown or foreign option IDs return 400 with error `unknown_variant_options`. Option ownership is validated before any write; assignments are applied after the content update succeeds. If the content update succeeds but the assignment sync fails, the response is still 200 and includes `variant_assignments_warning: variant_assignments_failed` while omitting `variant_options`; an assignment-only update that fails to sync returns 500 with error `variant_assignments_failed`. On success the response echoes the assigned option IDs as `variant_options`.

Example (Update default-locale content and shared fields):

```json
{
  "locale": "en",
  "question": "What security certifications and compliance standards do you maintain?",
  "answer": "We maintain SOC 2 Type II, ISO 27001, and GDPR compliance certifications.",
  "answer_md": "We maintain **SOC 2 Type II**, **ISO 27001**, and GDPR compliance certifications.",
  "access_level": "public",
  "tags": [
    "security",
    "compliance"
  ]
}
```

Example (Update localized German content):

```json
{
  "locale": "de",
  "question": "Welche Sicherheitszertifizierungen haben Sie?",
  "answer": "Wir verfuegen ueber SOC 2 Type II und ISO 27001 Zertifizierungen.",
  "answer_md": "Wir verfuegen ueber **SOC 2 Type II** und **ISO 27001** Zertifizierungen."
}
```

Example (Delete localized German content):

```json
{
  "locale": "de",
  "intent": "delete_translation"
}
```

**Responses:**

- `200` - Q&A item or localized content updated successfully
  - `success` (boolean, required)
  - `data` (object, required)
    - `id` (string): Unique knowledge base item identifier
    - `question` (string): Question text for the selected locale
    - `answer` (string): Answer content for the selected locale. Supports Markdown.
    - `answer_md` (string): Markdown answer content for the selected locale when stored separately.
    - `access_level` (enum: public | restricted | internal | requires_nda): Shared access level for this Q&A item
    - `tags` (array of string): Shared tags for categorization
    - `id` (string): Knowledge base item ID
    - `translation` (KnowledgeBaseLocalizedContent (object))
      - `id` (string)
      - `languages_code` (object)
      - `question` (string)
      - `answer` (string)
      - `answer_md` (string)
    - `deletedTranslation` (object)
      - `id` (string)

  Example (Base item updated):
  
  ```json
  {
  "success": true,
  "data": {
    "id": "kb-123",
    "question": "What security certifications and compliance standards do you maintain?",
    "answer": "We maintain SOC 2 Type II, ISO 27001, and GDPR compliance certifications.",
    "answer_md": "We maintain **SOC 2 Type II**, **ISO 27001**, and GDPR compliance certifications.",
    "access_level": "public",
    "tags": [
      "security",
      "compliance"
    ]
  }
}
  ```

  Example (Localized content updated):
  
  ```json
  {
  "success": true,
  "data": {
    "id": "kb-123",
    "translation": {
      "id": "translation-456",
      "languages_code": "de-DE",
      "question": "Welche Sicherheitszertifizierungen haben Sie?",
      "answer": "Wir verfuegen ueber SOC 2 Type II und ISO 27001 Zertifizierungen.",
      "answer_md": "Wir verfuegen ueber **SOC 2 Type II** und **ISO 27001** Zertifizierungen."
    }
  }
}
  ```

  Example (Localized content deleted):
  
  ```json
  {
  "success": true,
  "data": {
    "id": "kb-123",
    "deletedTranslation": {
      "id": "translation-456"
    }
  }
}
  ```
- `400` - Bad Request - invalid ID, invalid body, disabled locale, or invalid translation delete request
  - `error` (string)

  Example (invalid_id):
  
  ```json
  {
  "error": "The knowledge base ID provided is not valid."
}
  ```

  Example (disabled_locale):
  
  ```json
  {
  "error": "Locale is not enabled."
}
  ```

  Example (default_locale_delete):
  
  ```json
  {
  "error": "Default locale content cannot be deleted as a translation."
}
  ```

  Example (variant_options_default_locale_only):
  
  ```json
  {
  "error": "variant_options_default_locale_only"
}
  ```

  Example (unknown_variant_options):
  
  ```json
  {
  "error": "unknown_variant_options"
}
  ```
- `401` - Unauthorized
  - `error` (string)
- `403` - Forbidden
  - `error` (string)
- `404` - Not found
  - `error` (string)
- `500` - Internal server error
  - `error` (string)

**Code samples:**

cURL:

```bash
curl -X PATCH "https://app.orbiqhq.com/api/v1/knowledge-base/kb-123" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "locale": "de",
    "question": "Welche Sicherheitszertifizierungen haben Sie?",
    "answer": "Wir verfuegen ueber SOC 2 Type II und ISO 27001 Zertifizierungen."
  }'
```

Fetch:

```JavaScript
const response = await fetch("https://app.orbiqhq.com/api/v1/knowledge-base/kb-123", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${accessToken}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    locale: "de",
    question: "Welche Sicherheitszertifizierungen haben Sie?",
    answer: "Wir verfuegen ueber SOC 2 Type II und ISO 27001 Zertifizierungen.",
  }),
});

const result = await response.json();
```

requests:

```Python
import requests

response = requests.patch(
    "https://app.orbiqhq.com/api/v1/knowledge-base/kb-123",
    headers={
        "Authorization": f"Bearer {access_token}",
        "Content-Type": "application/json",
    },
    json={
        "locale": "de",
        "question": "Welche Sicherheitszertifizierungen haben Sie?",
        "answer": "Wir verfuegen ueber SOC 2 Type II und ISO 27001 Zertifizierungen.",
    },
)
result = response.json()
```

