Skip to main content
POST
/
events
/
{event}
/
races
/
{race}
/
categories
Criar categoria
curl --request POST \
  --url http://localhost/api/v1/events/{event}/races/{race}/categories \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "type": "<string>",
  "modality_id": 123,
  "age_min": 60,
  "age_max": 60,
  "award_count": 50,
  "is_pwd": true,
  "is_team": true,
  "sort_order": 123,
  "modality_ids": [
    123
  ]
}
'
{
  "data": "<string>"
}

Authorizations

Authorization
string
header
required

API key do hub com escopo manage. Header: Authorization: Bearer <api_key>.

Path Parameters

event
string
required
race
integer
required

Body

application/json

POST /api/v1/events/{event}/races/{race}/categories — cria categoria. Espelha RaceView::saveCategory (categoryForm).

name
string
required
Maximum string length: 80
type
string | null
Maximum string length: 20
modality_id
integer | null

Atalho retrocompat (1 linha). Pra fan-out por modalidade, use modality_ids.

sex
enum<string> | null
Available options:
M,
F
age_min
integer | null
Required range: 0 <= x <= 120
age_max
integer | null
Required range: 0 <= x <= 120
award_count
integer | null
Required range: 0 <= x <= 100
is_pwd
boolean | null
is_team
boolean | null
sort_order
integer | null
status
enum<string>

Status genérico usado por várias entidades (Hub, User, Group, Category, etc.). Entidades com estados específicos (Event, Registration) têm enums próprios.

Available options:
active,
inactive,
suspended
modality_ids
integer[] | null

Materializa 1 categoria por modalidade marcada (subconjunto das da prova).

Response

JsonResource

data
string
required