---
title: "List agricultural service categories"
method: GET
path: "/categories"
tags: ["Categories"]
---

# List agricultural service categories

`GET /categories`

## Request

- Base URL: `https://api.purplegrain.com/api/v1`
- URL: `https://api.purplegrain.com/api/v1/categories`
- Auth: none declared

List the category catalogue, returning each category's ID, name and type. Use the exact name as the category filter for service or task searches. Results are paginated with page and per_page; meta provides current_page, next_page and prev_page. This lookup does not change data.

## Query parameters

- `page` integer
- `per_page` integer

## Response `200`

Success.

- CategoriesIndexResponseAttributes
  - `data` CategoryModelAttributes[]
    - `id` string
    - `type` string
    - `name` string
    - `category_type` 'ServiceCategory': Attribute "type" in JSON:API; renamed here to avoid clash with resource type
  - `meta` PaginationMeta
    - `current_page` number
    - `next_page` number, nullable
    - `prev_page` number, nullable

---

[API](https://skmtc.dev/purplegrain/apis/purple-grain-api.md) · [All operations](https://skmtc.dev/purplegrain/apis/purple-grain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/purplegrain/apis/purple-grain-api/revisions/4bedbc1c784c?raw)
