# Departments

Read JioMart top-level catalogue departments and their identifiers.

- Platform: [JioMart](https://docs.upscrape.com/docs/platforms/jiomart)
- Capability ID: `jiomart.departments.list`
- Cost: 1 credit per request
- Maximum runtime: 30 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {},
  "capability": "jiomart.departments.list"
}'
```

## Input

No input is required.

This capability accepts an empty input object.

### Example input

```json
{}
```

## Response

Successful output is returned in `results[0].data`.

Returned department names, slugs and identifiers can anchor taxonomy and compatible browse requests.

Departments describe catalogue structure rather than local serviceability or stock.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "items": [
    {
      "logo": {
        "type": "image",
        "url": "https://cdn1.jiomartjcp.com/v2/jio-mart-2/MOluAr/original/jiomarty0/department/pictures/square-logo/original/nNNDA0Cu--department.png"
      },
      "name": "Groceries",
      "priority_order": 1,
      "slug": "groceries",
      "uid": 1
    }
  ],
  "raw": {
    "items": [
      {
        "logo": {
          "type": "image",
          "url": "https://cdn1.jiomartjcp.com/v2/jio-mart-2/MOluAr/original/jiomarty0/department/pictures/square-logo/original/nNNDA0Cu--department.png"
        },
        "name": "Groceries",
        "priority_order": 1,
        "slug": "groceries",
        "uid": 1
      }
    ]
  }
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `items` | `array` | 1 items |
| `items` | `array` | 1 items |
| `raw` | `object` | 1 fields |
| `raw.items` | `array` | 1 items |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
