Atualizar prova
Atualização parcial
curl --request PATCH \
--url http://localhost/api/v1/events/{event}/races/{race} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"default_modality_id": 123,
"distance": 1,
"distance_label": "<string>",
"sort_order": 123,
"starts_at": "2023-11-07T05:31:56Z",
"type": "<string>",
"scoring_type": "<string>",
"duration_minutes": 123,
"lap_count": 123,
"lap_distance": 1,
"registration_limit": 123,
"sem_classificacao": true,
"modality_ids": [
123
]
}
'import requests
url = "http://localhost/api/v1/events/{event}/races/{race}"
payload = {
"name": "<string>",
"default_modality_id": 123,
"distance": 1,
"distance_label": "<string>",
"sort_order": 123,
"starts_at": "2023-11-07T05:31:56Z",
"type": "<string>",
"scoring_type": "<string>",
"duration_minutes": 123,
"lap_count": 123,
"lap_distance": 1,
"registration_limit": 123,
"sem_classificacao": True,
"modality_ids": [123]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
default_modality_id: 123,
distance: 1,
distance_label: '<string>',
sort_order: 123,
starts_at: '2023-11-07T05:31:56Z',
type: '<string>',
scoring_type: '<string>',
duration_minutes: 123,
lap_count: 123,
lap_distance: 1,
registration_limit: 123,
sem_classificacao: true,
modality_ids: [123]
})
};
fetch('http://localhost/api/v1/events/{event}/races/{race}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://localhost/api/v1/events/{event}/races/{race}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'default_modality_id' => 123,
'distance' => 1,
'distance_label' => '<string>',
'sort_order' => 123,
'starts_at' => '2023-11-07T05:31:56Z',
'type' => '<string>',
'scoring_type' => '<string>',
'duration_minutes' => 123,
'lap_count' => 123,
'lap_distance' => 1,
'registration_limit' => 123,
'sem_classificacao' => true,
'modality_ids' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost/api/v1/events/{event}/races/{race}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"default_modality_id\": 123,\n \"distance\": 1,\n \"distance_label\": \"<string>\",\n \"sort_order\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"type\": \"<string>\",\n \"scoring_type\": \"<string>\",\n \"duration_minutes\": 123,\n \"lap_count\": 123,\n \"lap_distance\": 1,\n \"registration_limit\": 123,\n \"sem_classificacao\": true,\n \"modality_ids\": [\n 123\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost/api/v1/events/{event}/races/{race}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"default_modality_id\": 123,\n \"distance\": 1,\n \"distance_label\": \"<string>\",\n \"sort_order\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"type\": \"<string>\",\n \"scoring_type\": \"<string>\",\n \"duration_minutes\": 123,\n \"lap_count\": 123,\n \"lap_distance\": 1,\n \"registration_limit\": 123,\n \"sem_classificacao\": true,\n \"modality_ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/v1/events/{event}/races/{race}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"default_modality_id\": 123,\n \"distance\": 1,\n \"distance_label\": \"<string>\",\n \"sort_order\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"type\": \"<string>\",\n \"scoring_type\": \"<string>\",\n \"duration_minutes\": 123,\n \"lap_count\": 123,\n \"lap_distance\": 1,\n \"registration_limit\": 123,\n \"sem_classificacao\": true,\n \"modality_ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"event_id": 123,
"code": "<string>",
"name": "<string>",
"distance": 123,
"distance_label": "<string>",
"sort_order": 123,
"starts_at": "<string>",
"type": "<string>",
"scoring_type": "<string>",
"duration_minutes": 123,
"lap_count": 123,
"lap_distance": 123,
"registration_limit": 123,
"sem_classificacao": true,
"status": "<string>",
"results_status": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"modalities": [
{
"id": 123,
"name": "<string>",
"is_default": true
}
],
"categories": [
{
"id": 123,
"race_id": 123,
"event_id": 123,
"name": "<string>",
"type": "<string>",
"modality_id": 123,
"category_group_id": "<string>",
"sex": "<string>",
"age_min": 123,
"age_max": 123,
"award_count": 123,
"is_pwd": true,
"is_team": true,
"sort_order": 123,
"status": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"modality": {
"id": 123,
"name": "<string>"
}
}
],
"prize_rules": [
{
"id": 123,
"race_id": 123,
"event_id": 123,
"seq": 123,
"modality_id": 123,
"ranking_type": "<string>",
"ranking_cut": 123,
"gender_filter": "<string>",
"pne_filter": "<string>",
"dupla_prem": [
"<unknown>"
],
"tipo_premiacao": "<string>",
"eqp_apuracao": "<string>",
"eqp_n_melhores": 123,
"eqp_base_ranking": "<string>",
"status": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"modality": {
"id": 123,
"name": "<string>"
}
}
],
"categories_count": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Authorizations
API key do hub com escopo manage. Header: Authorization: Bearer <api_key>.
Body
PATCH /api/v1/events/{event}/races/{race} — atualização parcial da prova.
80x >= 0202020x >= 0Status genérico usado por várias entidades (Hub, User, Group, Category, etc.). Entidades com estados específicos (Event, Registration) têm enums próprios.
active, inactive, suspended Prova sem cronometragem (ex.: KIDS) — portal exibe lista de inscritos.
Status de publicação do resultado de uma prova (race) como um todo. Provisório → resultado publicado, mas ainda sujeito a recurso/correção. Homologado → resultado oficial, chancelado pelo hub. O status NUNCA muda por import (decisão do Marcos, 2026-06-12): só por ação explícita na UI do hub ou via API (integrations /results-status e v1 PATCH race).
provisional, homologated Conjunto de modalidades da prova (sync race_modalities). Remoção é guardada: modalidade com inscrições/resultados → 409.
Response
JsonResource
Show child attributes
Show child attributes
curl --request PATCH \
--url http://localhost/api/v1/events/{event}/races/{race} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"default_modality_id": 123,
"distance": 1,
"distance_label": "<string>",
"sort_order": 123,
"starts_at": "2023-11-07T05:31:56Z",
"type": "<string>",
"scoring_type": "<string>",
"duration_minutes": 123,
"lap_count": 123,
"lap_distance": 1,
"registration_limit": 123,
"sem_classificacao": true,
"modality_ids": [
123
]
}
'import requests
url = "http://localhost/api/v1/events/{event}/races/{race}"
payload = {
"name": "<string>",
"default_modality_id": 123,
"distance": 1,
"distance_label": "<string>",
"sort_order": 123,
"starts_at": "2023-11-07T05:31:56Z",
"type": "<string>",
"scoring_type": "<string>",
"duration_minutes": 123,
"lap_count": 123,
"lap_distance": 1,
"registration_limit": 123,
"sem_classificacao": True,
"modality_ids": [123]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
default_modality_id: 123,
distance: 1,
distance_label: '<string>',
sort_order: 123,
starts_at: '2023-11-07T05:31:56Z',
type: '<string>',
scoring_type: '<string>',
duration_minutes: 123,
lap_count: 123,
lap_distance: 1,
registration_limit: 123,
sem_classificacao: true,
modality_ids: [123]
})
};
fetch('http://localhost/api/v1/events/{event}/races/{race}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://localhost/api/v1/events/{event}/races/{race}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'default_modality_id' => 123,
'distance' => 1,
'distance_label' => '<string>',
'sort_order' => 123,
'starts_at' => '2023-11-07T05:31:56Z',
'type' => '<string>',
'scoring_type' => '<string>',
'duration_minutes' => 123,
'lap_count' => 123,
'lap_distance' => 1,
'registration_limit' => 123,
'sem_classificacao' => true,
'modality_ids' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost/api/v1/events/{event}/races/{race}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"default_modality_id\": 123,\n \"distance\": 1,\n \"distance_label\": \"<string>\",\n \"sort_order\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"type\": \"<string>\",\n \"scoring_type\": \"<string>\",\n \"duration_minutes\": 123,\n \"lap_count\": 123,\n \"lap_distance\": 1,\n \"registration_limit\": 123,\n \"sem_classificacao\": true,\n \"modality_ids\": [\n 123\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost/api/v1/events/{event}/races/{race}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"default_modality_id\": 123,\n \"distance\": 1,\n \"distance_label\": \"<string>\",\n \"sort_order\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"type\": \"<string>\",\n \"scoring_type\": \"<string>\",\n \"duration_minutes\": 123,\n \"lap_count\": 123,\n \"lap_distance\": 1,\n \"registration_limit\": 123,\n \"sem_classificacao\": true,\n \"modality_ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/v1/events/{event}/races/{race}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"default_modality_id\": 123,\n \"distance\": 1,\n \"distance_label\": \"<string>\",\n \"sort_order\": 123,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"type\": \"<string>\",\n \"scoring_type\": \"<string>\",\n \"duration_minutes\": 123,\n \"lap_count\": 123,\n \"lap_distance\": 1,\n \"registration_limit\": 123,\n \"sem_classificacao\": true,\n \"modality_ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"event_id": 123,
"code": "<string>",
"name": "<string>",
"distance": 123,
"distance_label": "<string>",
"sort_order": 123,
"starts_at": "<string>",
"type": "<string>",
"scoring_type": "<string>",
"duration_minutes": 123,
"lap_count": 123,
"lap_distance": 123,
"registration_limit": 123,
"sem_classificacao": true,
"status": "<string>",
"results_status": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"modalities": [
{
"id": 123,
"name": "<string>",
"is_default": true
}
],
"categories": [
{
"id": 123,
"race_id": 123,
"event_id": 123,
"name": "<string>",
"type": "<string>",
"modality_id": 123,
"category_group_id": "<string>",
"sex": "<string>",
"age_min": 123,
"age_max": 123,
"award_count": 123,
"is_pwd": true,
"is_team": true,
"sort_order": 123,
"status": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"modality": {
"id": 123,
"name": "<string>"
}
}
],
"prize_rules": [
{
"id": 123,
"race_id": 123,
"event_id": 123,
"seq": 123,
"modality_id": 123,
"ranking_type": "<string>",
"ranking_cut": 123,
"gender_filter": "<string>",
"pne_filter": "<string>",
"dupla_prem": [
"<unknown>"
],
"tipo_premiacao": "<string>",
"eqp_apuracao": "<string>",
"eqp_n_melhores": 123,
"eqp_base_ranking": "<string>",
"status": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"modality": {
"id": 123,
"name": "<string>"
}
}
],
"categories_count": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}