# Category

## Module endpoints

* [`DELETE /categories/:id`](#delete-categories-id)​
* ​[`GET /categories`](#get-invites)​
* ​[`GET /categories/:id`](#get-categories-id)​
* ​[`PATCH /categories/:id`](#patch-categories-id)​
* ​[`POST /categories`](#post-categories)​
* ​[`POST /categories/:id/reorder`](#post-categories-id-reorder)

### `DELETE /categories/:id`

> `DELETE` <http://api.slyk.i&#x6F;**/categories/:id>\*\*

Deletes the `category` with given `id`.

{% tabs %}
{% tab title="Response" %}

> `204` No Content
> {% endtab %}
> {% endtabs %}

### `GET /categories` <a href="#get-invites" id="get-invites"></a>

> `GET` <https://api.slyk.i&#x6F;**/categories>\*\*

Returns a paginated list of `categories`.

{% tabs %}
{% tab title="Available Filters" %}

| Name                  |                              Type                             | Example                                           |
| --------------------- | :-----------------------------------------------------------: | ------------------------------------------------- |
| **availableProducts** |                            `custom`                           | `filter[availableProducts]=true`                  |
| **description**       |                            `ilike`                            | `filter[description]=foo`                         |
| **id**                |                         `=` `in` `nin`                        | `filter[id]=7938e446-1c77-4513-8cb0-8b1f2e9f47b9` |
| **order**             | <p><code>=</code></p><p><code>gte</code> <code>lte</code></p> | `filter[order]=gte:0.5`                           |
| **title**             |                            `ilike`                            | `filter[title]=foo`                               |
| **visibleProducts**   |                            `custom`                           | `filter[visibleProducts]=true`                    |
| {% endtab %}          |                                                               |                                                   |

{% tab title="Available Sorts" %}

| Name          | Example                                                            |
| ------------- | ------------------------------------------------------------------ |
| **createdAt** | <p><code>sort=createdAt</code><br><code>sort=-createdAt</code></p> |
| **order**     | <p><code>sort=order</code><br><code>sort=-order</code></p>         |
| **title**     | <p><code>sort=title</code><br><code>sort=-title</code></p>         |
| {% endtab %}  |                                                                    |

{% tab title="Paginate Options" %}

| Name         | Description                                             | Example          |
| ------------ | ------------------------------------------------------- | ---------------- |
| **size**     | Defines the number of results per page. Default = 30.   | `page[size]=2`   |
| **number**   | Defines the number of the page to retrieve. Default = 1 | `page[number]=2` |
| {% endtab %} |                                                         |                  |

{% tab title="Response" %}

```javascript
{
  "data": [
    {
      "createdAt": "2020-08-10T10:00:00.000Z",
      "customData": {},
      "description": "Category with music related things",
      "id": "7938e446-1c77-4513-8cb0-8b1f2e9f47b8",
      "imageUrl": "http://slyk.io/music.png",
      "title": "Music",
      "updatedAt": "2020-08-10T10:00:00.000Z"
    },
    {
      "createdAt": "2020-08-10T11:00:00.000Z",
      "customData": {},
      "description": "Category with clothes",
      "id": "7938e446-1c77-4513-8cb0-8b1f2e9f47b9",
      "imageUrl": "http://slyk.io/clothes.png",
      "title": "Clothes",
      "updatedAt": "2020-08-10T11:00:00.000Z"
    }
  ],
  "total": 2
}
```

{% endtab %}
{% endtabs %}

### `GET /categories/:id`

> `GET` <https://api.slyk.i&#x6F;**/categories/:id**‌>

Gets the category details of the given `id`.

{% tabs %}
{% tab title="Response" %}

```javascript
{
  "data": {
    "createdAt": "2020-08-10T10:00:00.000Z",
    "customData": {},
    "description": "Category with music related things",
    "id": "7938e446-1c77-4513-8cb0-8b1f2e9f47b9",
    "imageUrl": "http://slyk.io/music.png",
    "title": "Music",
    "updatedAt": "2020-08-10T10:00:00.000Z"
  }
}
```

{% endtab %}
{% endtabs %}

### `PATCH /categories/:id`

> `PATCH` <https://api.slyk.i&#x6F;**/categories/:id>\*\*

Patches the `category` details of the given `id`.

{% tabs %}
{% tab title="Request Parameters" %}

| Field           |   Type   | Required | Description                                              |
| --------------- | :------: | :------: | -------------------------------------------------------- |
| **customData**  | `object` |  `false` | Can store any additional information about the category. |
| **description** | `string` |  `false` | Category description.                                    |
| **image**       | `string` |  `false` | Category image.                                          |
| **order**       | `string` |  `false` | Category order value.                                    |
| **title**       | `string` |  `false` | Category title.                                          |
| {% endtab %}    |          |          |                                                          |

{% tab title="Request" %}

```javascript
{
  "description": "foobiz",
  "image": "foobar.png",
  "title": "foobar"
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "createdAt": "2020-08-10T10:00:00.000Z",
    "customData": {},
    "description": "Category with music related things",
    "id": "7938e446-1c77-4513-8cb0-8b1f2e9f47b9",
    "imageUrl": "http://slyk.io/music.png",
    "title": "Music",
    "updatedAt": "2020-08-10T11:00:00.000Z"
  }
}
```

{% endtab %}
{% endtabs %}

### `POST /categories`

> `POST` <https://api.slyk.i&#x6F;**/categories>\*\*

Creates a new `category`.

{% tabs %}
{% tab title="Request Parameters" %}

| Field           |   Type   | Required | Description                                              |
| --------------- | :------: | :------: | -------------------------------------------------------- |
| **customData**  | `object` |  `false` | Can store any additional information about the category. |
| **description** | `string` |  `false` | Category description.                                    |
| **image**       | `string` |  `false` | Category image.                                          |
| **order**       | `string` |  `false` | Category order value.                                    |
| **title**       | `string` |  `true`  | Category title.                                          |
| {% endtab %}    |          |          |                                                          |

{% tab title="Request" %}

```javascript
{
  "description": "foobiz",
  "image": "foobar.png",
  "title": "foobar"
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "createdAt": "2020-08-10T10:00:00.000Z",
    "customData": {},
    "description": "Category with music related things",
    "id": "7938e446-1c77-4513-8cb0-8b1f2e9f47b9",
    "imageUrl": "http://slyk.io/music.png",
    "title": "Music",
    "updatedAt": "2020-08-10T10:00:00.000Z"
  }
}
```

{% endtab %}
{% endtabs %}

### `POST /categories/:id/reorder`

> `POST` <http://api.slyk.i&#x6F;**/categories/:id/reorder>\*\*

Reorders the `category` with the given `id`.

{% tabs %}
{% tab title="Request Parameters" %}

| Field            |   Type   | Required | Description                     |
| ---------------- | :------: | :------: | ------------------------------- |
| **subsequentId** | `string` |  `false` | Subsequent category identifier. |
| {% endtab %}     |          |          |                                 |

{% tab title="Request" %}

```javascript
{
  "subsequentId": "174c3e0d-226f-443a-a010-12b2140de03c"
}
```

{% endtab %}

{% tab title="Response" %}

> `204` No Content
> {% 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://developers.slyk.io/slyk/reference/endpoints/category.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.
