Skip to main content
PUT
/
api
/
contacto
/
:id
Update Contact Message
curl --request PUT \
  --url https://api.example.com/api/contacto/:id \
  --header 'Content-Type: application/json' \
  --data '
{
  "asunto": "<string>",
  "mensaje": "<string>"
}
'
{
  "message": "<string>",
  "contacto": {
    "contacto.id": 123,
    "contacto.cliente_id": 123,
    "contacto.asunto": "<string>",
    "contacto.mensaje": "<string>",
    "contacto.created_at": "<string>"
  },
  "400 Bad Request": {},
  "500 Internal Server Error": {}
}
This endpoint allows updating the subject (asunto) or message content (mensaje) of an existing contact message. At least one field must be provided.

Authentication

No authentication required based on the source code.

Path Parameters

id
number
required
The ID of the contact message to update

Request Body

asunto
string
Updated subject or title of the message
mensaje
string
Updated message content
At least one of asunto or mensaje must be provided in the request body.

Response

message
string
Success message: “Mensaje actualizado correctamente”
contacto
object
The updated contact message object
contacto.id
number
Message ID
contacto.cliente_id
number
ID of the public client
contacto.asunto
string
Updated message subject
contacto.mensaje
string
Updated message content
contacto.created_at
string
Original creation timestamp

Error Responses

400 Bad Request
object
Returned when the ID is invalid or no fields are provided to update
{
  "message": "ID inválido"
}
or
{
  "message": "Debe enviar asunto o mensaje para actualizar"
}
500 Internal Server Error
object
Returned when a server error occurs
{
  "message": "Error al actualizar mensaje"
}

Example Request

curl -X PUT https://api.example.com/api/contacto/78 \
  -H "Content-Type: application/json" \
  -d '{
    "asunto": "Consulta urgente sobre horarios",
    "mensaje": "Buenos días, necesito saber urgentemente si atienden los sábados. Gracias."
  }'

Example Response

{
  "message": "Mensaje actualizado correctamente",
  "contacto": {
    "id": 78,
    "cliente_id": 45,
    "asunto": "Consulta urgente sobre horarios",
    "mensaje": "Buenos días, necesito saber urgentemente si atienden los sábados. Gracias.",
    "created_at": "2026-03-05T14:45:00.000Z"
  }
}

Notes

  • Only the asunto and mensaje fields can be updated
  • The cliente_id cannot be changed
  • You can update either field individually or both at once

Build docs developers (and LLMs) love