# Knowledge

URL: https://docs.dixa.io/openapi/dixa-api/v1/knowledge

## Get collection

Get a knowledge collection by id

### GET /v1/knowledge/collections/{collectionId}

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X GET 'https://dev.dixa.io/v1/knowledge/collections/{collectionId}' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 200 The knowledge collection

```json
{
  "data": {
    "id": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419",
    "title": "Test Collection",
    "description": "This is a test collection",
    "internalKbEnabled": true,
    "restrictions": {
      "isRestricted": true,
      "inheritedRestrictions": [
        {
          "fromCollection": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
        }
      ]
    }
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Get collection catalog

Get collection catalog, including all categories and articles

### GET /v1/knowledge/collections/{collectionId}/catalog

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X GET 'https://dev.dixa.io/v1/knowledge/collections/{collectionId}/catalog' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 200 The knowledge collection catalog

```json
{
  "data": {
    "categories": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "title": {
          "languageId": "en",
          "title": "Getting Started"
        },
        "categories": [
          {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "title": {
              "languageId": "en",
              "title": "Getting Started"
            },
            "categories": [],
            "articles": [
              {
                "id": "5f2640d8-631c-4472-8d48-3de0cfd21cd0",
                "title": {
                  "languageId": "en",
                  "title": "Getting Started"
                }
              }
            ]
          }
        ],
        "articles": [
          {
            "id": "5f2640d8-631c-4472-8d48-3de0cfd21cd0",
            "title": {
              "languageId": "en",
              "title": "Getting Started"
            }
          }
        ]
      }
    ],
    "articles": [
      {
        "id": "5f2640d8-631c-4472-8d48-3de0cfd21cd0",
        "title": {
          "languageId": "en",
          "title": "Getting Started"
        }
      }
    ]
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Get category

Get a knowledge category by id

### GET /v1/knowledge/categories/{categoryId}

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X GET 'https://dev.dixa.io/v1/knowledge/categories/{categoryId}' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 200 The category

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "title": {
      "languageId": "en",
      "title": "Getting Started"
    },
    "isDefaultLocation": true,
    "isLocked": false,
    "restrictions": {
      "isRestricted": true,
      "inheritedRestrictions": [
        {
          "fromCollection": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
        }
      ]
    },
    "parentCategory": "222e4567-e89b-12d3-a456-426614174111",
    "parentCollections": [
      "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
    ]
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Get category translations

Get the knowledge category translations

### GET /v1/knowledge/categories/{categoryId}/translations

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X GET 'https://dev.dixa.io/v1/knowledge/categories/{categoryId}/translations' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 200 The category translations

```json
{
  "data": {
    "titles": [
      {
        "languageId": "en",
        "title": "Getting Started"
      }
    ]
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Get article

Get a knowledge article by id

### GET /v1/knowledge/articles/{articleId}

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X GET 'https://dev.dixa.io/v1/knowledge/articles/{articleId}' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 200 The knowledge article

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "isDefaultLocation": true,
    "translation": {
      "draft": {
        "language": "en",
        "title": "Getting Started",
        "isIndexedVersion": true,
        "contents": {
          "html": "<p>HTML content</p>",
          "plaintext": "plaintext content"
        },
        "availableAt": {
          "helpCenterLinks": [
            {
              "id": "112b5b9c-926a-4338-8963-0dc73d29dec7",
              "name": "Dixa Help Center",
              "url": "https://help.dixa.com"
            }
          ]
        },
        "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
        "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
        "createdBy": "123e4567-e89b-12d3-a456-426614174000",
        "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
      },
      "published": {
        "language": "en",
        "title": "Getting Started",
        "isIndexedVersion": true,
        "contents": {
          "html": "<p>HTML content</p>",
          "plaintext": "plaintext content"
        },
        "availableAt": {
          "helpCenterLinks": [
            {
              "id": "112b5b9c-926a-4338-8963-0dc73d29dec7",
              "name": "Dixa Help Center",
              "url": "https://help.dixa.com"
            }
          ]
        },
        "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
        "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
        "createdBy": "123e4567-e89b-12d3-a456-426614174000",
        "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
      }
    },
    "tags": [
      "f6020a03-5a7a-4d9e-81e6-f1b76a855a5e"
    ],
    "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
    "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
    "indexedAt": "2021-12-01T12:46:36.581Z[GMT]",
    "createdBy": "123e4567-e89b-12d3-a456-426614174000",
    "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
    "ownedBy": "123e4567-e89b-12d3-a456-426614174000",
    "indexedBy": "123e4567-e89b-12d3-a456-426614174000",
    "restrictions": {
      "isRestricted": true,
      "inheritedRestrictions": [
        {
          "fromCollection": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
        }
      ]
    },
    "parentCategory": "123e4567-e89b-12d3-a456-426614174000",
    "parentCollections": [
      "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
    ]
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Delete article

Delete a knowledge article

### DELETE /v1/knowledge/articles/{articleId}

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X DELETE 'https://dev.dixa.io/v1/knowledge/articles/{articleId}' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 204

No body.

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Update article

Update a knowledge article

### PATCH /v1/knowledge/articles/{articleId}

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X PATCH 'https://dev.dixa.io/v1/knowledge/articles/{articleId}' \
  -H 'Authorization: <API token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "ownedBy": "123e4567-e89b-12d3-a456-426614174000",
  "tags": {
    "add": [
      "tag-id-1"
    ]
  },
  "preRelease": false
}'
```

