Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/miikorz/DailyNews/llms.txt

Use this file to discover all available pages before exploring further.

PUT /feed/:id updates an existing news feed item in MongoDB. The update is partial — only the fields included in the request body are written; omitted fields retain their current values. Internally the service calls findByIdAndUpdate with the new: true option, so the response always reflects the document’s state after the update. If no document matches the given id, the server responds with 404 NOT_FOUND.

Endpoint

PUT /feed/:id

Path Parameters

id
string
required
The MongoDB ObjectId of the feed item to update (e.g. 664a1f2e8b3c2a001e4d7f01).

Request Body

Send a JSON body with Content-Type: application/json. All fields are optional — include only the ones you want to change.
title
string
New headline or title of the news article.
description
string
New summary or excerpt of the article.
author
string
New byline for the article.
New canonical URL for the article.
portrait
string | null
New cover or thumbnail image URL. May be set to null to clear the field.
newsletter
string
New source identifier or publication name.

Response

data
Feed
The Feed object as it exists in MongoDB after the update has been applied.
error
null
Always null on a successful 200 response.

Example Request

curl -X PUT http://localhost:3001/feed/664a1f2e8b3c2a001e4d7f01 \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "title": "El Gobierno aprueba el nuevo plan de vivienda (actualizado)",
    "description": "Texto actualizado con los últimos detalles del plan de vivienda aprobado por el Consejo de Ministros."
  }'

Example Response

{
  "data": {
    "_id": "664a1f2e8b3c2a001e4d7f01",
    "title": "El Gobierno aprueba el nuevo plan de vivienda (actualizado)",
    "description": "Texto actualizado con los últimos detalles del plan de vivienda aprobado por el Consejo de Ministros.",
    "author": "María López",
    "link": "https://www.elpais.com/economia/2024-05-20/el-gobierno-aprueba-nuevo-plan-vivienda.html",
    "portrait": "https://imagenes.elpais.com/resizer/vivienda-cover.jpg",
    "newsletter": "El País",
    "createdAt": "2024-05-20T08:34:22.000Z"
  },
  "error": null
}

Error Responses

404 — Feed item not found:
{
  "data": null,
  "error": {
    "code": "NOT_FOUND",
    "message": "Feed not found"
  }
}
500 — Unexpected server error:
{
  "data": null,
  "error": {
    "code": "INTERNAL_SERVER_ERROR",
    "message": "Unexpected error occurred"
  }
}

Status Codes

CodeMeaning
200Feed item updated and returned successfully
404No feed item exists with the provided ObjectId
500An unexpected server error occurred

Build docs developers (and LLMs) love