Skip to content

List Categories

GET/categories

Retrieve a paginated list of categories.

Parameters

ParameterDefaultValues / Description
page[size]50Maximum number of results per page
page[number]1Page number

Fields marked with * are required.

Request

js
import Confetti from 'confetti'

const confetti = new Confetti({ apiKey: 'your-key' })

const categories = await confetti.categories.findAll({
  page: { size: 10, number: 1 },
})
sh
curl "https://api.confetti.events/categories" \
  -H "Authorization: apikey your-key"

Response

ts
interface Category {
  id: number
  name: string
  createdAt: Date
  updatedAt: Date
  organisationId: number
}
json
[
  {
    "id": 1,
    "name": "My category",
    "createdAt": "2023-02-01T10:27:57.026Z",
    "updatedAt": "2023-06-19T14:45:12.605Z",
    "organisationId": 1
  },
  {
    "id": 1,
    "name": "My category",
    "createdAt": "2023-02-01T10:27:57.026Z",
    "updatedAt": "2023-06-19T14:45:12.605Z",
    "organisationId": 1
  }
]
json
{
  "data": [
    {
      "id": 1,
      "type": "category",
      "attributes": {
        "name": "My category",
        "createdAt": "2023-02-01T10:27:57.026Z",
        "updatedAt": "2023-06-19T14:45:12.605Z",
        "organisationId": 1
      }
    },
    {
      "id": 1,
      "type": "category",
      "attributes": {
        "name": "My category",
        "createdAt": "2023-02-01T10:27:57.026Z",
        "updatedAt": "2023-06-19T14:45:12.605Z",
        "organisationId": 1
      }
    }
  ]
}