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

# POST /api/v1/integrations/{app}/processes

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.processes.sync",
  "summary": "Sincronizar una inscripción de Be School o una cita de Be Schedule",
  "description": "Solo OAuth oficial de la app indicada. Identidad estable, sin duplicar contactos u oportunidades; rechaza observaciones antiguas. Requiere activar el seguimiento en el CRM. historical:true carga estados sin emitir campañas ni avisos. Las citas restringidas quedan fuera de negocios, etiquetas y segmentación. La aplicación conserva la autoridad de matrículas, citas y pagos.",
  "tags": [
    "Negocios"
  ],
  "x-scope": "deals:write",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "name": "app",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "enum": [
          "beschool",
          "beschedule"
        ]
      }
    },
    {
      "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"
                  },
                  "dealId": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "pending": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "applied",
                  "dealId",
                  "pending"
                ]
              }
            }
          }
        }
      }
    },
    "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": "`invalid_state`: Operación no válida en el estado actual. `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": {
            "externalId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "contactId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/]+$"
            },
            "instanceId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/]+$"
            },
            "instanceName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "subjectId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[^/]+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "offeringId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[^/]+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "offeringName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "offerings": {
              "default": [],
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^[^/]+$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "periodId": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[^/]+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "periodName": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ]
            },
            "state": {
              "type": "string",
              "enum": [
                "started",
                "requirements_pending",
                "payment_pending",
                "payment_processing",
                "payment_failed",
                "needs_review",
                "completed",
                "closed",
                "inquiry",
                "booking_pending",
                "scheduled",
                "rescheduled",
                "held",
                "no_show",
                "canceled"
              ]
            },
            "observedAt": {
              "type": "string",
              "format": "date-time"
            },
            "startedAt": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "amountMinor": {
              "default": null,
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100000000000000
                },
                {
                  "type": "null"
                }
              ]
            },
            "currency": {
              "default": "USD",
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            },
            "externalUrl": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2000,
                  "format": "uri"
                },
                {
                  "type": "null"
                }
              ]
            },
            "historical": {
              "default": false,
              "type": "boolean"
            },
            "visibility": {
              "default": "workspace",
              "type": "string",
              "enum": [
                "workspace",
                "restricted"
              ]
            }
          },
          "required": [
            "externalId",
            "contactId",
            "instanceId",
            "instanceName",
            "subjectId",
            "offeringId",
            "offeringName",
            "state",
            "observedAt"
          ],
          "additionalProperties": false
        }
      }
    }
  }
}
```
