Skip to content

Get Category

GET/categories/:id

Retrieve a single category by its ID.

Request

js
import Confetti from 'confetti'

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

const category = await confetti.categories.find(1)
sh
curl "https://api.confetti.events/categories/1" \
  -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
}
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
    }
  }
}