Skip to main content
PUT
/
space
/
update
Update Space
curl --request PUT \
  --url https://api.example.com/space/update \
  --header 'Content-Type: application/json' \
  --data '
{
  "v_id_rate": 123,
  "v_name": "<string>",
  "v_descrip": "<string>",
  "v_pax": 123,
  "v_value4": 123,
  "v_value8": 123,
  "v_value_extra": 123,
  "v_url_img": [
    {}
  ]
}
'
{
  "400": {},
  "401": {},
  "404": {},
  "500": {},
  "message": "<string>"
}

Authentication

This endpoint requires authentication. The JWT token must be provided in the access_token cookie.

Request Body

v_id_rate
number
required
ID of the space to update (associated rate ID)Example: 3
v_name
string
required
Updated name of the spaceExample: "Salón Principal Remodelado"
v_descrip
string
required
Updated description of the spaceExample: "Espacio actualizado con nueva iluminación y mobiliario"
v_pax
number
required
Updated maximum capacity (number of people)Example: 100
v_value4
number
required
Updated price for 4-hour rental periodExample: 300000
v_value8
number
required
Updated price for 8-hour rental periodExample: 480000
v_value_extra
number
required
Updated price for each additional hourExample: 70000
v_url_img
array
required
Updated array of image URLs (minimum 1 image required)Example: ["https://mi-servidor.com/uploads/salon1.jpg", "https://mi-servidor.com/uploads/salon2.jpg"]

Response

message
string
Success message confirming space updateExample: "Update Exitoso"

Example Request

curl -X PUT https://api.demet.com/space/update \
  -H "Content-Type: application/json" \
  -b "access_token=YOUR_JWT_TOKEN" \
  -d '{
    "v_id_rate": 3,
    "v_name": "Salón Principal Remodelado",
    "v_descrip": "Espacio actualizado con nueva iluminación y mobiliario",
    "v_pax": 100,
    "v_value4": 300000,
    "v_value8": 480000,
    "v_value_extra": 70000,
    "v_url_img": [
      "https://mi-servidor.com/uploads/salon1.jpg",
      "https://mi-servidor.com/uploads/salon2.jpg"
    ]
  }'

Example Response

{
  "message": "Update Exitoso"
}

Error Responses

400
error
Validation error or duplicate data detected.
401
error
Authentication error. Token not sent, invalid, or expired.
404
error
Space not found with the provided ID.
500
error
Internal server error.

Build docs developers (and LLMs) love