# Generic topics

### Overview terms

<table><thead><tr><th width="150">Name</th><th>Type</th><th width="181">Required</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>string</td><td>Yes</td><td>Name of the generic topic</td></tr><tr><td>Description</td><td>string</td><td>No</td><td>Description of the generic topic</td></tr><tr><td>Code</td><td>string</td><td>No</td><td>Code of the generic topic</td></tr><tr><td>externalId</td><td>string</td><td>No</td><td>Probably needed when using the API with externalIds</td></tr><tr><td>blocks</td><td>Array object</td><td>No</td><td>You can pass a block object to the generic topic. This block will be used when creating an evaluation from a calendar. </td></tr><tr><td>block->topicType</td><td>String</td><td>Yes (in a block object)</td><td>The block type (you can manage generic topic blocks on top organisation)</td></tr><tr><td>block->questionSets</td><td>Array object </td><td>No</td><td>Array of questionSet ids. You can use id or code of the questionSet<br>[{id: number, code: string}]</td></tr><tr><td>block->index</td><td>integer</td><td>No</td><td>Order of the blocks</td></tr><tr><td>labels</td><td>Array object</td><td>No</td><td>Add labels to the generic topic</td></tr><tr><td>labels->name</td><td>string</td><td>Yes (in a label object)</td><td>name of the label</td></tr></tbody></table>

## Get a list of generic topics

<mark style="color:blue;">`GET`</mark> `https://api-portal.evalytics.nl/genericTopic`

#### Query Parameters

| Name           | Type         | Description                                                 |
| -------------- | ------------ | ----------------------------------------------------------- |
| q              | String       | Search for a specific generic topic                         |
| archived       | boolean      | Filter generic topics on archived (default=null)            |
| populateBlocks | boolean      | Populate blocks object (default = false)                    |
| populateLabels | boolean      | Populate labels (default = false)                           |
| skip           | number       | Total items to be skipped for pagination (default=0)        |
| limit          | number       | Limit the total items returned from the api (default=30)    |
| status         | string array | Filter list on active, archived, deleted (default = active) |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
	"metadata": {
		"timestamp": "2023-01-11T10:00:37.605Z",
		"resultSet": {
			"count": 1,
			"limit": 30,
			"skip": 0
		}
	},
	"results": [
		{
			"id": 1,
			"name": "Example topic",
			"description": "",
			"externalId": "",
			"code": "",
			"organisation": 4,
			"topOrganisation": 3,
			"updatedAt": null,
			"modifiedBy": null,
			"createdAt": "2023-01-03T16:08:45.000Z",
			"createdBy": 1,
			"deleted": false,
			"archived": false,
			"labels": [{
				"name": "Example label"
			}]
		}
	]
}
```

{% endtab %}
{% endtabs %}

## Get a generic topic

<mark style="color:blue;">`GET`</mark> `https://api-portal.evalytics.nl/genericTopic/:id`

#### Path Parameters

| Name                                 | Type   | Description                          |
| ------------------------------------ | ------ | ------------------------------------ |
| id<mark style="color:red;">\*</mark> | number | Id or externalId of the genericTopic |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
			"id": 1,
			"name": "Example topic",
			"description": "",
			"externalId": "",
			"code": "",
			"organisation": 4,
			"topOrganisation": 3,
			"updatedAt": null,
			"modifiedBy": null,
			"createdAt": "2023-01-03T16:08:45.000Z",
			"createdBy": 1,
			"deleted": false,
			"archived": false,
			"labels": [{
				"name": "Example label"
			}]
}
```

{% endtab %}
{% endtabs %}

## Creates a generic topic

<mark style="color:green;">`POST`</mark> `https://api-portal.evalytics.nl/genericTopic`

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
			"id": 1,
			"name": "Example topic",
			"description": "",
			"externalId": "",
			"code": "",
			"organisation": 4,
			"topOrganisation": 3,
			"updatedAt": null,
			"modifiedBy": null,
			"createdAt": "2023-01-03T16:08:45.000Z",
			"createdBy": 1,
			"deleted": false,
			"archived": false,
			"labels": [{
				"name": "Example label"
			}]
}
```

{% endtab %}
{% endtabs %}

```json
{
    "name": (string - required),
    "description": (string),
    "code": (string),
    "externalId": (string),
    "blocks": [{
        "name": (string - required),
        "topicType": {
            "id": (integer - required or use type),
            "type": (string - required or use id)
        } - (required),
        "index": (integer),
        "questionSets": [{
            "id": (integer - required or use code),
            "code": (string - required or use id)
        }] - (optional)
    }]- (optional),
    "labels": [{
        "name": (string - required)
    }] - (optional)
}
```

## Update a generic topic

<mark style="color:orange;">`PUT`</mark> `https://api-portal.evalytics.nl/genericTopic/:id`

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
			"id": 1,
			"name": "Example topic updated",
			"description": "",
			"externalId": "",
			"code": "",
			"organisation": 4,
			"topOrganisation": 3,
			"updatedAt": null,
			"modifiedBy": null,
			"createdAt": "2023-01-03T16:08:45.000Z",
			"createdBy": 1,
			"deleted": false,
			"archived": false,
			"labels": [{
				"name": "Example label"
			}]
		}
```

{% endtab %}
{% endtabs %}

```json
{
    "name": (string - required),
    "description": (string),
    "code": (string),
    "externalId": (string),
    "blocks": [{
        "topicType": {
            "id": (integer - required or use type),
            "type": (string - required or use id)
        }
        "index": (integer),
        "questionSets": [{
            "id": (integer - required or use code),
            "code": (string - required or use id)
        }] - (optional)
    }]- (optional),
    "labels": [{
        "name": (string - required)
    }] - (optional)
}
```

## Archive a generic topic

<mark style="color:green;">`POST`</mark> `https://api-portal.evalytics.nl/genericTopic/:id/archive`

#### Path Parameters

| Name                               | Type   | Description                          |
| ---------------------------------- | ------ | ------------------------------------ |
| <mark style="color:red;">\*</mark> | number | id or externalId of the genericTopic |

#### Query Parameters

| Name | Type    | Description               |
| ---- | ------- | ------------------------- |
| undo | boolean | Undo the archiving action |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Delete a generic topic

<mark style="color:red;">`DELETE`</mark> `https://api-portal.evalytics.nl/genericTopic/:id`

#### Path Parameters

| Name                                 | Type   | Description                          |
| ------------------------------------ | ------ | ------------------------------------ |
| id<mark style="color:red;">\*</mark> | number | id or externalId of the genericTopic |

#### Query Parameters

| Name | Type    | Description               |
| ---- | ------- | ------------------------- |
| undo | boolean | Undo the archiving action |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.evalytics.nl/onderdelen/generic-topics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
