Service Hours

The schedule is part of the agent's supportInformation. The PATCH supports a per-day merge: you can update a single day without having to resend the rest.

Get Schedule

GET https://api.platica.mx/v1/agents/{agentId}/schedule

URL parameters

ParameterTypeDescriptionRequired
agentIdstringUnique identifier of the agent

Response

{
  "outOfServiceBehavior": "limited",
  "serviceHours": {
    "monday":    { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
    "tuesday":   { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
    "wednesday": { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
    "thursday":  { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
    "friday":    { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
    "saturday":  { "availability": "Cerrado", "start": "Cerrado", "end": "Cerrado" },
    "sunday":    { "availability": "Cerrado", "start": "Cerrado", "end": "Cerrado" }
  }
}

Response fields

FieldDescription
outOfServiceBehaviorWhat the agent does outside service hours: "limited", "full", or "none"
serviceHours.{day}.availability"Abierto" or "Cerrado"
serviceHours.{day}.startOpening time (free-form, e.g. "9:00am"). Convention: "Cerrado" when availability is "Cerrado".
serviceHours.{day}.endClosing time (same rules as start)

Update Schedule

At least one of outOfServiceBehavior or serviceHours must be present. The server performs a per-day merge inside serviceHours, so days not included in the body keep their existing configuration.

PATCH https://api.platica.mx/v1/agents/{agentId}/schedule

URL parameters

ParameterTypeDescriptionRequired
agentIdstringUnique identifier of the agent

Request body

Change Saturday's schedule only (other days stay the same):

{
  "serviceHours": {
    "saturday": { "availability": "Abierto", "start": "10:00am", "end": "2:00pm" }
  }
}

Change the out-of-service behavior without touching the hours:

{
  "outOfServiceBehavior": "none"
}
ParameterTypeDescription
outOfServiceBehavior"limited" \| "full" \| "none"Agent behavior outside service hours
serviceHoursobjectPartial map of days (monday..sunday) to their new configuration
ValueDescription
limitedThe agent answers but warns it is outside service hours
fullThe agent answers normally, ignoring the schedule
noneThe agent does not answer outside service hours

Response

{
  "status": "success",
  "message": "Agent schedule updated successfully",
  "data": {
    "outOfServiceBehavior": "none",
    "serviceHours": {
      "monday":    { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
      "tuesday":   { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
      "wednesday": { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
      "thursday":  { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
      "friday":    { "availability": "Abierto", "start": "9:00am", "end": "5:00pm" },
      "saturday":  { "availability": "Abierto", "start": "10:00am", "end": "2:00pm" },
      "sunday":    { "availability": "Cerrado", "start": "Cerrado", "end": "Cerrado" }
    }
  }
}

data always returns the full seven days after the merge.