Skip to main content

Overview

The Noticia content type manages news articles and announcements for the club. It includes rich text content, featured images, and publishing controls.
This is a collection type with draft and publish enabled. Articles can be saved as drafts and scheduled for publication.

Schema Information

  • Collection Name: noticias
  • Singular: noticia
  • Plural: noticias
  • Draft & Publish: Enabled

Attributes

titulo

titulo
string
required
The title of the news article.
  • Required field
  • Used to generate the slug automatically
  • Displayed as the main heading

slug

slug
uid
URL-friendly unique identifier generated from the title.
  • Automatically generated from titulo
  • Unique across all news articles
  • Used in article URLs
  • Example: “nueva-competencia-2026” from “Nueva Competencia 2026”

imagenPrincipal

imagenPrincipal
media
Featured image for the news article.
  • Single file upload
  • Allowed types: images, files, videos, audios
  • Recommended: High-quality JPEG, 1200x630px (2:1 ratio)
  • Optional field
  • Used in article previews and social sharing

resumen

resumen
text
required
Short summary or excerpt of the article.
  • Required field
  • Plain text (no rich formatting)
  • Recommended: 150-300 characters
  • Used in article listings and previews

contenido

contenido
blocks
required
Main article content with rich text formatting.
  • Required field
  • Supports rich text blocks
  • Can include headings, paragraphs, lists, links
  • Full article body content

fecha

fecha
date
required
Publication date of the article.
  • Required field
  • Date format: YYYY-MM-DD
  • Used for sorting and displaying articles chronologically

autor

autor
string
Name of the article author.
  • Optional field
  • Free text format
  • Displayed with the article

publicado

publicado
boolean
default:true
Whether the article is published and visible.
  • Default: true
  • Can be used for additional visibility control
  • Works in conjunction with draft/publish system

API Endpoints

List All News Articles

curl -X GET 'https://api.example.com/api/noticias?sort=fecha:desc' \
  -H 'Authorization: Bearer YOUR_TOKEN'
data
array
Array of news article entries

Get Single Article

# By ID
curl -X GET 'https://api.example.com/api/noticias/1?populate=*' \
  -H 'Authorization: Bearer YOUR_TOKEN'

# By slug (requires custom route or filter)
curl -X GET 'https://api.example.com/api/noticias?filters[slug][$eq]=nueva-competencia-2026&populate=*' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Create News Article

curl -X POST 'https://api.example.com/api/noticias' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "data": {
      "titulo": "Nueva Competencia Regional 2026",
      "resumen": "Anunciamos la apertura de inscripciones para la competencia regional de MTB que se realizará en abril.",
      "contenido": [
        {
          "type": "paragraph",
          "children": [
            {
              "type": "text",
              "text": "Nos complace anunciar la nueva competencia regional..."
            }
          ]
        }
      ],
      "fecha": "2026-03-15",
      "autor": "Juan Pérez",
      "publicado": true
    }
  }'

Update Article

curl -X PUT 'https://api.example.com/api/noticias/1' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "data": {
      "publicado": false
    }
  }'

Delete Article

curl -X DELETE 'https://api.example.com/api/noticias/1' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Query Parameters

Sorting

Sort articles by date (newest first):
curl -X GET 'https://api.example.com/api/noticias?sort=fecha:desc' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Filtering

Filter published articles only:
curl -X GET 'https://api.example.com/api/noticias?filters[publicado][$eq]=true&publicationState=live' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Filter by date range:
curl -X GET 'https://api.example.com/api/noticias?filters[fecha][$gte]=2026-01-01&filters[fecha][$lte]=2026-12-31' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Pagination

curl -X GET 'https://api.example.com/api/noticias?pagination[page]=1&pagination[pageSize]=10' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Populate Media

curl -X GET 'https://api.example.com/api/noticias?populate=imagenPrincipal' \
  -H 'Authorization: Bearer YOUR_TOKEN'

Example Response

{
  "data": [
    {
      "id": 1,
      "attributes": {
        "titulo": "Nueva Competencia Regional 2026",
        "slug": "nueva-competencia-regional-2026",
        "resumen": "Anunciamos la apertura de inscripciones para la competencia regional de MTB que se realizará en abril.",
        "contenido": [
          {
            "type": "heading",
            "level": 2,
            "children": [
              {
                "type": "text",
                "text": "Detalles de la Competencia"
              }
            ]
          },
          {
            "type": "paragraph",
            "children": [
              {
                "type": "text",
                "text": "La competencia se realizará el día 15 de abril en..."
              }
            ]
          }
        ],
        "fecha": "2026-03-15",
        "autor": "Juan Pérez",
        "publicado": true,
        "imagenPrincipal": {
          "data": {
            "id": 5,
            "attributes": {
              "name": "competencia.jpg",
              "url": "/uploads/competencia_456.jpg",
              "formats": {
                "large": {
                  "url": "/uploads/large_competencia_456.jpg",
                  "width": 1000,
                  "height": 667
                },
                "medium": {
                  "url": "/uploads/medium_competencia_456.jpg",
                  "width": 750,
                  "height": 500
                },
                "small": {
                  "url": "/uploads/small_competencia_456.jpg",
                  "width": 500,
                  "height": 333
                }
              }
            }
          }
        },
        "createdAt": "2026-03-04T09:00:00.000Z",
        "updatedAt": "2026-03-04T09:15:00.000Z",
        "publishedAt": "2026-03-04T09:15:00.000Z"
      }
    }
  ],
  "meta": {
    "pagination": {
      "page": 1,
      "pageSize": 25,
      "pageCount": 1,
      "total": 1
    }
  }
}

Slug Generation

The slug field is automatically generated from the titulo field:
  • Converts to lowercase
  • Replaces spaces with hyphens
  • Removes special characters
  • Ensures uniqueness
You can manually override the slug when creating or updating an article by providing a custom value.

Best Practices

SEO-Friendly Titles

Write clear, descriptive titles that accurately represent the article content. This improves SEO and user engagement.

Compelling Summaries

Create engaging summaries that encourage readers to click through. Keep them concise (150-300 characters).

Featured Images

Always include a high-quality featured image. Use 1200x630px (2:1 ratio) for optimal display across devices and social media.

Consistent Dating

Use the fecha field consistently for proper chronological sorting. Set it to the actual publication date.

Rich Content

Leverage the blocks editor for well-structured content with headings, lists, and formatting for better readability.

Draft Workflow

Use draft mode to prepare articles before publication. Review and edit before making them live.

Content Structure Example

Here’s a recommended structure for the contenido blocks:
[
  {
    "type": "heading",
    "level": 2,
    "children": [{ "type": "text", "text": "Introducción" }]
  },
  {
    "type": "paragraph",
    "children": [{ "type": "text", "text": "Párrafo introductorio..." }]
  },
  {
    "type": "heading",
    "level": 2,
    "children": [{ "type": "text", "text": "Detalles" }]
  },
  {
    "type": "list",
    "format": "unordered",
    "children": [
      {
        "type": "list-item",
        "children": [{ "type": "text", "text": "Punto 1" }]
      },
      {
        "type": "list-item",
        "children": [{ "type": "text", "text": "Punto 2" }]
      }
    ]
  }
]

Build docs developers (and LLMs) love