#### Response examples

##### 200 The updated knowledge article

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "isDefaultLocation": true,
    "translation": {
      "draft": {
        "language": "en",
        "title": "Getting Started",
        "isIndexedVersion": true,
        "contents": {
          "html": "<p>HTML content</p>",
          "plaintext": "plaintext content"
        },
        "availableAt": {
          "helpCenterLinks": [
            {
              "id": "112b5b9c-926a-4338-8963-0dc73d29dec7",
              "name": "Dixa Help Center",
              "url": "https://help.dixa.com"
            }
          ]
        },
        "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
        "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
        "createdBy": "123e4567-e89b-12d3-a456-426614174000",
        "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
      },
      "published": {
        "language": "en",
        "title": "Getting Started",
        "isIndexedVersion": true,
        "contents": {
          "html": "<p>HTML content</p>",
          "plaintext": "plaintext content"
        },
        "availableAt": {
          "helpCenterLinks": [
            {
              "id": "112b5b9c-926a-4338-8963-0dc73d29dec7",
              "name": "Dixa Help Center",
              "url": "https://help.dixa.com"
            }
          ]
        },
        "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
        "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
        "createdBy": "123e4567-e89b-12d3-a456-426614174000",
        "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
      }
    },
    "tags": [
      "f6020a03-5a7a-4d9e-81e6-f1b76a855a5e"
    ],
    "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
    "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
    "indexedAt": "2021-12-01T12:46:36.581Z[GMT]",
    "createdBy": "123e4567-e89b-12d3-a456-426614174000",
    "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
    "ownedBy": "123e4567-e89b-12d3-a456-426614174000",
    "indexedBy": "123e4567-e89b-12d3-a456-426614174000",
    "restrictions": {
      "isRestricted": true,
      "inheritedRestrictions": [
        {
          "fromCollection": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
        }
      ]
    },
    "parentCategory": "123e4567-e89b-12d3-a456-426614174000",
    "parentCollections": [
      "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
    ]
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Get article translations

Get a knowledge article translations

### GET /v1/knowledge/articles/{articleId}/translations

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X GET 'https://dev.dixa.io/v1/knowledge/articles/{articleId}/translations' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 200 The article translations

```json
{
  "data": {
    "translations": {
      "draft": [
        {
          "language": "en",
          "title": "Getting Started",
          "isIndexedVersion": true,
          "contents": {
            "html": "<p>HTML content</p>",
            "plaintext": "plaintext content"
          },
          "availableAt": {
            "helpCenterLinks": [
              {
                "id": "112b5b9c-926a-4338-8963-0dc73d29dec7",
                "name": "Dixa Help Center",
                "url": "https://help.dixa.com"
              }
            ]
          },
          "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
          "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
          "createdBy": "123e4567-e89b-12d3-a456-426614174000",
          "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "published": [
        {
          "language": "en",
          "title": "Getting Started",
          "isIndexedVersion": true,
          "contents": {
            "html": "<p>HTML content</p>",
            "plaintext": "plaintext content"
          },
          "availableAt": {
            "helpCenterLinks": [
              {
                "id": "112b5b9c-926a-4338-8963-0dc73d29dec7",
                "name": "Dixa Help Center",
                "url": "https://help.dixa.com"
              }
            ]
          },
          "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
          "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
          "createdBy": "123e4567-e89b-12d3-a456-426614174000",
          "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
        }
      ]
    }
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Update article translations

Update translations for a knowledge article. Supports partial success.

### PATCH /v1/knowledge/articles/{articleId}/translations

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X PATCH 'https://dev.dixa.io/v1/knowledge/articles/{articleId}/translations' \
  -H 'Authorization: <API token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "translations": [
    {
      "languageId": "en",
      "title": "My Article",
      "content": "<p>Hello world</p>"
    }
  ]
}'
```

#### Response examples

##### 200 The updated translations, with partial errors if any

