# Delete a category

Source: https://developers.swell.is/backend-api/categories/delete-a-category

Delete a category.

## Arguments

- `id` (objectId, required): The id of the category to delete.

## Example request

`DELETE /categories/:id`

**cURL**

```bash
$ curl https://api.swell.store/categories/5ca9871f9b14d199072432a1 \
  -u store-id:secret-key \
  -X DELETE
```

**Node**

```javascript
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');

await swell.delete('/categories/{id}', {
  id: '5ca9871f9b14d199072432a1',
});
```

**PHP**

```php
<?php $swell = new \Swell\Client('store-id', 'secret-key');

$swell->delete('/categories/{id}', [
  'id' => '5ca9871f9b14d199072432a1',
]);
```

## Example response

```json
{
  "id": "5ca9871f9b14d199072432a1",
  "active": false,
  "name": "Widgets",
  "slug": "widgets",
  "date_created": "2019-04-01T00:00:00.000Z"
  "date_updated": "2019-04-01T00:00:00.000Z",
  "description": 'A bunch of widgets',
  "images": [
    {
      "id": "5ca24abb9c077817e5fe2b37",
      "file": {
        "id": "5ca24abb9c077817e5fe2b38",
        "date_uploaded": "2019-04-02T00:26:23.399Z",
        "length": 66764,
        "md5": "99194f53bfdea832553e7fa8ae8fd80f",
        "content_type": "image/png",
        "url": "http://cdn.swell.store/test/5ca24abb9c077817e5fe2b36/99194f53bfdea832553e7fa8ae8fd80f",
        "width": 940,
        "height": 600
      }
    }
  ],
  "meta_title": null,
  "meta_keywords": null,
  "meta_description": null
}
```
