Skip to main content

Endpoint

PATCH /api/professional-settings/:id

Description

Updates the configuration settings for a professional. This endpoint performs a partial update, allowing you to modify specific fields without providing all settings. See implementation in server/src/modules/professional-settings/professional-settings.controller.ts:27-44.

Authentication

This endpoint requires both Bearer token authentication AND the RolesGuard. Only users with appropriate roles can update professional settings.

Path Parameters

id
string
required
The unique identifier of the settings configuration to updateExample: cfg123

Request Body

All fields are from the UpdateProfessionalSettingDto. Include only the fields you want to update.
user_id
string
UUID of the professional (required for updates)
session_duration_minutes
number
Session duration in minutes
  • Minimum: 15
  • Maximum: 180
work_days
string
String representation of available work days
work_start_time
string
Start time of work day (e.g., “09:00”)
work_end_time
string
End time of work day (e.g., “17:00”)
reservation_window_days
number
How many days ahead clients can book
  • Minimum: 1
  • Maximum: 365
requires_deposit
boolean
Whether payment is required to book appointments
deposit_amount
number
Amount required for deposit (can be null)
  • Minimum: 0
  • Only relevant if requires_deposit is true
session_modalities
string
Type of sessions offered
  • Virtual - Online sessions only
  • Presencial - In-person sessions only
  • BOTH - Both virtual and in-person
office_address
string
Physical address for in-person sessions (required for Presencial or BOTH)

Response

Returns the updated professional settings object.

Example Request

curl -X PATCH https://your-domain.com/api/professional-settings/cfg123 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "prof456",
    "session_duration_minutes": 45,
    "work_start_time": "08:00",
    "work_end_time": "18:00",
    "requires_deposit": true,
    "deposit_amount": 10000,
    "session_modalities": "BOTH"
  }'

Example Response

{
  "status": 200,
  "data": {
    "user_id": "prof456",
    "session_duration_minutes": 45,
    "work_days": "1,2,3,4,5",
    "work_start_time": "08:00",
    "work_end_time": "18:00",
    "reservation_window_days": 30,
    "requires_deposit": true,
    "deposit_amount": 10000,
    "session_modalities": "BOTH",
    "office_address": "Av. Example 123, City"
  }
}

Error Responses

Not Found

{
  "statusCode": 404,
  "message": "Configuración no encontrada",
  "error": "Not Found"
}

Bad Request (Validation Error)

{
  "statusCode": 400,
  "message": [
    "session_duration_minutes must not be less than 15",
    "session_duration_minutes must not be greater than 180"
  ],
  "error": "Bad Request"
}

Forbidden (Insufficient Permissions)

{
  "statusCode": 403,
  "message": "No tenés permisos para acceder a este recurso",
  "error": "Forbidden"
}

Unauthorized

{
  "statusCode": 401,
  "message": "Token inválido o expirado",
  "error": "Unauthorized"
}

Validation Rules

The API validates all input according to the DTO constraints. See server/src/modules/professional-settings/dto/update-professional-setting.dto.ts:18-55.
  • session_duration_minutes: Must be between 15 and 180
  • reservation_window_days: Must be between 1 and 365
  • deposit_amount: Must be at least 0 (when provided)
  • user_id: Must be a valid UUID
  • session_modalities: Must be one of: Virtual, Presencial, or BOTH

Use Cases

  • Change work schedule or hours
  • Adjust session duration
  • Enable or disable payment requirements
  • Update deposit amounts
  • Add or modify office address
  • Change session modalities (virtual/in-person)
  • Adjust how far in advance bookings are allowed

Important Notes

  • This is a PATCH operation (partial update) - only send fields you want to change
  • Requires RolesGuard - typically restricted to admin or professional users
  • Changing requires_deposit affects future reservation creation
  • Updated settings take effect immediately for new reservations

Build docs developers (and LLMs) love