Overview
The Clubs API allows you to manage club information in the MTB Backend system. Each club can have a name, logo, cover image, history, mission, and contact details.
This endpoint supports draft and publish functionality. Use the publishedAt field to control publication status.
List All Clubs
Retrieve a list of all clubs with optional filtering, sorting, and pagination.
Query Parameters
Filter clubs by field values
Sort clubs by field(s). Example: nombreClub:asc
Page number for pagination
Populate relations. Use * for all relations or specify fields like logo,imagenPortada
Response
Array of club objects Unique identifier for the club
Club history in blocks format
Club mission statement in blocks format
Physical address of the club
Publication timestamp (null if draft)
Example Request
curl -X GET "https://api.example.com/api/clubs?populate=*&sort=nombreClub:asc" \
-H "Content-Type: application/json"
Example Response
{
"data" : [
{
"id" : 1 ,
"attributes" : {
"nombreClub" : "Club MTB Ejemplo" ,
"emailConacto" : "[email protected] " ,
"telefonoContacto" : "+56912345678" ,
"direccion" : "Av. Principal 123, Santiago" ,
"historia" : [
{
"type" : "paragraph" ,
"children" : [
{ "type" : "text" , "text" : "Historia del club..." }
]
}
],
"mision" : [
{
"type" : "paragraph" ,
"children" : [
{ "type" : "text" , "text" : "Nuestra misión..." }
]
}
],
"logo" : {
"data" : {
"id" : 1 ,
"attributes" : {
"url" : "/uploads/logo.png"
}
}
},
"imagenPortada" : {
"data" : {
"id" : 2 ,
"attributes" : {
"url" : "/uploads/portada.jpg"
}
}
},
"publishedAt" : "2024-01-15T10:00:00.000Z" ,
"createdAt" : "2024-01-15T10:00:00.000Z" ,
"updatedAt" : "2024-01-20T15:30:00.000Z"
}
}
],
"meta" : {
"pagination" : {
"page" : 1 ,
"pageSize" : 25 ,
"pageCount" : 1 ,
"total" : 1
}
}
}
Get a Single Club
Retrieve a specific club by its ID.
Path Parameters
The unique identifier of the club
Query Parameters
Populate relations. Use * for all relations or specify fields like logo,imagenPortada
Response
The club object (see List All Clubs for structure)
Example Request
curl -X GET "https://api.example.com/api/clubs/1?populate=*" \
-H "Content-Type: application/json"
Example Response
{
"data" : {
"id" : 1 ,
"attributes" : {
"nombreClub" : "Club MTB Ejemplo" ,
"emailConacto" : "[email protected] " ,
"telefonoContacto" : "+56912345678" ,
"direccion" : "Av. Principal 123, Santiago" ,
"historia" : [ ... ],
"mision" : [ ... ],
"logo" : { ... },
"imagenPortada" : { ... },
"publishedAt" : "2024-01-15T10:00:00.000Z" ,
"createdAt" : "2024-01-15T10:00:00.000Z" ,
"updatedAt" : "2024-01-20T15:30:00.000Z"
}
}
}
Create a Club
Create a new club entry.
Request Body
ID of the uploaded logo media file
ID of the uploaded cover image media file
Club history in blocks format
Club mission statement in blocks format
Physical address of the club
Response
Example Request
curl -X POST "https://api.example.com/api/clubs" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"data": {
"nombreClub": "Nuevo Club MTB",
"emailConacto": "[email protected] ",
"telefonoContacto": "+56987654321",
"direccion": "Calle Nueva 456, Valparaíso",
"historia": [
{
"type": "paragraph",
"children": [{"type": "text", "text": "Historia del nuevo club..."}]
}
],
"mision": [
{
"type": "paragraph",
"children": [{"type": "text", "text": "Nuestra misión es..."}]
}
]
}
}'
Example Response
{
"data" : {
"id" : 2 ,
"attributes" : {
"nombreClub" : "Nuevo Club MTB" ,
"emailConacto" : "[email protected] " ,
"telefonoContacto" : "+56987654321" ,
"direccion" : "Calle Nueva 456, Valparaíso" ,
"historia" : [ ... ],
"mision" : [ ... ],
"logo" : { "data" : null },
"imagenPortada" : { "data" : null },
"publishedAt" : null ,
"createdAt" : "2024-01-22T10:00:00.000Z" ,
"updatedAt" : "2024-01-22T10:00:00.000Z"
}
}
}
Update a Club
Update an existing club by its ID.
Path Parameters
The unique identifier of the club to update
Request Body
Club fields to update (same structure as Create)
Response
Example Request
curl -X PUT "https://api.example.com/api/clubs/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"data": {
"nombreClub": "Club MTB Actualizado",
"telefonoContacto": "+56911111111"
}
}'
Example Response
{
"data" : {
"id" : 1 ,
"attributes" : {
"nombreClub" : "Club MTB Actualizado" ,
"emailConacto" : "[email protected] " ,
"telefonoContacto" : "+56911111111" ,
"direccion" : "Av. Principal 123, Santiago" ,
"historia" : [ ... ],
"mision" : [ ... ],
"logo" : { ... },
"imagenPortada" : { ... },
"publishedAt" : "2024-01-15T10:00:00.000Z" ,
"createdAt" : "2024-01-15T10:00:00.000Z" ,
"updatedAt" : "2024-01-22T11:00:00.000Z"
}
}
}
Delete a Club
Delete a club by its ID.
Path Parameters
The unique identifier of the club to delete
Response
Example Request
curl -X DELETE "https://api.example.com/api/clubs/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"
Example Response
{
"data" : {
"id" : 1 ,
"attributes" : {
"nombreClub" : "Club MTB Actualizado" ,
"emailConacto" : "[email protected] " ,
"telefonoContacto" : "+56911111111" ,
"direccion" : "Av. Principal 123, Santiago" ,
"historia" : [ ... ],
"mision" : [ ... ],
"logo" : { ... },
"imagenPortada" : { ... },
"publishedAt" : "2024-01-15T10:00:00.000Z" ,
"createdAt" : "2024-01-15T10:00:00.000Z" ,
"updatedAt" : "2024-01-22T11:00:00.000Z"
}
}
}
Important: Deleting a club is permanent and cannot be undone. Ensure you have proper backups before performing delete operations.