# Categories

These keys are specified to use as defined in docs, they are case-sensitive. Any change in these keys may cause issues during data sync&#x20;

### Authentication&#x20;

\
Use your token provided inside converted.in after on boarding process to authenticate the request using form-data body

![](/files/R8GaOnQrAyPaVxflm3Yr)

## Categories API

<mark style="color:green;">`POST`</mark> `YOUR_BASEURL/convertedin/categories`

#### Request Body

| Name                                        | Type    | Description                         |
| ------------------------------------------- | ------- | ----------------------------------- |
| per\_page<mark style="color:red;">\*</mark> | integer | limit per page (default 100)        |
| page<mark style="color:red;">\*</mark>      | integer | page number                         |
| token<mark style="color:red;">\*</mark>     | string  | Fixed token provided by Convertedin |

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

```
{
    "current_page": 1, 
    "data": [ 
        {
            "id": 1,
            "title": "Uncategorized",
            "handle": "uncategorized",
            "content": "",
            "subcategories": []  // No subcategories for "Uncategorized"
        }, 
        {
            "id": 2,
            "title": "For him",
            "handle": "for-him",
            "content": "",
            "subcategories": [
                {
                    "id": 3,
                    "title": "Accessories",
                    "handle": "accessories",
                    "content": "",
                    "subcategories": []  // You can also have nested subcategories here
                },
                {
                    "id": 4,
                    "title": "Clothing",
                    "handle": "clothing",
                    "content": "",
                    "subcategories": [
                        {
                            "id": 5,
                            "title": "Shirts",
                            "handle": "shirts",
                            "content": ""
                        },
                        {
                            "id": 6,
                            "title": "Jackets",
                            "handle": "jackets",
                            "content": ""
                        }
                    ]
                }
            ]
        }
    ],
    "from": 1, // start for current page
    "last_page": 23, // last available page 
    "per_page": 100, // limit per page
    "to": 100,  // end for current page
    "total": 2220 // total number of categories
}

```

{% endtab %}
{% endtabs %}

| id            | category id linked to your products                                                     | **Required** |
| ------------- | --------------------------------------------------------------------------------------- | ------------ |
| title         | category name                                                                           | **Required** |
| handle        | category slug or url                                                                    | Not required |
| content       | category description or brief                                                           | Not required |
| subcategories | Each category object has a subcategories key, which is an array of subcategory objects. | **Required** |
| available     | is category publicly available                                                          | **Required** |
| published\_at | the date that the category was available on it.                                         | **Required** |

### Response

```json
{
    "data": [
        {
            "id": 841564295,
            "taxonomy": "Category > Sub Category",
            "handle": "ipods",
            "title": "IPods",
            "updated_at": "2008-02-01T19:00:00-05:00",
            "content": "<p>The best selling ipod ever</p>",
            "published_at": "2008-02-01T19:00:00-05:00",
            "available": true,
            "image": {
                "created_at": "2021-10-01T17:17:03-04:00",
                "alt": "MP3 Player 8gb",
                "width": 123,
                "height": 456,
                "src": "https://cdn.shopify.com/s/files/1/0006/9093/3842/collections/ipod_nano_8gb.jpg?v=1633123023"
            },
            "subcategories": [
                {
                    "id": 841564296,
                    "taxonomy": "Category > Sub Category > Sub Sub Category",
                    "handle": "ipod_nano",
                    "title": "IPod Nano",
                    "updated_at": "2008-03-01T19:00:00-05:00",
                    "content": "<p>Compact iPod Nano</p>",
                    "published_at": "2008-03-01T19:00:00-05:00",
                    "available": true,
                    "image": {
                        "created_at": "2021-10-01T18:00:00-04:00",
                        "alt": "iPod Nano",
                        "width": 100,
                        "height": 200,
                        "src": "https://cdn.shopify.com/s/files/1/0006/9093/3842/collections/ipod_nano.jpg?v=1633123024"
                    }
                }
            ]
        },
        {
            "id": 395646240,
            "taxonomy": "Category > Sub Category",
            "handle": "ipods_two",
            "title": "IPods Two",
            "updated_at": "2008-02-01T19:00:00-05:00",
            "body_html": "<p>The best selling ipod ever. Again</p>",
            "published_at": "2008-02-01T19:00:00-05:00",
            "sort_order": "manual",
            "template_suffix": null,
            "available": true,
            "image": null,
            "subcategories": []
        }
    ],
    "total": 1000,
    "per_page": 100,
    "current_page": 1,
    "last_page": 10,
    "from": 1,
    "to": 100
}

```


---

# 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://developer.converted.in/api-1/categories.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.
