Dokumentacja API
Zintegruj SquadHub.GG ze swoimi aplikacjami za pomocą naszego REST API
Pierwsze kroki
1. Uzyskaj klucz API
Dostęp do API jest dostępny dla użytkowników planu Organizacja. Utwórz klucz API w ustawieniach konta.
2. Uwierzytelnianie
Dołącz swój klucz API w nagłówku Authorization każdego żądania:
Authorization: Bearer sk_live_your_api_key_here3. Bazowy URL
https://squadhub.gg/api/v14. Limity żądań
100 żądań na minutę na klucz API
Endpointy API
GET
/api/v1/tournamentsWyświetl wszystkie swoje turnieje
read:tournaments
Parametry zapytania
page(number)Numer strony (domyślnie: 1)limit(number)Wyników na stronę (domyślnie: 20, maks: 100)status(string)Filtruj według statusu (registration, ongoing, completed)game_id(string)Filtruj według ID gryOdpowiedź
{
"success": true,
"data": [
{
"id": "uuid",
"name": "Tournament Name",
"slug": "tournament-slug",
"status": "registration",
"format": "single_elimination",
"team_size": 5,
"max_teams": 32,
...
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45
},
"meta": {
"timestamp": "2025-12-11T...",
"api_version": "1.0"
}
}POST
/api/v1/tournamentsUtwórz nowy turniej
write:tournaments
Treść żądania
{
"name": "Summer Championship 2025",
"description": "Annual summer tournament",
"game_id": "uuid",
"format": "single_elimination",
"team_size": 5,
"max_teams": 32,
"entry_fee": 0,
"prize_pool": 1000,
"starts_at": "2025-07-01T18:00:00Z",
"registration_closes": "2025-06-25T18:00:00Z",
"rules": "Standard tournament rules apply"
}Odpowiedź
{
"success": true,
"data": {
"id": "uuid",
"name": "Summer Championship 2025",
"slug": "summer-championship-2025-abc123",
"status": "registration",
...
},
"meta": { ... }
}GET
/api/v1/tournaments/{id}Pobierz szczegóły turnieju
read:tournaments
Odpowiedź
{
"success": true,
"data": {
"id": "uuid",
"name": "Tournament Name",
...
},
"meta": { ... }
}PATCH
/api/v1/tournaments/{id}Zaktualizuj turniej
write:tournaments
Treść żądania
{
"name": "Updated Name",
"max_teams": 64,
"status": "ongoing"
}Odpowiedź
{
"success": true,
"data": { ... },
"meta": { ... }
}DELETE
/api/v1/tournaments/{id}Usuń turniej
write:tournaments
Odpowiedź
{
"success": true,
"data": {
"message": "Tournament deleted successfully"
},
"meta": { ... }
}GET
/api/v1/tournaments/{id}/registrationsWyświetl rejestracje turniejowe
read:registrations
Parametry zapytania
status(string)Filtruj według statusu płatnościOdpowiedź
{
"success": true,
"data": [
{
"id": "uuid",
"tournament_id": "uuid",
"team_id": "uuid",
"payment_status": "complete",
"registered_at": "2025-06-20T...",
"teams": {
"id": "uuid",
"name": "Team Name",
"tag": "TAG",
"logo_url": "..."
}
}
],
"meta": { ... }
}POST
/api/v1/tournaments/{id}/registrationsZarejestruj drużynę do turnieju
write:registrations
Treść żądania
{
"team_id": "uuid"
}Odpowiedź
{
"success": true,
"data": {
"id": "uuid",
"tournament_id": "uuid",
"team_id": "uuid",
...
},
"meta": { ... }
}GET
/api/v1/tournaments/{id}/resultsPobierz wyniki i klasyfikacje turnieju
read:results
Odpowiedź
{
"success": true,
"data": {
"tournament": {
"id": "uuid",
"format": "single_elimination",
"status": "completed"
},
"matches": [ ... ],
"standings": [
{
"position": 1,
"team_id": "uuid",
"team_name": "Champions",
"team_tag": "CHM"
}
]
},
"meta": { ... }
}Kody błędów
400Złe żądanie
Nieprawidłowe parametry lub treść żądania
401Nieautoryzowany
Brak lub nieprawidłowy klucz API
403Zabroniony
Brak wymaganego uprawnienia
404Nie znaleziono
Zasób nie znaleziony
429Za dużo żądań
Przekroczono limit żądań
500Błąd serwera
Wystąpił błąd serwera