```json
{
  "data": [
    {
      "language": "en",
      "title": "Getting Started",
      "isIndexedVersion": true,
      "contents": {
        "html": "<p>HTML content</p>",
        "plaintext": "plaintext content"
      },
      "availableAt": {
        "helpCenterLinks": [
          {
            "id": "112b5b9c-926a-4338-8963-0dc73d29dec7",
            "name": "Dixa Help Center",
            "url": "https://help.dixa.com"
          }
        ]
      },
      "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
      "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
      "createdBy": "123e4567-e89b-12d3-a456-426614174000",
      "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
    }
  ]
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Create article

Create a knowledge article

### POST /v1/knowledge/articles

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X POST 'https://dev.dixa.io/v1/knowledge/articles' \
  -H 'Authorization: <API token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "translations": [
    {
      "languageId": "en",
      "title": "My Article",
      "content": "<p>Content</p>"
    }
  ],
  "parentId": "123e4567-e89b-12d3-a456-426614174000",
  "tags": [
    "f6020a03-5a7a-4d9e-81e6-f1b76a855a5e"
  ],
  "preRelease": false
}'
```

#### Response examples

##### 200 The created knowledge article

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "isDefaultLocation": true,
    "translation": {
      "draft": {
        "language": "en",
        "title": "Getting Started",
        "isIndexedVersion": true,
        "contents": {
          "html": "<p>HTML content</p>",
          "plaintext": "plaintext content"
        },
        "availableAt": {
          "helpCenterLinks": [
            {
              "id": "112b5b9c-926a-4338-8963-0dc73d29dec7",
              "name": "Dixa Help Center",
              "url": "https://help.dixa.com"
            }
          ]
        },
        "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
        "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
        "createdBy": "123e4567-e89b-12d3-a456-426614174000",
        "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
      },
      "published": {
        "language": "en",
        "title": "Getting Started",
        "isIndexedVersion": true,
        "contents": {
          "html": "<p>HTML content</p>",
          "plaintext": "plaintext content"
        },
        "availableAt": {
          "helpCenterLinks": [
            {
              "id": "112b5b9c-926a-4338-8963-0dc73d29dec7",
              "name": "Dixa Help Center",
              "url": "https://help.dixa.com"
            }
          ]
        },
        "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
        "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
        "createdBy": "123e4567-e89b-12d3-a456-426614174000",
        "updatedBy": "123e4567-e89b-12d3-a456-426614174000"
      }
    },
    "tags": [
      "f6020a03-5a7a-4d9e-81e6-f1b76a855a5e"
    ],
    "createdAt": "2021-12-01T12:46:36.581Z[GMT]",
    "updatedAt": "2021-12-01T12:46:36.581Z[GMT]",
    "indexedAt": "2021-12-01T12:46:36.581Z[GMT]",
    "createdBy": "123e4567-e89b-12d3-a456-426614174000",
    "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
    "ownedBy": "123e4567-e89b-12d3-a456-426614174000",
    "indexedBy": "123e4567-e89b-12d3-a456-426614174000",
    "restrictions": {
      "isRestricted": true,
      "inheritedRestrictions": [
        {
          "fromCollection": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
        }
      ]
    },
    "parentCategory": "123e4567-e89b-12d3-a456-426614174000",
    "parentCollections": [
      "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
    ]
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Create category

Create a knowledge category. Every category belongs to a collection: pass a collection ID as `parentId` to create a top-level category, or a category ID to create a subcategory

