Fuente: https://crm.begraffic.com/docs/api
Índice para agentes: [llms.txt](https://crm.begraffic.com/llms.txt)

# POST /api/v1/integrations/beschedule/clients

URL base: https://crm.begraffic.com. Autenticación: Authorization: Bearer <CLAVE_V1_bcrm_...>.

Definición OpenAPI de la operación (los bloques schema son esquemas, no cuerpos de ejemplo):

```json
{
  "operationId": "integrations.beschedule.clients",
  "summary": "Actualizar la ficha nativa de Be Schedule",
  "description": "Solo OAuth oficial de Be Schedule. Resumen del cliente, totales y hasta 20 citas. Salud requiere visibilidad restringida, sin servicios, profesionales ni expediente clínico. La privacidad es irreversible. No cambia contactos, consentimiento, etiquetas, pipelines ni campañas. Observaciones repetidas o antiguas no revierten datos; una corrección de privacidad retira siempre la ficha pública.",
  "tags": [
    "Contactos"
  ],
  "x-scope": "contacts:write",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "Clave única por operación (≤ 255 caracteres). Repetir la misma petición devuelve la misma respuesta durante 24 h; con otro cuerpo, 422.",
      "schema": {
        "type": "string",
        "maxLength": 255
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Correcto.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "data"
            ],
            "properties": {
              "data": {
                "type": "object",
                "properties": {
                  "applied": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "applied"
                ]
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "`invalid_request`: Petición inválida (cuerpo, parámetros o consulta).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "`unauthorized`: Falta la clave, no existe, está revocada o caducó.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "`insufficient_scope`: La clave no tiene el alcance que exige la ruta.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "404": {
      "description": "`not_found`: No existe (o no es de este workspace).",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "`idempotency_in_progress`: Otra petición con la misma Idempotency-Key se está procesando.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "`idempotency_key_reused`: La Idempotency-Key ya se usó con otra petición.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "`rate_limited`: Demasiadas llamadas (límite por clave y minuto). Ver `Retry-After`.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "500": {
      "description": "`internal`: Error interno.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "businessId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/]+$"
            },
            "clientId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/]+$"
            },
            "businessName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "vertical": {
              "type": "string",
              "enum": [
                "general",
                "salud"
              ]
            },
            "visibility": {
              "type": "string",
              "enum": [
                "workspace",
                "restricted"
              ]
            },
            "accountState": {
              "type": "string",
              "enum": [
                "active",
                "inactive",
                "unavailable"
              ]
            },
            "joinedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "observedAt": {
              "type": "string",
              "format": "date-time"
            },
            "timeZone": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "totals": {
              "type": "object",
              "properties": {
                "appointments": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "held": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "canceled": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "noShow": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "appointments",
                "held",
                "canceled",
                "noShow"
              ],
              "additionalProperties": false
            },
            "truncated": {
              "type": "boolean"
            },
            "appointments": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^[^/]+$"
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "booking_pending",
                      "payment_pending",
                      "scheduled",
                      "rescheduled",
                      "held",
                      "no_show",
                      "canceled"
                    ]
                  },
                  "startAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "endAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "serviceName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "professionalName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "modality": {
                    "type": "string",
                    "enum": [
                      "online",
                      "in_person",
                      "unavailable"
                    ]
                  }
                },
                "required": [
                  "id",
                  "state",
                  "startAt",
                  "endAt",
                  "serviceName",
                  "professionalName",
                  "modality"
                ],
                "additionalProperties": false
              }
            },
            "contactId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/]+$"
            }
          },
          "required": [
            "businessId",
            "clientId",
            "businessName",
            "vertical",
            "visibility",
            "accountState",
            "joinedAt",
            "observedAt",
            "timeZone",
            "totals",
            "truncated",
            "appointments",
            "contactId"
          ],
          "additionalProperties": false
        }
      }
    }
  }
}
```