### POST /v1/knowledge/categories

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X POST 'https://dev.dixa.io/v1/knowledge/categories' \
  -H 'Authorization: <API token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "translations": [
    {
      "languageId": "en",
      "title": "Getting Started"
    }
  ],
  "parentId": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
}'
```

#### Response examples

##### 200 The created knowledge category

```json
{
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "title": {
      "languageId": "en",
      "title": "Getting Started"
    },
    "isDefaultLocation": true,
    "isLocked": false,
    "restrictions": {
      "isRestricted": true,
      "inheritedRestrictions": [
        {
          "fromCollection": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
        }
      ]
    },
    "parentCategory": "222e4567-e89b-12d3-a456-426614174111",
    "parentCollections": [
      "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
    ]
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## List collections

Paginated list knowledge collections

### GET /v1/knowledge/collections

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X GET 'https://dev.dixa.io/v1/knowledge/collections' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 200 A list of knowledge collections

```json
{
  "data": [
    {
      "id": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419",
      "title": "Test Collection",
      "description": "This is a test collection",
      "internalKbEnabled": true,
      "restrictions": {
        "isRestricted": true,
        "inheritedRestrictions": [
          {
            "fromCollection": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
          }
        ]
      }
    }
  ]
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Create collection

Create a knowledge collection

### POST /v1/knowledge/collections

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X POST 'https://dev.dixa.io/v1/knowledge/collections' \
  -H 'Authorization: <API token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "Test Collection",
  "description": "This is a test collection",
  "internalKbEnabled": true
}'
```

#### Response examples

##### 200 The created knowledge collection

```json
{
  "data": {
    "id": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419",
    "title": "Test Collection",
    "description": "This is a test collection",
    "internalKbEnabled": true,
    "restrictions": {
      "isRestricted": true,
      "inheritedRestrictions": [
        {
          "fromCollection": "78dfb531-2e1e-4ffc-bd18-fdad68cd2419"
        }
      ]
    }
  }
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Publish translation

Publish a specific translation for search

### POST /v1/knowledge/articles/{articleId}/translations/{languageId}/publish

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X POST 'https://dev.dixa.io/v1/knowledge/articles/{articleId}/translations/{languageId}/publish' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 204

No body.

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Unpublish translation

Mark a specific translation as unpublished

### POST /v1/knowledge/articles/{articleId}/translations/{languageId}/unpublish

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X POST 'https://dev.dixa.io/v1/knowledge/articles/{articleId}/translations/{languageId}/unpublish' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 204

No body.

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Delete article translation

Delete all versions of a knowledge article translation

### DELETE /v1/knowledge/articles/{articleId}/translations/{languageId}

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X DELETE 'https://dev.dixa.io/v1/knowledge/articles/{articleId}/translations/{languageId}' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 204

No body.

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Publish article

Publish a new version of all translations for a knowledge article

### POST /v1/knowledge/articles/{articleId}/publish

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X POST 'https://dev.dixa.io/v1/knowledge/articles/{articleId}/publish' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 204

No body.

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Unpublish article

Remove all translations of a knowledge article from search

### POST /v1/knowledge/articles/{articleId}/unpublish

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X POST 'https://dev.dixa.io/v1/knowledge/articles/{articleId}/unpublish' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 204

No body.

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Move article

Move a knowledge article to a new parent

### PATCH /v1/knowledge/articles/{articleId}/parent/{parentId}

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X PATCH 'https://dev.dixa.io/v1/knowledge/articles/{articleId}/parent/{parentId}' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 204

No body.

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Remove article parent

Remove a parent from a knowledge article

### DELETE /v1/knowledge/articles/{articleId}/parent

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

```bash
curl -X DELETE 'https://dev.dixa.io/v1/knowledge/articles/{articleId}/parent' \
  -H 'Authorization: <API token>'
```

#### Response examples

##### 204

No body.

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## Upload article attachments

Upload one or more image files to be used as attachments in knowledge articles. Supported formats: image/png, image/jpeg, image/gif, image/webp. Maximum 5 files per request, 4 MB per file, with a total request payload limit of 10 MB. Supports partial success.

### POST /v1/knowledge/articles/attachments

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

#### Request example

_Generated from the schema; the spec has no example._

```bash
curl -X POST 'https://dev.dixa.io/v1/knowledge/articles/attachments' \
  -H 'Authorization: <API token>' \
  -F 'files=@<file>'
```

#### Response examples

##### 200 The uploaded attachments, with partial errors if any

Every uploaded file was accepted:

```json
{
  "data": [
    {
      "originalFilename": "logo.png",
      "url": "https://cdn.example.com/images/org-id/uuid.png"
    },
    {
      "originalFilename": "banner.jpg",
      "url": "https://cdn.example.com/images/org-id/uuid2.jpg"
    }
  ],
  "partialErrors": []
}
```

Some files succeeded; others failed validation (400) or upload (500):

```json
{
  "data": [
    {
      "originalFilename": "logo.png",
      "url": "https://cdn.example.com/images/org-id/uuid.png"
    }
  ],
  "partialErrors": [
    {
      "originalFilename": "note.txt",
      "message": "Unsupported MIME type 'text/plain'. Allowed: image/gif, image/jpeg, image/png, image/webp",
      "code": 400
    },
    {
      "originalFilename": "huge.png",
      "message": "File exceeds 4 MB size limit",
      "code": 400
    },
    {
      "originalFilename": "hero.png",
      "message": "Upload failed due to unexpected error",
      "code": 500
    }
  ]
}
```

##### 400

```json
{
  "message": "Decoding failure in request"
}
```

##### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## OpenAPI definition

The operations and the schemas used, from the full spec at https://docs.dixa.io/openapi-specs/dixa-v1.yaml. Request and response examples are above.

```yaml
openapi: 3.0.3
info:
  title: Dixa API
  version: v1
servers:
  - url: https://dev.dixa.io
security:
  - ApiKeyAuth: []
paths:
  /v1/knowledge/collections/{collectionId}:
    get:
      tags:
        - Knowledge
      summary: Get collection
      description: Get a knowledge collection by id
      operationId: getKnowledgeCollectionsCollectionid
      parameters:
        - name: collectionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: The knowledge collection
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetKnowledgeCollectionOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
  /v1/knowledge/collections/{collectionId}/catalog:
    get:
      tags:
        - Knowledge
      summary: Get collection catalog
      description: Get collection catalog, including all categories and articles
      operationId: getKnowledgeCollectionsCollectionidCatalog
      parameters:
        - name: collectionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: language
          in: query
          description: Language in which the article translations will be returned. If not
            provided, the default language will be used.
          required: false
          schema:
            type: string
      responses:
        "200":
          description: The knowledge collection catalog
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetKnowledgeCollectionCatalogOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
  /v1/knowledge/categories/{categoryId}:
    get:
      tags:
        - Knowledge
      summary: Get category
      description: Get a knowledge category by id
      operationId: getKnowledgeCategoriesCategoryid
      parameters:
        - name: categoryId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: language
          in: query
          description: Language in which the article translations will be returned. If not
            provided, the default language will be used.
          required: false
          schema:
            type: string
      responses:
        "200":
          description: The category
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetKnowledgeCategoryOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
  /v1/knowledge/categories/{categoryId}/translations:
    get:
      tags:
        - Knowledge
      summary: Get category translations
      description: Get the knowledge category translations
      operationId: getKnowledgeCategoriesCategoryidTranslations
      parameters:
        - name: categoryId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: The category translations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetKnowledgeCategoryTranslationsOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
  /v1/knowledge/articles/{articleId}:
    get:
      tags:
        - Knowledge
      summary: Get article
      description: Get a knowledge article by id
      operationId: getKnowledgeArticlesArticleid
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: language
          in: query
          description: Language in which the article translations will be returned. If not
            provided, the default language will be used.
          required: false
          schema:
            type: string
      responses:
        "200":
          description: The knowledge article
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetKnowledgeArticleOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
    delete:
      tags:
        - Knowledge
      summary: Delete article
      description: Delete a knowledge article
      operationId: deleteKnowledgeArticlesArticleid
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "204":
          description: ""
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
    patch:
      tags:
        - Knowledge
      summary: Update article
      description: Update a knowledge article
      operationId: patchKnowledgeArticlesArticleid
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: The knowledge article fields to update
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateKnowledgeArticleInput"
        required: true
      responses:
        "200":
          description: The updated knowledge article
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateKnowledgeArticleOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/articles/{articleId}/translations:
    get:
      tags:
        - Knowledge
      summary: Get article translations
      description: Get a knowledge article translations
      operationId: getKnowledgeArticlesArticleidTranslations
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: The article translations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetKnowledgeArticleTranslationsOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
    patch:
      tags:
        - Knowledge
      summary: Update article translations
      description: Update translations for a knowledge article. Supports partial success.
      operationId: patchKnowledgeArticlesArticleidTranslations
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: The translations to update for the article
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTranslationsInput"
        required: true
      responses:
        "200":
          description: The updated translations, with partial errors if any
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateTranslationsOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/articles:
    post:
      tags:
        - Knowledge
      summary: Create article
      description: Create a knowledge article
      operationId: postKnowledgeArticles
      requestBody:
        description: The knowledge article to create
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateKnowledgeArticleInput"
        required: true
      responses:
        "200":
          description: The created knowledge article
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateKnowledgeArticleOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/categories:
    post:
      tags:
        - Knowledge
      summary: Create category
      description: "Create a knowledge category. Every category belongs to a
        collection: pass a collection ID as `parentId` to create a top-level
        category, or a category ID to create a subcategory"
      operationId: postKnowledgeCategories
      requestBody:
        description: The knowledge category to create
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateKnowledgeCategoryInput"
        required: true
      responses:
        "200":
          description: The created knowledge category
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateKnowledgeCategoryOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/collections:
    get:
      tags:
        - Knowledge
      summary: List collections
      description: Paginated list knowledge collections
      operationId: getKnowledgeCollections
      parameters:
        - name: pageLimit
          in: query
          description: Maximum number of results per page. May be used in combination with
            pageKey to change the number of results in between page requests.
          required: false
          schema:
            type: integer
            format: int32
        - name: pageKey
          in: query
          description: Base64 encoded form of pagination query parameters. Do not try to
            construct or change programmatically as the internal structure may
            change without notice.
          required: false
          schema:
            type: string
      responses:
        "200":
          description: A list of knowledge collections
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListKnowledgeCollectionsOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
    post:
      tags:
        - Knowledge
      summary: Create collection
      description: Create a knowledge collection
      operationId: postKnowledgeCollections
      requestBody:
        description: The knowledge collection to create
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateKnowledgeCollectionInput"
        required: true
      responses:
        "200":
          description: The created knowledge collection
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateKnowledgeCollectionOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.collections:w
  /v1/knowledge/articles/{articleId}/translations/{languageId}/publish:
    post:
      tags:
        - Knowledge
      summary: Publish translation
      description: Publish a specific translation for search
      operationId: postKnowledgeArticlesArticleidTranslationsLanguageidPublish
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: languageId
          in: path
          required: true
          schema:
            type: string
      responses:
        "204":
          description: ""
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/articles/{articleId}/translations/{languageId}/unpublish:
    post:
      tags:
        - Knowledge
      summary: Unpublish translation
      description: Mark a specific translation as unpublished
      operationId: postKnowledgeArticlesArticleidTranslationsLanguageidUnpublish
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: languageId
          in: path
          required: true
          schema:
            type: string
      responses:
        "204":
          description: ""
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/articles/{articleId}/translations/{languageId}:
    delete:
      tags:
        - Knowledge
      summary: Delete article translation
      description: Delete all versions of a knowledge article translation
      operationId: deleteKnowledgeArticlesArticleidTranslationsLanguageid
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: languageId
          in: path
          required: true
          schema:
            type: string
      responses:
        "204":
          description: ""
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/articles/{articleId}/publish:
    post:
      tags:
        - Knowledge
      summary: Publish article
      description: Publish a new version of all translations for a knowledge article
      operationId: postKnowledgeArticlesArticleidPublish
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "204":
          description: ""
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/articles/{articleId}/unpublish:
    post:
      tags:
        - Knowledge
      summary: Unpublish article
      description: Remove all translations of a knowledge article from search
      operationId: postKnowledgeArticlesArticleidUnpublish
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "204":
          description: ""
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/articles/{articleId}/parent/{parentId}:
    patch:
      tags:
        - Knowledge
      summary: Move article
      description: Move a knowledge article to a new parent
      operationId: patchKnowledgeArticlesArticleidParentParentid
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: parentId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "204":
          description: ""
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/articles/{articleId}/parent:
    delete:
      tags:
        - Knowledge
      summary: Remove article parent
      description: Remove a parent from a knowledge article
      operationId: deleteKnowledgeArticlesArticleidParent
      parameters:
        - name: articleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "204":
          description: ""
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
  /v1/knowledge/articles/attachments:
    post:
      tags:
        - Knowledge
      summary: Upload article attachments
      description: "Upload one or more image files to be used as attachments in
        knowledge articles. Supported formats: image/png, image/jpeg, image/gif,
        image/webp. Maximum 5 files per request, 4 MB per file, with a total
        request payload limit of 10 MB. Supports partial success."
      operationId: postKnowledgeArticlesAttachments
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/UploadAttachmentsInput"
        required: true
      responses:
        "200":
          description: The uploaded attachments, with partial errors if any
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UploadAttachmentsOutput"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
      security:
        - ApiKeyAuth:
            - knowledge.content:w
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
  schemas:
    GetKnowledgeCollectionOutput:
      title: GetKnowledgeCollectionOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/Collection"
    Collection:
      title: Collection
      type: object
      required:
        - id
        - title
        - internalKbEnabled
        - restrictions
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type: string
        internalKbEnabled:
          type: boolean
        restrictions:
          $ref: "#/components/schemas/Restrictions"
    Restrictions:
      title: Restrictions
      type: object
      required:
        - isRestricted
      properties:
        isRestricted:
          description: "Whether a restriction is set directly on this item. The only
            restriction is internal use: the content is available only to
            logged-in users"
          type: boolean
        inheritedRestrictions:
          description: Restrictions inherited from parent collections or categories. When
            several parents have the same restriction, only the top-most parent
            is listed
          type: array
          items:
            $ref: "#/components/schemas/InheritedRestriction"
    InheritedRestriction:
      title: InheritedRestriction
      type: object
      properties:
        fromCollection:
          description: ID of the collection the restriction is inherited from. Empty if it
            comes from a category
          type: string
        fromCategory:
          description: ID of the category the restriction is inherited from. Empty if it
            comes from a collection
          type: string
    BadRequest:
      title: BadRequest
      type: object
      required:
        - message
      properties:
        message:
          type: string
    NotFound:
      title: NotFound
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ServerError:
      title: ServerError
      type: object
      required:
        - message
      properties:
        message:
          type: string
    GetKnowledgeCollectionCatalogOutput:
      title: GetKnowledgeCollectionCatalogOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/CollectionCatalogItem"
    CollectionCatalogItem:
      title: CollectionCatalogItem
      type: object
      properties:
        categories:
          type: array
          items:
            $ref: "#/components/schemas/CategoryCatalogItem"
        articles:
          type: array
          items:
            $ref: "#/components/schemas/ArticleCatalogItem"
    CategoryCatalogItem:
      title: CategoryCatalogItem
      type: object
      required:
        - id
      properties:
        id:
          type: string
        title:
          $ref: "#/components/schemas/TranslationTitle"
        categories:
          type: array
          items:
            $ref: "#/components/schemas/CategoryCatalogItem"
        articles:
          type: array
          items:
            $ref: "#/components/schemas/ArticleCatalogItem"
    TranslationTitle:
      title: TranslationTitle
      type: object
      required:
        - languageId
        - title
      properties:
        languageId:
          type: string
        title:
          type: string
    ArticleCatalogItem:
      title: ArticleCatalogItem
      type: object
      required:
        - id
      properties:
        id:
          type: string
        title:
          $ref: "#/components/schemas/TranslationTitle"
    GetKnowledgeCategoryOutput:
      title: GetKnowledgeCategoryOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/Category"
    Category:
      title: Category
      type: object
      required:
        - id
        - isLocked
        - restrictions
      properties:
        id:
          description: ID of the category
          type: string
        title:
          $ref: "#/components/schemas/TranslationTitle"
          description: Title of the category in the requested language, or in the default
            language if no language was requested. Empty if the category has no
            translation in the requested language
        isDefaultLocation:
          description: Whether this is the category's default placement. Always `true`, or
            empty if the category has no parent
          type: boolean
        isLocked:
          description: Whether the category is synced from an Elevio workspace import.
            Locked categories cannot be modified (deleted, moved or renamed)
            while the import is active
          type: boolean
        restrictions:
          $ref: "#/components/schemas/Restrictions"
          description: Access restrictions on the category, set directly or inherited from
            its parents
        parentCategory:
          description: ID of the parent category. Empty for a top-level category, whose
            parent is a collection
          type: string
        parentCollections:
          description: IDs of all collections the category belongs to
          type: array
          items:
            type: string
    GetKnowledgeCategoryTranslationsOutput:
      title: GetKnowledgeCategoryTranslationsOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/CategoryTranslations"
    CategoryTranslations:
      title: CategoryTranslations
      type: object
      properties:
        titles:
          type: array
          items:
            $ref: "#/components/schemas/TranslationTitle"
    GetKnowledgeArticleOutput:
      title: GetKnowledgeArticleOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/Article"
    Article:
      title: Article
      type: object
      required:
        - id
        - createdAt
        - updatedAt
        - restrictions
      properties:
        id:
          type: string
        isDefaultLocation:
          type: boolean
        translation:
          $ref: "#/components/schemas/Translation1"
        tags:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        indexedAt:
          type: string
          format: date-time
        createdBy:
          type: string
        updatedBy:
          type: string
        ownedBy:
          type: string
        indexedBy:
          type: string
        restrictions:
          $ref: "#/components/schemas/Restrictions"
        parentCategory:
          type: string
        parentCollections:
          type: array
          items:
            type: string
    Translation1:
      title: Translation
      type: object
      required:
        - draft
      properties:
        draft:
          $ref: "#/components/schemas/ArticleTranslation"
        published:
          $ref: "#/components/schemas/ArticleTranslation"
    ArticleTranslation:
      title: ArticleTranslation
      type: object
      required:
        - language
        - title
        - isIndexedVersion
        - contents
        - availableAt
        - createdAt
        - updatedAt
      properties:
        language:
          type: string
        title:
          type: string
        isIndexedVersion:
          type: boolean
        contents:
          $ref: "#/components/schemas/ArticleContent"
        availableAt:
          $ref: "#/components/schemas/AvailableAt"
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          type: string
        updatedBy:
          type: string
    ArticleContent:
      title: ArticleContent
      type: object
      required:
        - html
        - plaintext
      properties:
        html:
          type: string
        plaintext:
          type: string
    AvailableAt:
      title: AvailableAt
      type: object
      properties:
        helpCenterLinks:
          type: array
          items:
            $ref: "#/components/schemas/HelpCenterLink"
    HelpCenterLink:
      title: HelpCenterLink
      type: object
      required:
        - id
        - name
        - url
      properties:
        id:
          type: string
        name:
          type: string
        url:
          type: string
    UpdateKnowledgeArticleInput:
      title: UpdateKnowledgeArticleInput
      type: object
      properties:
        ownedBy:
          description: ID of the user who owns the article
          type: string
        tags:
          $ref: "#/components/schemas/TagsUpdateInput"
        preRelease:
          description: Whether the article is only available in pre-release mode
          type: boolean
    TagsUpdateInput:
      title: TagsUpdateInput
      description: Tags to add or remove
      type: object
      properties:
        add:
          description: Tag IDs to add
          type: array
          items:
            type: string
        remove:
          description: Tag IDs to remove
          type: array
          items:
            type: string
    UpdateKnowledgeArticleOutput:
      title: UpdateKnowledgeArticleOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/Article"
          description: The updated article
    GetKnowledgeArticleTranslationsOutput:
      title: GetKnowledgeArticleTranslationsOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ArticleTranslations"
    ArticleTranslations:
      title: ArticleTranslations
      type: object
      required:
        - translations
      properties:
        translations:
          $ref: "#/components/schemas/TranslationList"
    TranslationList:
      title: TranslationList
      type: object
      properties:
        draft:
          type: array
          items:
            $ref: "#/components/schemas/ArticleTranslation"
        published:
          type: array
          items:
            $ref: "#/components/schemas/ArticleTranslation"
    UpdateTranslationsInput:
      title: UpdateTranslationsInput
      type: object
      properties:
        translations:
          description: List of translations to create or update
          type: array
          items:
            $ref: "#/components/schemas/TranslationInput1"
    TranslationInput1:
      title: TranslationInput
      type: object
      required:
        - languageId
        - title
      properties:
        languageId:
          description: ISO language code (e.g. en, da, de)
          type: string
        title:
          description: Title of the translation
          type: string
        content:
          description: HTML content of the translation
          type: string
    UpdateTranslationsOutput:
      title: UpdateTranslationsOutput
      type: object
      properties:
        data:
          description: Successfully upserted translations
          type: array
          items:
            $ref: "#/components/schemas/ArticleTranslation"
        partialErrors:
          description: Errors for translations that failed
          type: array
          items:
            $ref: "#/components/schemas/TranslationError"
    TranslationError:
      title: TranslationError
      type: object
      required:
        - languageId
        - message
      properties:
        languageId:
          description: Language code of the failed translation
          type: string
        message:
          description: Error message describing the failure
          type: string
    CreateKnowledgeArticleInput:
      title: CreateKnowledgeArticleInput
      type: object
      properties:
        translations:
          description: Initial translations for the article
          type: array
          items:
            $ref: "#/components/schemas/TranslationInput"
        parentId:
          description: ID of the parent category
          type: string
        tags:
          description: List of tag IDs to assign to the article
          type: array
          items:
            type: string
        preRelease:
          description: Whether the article is only available in pre-release mode
          type: boolean
    TranslationInput:
      title: TranslationInput
      type: object
      required:
        - languageId
        - title
      properties:
        languageId:
          description: ISO language code (e.g. en, da, de)
          type: string
        title:
          description: Title of the translation
          type: string
        content:
          description: HTML content of the translation
          type: string
    CreateKnowledgeArticleOutput:
      title: CreateKnowledgeArticleOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/Article"
          description: The created article
    CreateKnowledgeCategoryInput:
      title: CreateKnowledgeCategoryInput
      type: object
      required:
        - parentId
      properties:
        translations:
          description: Initial translations for the category
          type: array
          items:
            $ref: "#/components/schemas/CategoryTranslationInput"
        parentId:
          description: ID of the parent. Use a collection ID to create a top-level
            category, or a category ID to create a subcategory
          type: string
    CategoryTranslationInput:
      title: CategoryTranslationInput
      type: object
      required:
        - languageId
        - title
      properties:
        languageId:
          description: ISO language code (e.g. en, da, de)
          type: string
        title:
          description: Title of the translation
          type: string
    CreateKnowledgeCategoryOutput:
      title: CreateKnowledgeCategoryOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/Category"
          description: The created category
    ListKnowledgeCollectionsOutput:
      title: ListKnowledgeCollectionsOutput
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Collection"
    CreateKnowledgeCollectionInput:
      title: CreateKnowledgeCollectionInput
      type: object
      required:
        - title
      properties:
        title:
          description: Title of the collection
          type: string
        description:
          description: Description of the collection
          type: string
        internalKbEnabled:
          description: Whether the collection is available to browse in the internal
            knowledge base. Defaults to true
          type: boolean
    CreateKnowledgeCollectionOutput:
      title: CreateKnowledgeCollectionOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/Collection"
          description: The created collection
    UploadAttachmentsInput:
      title: UploadAttachmentsInput
      type: object
      properties:
        files:
          description: One or more image files to upload as article attachments. Each part
            must be a supported image format.
          type: array
          items:
            type: string
            format: binary
    UploadAttachmentsOutput:
      title: UploadAttachmentsOutput
      type: object
      properties:
        data:
          description: Successfully uploaded attachments
          type: array
          items:
            $ref: "#/components/schemas/AttachmentResult"
        partialErrors:
          description: Errors for attachments that failed
          type: array
          items:
            $ref: "#/components/schemas/AttachmentError"
    AttachmentResult:
      title: AttachmentResult
      type: object
      required:
        - originalFilename
        - url
      properties:
        originalFilename:
          description: Original filename of the uploaded file
          type: string
        url:
          description: Public URL of the uploaded file
          type: string
    AttachmentError:
      title: AttachmentError
      type: object
      required:
        - originalFilename
        - message
        - code
      properties:
        originalFilename:
          description: Original filename of the failed file
          type: string
        message:
          description: Error message describing the failure
          type: string
        code:
          description: "HTTP-style status code: 400 for client-side errors, 500 for
            server-side errors"
          type: integer
          format: int32
```
