{"openapi":"3.1.0","info":{"title":"HoraMatch API","version":"1.0.0","description":"API versionada para disponibilidad, reservas, CRM de ventas y webhooks firmados."},"servers":[{"url":"https://horamatch.com/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/account":{"get":{"operationId":"account.retrieve","summary":"Identidad y scopes de la API key","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApiAccount"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event-types":{"get":{"operationId":"eventTypes.list","summary":"Tipos de evento publicados","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EventTypeList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event-types/{id}":{"get":{"operationId":"eventTypes.retrieve","summary":"Detalle de un tipo de evento","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EventType"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/event-types/{id}/slots":{"get":{"operationId":"availability.list","summary":"Disponibilidad calculada","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Availability"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"}}]}},"/bookings":{"get":{"operationId":"bookings.list","summary":"Reservas paginadas","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["tentative","pending_approval","confirmed","reschedule_pending","rejected","cancelled","completed","no_show","expired"]}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"guestEmail","in":"query","required":false,"schema":{"type":"string","format":"email"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}]},"post":{"operationId":"bookings.create","summary":"Crear una reserva","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCreateResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCreateResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBookingInput"}}}}}},"/bookings/{uid}":{"get":{"operationId":"bookings.retrieve","summary":"Detalle de una reserva","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Booking"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}}]}},"/bookings/{uid}/cancel":{"post":{"operationId":"bookings.cancel","summary":"Cancelar una reserva","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCancelResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCancelResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBookingInput"}}}}}},"/bookings/{uid}/complete":{"post":{"operationId":"bookings.complete","summary":"Marcar una reserva confirmada como completada","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCancelResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BookingCancelResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBookingInput"}}}}}},"/crm/contacts":{"get":{"operationId":"crm.contacts.list","summary":"Listar contactos accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.contacts:read"]}],"x-required-scopes":["crm.contacts:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"ownerUserId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"teamId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"lifecycle","in":"query","required":false,"schema":{"type":"string","enum":["subscriber","lead","qualified","opportunity","customer","former_customer","other"]}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":160}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmContactList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/contacts/{id}":{"get":{"operationId":"crm.contacts.retrieve","summary":"Detalle de un contacto accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.contacts:read"]}],"x-required-scopes":["crm.contacts:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmContact"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/contacts/upsert":{"post":{"operationId":"crm.contacts.upsert","summary":"Crear o resolver un contacto por identidad normalizada","tags":["CRM"],"security":[{"bearerAuth":["crm.contacts:write"]}],"x-required-scopes":["crm.contacts:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmContactUpsertResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmContactUpsertResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmContactUpsertInput"}}}}}},"/crm/contacts/{id}/update":{"post":{"operationId":"crm.contacts.update","summary":"Actualizar un contacto con control de revisión","tags":["CRM"],"security":[{"bearerAuth":["crm.contacts:write"]}],"x-required-scopes":["crm.contacts:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmContactUpdateInput"}}}}}},"/crm/contacts/{id}/archive":{"post":{"operationId":"crm.contacts.archive","summary":"Archivar un contacto de forma reversible","tags":["CRM"],"security":[{"bearerAuth":["crm.contacts:write"]}],"x-required-scopes":["crm.contacts:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmEntityArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmEntityArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/contacts/{id}/restore":{"post":{"operationId":"crm.contacts.restore","summary":"Restaurar un contacto archivado","tags":["CRM"],"security":[{"bearerAuth":["crm.contacts:write"]}],"x-required-scopes":["crm.contacts:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmEntityArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmEntityArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/contacts/{id}/merge":{"post":{"operationId":"crm.contacts.merge","summary":"Iniciar un merge reversible de contactos","tags":["CRM"],"security":[{"bearerAuth":["crm.contacts:write","crm.admin"]}],"x-required-scopes":["crm.contacts:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMergeResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMergeResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmMergeBeginInput"}}}}}},"/crm/companies":{"get":{"operationId":"crm.companies.list","summary":"Listar empresas accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.companies:read"]}],"x-required-scopes":["crm.companies:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"ownerUserId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"teamId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"industry","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"segment","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":160}},{"name":"includeArchived","in":"query","required":false,"schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCompanyList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.companies.create","summary":"Crear una empresa","tags":["CRM"],"security":[{"bearerAuth":["crm.companies:write"]}],"x-required-scopes":["crm.companies:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCompanyUpsertResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCompanyUpsertResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmCompanyCreateInput"}}}}}},"/crm/companies/{id}":{"get":{"operationId":"crm.companies.retrieve","summary":"Detalle de una empresa accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.companies:read"]}],"x-required-scopes":["crm.companies:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCompany"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/companies/upsert":{"post":{"operationId":"crm.companies.upsert","summary":"Crear o resolver una empresa por dominio normalizado","tags":["CRM"],"security":[{"bearerAuth":["crm.companies:write"]}],"x-required-scopes":["crm.companies:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCompanyUpsertResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCompanyUpsertResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmCompanyUpsertInput"}}}}}},"/crm/companies/{id}/update":{"post":{"operationId":"crm.companies.update","summary":"Actualizar una empresa con control de revisión","tags":["CRM"],"security":[{"bearerAuth":["crm.companies:write"]}],"x-required-scopes":["crm.companies:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmCompanyUpdateInput"}}}}}},"/crm/companies/{id}/archive":{"post":{"operationId":"crm.companies.archive","summary":"Archivar una empresa de forma reversible","tags":["CRM"],"security":[{"bearerAuth":["crm.companies:write"]}],"x-required-scopes":["crm.companies:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/companies/{id}/restore":{"post":{"operationId":"crm.companies.restore","summary":"Restaurar una empresa archivada","tags":["CRM"],"security":[{"bearerAuth":["crm.companies:write"]}],"x-required-scopes":["crm.companies:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/companies/{id}/merge":{"post":{"operationId":"crm.companies.merge","summary":"Iniciar un merge reversible de empresas","tags":["CRM"],"security":[{"bearerAuth":["crm.companies:write","crm.admin"]}],"x-required-scopes":["crm.companies:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMergeResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMergeResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmMergeBeginInput"}}}}}},"/crm/merges/{id}/resume":{"post":{"operationId":"crm.merges.resume","summary":"Avanzar un checkpoint del merge","tags":["CRM"],"security":[{"bearerAuth":["crm.admin"]}],"x-required-scopes":["crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMergeResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMergeResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmMergeAdvanceInput"}}}}}},"/crm/merges/{id}/rollback":{"post":{"operationId":"crm.merges.rollback","summary":"Revertir un merge por checkpoints","tags":["CRM"],"security":[{"bearerAuth":["crm.admin"]}],"x-required-scopes":["crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMergeResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMergeResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmMergeAdvanceInput"}}}}}},"/crm/leads":{"get":{"operationId":"crm.leads.list","summary":"Listar leads accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.leads:read"]}],"x-required-scopes":["crm.leads:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"ownerUserId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"teamId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"contactId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["new","working","qualified","converted","disqualified","archived"]}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":160}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLeadList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.leads.create","summary":"Crear un lead canónico para un contacto accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.leads:write"]}],"x-required-scopes":["crm.leads:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLeadCreateInput"}}}}}},"/crm/leads/{id}":{"get":{"operationId":"crm.leads.retrieve","summary":"Detalle de un lead accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.leads:read"]}],"x-required-scopes":["crm.leads:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLead"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/leads/{id}/transition":{"post":{"operationId":"crm.leads.transition","summary":"Cambiar estado, SLA y scoring explicable","tags":["CRM"],"security":[{"bearerAuth":["crm.leads:write"]}],"x-required-scopes":["crm.leads:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLeadMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLeadMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLeadTransitionInput"}}}}}},"/crm/leads/{id}/convert":{"post":{"operationId":"crm.leads.convert","summary":"Convertir un lead calificado con confirmación explícita","tags":["CRM"],"security":[{"bearerAuth":["crm.leads:write"]}],"x-required-scopes":["crm.leads:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLeadMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLeadMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLeadConvertInput"}}}}}},"/crm/leads/{id}/update":{"post":{"operationId":"crm.leads.update","summary":"Actualizar asignación, fuente o SLA con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.leads:write"]}],"x-required-scopes":["crm.leads:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmLeadUpdateInput"}}}}}},"/crm/leads/{id}/archive":{"post":{"operationId":"crm.leads.archive","summary":"Archivar un lead sin perder su estado","tags":["CRM"],"security":[{"bearerAuth":["crm.leads:write"]}],"x-required-scopes":["crm.leads:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/leads/{id}/restore":{"post":{"operationId":"crm.leads.restore","summary":"Restaurar un lead archivado","tags":["CRM"],"security":[{"bearerAuth":["crm.leads:write"]}],"x-required-scopes":["crm.leads:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/deals":{"get":{"operationId":"crm.deals.list","summary":"Listar deals accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:read"]}],"x-required-scopes":["crm.deals:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"ownerUserId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"teamId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"pipelineId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"stageId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","won","lost","archived"]}},{"name":"expectedCloseFrom","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"expectedCloseTo","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.deals.create","summary":"Crear un deal con monto en unidades menores","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write"]}],"x-required-scopes":["crm.deals:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmDealCreateInput"}}}}}},"/crm/deals/{id}":{"get":{"operationId":"crm.deals.retrieve","summary":"Detalle de un deal accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:read"]}],"x-required-scopes":["crm.deals:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDeal"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/deals/{id}/update":{"post":{"operationId":"crm.deals.update","summary":"Actualizar un deal con control de revisión","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write"]}],"x-required-scopes":["crm.deals:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmDealUpdateInput"}}}}}},"/crm/deals/{id}/stage":{"post":{"operationId":"crm.deals.moveStage","summary":"Mover un deal con control de revisión","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write"]}],"x-required-scopes":["crm.deals:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmDealMoveStageInput"}}}}}},"/crm/deals/{id}/line-items":{"post":{"operationId":"crm.deals.replaceLineItems","summary":"Reemplazar line items con snapshot monetario y CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write"]}],"x-required-scopes":["crm.deals:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmOpportunityLineItemsResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmOpportunityLineItemsResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmOpportunityLineItemsInput"}}}}}},"/crm/deals/{id}/archive":{"post":{"operationId":"crm.deals.archive","summary":"Archivar un deal preservando su resultado","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write"]}],"x-required-scopes":["crm.deals:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/deals/{id}/restore":{"post":{"operationId":"crm.deals.restore","summary":"Restaurar un deal con su estado previo","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write"]}],"x-required-scopes":["crm.deals:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/deals/{id}/stakeholders":{"get":{"operationId":"crm.deals.stakeholders.list","summary":"Listar stakeholders de un deal accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:read"]}],"x-required-scopes":["crm.deals:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealStakeholderList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.deals.stakeholders.upsert","summary":"Crear o actualizar un stakeholder y la revisión del deal","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write"]}],"x-required-scopes":["crm.deals:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealStakeholderMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealStakeholderMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmDealStakeholderInput"}}}}}},"/crm/deals/{id}/stakeholders/{contactId}/remove":{"post":{"operationId":"crm.deals.stakeholders.remove","summary":"Eliminar un stakeholder con CAS del deal","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write"]}],"x-required-scopes":["crm.deals:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"contactId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealStakeholderMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmDealStakeholderMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmDealStakeholderRemoveInput"}}}}}},"/crm/meetings/outcomes":{"get":{"operationId":"crm.meetingOutcomes.list","summary":"Listar outcomes de reuniones accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.meetings:read"]}],"x-required-scopes":["crm.meetings:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMeetingOutcomeList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/meetings/outcomes/{id}":{"get":{"operationId":"crm.meetingOutcomes.retrieve","summary":"Recuperar un outcome de reunión accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.meetings:read"]}],"x-required-scopes":["crm.meetings:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMeetingOutcome"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/meetings/{bookingId}/outcomes":{"post":{"operationId":"crm.meetingOutcomes.record","summary":"Registrar una conclusión estructurada y acciones de seguimiento","tags":["CRM"],"security":[{"bearerAuth":["crm.meetings:write"]}],"x-required-scopes":["crm.meetings:write"],"parameters":[{"name":"bookingId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMeetingOutcomeMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMeetingOutcomeMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmMeetingOutcomeInput"}}}}}},"/crm/bookings/{bookingUid}/deal-links":{"get":{"operationId":"crm.bookingDealLinks.listByBooking","summary":"Listar asociaciones de una reserva con sus deals accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.meetings:read"]}],"x-required-scopes":["crm.meetings:read"],"parameters":[{"name":"bookingUid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmBookingDealLinkList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.bookingDealLinks.create","summary":"Asociar una reserva a un deal con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.meetings:write"]}],"x-required-scopes":["crm.meetings:write"],"parameters":[{"name":"bookingUid","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmBookingDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmBookingDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmBookingDealLinkCreateInput"}}}}}},"/crm/bookings/{bookingUid}/deal-links/{linkId}/update":{"post":{"operationId":"crm.bookingDealLinks.update","summary":"Cambiar la asociación primaria con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.meetings:write"]}],"x-required-scopes":["crm.meetings:write"],"parameters":[{"name":"bookingUid","in":"path","required":true,"schema":{"type":"string"}},{"name":"linkId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmBookingDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmBookingDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmBookingDealLinkUpdateInput"}}}}}},"/crm/bookings/{bookingUid}/deal-links/{linkId}/remove":{"post":{"operationId":"crm.bookingDealLinks.remove","summary":"Desvincular un deal de una reserva con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.meetings:write"]}],"x-required-scopes":["crm.meetings:write"],"parameters":[{"name":"bookingUid","in":"path","required":true,"schema":{"type":"string"}},{"name":"linkId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmBookingDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmBookingDealMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmBookingDealLinkRemoveInput"}}}}}},"/crm/deals/{id}/booking-links":{"get":{"operationId":"crm.bookingDealLinks.listByDeal","summary":"Listar reservas asociadas a un deal accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.meetings:read"]}],"x-required-scopes":["crm.meetings:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmBookingDealLinkList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/pipelines":{"get":{"operationId":"crm.pipelines.list","summary":"Listar pipelines y sus etapas","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:read"]}],"x-required-scopes":["crm.deals:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"includeArchived","in":"query","required":false,"schema":{"default":"false","type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmPipelineList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.pipelines.create","summary":"Crear un pipeline manteniendo un único default","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write","crm.admin"]}],"x-required-scopes":["crm.deals:write","crm.admin"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmPipelineCreateInput"}}}}}},"/crm/pipelines/{id}/update":{"post":{"operationId":"crm.pipelines.update","summary":"Actualizar un pipeline con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write","crm.admin"]}],"x-required-scopes":["crm.deals:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmPipelineUpdateInput"}}}}}},"/crm/pipelines/{id}/archive":{"post":{"operationId":"crm.pipelines.archive","summary":"Archivar un pipeline no predeterminado y sin deals activos","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write","crm.admin"]}],"x-required-scopes":["crm.deals:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/pipelines/{id}/restore":{"post":{"operationId":"crm.pipelines.restore","summary":"Restaurar un pipeline archivado","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write","crm.admin"]}],"x-required-scopes":["crm.deals:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/pipelines/{id}/stages":{"post":{"operationId":"crm.pipelines.stages.create","summary":"Crear una etapa validada en un pipeline","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write","crm.admin"]}],"x-required-scopes":["crm.deals:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmPipelineStageCreateInput"}}}}}},"/crm/pipelines/{id}/stages/{stageId}/update":{"post":{"operationId":"crm.pipelines.stages.update","summary":"Actualizar una etapa con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write","crm.admin"]}],"x-required-scopes":["crm.deals:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stageId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmPipelineStageUpdateInput"}}}}}},"/crm/pipelines/{id}/stages/{stageId}/archive":{"post":{"operationId":"crm.pipelines.stages.archive","summary":"Archivar una etapa sin deals activos","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write","crm.admin"]}],"x-required-scopes":["crm.deals:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stageId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/pipelines/{id}/stages/{stageId}/restore":{"post":{"operationId":"crm.pipelines.stages.restore","summary":"Restaurar una etapa archivada","tags":["CRM"],"security":[{"bearerAuth":["crm.deals:write","crm.admin"]}],"x-required-scopes":["crm.deals:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stageId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/activities":{"get":{"operationId":"crm.activities.list","summary":"Listar actividades accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.activities:read"]}],"x-required-scopes":["crm.activities:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"contactId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"dealId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["meeting","email","task","note","stage_change","automation","quote","system"]}},{"name":"occurredFrom","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"occurredTo","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmActivityList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.activities.create","summary":"Crear una actividad vinculada y auditable","tags":["CRM"],"security":[{"bearerAuth":["crm.activities:write"]}],"x-required-scopes":["crm.activities:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmActivityCreateInput"}}}}}},"/crm/activities/{id}":{"get":{"operationId":"crm.activities.retrieve","summary":"Detalle de una actividad accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.activities:read"]}],"x-required-scopes":["crm.activities:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmActivity"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/activities/{id}/update":{"post":{"operationId":"crm.activities.update","summary":"Actualizar una actividad con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.activities:write"]}],"x-required-scopes":["crm.activities:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmActivityUpdateInput"}}}}}},"/crm/activities/{id}/archive":{"post":{"operationId":"crm.activities.archive","summary":"Archivar una actividad","tags":["CRM"],"security":[{"bearerAuth":["crm.activities:write"]}],"x-required-scopes":["crm.activities:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/activities/{id}/restore":{"post":{"operationId":"crm.activities.restore","summary":"Restaurar una actividad","tags":["CRM"],"security":[{"bearerAuth":["crm.activities:write"]}],"x-required-scopes":["crm.activities:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmLifecycleResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/tasks":{"get":{"operationId":"crm.tasks.list","summary":"Listar tareas accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.tasks:read"]}],"x-required-scopes":["crm.tasks:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"ownerUserId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"contactId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"dealId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","in_progress","completed","cancelled"]}},{"name":"priority","in":"query","required":false,"schema":{"type":"string","enum":["low","normal","high","urgent"]}},{"name":"dueFrom","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"dueTo","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTaskList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.tasks.create","summary":"Crear una tarea vinculada","tags":["CRM"],"security":[{"bearerAuth":["crm.tasks:write"]}],"x-required-scopes":["crm.tasks:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTask"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTask"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTaskCreateInput"}}}}}},"/crm/tasks/{id}":{"get":{"operationId":"crm.tasks.retrieve","summary":"Detalle de una tarea accesible","tags":["CRM"],"security":[{"bearerAuth":["crm.tasks:read"]}],"x-required-scopes":["crm.tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTask"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/tasks/{id}/update":{"post":{"operationId":"crm.tasks.update","summary":"Actualizar una tarea con control de revisión","tags":["CRM"],"security":[{"bearerAuth":["crm.tasks:write"]}],"x-required-scopes":["crm.tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTask"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTask"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmTaskUpdateInput"}}}}}},"/crm/tasks/{id}/complete":{"post":{"operationId":"crm.tasks.complete","summary":"Completar una tarea con control de revisión","tags":["CRM"],"security":[{"bearerAuth":["crm.tasks:write"]}],"x-required-scopes":["crm.tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTask"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTask"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/tasks/{id}/cancel":{"post":{"operationId":"crm.tasks.cancel","summary":"Cancelar una tarea con control de revisión","tags":["CRM"],"security":[{"bearerAuth":["crm.tasks:write"]}],"x-required-scopes":["crm.tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTask"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmTask"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/products":{"get":{"operationId":"crm.products.list","summary":"Listar productos del catálogo","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:read"]}],"x-required-scopes":["crm.quotes:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived"]}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":160}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmProductList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.products.create","summary":"Crear un producto del catálogo","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:write"]}],"x-required-scopes":["crm.quotes:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCatalogMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCatalogMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmProductCreateInput"}}}}}},"/crm/price-books":{"get":{"operationId":"crm.priceBooks.list","summary":"Listar listas de precios","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:read"]}],"x-required-scopes":["crm.quotes:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived"]}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z]{3}$"}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmPriceBookList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.priceBooks.create","summary":"Crear una lista de precios","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:write"]}],"x-required-scopes":["crm.quotes:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCatalogMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCatalogMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmPriceBookCreateInput"}}}}}},"/crm/price-books/{id}/items":{"post":{"operationId":"crm.priceBooks.setItem","summary":"Crear o actualizar un precio con CAS opcional","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:write"]}],"x-required-scopes":["crm.quotes:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCatalogMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCatalogMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmPriceBookItemSetInput"}}}}}},"/crm/quotes":{"get":{"operationId":"crm.quotes.list","summary":"Listar cotizaciones accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:read"]}],"x-required-scopes":["crm.quotes:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"dealId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","approval_required","approved","sent","accepted","rejected","expired","void"]}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.quotes.create","summary":"Crear un borrador versionado desde un deal","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:write"]}],"x-required-scopes":["crm.quotes:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmQuoteCreateInput"}}}}}},"/crm/quotes/{id}":{"get":{"operationId":"crm.quotes.retrieve","summary":"Detalle y totales de una cotización","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:read"]}],"x-required-scopes":["crm.quotes:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuote"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/quotes/{id}/revise":{"post":{"operationId":"crm.quotes.revise","summary":"Crear una nueva versión inmutable del borrador","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:write"]}],"x-required-scopes":["crm.quotes:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmQuoteReviseInput"}}}}}},"/crm/quotes/{id}/send":{"post":{"operationId":"crm.quotes.send","summary":"Entregar una versión inmutable por Resend con confirmación, consentimiento y PDF privado verificado","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:write"]}],"x-required-scopes":["crm.quotes:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteDeliveryResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteDeliveryResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Resultado del proveedor todavía incierto; reintenta con la misma Idempotency-Key","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteDeliveryAttempt"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT, CRM_IDEMPOTENCY_MISMATCH o CRM_SEQUENCE_BLOCKED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmQuoteSendInput"}}}}}},"/crm/quotes/{id}/decision":{"post":{"operationId":"crm.quotes.decision","summary":"Registrar aceptación, rechazo o expiración","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:write"]}],"x-required-scopes":["crm.quotes:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuoteMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmQuoteDecisionInput"}}}}}},"/crm/forecast":{"get":{"operationId":"crm.forecast.retrieve","summary":"Último forecast o snapshot solicitado, separado por moneda","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[{"name":"periodId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"snapshotId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmForecast"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/reports/pipeline":{"get":{"operationId":"crm.reports.pipeline","summary":"Pipeline agregado por etapa y moneda","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[{"name":"pipelineId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"ownerUserId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","won","lost"]}},{"name":"expectedCloseFrom","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"expectedCloseTo","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmPipelineReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/sequences":{"get":{"operationId":"crm.sequences.list","summary":"Listar secuencias administrables","tags":["CRM"],"security":[{"bearerAuth":["crm.sequences:read"]}],"x-required-scopes":["crm.sequences:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequenceList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.sequences.create","summary":"Crear un borrador de secuencia","tags":["CRM"],"security":[{"bearerAuth":["crm.sequences:write"]}],"x-required-scopes":["crm.sequences:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequenceMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequenceMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSequenceDraftInput"}}}}}},"/crm/sequences/{id}/validate":{"post":{"operationId":"crm.sequences.validate","summary":"Validar referencias y checksum del borrador","tags":["CRM"],"security":[{"bearerAuth":["crm.sequences:read"]}],"x-required-scopes":["crm.sequences:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequenceValidation"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmEmptyInput"}}}}}},"/crm/sequences/{id}/revise":{"post":{"operationId":"crm.sequences.revise","summary":"Crear una nueva versión del borrador con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.sequences:write"]}],"x-required-scopes":["crm.sequences:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequenceMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequenceMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSequenceReviseInput"}}}}}},"/crm/sequences/{id}/publish":{"post":{"operationId":"crm.sequences.publish","summary":"Publicar una versión validada con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.sequences:write"]}],"x-required-scopes":["crm.sequences:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequencePublishResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequencePublishResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/sequences/{id}/archive":{"post":{"operationId":"crm.sequences.archive","summary":"Archivar una secuencia con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.sequences:write"]}],"x-required-scopes":["crm.sequences:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequenceArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmSequenceArchiveResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/sequences/{id}/enrollments/preview":{"post":{"operationId":"crm.sequences.enrollments.preview","summary":"Previsualizar elegibilidad sin efectos","tags":["CRM"],"security":[{"bearerAuth":["crm.sequences:enroll"]}],"x-required-scopes":["crm.sequences:enroll"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmEnrollmentPreview"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmEnrollmentPreview"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSequenceEnrollmentInput"}}}}}},"/crm/sequences/{id}/enrollments/confirm":{"post":{"operationId":"crm.sequences.enrollments.confirm","summary":"Confirmar altas elegibles explícitamente","tags":["CRM"],"security":[{"bearerAuth":["crm.sequences:enroll"]}],"x-required-scopes":["crm.sequences:enroll"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmEnrollmentConfirmation"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmEnrollmentConfirmation"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSequenceEnrollmentInput"}}}}}},"/crm/sequences/{id}/enrollments/{enrollmentId}":{"post":{"operationId":"crm.sequences.enrollments.control","summary":"Pausar, reanudar o cancelar una alta con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.sequences:enroll"]}],"x-required-scopes":["crm.sequences:enroll"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"enrollmentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmSequenceControlInput"}}}}}},"/crm/automations":{"get":{"operationId":"crm.automations.list","summary":"Listar automatizaciones administrables","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:read","crm.admin"]}],"x-required-scopes":["crm.automations:read","crm.admin"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.automations.create","summary":"Crear un borrador de automatización de alcance tenant","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:write","crm.admin"]}],"x-required-scopes":["crm.automations:write","crm.admin"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmAutomationDraftInput"}}}}}},"/crm/automations/{id}":{"get":{"operationId":"crm.automations.retrieve","summary":"Recuperar definición y versiones de una automatización","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:read","crm.admin"]}],"x-required-scopes":["crm.automations:read","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomation"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/automations/{id}/update":{"post":{"operationId":"crm.automations.update","summary":"Crear una revisión de borrador con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:write","crm.admin"]}],"x-required-scopes":["crm.automations:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmAutomationUpdateInput"}}}}}},"/crm/automations/{id}/validate":{"post":{"operationId":"crm.automations.validate","summary":"Validar checksum y referencias del borrador","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:read","crm.admin"]}],"x-required-scopes":["crm.automations:read","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationValidation"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmEmptyInput"}}}}}},"/crm/automations/{id}/dry-run":{"post":{"operationId":"crm.automations.dryRun","summary":"Evaluar determinísticamente un evento sin efectos","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:read","crm.admin"]}],"x-required-scopes":["crm.automations:read","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationDryRun"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationDryRun"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmAutomationEvent"}}}}}},"/crm/automations/{id}/publish":{"post":{"operationId":"crm.automations.publish","summary":"Publicar una versión tenant-wide con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:write","crm.admin"]}],"x-required-scopes":["crm.automations:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmAutomationPublishInput"}}}}}},"/crm/automations/{id}/pause":{"post":{"operationId":"crm.automations.pause","summary":"Pausar una automatización activa con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:write","crm.admin"]}],"x-required-scopes":["crm.automations:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/automations/{id}/resume":{"post":{"operationId":"crm.automations.resume","summary":"Reanudar una automatización pausada con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:write","crm.admin"]}],"x-required-scopes":["crm.automations:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/automations/{id}/archive":{"post":{"operationId":"crm.automations.archive","summary":"Archivar una automatización con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:write","crm.admin"]}],"x-required-scopes":["crm.automations:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/automations/{id}/runs":{"get":{"operationId":"crm.automations.runs.list","summary":"Listar ejecuciones de una automatización","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:read","crm.admin"]}],"x-required-scopes":["crm.automations:read","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationRunList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/automations/{id}/runs/{runId}":{"get":{"operationId":"crm.automations.runs.retrieve","summary":"Recuperar ejecución y estados de pasos","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:read","crm.admin"]}],"x-required-scopes":["crm.automations:read","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationRun"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/automations/{id}/runs/{runId}/retry":{"post":{"operationId":"crm.automations.runs.retry","summary":"Reintentar pasos fallidos de una ejecución","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:write","crm.admin"]}],"x-required-scopes":["crm.automations:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationRequeueResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationRequeueResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Trabajo aceptado o todavía en ejecución","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationRequeueResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmAutomationRequeueInput"}}}}}},"/crm/automations/{id}/runs/{runId}/replay":{"post":{"operationId":"crm.automations.runs.replay","summary":"Reejecutar pasos seleccionados de una ejecución terminal","tags":["CRM"],"security":[{"bearerAuth":["crm.automations:write","crm.admin"]}],"x-required-scopes":["crm.automations:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationRequeueResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationRequeueResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Trabajo aceptado o todavía en ejecución","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmAutomationRequeueResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmAutomationRequeueInput"}}}}}},"/crm/custom-fields":{"get":{"operationId":"crm.customFields.list","summary":"Listar definiciones visibles","tags":["CRM"],"security":[{"bearerAuth":["crm.custom-fields:read"]}],"x-required-scopes":["crm.custom-fields:read"],"parameters":[{"name":"entityType","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Página paginada","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldDefinitionList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId","nextCursor","hasMore"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.customFields.create","summary":"Crear una definición administrada","tags":["CRM"],"security":[{"bearerAuth":["crm.custom-fields:write","crm.admin"]}],"x-required-scopes":["crm.custom-fields:write","crm.admin"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldDefinition"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldDefinition"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmCustomFieldCreateInput"}}}}}},"/crm/custom-fields/{id}/update":{"post":{"operationId":"crm.customFields.update","summary":"Actualizar una definición con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.custom-fields:write","crm.admin"]}],"x-required-scopes":["crm.custom-fields:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldDefinition"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldDefinition"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmCustomFieldUpdateInput"}}}}}},"/crm/custom-fields/{id}/archive":{"post":{"operationId":"crm.customFields.archive","summary":"Archivar una definición con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.custom-fields:write","crm.admin"]}],"x-required-scopes":["crm.custom-fields:write","crm.admin"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldDefinition"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldDefinition"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/custom-fields/values/{entityType}/{entityId}":{"get":{"operationId":"crm.customFields.values.list","summary":"Listar valores no sensibles accesibles","tags":["CRM"],"security":[{"bearerAuth":["crm.custom-fields:read"]}],"x-required-scopes":["crm.custom-fields:read"],"parameters":[{"name":"entityType","in":"path","required":true,"schema":{"type":"string"}},{"name":"entityId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldValueList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/custom-fields/values/set":{"post":{"operationId":"crm.customFields.values.set","summary":"Asignar un valor con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.custom-fields:write"]}],"x-required-scopes":["crm.custom-fields:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldValue"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldValue"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmCustomFieldValueSetInput"}}}}}},"/crm/custom-fields/values/clear":{"post":{"operationId":"crm.customFields.values.clear","summary":"Eliminar un valor con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.custom-fields:write"]}],"x-required-scopes":["crm.custom-fields:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldValue"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmCustomFieldValue"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmCustomFieldValueClearInput"}}}}}},"/crm/forecast/periods":{"post":{"operationId":"crm.forecast.periods.create","summary":"Crear un período de forecast","tags":["CRM"],"security":[{"bearerAuth":["crm.forecasts:write"]}],"x-required-scopes":["crm.forecasts:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmForecastPeriodInput"}}}}}},"/crm/forecast/quotas":{"post":{"operationId":"crm.forecast.quotas.set","summary":"Crear o actualizar una cuota con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.forecasts:write"]}],"x-required-scopes":["crm.forecasts:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmForecastQuotaInput"}}}}}},"/crm/forecast/snapshots":{"post":{"operationId":"crm.forecast.snapshots.create","summary":"Materializar un snapshot inmutable","tags":["CRM"],"security":[{"bearerAuth":["crm.forecasts:write"]}],"x-required-scopes":["crm.forecasts:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmRecordMutationResult"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmForecastSnapshotInput"}}}}}},"/crm/imports/preview":{"post":{"operationId":"crm.imports.preview","summary":"Subir y validar CSV privado de hasta el límite documentado","tags":["CRM"],"security":[{"bearerAuth":["crm.imports:write"]}],"x-required-scopes":["crm.imports:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Aceptado para proceso acotado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_JOB_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"entityType":{"type":"string","enum":["contact","opportunity"]},"mapping":{"type":"string","description":"Objeto JSON columna-a-campo, máximo 24 entradas."},"file":{"type":"string","format":"binary","description":"CSV privado sujeto a los límites de filas y bytes."}},"required":["entityType","mapping","file"],"additionalProperties":false}}}}}},"/crm/imports/{id}":{"get":{"operationId":"crm.imports.retrieve","summary":"Consultar progreso y revisión del import","tags":["CRM"],"security":[{"bearerAuth":["crm.imports:read"]}],"x-required-scopes":["crm.imports:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Trabajo todavía en ejecución","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/imports/{id}/commit":{"post":{"operationId":"crm.imports.commit","summary":"Confirmar import explícitamente con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.imports:write"]}],"x-required-scopes":["crm.imports:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Trabajo aceptado o todavía en ejecución","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/imports/{id}/resume":{"post":{"operationId":"crm.imports.resume","summary":"Procesar el siguiente chunk acotado con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.imports:write"]}],"x-required-scopes":["crm.imports:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Trabajo aceptado o todavía en ejecución","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/imports/{id}/cancel":{"post":{"operationId":"crm.imports.cancel","summary":"Cancelar import con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.imports:write"]}],"x-required-scopes":["crm.imports:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/imports/{id}/rollback":{"post":{"operationId":"crm.imports.rollback","summary":"Revertir lógicamente un import completado con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.imports:write"]}],"x-required-scopes":["crm.imports:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Trabajo aceptado o todavía en ejecución","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmImportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/imports/{id}/errors":{"get":{"operationId":"crm.imports.errors.download","summary":"Descargar CSV privado de errores","tags":["CRM"],"security":[{"bearerAuth":["crm.imports:read"]}],"x-required-scopes":["crm.imports:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expires","in":"query","required":true,"schema":{"type":"integer","minimum":0},"description":"Expiración UTC del enlace HMAC."},{"name":"signature","in":"query","required":true,"schema":{"type":"string","minLength":43,"maxLength":43},"description":"Firma HMAC ligada al tenant, recurso y expiración."}],"responses":{"200":{"description":"Stream privado","headers":{"Cache-Control":{"schema":{"type":"string","const":"private, no-store"}}},"content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_JOB_NOT_FOUND o CRM_QUOTE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/exports":{"post":{"operationId":"crm.exports.create","summary":"Crear export asíncrono y acotado","tags":["CRM"],"security":[{"bearerAuth":["crm.exports:write"]}],"x-required-scopes":["crm.exports:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Trabajo aceptado o todavía en ejecución","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmExportInput"}}}}}},"/crm/exports/{id}":{"get":{"operationId":"crm.exports.retrieve","summary":"Consultar progreso y revisión del export","tags":["CRM"],"security":[{"bearerAuth":["crm.exports:read"]}],"x-required-scopes":["crm.exports:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Trabajo todavía en ejecución","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/exports/{id}/resume":{"post":{"operationId":"crm.exports.resume","summary":"Reanudar un chunk del export con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.exports:write"]}],"x-required-scopes":["crm.exports:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"202":{"description":"Trabajo aceptado o todavía en ejecución","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/exports/{id}/cancel":{"post":{"operationId":"crm.exports.cancel","summary":"Cancelar export con CAS","tags":["CRM"],"security":[{"bearerAuth":["crm.exports:write"]}],"x-required-scopes":["crm.exports:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmExportJob"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmArchiveInput"}}}}}},"/crm/exports/{id}/download":{"get":{"operationId":"crm.exports.download","summary":"Descargar CSV privado completo y vigente","tags":["CRM"],"security":[{"bearerAuth":["crm.exports:read"]}],"x-required-scopes":["crm.exports:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expires","in":"query","required":true,"schema":{"type":"integer","minimum":0},"description":"Expiración UTC del enlace HMAC."},{"name":"signature","in":"query","required":true,"schema":{"type":"string","minLength":43,"maxLength":43},"description":"Firma HMAC ligada al tenant, recurso y expiración."}],"responses":{"200":{"description":"Stream privado","headers":{"Cache-Control":{"schema":{"type":"string","const":"private, no-store"}}},"content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_JOB_NOT_FOUND o CRM_QUOTE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/quotes/{id}/versions/{versionId}/pdf":{"get":{"operationId":"crm.quotes.pdf.download","summary":"Descargar PDF privado autorizado por alcance","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:read"]}],"x-required-scopes":["crm.quotes:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"expires","in":"query","required":true,"schema":{"type":"integer","minimum":0},"description":"Expiración UTC del enlace HMAC."},{"name":"signature","in":"query","required":true,"schema":{"type":"string","minLength":43,"maxLength":43},"description":"Firma HMAC ligada al tenant, recurso y expiración."}],"responses":{"200":{"description":"Stream privado","headers":{"Cache-Control":{"schema":{"type":"string","const":"private, no-store"}}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_JOB_NOT_FOUND o CRM_QUOTE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}},"post":{"operationId":"crm.quotes.pdf.generate","summary":"Generar y adjuntar PDF privado de una versión inmutable","tags":["CRM"],"security":[{"bearerAuth":["crm.quotes:write"]}],"x-required-scopes":["crm.quotes:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuotePdfReference"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"Creado","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmQuotePdfReference"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_VERSION_CONFLICT o CRM_IDEMPOTENCY_MISMATCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmEmptyInput"}}}}}},"/crm/reports/funnel":{"get":{"operationId":"crm.reports.funnel","summary":"Reporte CRM funnel","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMetricReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/reports/conversion":{"get":{"operationId":"crm.reports.conversion","summary":"Reporte CRM conversion","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMetricReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/reports/velocity":{"get":{"operationId":"crm.reports.velocity","summary":"Reporte CRM velocity","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMetricReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/reports/aging":{"get":{"operationId":"crm.reports.aging","summary":"Reporte CRM aging","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMetricReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/reports/win-loss":{"get":{"operationId":"crm.reports.win.loss","summary":"Reporte CRM win-loss","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMetricReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/reports/source":{"get":{"operationId":"crm.reports.source","summary":"Reporte CRM source","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMetricReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/reports/activity":{"get":{"operationId":"crm.reports.activity","summary":"Reporte CRM activity","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMetricReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/reports/rep-team":{"get":{"operationId":"crm.reports.rep.team","summary":"Reporte CRM rep-team","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMetricReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/crm/reports/meeting-attribution":{"get":{"operationId":"crm.reports.meeting.attribution","summary":"Reporte CRM meeting-attribution","tags":["CRM"],"security":[{"bearerAuth":["crm.reports:read"]}],"x-required-scopes":["crm.reports:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CrmMetricReport"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"CRM_AUTHENTICATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"403":{"description":"CRM_SCOPE_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"404":{"description":"CRM_RECORD_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"409":{"description":"CRM_STATE_CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"413":{"description":"CRM_LIMIT_EXCEEDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"422":{"description":"CRM_REQUIRED_FIELD_MISSING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"429":{"description":"CRM_RATE_LIMITED","headers":{"Retry-After":{"description":"Segundos que el cliente debe esperar antes de reintentar.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}},"503":{"description":"CRM_SERVICE_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmError"}}}}}}},"/webhooks/endpoints":{"get":{"operationId":"webhooks.list","summary":"Endpoints configurados","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointList"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Webhooks"],"security":[{"bearerAuth":["webhooks:manage"]}],"x-required-scopes":["webhooks:manage"]},"post":{"operationId":"webhooks.create","summary":"Crear endpoint y revelar el secreto una vez por clave idempotente","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointSecret"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointSecret"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointInput"}}}},"tags":["Webhooks"],"security":[{"bearerAuth":["webhooks:manage"]}],"x-required-scopes":["webhooks:manage"],"x-webhook-event-authorization":{"description":"Cada evento exige su scope de recurso y capacidades CRM actuales. La autorización y el alcance de la fila se vuelven a evaluar antes de cada intento o reintento; una revocación termina la entrega sin llamada de red.","revalidatedAt":["subscription_creation","each_delivery_attempt"],"events":[{"event":"booking.confirmed","requiredScopes":["webhooks:manage","bookings:read"],"requiredCrmCapabilities":[],"rowScope":"none"},{"event":"booking.approval_requested","requiredScopes":["webhooks:manage","bookings:read"],"requiredCrmCapabilities":[],"rowScope":"none"},{"event":"booking.approved","requiredScopes":["webhooks:manage","bookings:read"],"requiredCrmCapabilities":[],"rowScope":"none"},{"event":"booking.rejected","requiredScopes":["webhooks:manage","bookings:read"],"requiredCrmCapabilities":[],"rowScope":"none"},{"event":"booking.rescheduled","requiredScopes":["webhooks:manage","bookings:read"],"requiredCrmCapabilities":[],"rowScope":"none"},{"event":"booking.cancelled","requiredScopes":["webhooks:manage","bookings:read"],"requiredCrmCapabilities":[],"rowScope":"none"},{"event":"booking.completed","requiredScopes":["webhooks:manage","bookings:read"],"requiredCrmCapabilities":[],"rowScope":"none"},{"event":"booking.no_show","requiredScopes":["webhooks:manage","bookings:read"],"requiredCrmCapabilities":[],"rowScope":"none"},{"event":"crm.contact.created","requiredScopes":["webhooks:manage","crm.contacts:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.contact.updated","requiredScopes":["webhooks:manage","crm.contacts:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.contact.merged","requiredScopes":["webhooks:manage","crm.contacts:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.contact.archived","requiredScopes":["webhooks:manage","crm.contacts:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.contact.restored","requiredScopes":["webhooks:manage","crm.contacts:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.company.created","requiredScopes":["webhooks:manage","crm.companies:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.company.updated","requiredScopes":["webhooks:manage","crm.companies:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.company.merged","requiredScopes":["webhooks:manage","crm.companies:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.company.archived","requiredScopes":["webhooks:manage","crm.companies:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.company.restored","requiredScopes":["webhooks:manage","crm.companies:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.lead.created","requiredScopes":["webhooks:manage","crm.leads:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.lead.updated","requiredScopes":["webhooks:manage","crm.leads:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.lead.qualified","requiredScopes":["webhooks:manage","crm.leads:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.lead.converted","requiredScopes":["webhooks:manage","crm.leads:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.lead.disqualified","requiredScopes":["webhooks:manage","crm.leads:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.lead.archived","requiredScopes":["webhooks:manage","crm.leads:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.lead.restored","requiredScopes":["webhooks:manage","crm.leads:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.deal.created","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.deal.updated","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.deal.stage_changed","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.deal.won","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.deal.lost","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.deal.archived","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.deal.restored","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.activity.created","requiredScopes":["webhooks:manage","crm.activities:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.activity.updated","requiredScopes":["webhooks:manage","crm.activities:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.activity.archived","requiredScopes":["webhooks:manage","crm.activities:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.activity.restored","requiredScopes":["webhooks:manage","crm.activities:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.pipeline.created","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"none"},{"event":"crm.pipeline.updated","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"none"},{"event":"crm.pipeline.archived","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"none"},{"event":"crm.pipeline.restored","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"none"},{"event":"crm.pipeline_stage.created","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"none"},{"event":"crm.pipeline_stage.updated","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"none"},{"event":"crm.pipeline_stage.archived","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"none"},{"event":"crm.pipeline_stage.restored","requiredScopes":["webhooks:manage","crm.deals:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"none"},{"event":"crm.task.created","requiredScopes":["webhooks:manage","crm.tasks:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.task.completed","requiredScopes":["webhooks:manage","crm.tasks:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.task.overdue","requiredScopes":["webhooks:manage","crm.tasks:read"],"requiredCrmCapabilities":["crm.records.read"],"rowScope":"current_event_resource"},{"event":"crm.sequence.enrolled","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.records.read","crm.automation.manage"],"rowScope":"current_event_resource"},{"event":"crm.sequence.step_sent","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.records.read","crm.automation.manage"],"rowScope":"current_event_resource"},{"event":"crm.sequence.replied","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.records.read","crm.automation.manage"],"rowScope":"current_event_resource"},{"event":"crm.sequence.completed","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.records.read","crm.automation.manage"],"rowScope":"current_event_resource"},{"event":"crm.sequence.failed","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.records.read","crm.automation.manage"],"rowScope":"current_event_resource"},{"event":"crm.sequence.unsubscribed","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.records.read","crm.automation.manage"],"rowScope":"current_event_resource"},{"event":"crm.sequence.created","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.automation.manage"],"rowScope":"none"},{"event":"crm.sequence.revised","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.automation.manage"],"rowScope":"none"},{"event":"crm.sequence.published","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.automation.manage"],"rowScope":"none"},{"event":"crm.sequence.archived","requiredScopes":["webhooks:manage","crm.sequences:read"],"requiredCrmCapabilities":["crm.automation.manage"],"rowScope":"none"},{"event":"crm.automation.created","requiredScopes":["webhooks:manage","crm.automations:read"],"requiredCrmCapabilities":["crm.automation.manage","crm.admin"],"rowScope":"none"},{"event":"crm.automation.published","requiredScopes":["webhooks:manage","crm.automations:read"],"requiredCrmCapabilities":["crm.automation.manage","crm.admin"],"rowScope":"none"},{"event":"crm.meeting.linked","requiredScopes":["webhooks:manage","crm.meetings:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.meeting.link_updated","requiredScopes":["webhooks:manage","crm.meetings:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.meeting.unlinked","requiredScopes":["webhooks:manage","crm.meetings:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.meeting.outcome_recorded","requiredScopes":["webhooks:manage","crm.meetings:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.quote.sent","requiredScopes":["webhooks:manage","crm.quotes:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.quote.accepted","requiredScopes":["webhooks:manage","crm.quotes:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.quote.rejected","requiredScopes":["webhooks:manage","crm.quotes:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.quote.expired","requiredScopes":["webhooks:manage","crm.quotes:read"],"requiredCrmCapabilities":["crm.records.read","crm.revenue.read"],"rowScope":"current_event_resource"},{"event":"crm.import.completed","requiredScopes":["webhooks:manage","crm.imports:read"],"requiredCrmCapabilities":["crm.bulk.execute"],"rowScope":"current_event_resource"},{"event":"crm.import.failed","requiredScopes":["webhooks:manage","crm.imports:read"],"requiredCrmCapabilities":["crm.bulk.execute"],"rowScope":"current_event_resource"}]}}},"/webhooks/endpoints/{id}":{"delete":{"operationId":"webhooks.remove","summary":"Desactivar endpoint","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointDisabled"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Webhooks"],"security":[{"bearerAuth":["webhooks:manage"]}],"x-required-scopes":["webhooks:manage"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]{16,128}$"}}]}},"/openapi.json":{"get":{"operationId":"openapi.retrieve","summary":"Contrato OpenAPI","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OpenApiDocument"},"meta":{"type":"object","properties":{"requestId":{"type":"string"},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["requestId"],"additionalProperties":false}},"required":["data","meta"],"additionalProperties":false}}}},"401":{"description":"API key inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Solicitud inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"hm_live_*"}},"schemas":{"ApiAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tenant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","name","tenant","scopes"],"additionalProperties":false},"EventType":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"durationMinutes":{"type":"integer"},"bookingWindowDays":{"type":"integer"},"locationType":{"type":"string"},"requiresApproval":{"type":"boolean"},"groupCapacity":{"anyOf":[{"type":"integer"},{"type":"null"}]},"allowsRecurrence":{"type":"boolean"},"recurrenceMaxOccurrences":{"type":"integer"},"host":{"type":"object","properties":{"handle":{"type":"string"},"name":{"type":"string"}},"required":["handle","name"],"additionalProperties":false},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","slug","title","description","type","durationMinutes","bookingWindowDays","locationType","requiresApproval","groupCapacity","allowsRecurrence","recurrenceMaxOccurrences","host","updatedAt"],"additionalProperties":false},"EventTypeList":{"type":"array","items":{"$ref":"#/components/schemas/EventType"}},"Slot":{"type":"object","properties":{"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"localDate":{"type":"string"},"localTime":{"type":"string"},"timezone":{"type":"string"},"offset":{"type":"string"},"spotsLeft":{"type":"integer"}},"required":["startsAt","endsAt","localDate","localTime","timezone","offset"],"additionalProperties":false},"Availability":{"type":"object","properties":{"eventType":{"$ref":"#/components/schemas/EventType"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/Slot"}}},"required":["eventType","slots"],"additionalProperties":false},"CreateGuest":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"timezone":{"type":"string"},"locale":{"type":"string"},"notes":{"type":"string"}},"required":["name","email","timezone"],"additionalProperties":false},"BookingGuest":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"locale":{"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","email","locale","notes"],"additionalProperties":false},"Booking":{"type":"object","properties":{"uid":{"type":"string"},"eventTypeId":{"type":"string"},"status":{"type":"string","enum":["tentative","pending_approval","confirmed","reschedule_pending","rejected","cancelled","completed","no_show","expired"]},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"timezone":{"type":"string"},"title":{"type":"string"},"location":{"type":"object","properties":{"type":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","value"],"additionalProperties":false},"guest":{"$ref":"#/components/schemas/BookingGuest"},"revision":{"type":"integer"},"cancellationReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["uid","eventTypeId","status","startsAt","endsAt","timezone","title","location","guest","revision","cancellationReason","createdAt","updatedAt"],"additionalProperties":false},"BookingList":{"type":"array","items":{"$ref":"#/components/schemas/Booking"}},"RecurrenceInput":{"type":"object","properties":{"frequency":{"type":"string","const":"weekly"},"intervalWeeks":{"type":"integer"},"count":{"type":"integer"},"nonexistentTime":{"type":"string","enum":["skip","shift-forward"]},"ambiguousTime":{"type":"string","enum":["earlier","later"]}},"required":["intervalWeeks","count"],"additionalProperties":false},"CreateBookingInput":{"type":"object","properties":{"eventTypeId":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"guest":{"$ref":"#/components/schemas/CreateGuest"},"recurrence":{"$ref":"#/components/schemas/RecurrenceInput"}},"required":["eventTypeId","startsAt","guest"],"additionalProperties":false},"BookingOccurrence":{"type":"object","properties":{"bookingUid":{"type":"string"},"status":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"}},"required":["bookingUid","status","startsAt","endsAt"],"additionalProperties":false},"BookingSeriesResult":{"type":"object","properties":{"seriesUid":{"type":"string"},"frequency":{"type":"string","const":"weekly"},"intervalWeeks":{"type":"integer"},"count":{"type":"integer"},"occurrences":{"type":"array","items":{"$ref":"#/components/schemas/BookingOccurrence"}}},"required":["seriesUid","frequency","intervalWeeks","count","occurrences"],"additionalProperties":false},"BookingCreateResult":{"type":"object","properties":{"bookingUid":{"type":"string"},"status":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"replayed":{"type":"boolean"},"series":{"$ref":"#/components/schemas/BookingSeriesResult"}},"required":["bookingUid","status","startsAt","endsAt","replayed"],"additionalProperties":false},"CancelBookingInput":{"type":"object","properties":{"expectedRevision":{"type":"integer"}},"required":["expectedRevision"],"additionalProperties":false},"BookingCancelResult":{"type":"object","properties":{"booking":{"$ref":"#/components/schemas/Booking"},"replayed":{"type":"boolean"}},"required":["booking","replayed"],"additionalProperties":false},"CrmContactPointInput":{"type":"object","properties":{"type":{"type":"string","enum":["email","phone"]},"value":{"type":"string"},"consentStatus":{"type":"string","enum":["unknown","granted","revoked","suppressed"]}},"required":["type","value"],"additionalProperties":false},"CrmContactUpsertInput":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":160},"givenName":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"familyName":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string","minLength":1,"maxLength":160},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"locale":{"anyOf":[{"type":"string","minLength":1,"maxLength":35},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"source":{"default":"api","type":"string","minLength":1,"maxLength":100},"point":{"type":"object","properties":{"type":{"type":"string","enum":["email","phone"]},"value":{"type":"string","minLength":3,"maxLength":320},"consentStatus":{"type":"string","enum":["unknown","granted","revoked","suppressed"]}},"required":["type","value"],"additionalProperties":false}},"required":["displayName","point"],"additionalProperties":false},"CrmContactUpdateInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"displayName":{"type":"string","minLength":1,"maxLength":160},"givenName":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"familyName":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string","minLength":1,"maxLength":160},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"locale":{"anyOf":[{"type":"string","minLength":1,"maxLength":35},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"lifecycle":{"type":"string","enum":["subscriber","lead","qualified","opportunity","customer","former_customer","other"]}},"required":["expectedRevision"],"additionalProperties":false},"CrmContact":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"givenName":{"anyOf":[{"type":"string"},{"type":"null"}]},"familyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"lifecycle":{"type":"string","enum":["subscriber","lead","qualified","opportunity","customer","former_customer","other"]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryEmail":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}]},"primaryPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archivedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","displayName","givenName","familyName","jobTitle","timezone","locale","lifecycle","source","ownerUserId","teamId","primaryEmail","primaryPhone","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmContactList":{"type":"array","items":{"$ref":"#/components/schemas/CrmContact"}},"CrmContactUpsertResult":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"integer"},"created":{"type":"boolean"}},"required":["id","revision","created"],"additionalProperties":false},"CrmRecordMutationResult":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["id","revision"],"additionalProperties":false},"CrmCompanyCreateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"industry":{"anyOf":[{"type":"string","minLength":1,"maxLength":160},{"type":"null"}]},"segment":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"employeeCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000},{"type":"null"}]},"countryCode":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"parentCompanyId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"primaryDomain":{"anyOf":[{"type":"string","minLength":1,"maxLength":253,"pattern":"^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"CrmCompanyUpsertInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"industry":{"anyOf":[{"type":"string","minLength":1,"maxLength":160},{"type":"null"}]},"segment":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"employeeCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000},{"type":"null"}]},"countryCode":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"parentCompanyId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"primaryDomain":{"type":"string","minLength":1,"maxLength":253,"pattern":"^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"}},"required":["name","primaryDomain"],"additionalProperties":false},"CrmCompanyUpdateInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":200},"industry":{"anyOf":[{"type":"string","minLength":1,"maxLength":160},{"type":"null"}]},"segment":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"employeeCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000},{"type":"null"}]},"countryCode":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"parentCompanyId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"primaryDomain":{"anyOf":[{"type":"string","minLength":1,"maxLength":253,"pattern":"^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"},{"type":"null"}]}},"required":["expectedRevision"],"additionalProperties":false},"CrmArchiveInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["expectedRevision"],"additionalProperties":false},"CrmMergeBeginInput":{"type":"object","properties":{"targetId":{"type":"string","minLength":1,"maxLength":100},"sourceExpectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"targetExpectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["targetId","sourceExpectedRevision","targetExpectedRevision"],"additionalProperties":false},"CrmMergeAdvanceInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["expectedRevision"],"additionalProperties":false},"CrmCompany":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}]},"segment":{"anyOf":[{"type":"string"},{"type":"null"}]},"employeeCount":{"anyOf":[{"type":"integer"},{"type":"null"}]},"countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentCompanyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"primaryDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archivedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","name","industry","segment","employeeCount","countryCode","timezone","ownerUserId","teamId","parentCompanyId","primaryDomain","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmCompanyList":{"type":"array","items":{"$ref":"#/components/schemas/CrmCompany"}},"CrmCompanyUpsertResult":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"created":{"type":"boolean"}},"required":["id","revision","created"],"additionalProperties":false},"CrmArchiveResult":{"type":"object","properties":{"id":{"type":"string"},"entityType":{"type":"string","const":"account"},"archived":{"type":"boolean"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["id","entityType","archived","revision"],"additionalProperties":false},"CrmEntityArchiveResult":{"type":"object","properties":{"id":{"type":"string"},"entityType":{"type":"string","enum":["contact","account"]},"archived":{"type":"boolean"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["id","entityType","archived","revision"],"additionalProperties":false},"CrmMergeResult":{"type":"object","properties":{"id":{"type":"string"},"entityType":{"type":"string","enum":["contact","account"]},"sourceEntityId":{"type":"string"},"targetEntityId":{"type":"string"},"status":{"type":"string","enum":["pending","merge_in_progress","completed","rollback_in_progress","rolled_back","failed"]},"checkpoint":{"type":"string"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["id","entityType","sourceEntityId","targetEntityId","status","checkpoint","revision"],"additionalProperties":false},"CrmLeadTransitionInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"toStatus":{"type":"string","enum":["working","qualified","disqualified"]},"ownerUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"slaDueAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"score":{"type":"object","properties":{"factors":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["fit","intent","engagement","timing","authority","custom"]},"points":{"type":"integer","minimum":-100,"maximum":100},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["key","points","reason"],"additionalProperties":false}}},"required":["factors"],"additionalProperties":false},"qualificationNote":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"disqualificationReason":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]}},"required":["expectedRevision","toStatus"],"additionalProperties":false},"CrmLeadConvertInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"confirmed":{"type":"boolean","const":true},"createDeal":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"pipelineId":{"type":"string","minLength":1,"maxLength":100},"stageId":{"type":"string","minLength":1,"maxLength":100},"ownerUserId":{"type":"string","minLength":1,"maxLength":100},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"expectedCloseDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextStep":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"nextStepDueAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["name","pipelineId","stageId","ownerUserId","amountMinor","currency"],"additionalProperties":false},{"type":"null"}]}},"required":["expectedRevision","confirmed"],"additionalProperties":false},"CrmLead":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":"string"},"primaryEmail":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["new","working","qualified","converted","disqualified","archived"]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"score":{"type":"integer"},"scoreExplanation":{"type":"object","additionalProperties":true},"slaDueAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"disqualificationReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"convertedOpportunityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archivedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","contactId","contactName","primaryEmail","ownerUserId","teamId","status","source","score","scoreExplanation","slaDueAt","disqualificationReason","convertedOpportunityId","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmLeadList":{"type":"array","items":{"$ref":"#/components/schemas/CrmLead"}},"CrmLeadCreateInput":{"type":"object","properties":{"contactId":{"type":"string","minLength":1,"maxLength":192},"ownerUserId":{"type":"string","minLength":1,"maxLength":192},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":192},{"type":"null"}]},"source":{"default":"api","type":"string","minLength":1,"maxLength":100}},"required":["contactId"],"additionalProperties":false},"CrmLeadUpdateInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"ownerUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":192},{"type":"null"}]},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":192},{"type":"null"}]},"source":{"type":"string","minLength":1,"maxLength":100},"slaDueAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["expectedRevision"],"additionalProperties":false},"CrmLeadMutationResult":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["new","working","qualified","converted","disqualified","archived"]},"score":{"type":"integer"},"scoreExplanation":{"type":"object","additionalProperties":true},"slaDueAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"ownerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"convertedOpportunityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"disqualificationReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"replayed":{"type":"boolean"}},"required":["id","status","score","scoreExplanation","slaDueAt","ownerUserId","convertedOpportunityId","disqualificationReason","revision","replayed"],"additionalProperties":false},"CrmDealCreateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"pipelineId":{"type":"string","minLength":1,"maxLength":100},"stageId":{"type":"string","minLength":1,"maxLength":100},"accountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"ownerUserId":{"type":"string","minLength":1,"maxLength":100},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"expectedCloseDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextStep":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"nextStepDueAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"source":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]}},"required":["name","pipelineId","stageId","amountMinor","currency"],"additionalProperties":false},"CrmDealUpdateInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":200},"accountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"ownerUserId":{"type":"string","minLength":1,"maxLength":100},"teamId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"expectedCloseDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextStep":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"nextStepDueAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"source":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]}},"required":["expectedRevision"],"additionalProperties":false},"CrmDealMoveStageInput":{"type":"object","properties":{"stageId":{"type":"string","minLength":1,"maxLength":100},"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"lostReason":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]}},"required":["stageId","expectedRevision"],"additionalProperties":false},"CrmDealMutationResult":{"type":"object","properties":{"id":{"type":"string"},"stageId":{"type":"string"},"status":{"type":"string","enum":["open","won","lost","archived"]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["id","stageId","status","revision"],"additionalProperties":false},"CrmDeal":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"pipelineId":{"type":"string"},"pipelineName":{"type":"string"},"stageId":{"type":"string"},"stageName":{"type":"string"},"stageCategory":{"type":"string"},"status":{"type":"string","enum":["open","won","lost","archived"]},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountName":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerUserId":{"type":"string"},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Código ISO 4217 normalizado a mayúsculas; los montos asociados usan unidades menores enteras."},"expectedCloseDate":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"nextStep":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepDueAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"source":{"anyOf":[{"type":"string"},{"type":"null"}]},"score":{"type":"integer"},"lostReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"closedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archivedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","name","pipelineId","pipelineName","stageId","stageName","stageCategory","status","accountId","accountName","ownerUserId","teamId","amountMinor","currency","expectedCloseDate","nextStep","nextStepDueAt","source","score","lostReason","closedAt","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmDealList":{"type":"array","items":{"$ref":"#/components/schemas/CrmDeal"}},"CrmDealStakeholderInput":{"type":"object","properties":{"contactId":{"type":"string"},"expectedDealRevision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"buyingRole":{"type":"string","enum":["champion","decision_maker","economic_buyer","influencer","blocker","other"]},"isPrimary":{"type":"boolean"}},"required":["contactId","expectedDealRevision"],"additionalProperties":false},"CrmDealStakeholderRemoveInput":{"type":"object","properties":{"expectedDealRevision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["expectedDealRevision"],"additionalProperties":false},"CrmDealStakeholder":{"type":"object","properties":{"contactId":{"type":"string"},"displayName":{"type":"string"},"primaryEmail":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}]},"buyingRole":{"type":"string","enum":["champion","decision_maker","economic_buyer","influencer","blocker","other"]},"isPrimary":{"type":"boolean"},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["contactId","displayName","primaryEmail","buyingRole","isPrimary","createdAt","updatedAt"],"additionalProperties":false},"CrmDealStakeholderList":{"type":"array","items":{"$ref":"#/components/schemas/CrmDealStakeholder"}},"CrmDealStakeholderMutationResult":{"type":"object","properties":{"dealId":{"type":"string"},"contactId":{"type":"string"},"dealRevision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"removed":{"type":"boolean"},"replayed":{"type":"boolean"}},"required":["dealId","contactId","dealRevision","removed","replayed"],"additionalProperties":false},"CrmMeetingOutcomeInput":{"type":"object","properties":{"opportunityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"attendance":{"type":"string","enum":["attended","partial","no_show","unknown"]},"outcome":{"type":"string","enum":["qualified","follow_up","proposal_requested","won","lost","not_a_fit","no_show"]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"objections":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":500}},"nextStep":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepOwnerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepDueAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"nextStepTimezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"expectedOpportunityRevision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["attendance","outcome"],"additionalProperties":false},"CrmMeetingOutcome":{"type":"object","properties":{"id":{"type":"string"},"bookingId":{"type":"string"},"bookingUid":{"type":"string"},"opportunityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"attendance":{"type":"string","enum":["attended","partial","no_show","unknown"]},"outcome":{"type":"string","enum":["qualified","follow_up","proposal_requested","won","lost","not_a_fit","no_show"]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"objections":{"type":"array","items":{"type":"string"}},"nextStep":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepOwnerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepDueAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"recordedByUserId":{"type":"string"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","bookingId","bookingUid","opportunityId","attendance","outcome","summary","objections","nextStep","nextStepOwnerUserId","nextStepDueAt","recordedByUserId","revision","createdAt","updatedAt"],"additionalProperties":false},"CrmMeetingOutcomeList":{"type":"array","items":{"$ref":"#/components/schemas/CrmMeetingOutcome"}},"CrmMeetingOutcomeMutationResult":{"type":"object","properties":{"id":{"type":"string"},"bookingId":{"type":"string"},"opportunityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"taskId":{"anyOf":[{"type":"string"},{"type":"null"}]},"opportunityRevision":{"anyOf":[{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["id","bookingId","opportunityId","taskId","opportunityRevision","replayed"],"additionalProperties":false},"CrmBookingDealLinkCreateInput":{"type":"object","properties":{"dealId":{"type":"string","minLength":1,"maxLength":100},"isPrimary":{"default":false,"type":"boolean"},"expectedDealRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["dealId","expectedDealRevision"],"additionalProperties":false},"CrmBookingDealLinkUpdateInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"expectedDealRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"isPrimary":{"type":"boolean"}},"required":["expectedRevision","expectedDealRevision","isPrimary"],"additionalProperties":false},"CrmBookingDealLinkRemoveInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"expectedDealRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["expectedRevision","expectedDealRevision"],"additionalProperties":false},"CrmBookingDealLink":{"type":"object","properties":{"id":{"type":"string"},"bookingUid":{"type":"string"},"dealId":{"type":"string"},"isPrimary":{"type":"boolean"},"linkedBy":{"type":"string","enum":["projection","user","automation","api_client"]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","bookingUid","dealId","isPrimary","linkedBy","revision","createdAt","updatedAt"],"additionalProperties":false},"CrmBookingDealLinkList":{"type":"array","items":{"$ref":"#/components/schemas/CrmBookingDealLink"}},"CrmBookingDealMutationResult":{"type":"object","properties":{"id":{"type":"string"},"bookingUid":{"type":"string"},"dealId":{"type":"string"},"isPrimary":{"type":"boolean"},"linkedBy":{"type":"string","enum":["projection","user","automation","api_client"]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"dealRevision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archived":{"type":"boolean"},"replayed":{"type":"boolean"},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","bookingUid","dealId","isPrimary","linkedBy","revision","dealRevision","archived","replayed","createdAt","updatedAt"],"additionalProperties":false},"CrmOpportunityLineItemsInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"items":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"priceBookItemId":{"type":"string","minLength":1,"maxLength":100},"quantity":{"type":"integer","minimum":1,"maximum":1000000},"discountBasisPoints":{"default":0,"type":"integer","minimum":0,"maximum":10000},"description":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]}},"required":["priceBookItemId","quantity"],"additionalProperties":false}}},"required":["expectedRevision","items"],"additionalProperties":false},"CrmOpportunityLineItemsResult":{"type":"object","properties":{"opportunityId":{"type":"string"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Código ISO 4217 normalizado a mayúsculas; los montos asociados usan unidades menores enteras."},"totals":{"type":"object","properties":{"subtotalMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"discountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"netMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"taxMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"totalMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."}},"required":["subtotalMinor","discountMinor","netMinor","taxMinor","totalMinor"],"additionalProperties":false},"checksum":{"type":"string"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["opportunityId","revision","currency","totals","checksum","lines"],"additionalProperties":false},"CrmPipeline":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Código ISO 4217 normalizado a mayúsculas; los montos asociados usan unidades menores enteras."},"isDefault":{"type":"boolean"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archivedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"position":{"type":"integer"},"probabilityBasisPoints":{"type":"integer"},"terminalOutcome":{"anyOf":[{"type":"string"},{"type":"null"}]},"requiredFields":{"type":"array","items":{"type":"string"}},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["id","name","category","position","probabilityBasisPoints","terminalOutcome","requiredFields","revision"],"additionalProperties":false}}},"required":["id","name","currency","isDefault","revision","archivedAt","createdAt","updatedAt","stages"],"additionalProperties":false},"CrmPipelineList":{"type":"array","items":{"$ref":"#/components/schemas/CrmPipeline"}},"CrmPipelineCreateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"currency":{"type":"string","minLength":3,"maxLength":3},"isDefault":{"default":false,"type":"boolean"}},"required":["name","currency"],"additionalProperties":false},"CrmPipelineUpdateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"currency":{"type":"string","minLength":3,"maxLength":3},"isDefault":{"default":false,"type":"boolean"},"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["expectedRevision"],"additionalProperties":false},"CrmPipelineStageCreateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"category":{"type":"string","enum":["pipeline","best_case","commit","closed"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"probabilityBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"terminalOutcome":{"anyOf":[{"type":"string","enum":["won","lost"]},{"type":"null"}]},"requiredFields":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":72}}},"required":["name","category","position","probabilityBasisPoints"],"additionalProperties":false},"CrmPipelineStageUpdateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"category":{"type":"string","enum":["pipeline","best_case","commit","closed"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"probabilityBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"terminalOutcome":{"anyOf":[{"type":"string","enum":["won","lost"]},{"type":"null"}]},"requiredFields":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":72}},"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["expectedRevision"],"additionalProperties":false},"CrmActivityCreateInput":{"type":"object","properties":{"contactId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"dealId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"taskId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"type":{"type":"string","enum":["meeting","email","task","note","stage_change","automation","quote","system"]},"subject":{"type":"string","minLength":1,"maxLength":240},"bodyObjectKey":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"metadata":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"occurredAt":{"type":"integer","minimum":0,"maximum":9007199254740991},"sourceType":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"sourceId":{"anyOf":[{"type":"string","minLength":1,"maxLength":160},{"type":"null"}]}},"required":["type","subject","occurredAt"],"additionalProperties":false},"CrmActivityUpdateInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"subject":{"type":"string","minLength":1,"maxLength":240},"bodyObjectKey":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"occurredAt":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["expectedRevision"],"additionalProperties":false},"CrmActivity":{"type":"object","properties":{"id":{"type":"string"},"actorUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"dealId":{"anyOf":[{"type":"string"},{"type":"null"}]},"taskId":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["meeting","email","task","note","stage_change","automation","quote","system"]},"subject":{"type":"string"},"bodyObjectKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","additionalProperties":true},"occurredAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"sourceType":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archivedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","actorUserId","contactId","accountId","dealId","taskId","type","subject","bodyObjectKey","metadata","occurredAt","sourceType","sourceId","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmActivityList":{"type":"array","items":{"$ref":"#/components/schemas/CrmActivity"}},"CrmLifecycleResult":{"type":"object","properties":{"id":{"type":"string"},"entityType":{"type":"string","enum":["lead","deal","activity","pipeline","pipeline_stage"]},"archived":{"type":"boolean"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"replayed":{"type":"boolean"}},"required":["id","entityType","archived","revision","replayed"],"additionalProperties":false},"CrmTaskCreateInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":240},"description":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"ownerUserId":{"type":"string","minLength":1,"maxLength":100},"contactId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"dealId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"priority":{"default":"normal","type":"string","enum":["low","normal","high","urgent"]},"dueAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"dueTimezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"recurrence":{"anyOf":[{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","const":"daily"},"interval":{"type":"integer","minimum":1,"maximum":365},"endAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxOccurrences":{"anyOf":[{"type":"integer","minimum":2,"maximum":10000},{"type":"null"}]}},"required":["frequency","interval"],"additionalProperties":false},{"type":"object","properties":{"frequency":{"type":"string","const":"weekly"},"interval":{"type":"integer","minimum":1,"maximum":365},"weekdays":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"endAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxOccurrences":{"anyOf":[{"type":"integer","minimum":2,"maximum":10000},{"type":"null"}]}},"required":["frequency","interval","weekdays"],"additionalProperties":false},{"type":"object","properties":{"frequency":{"type":"string","const":"monthly"},"interval":{"type":"integer","minimum":1,"maximum":365},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"endAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"maxOccurrences":{"anyOf":[{"type":"integer","minimum":2,"maximum":10000},{"type":"null"}]}},"required":["frequency","interval","dayOfMonth"],"additionalProperties":false}]},{"type":"null"}]}},"required":["title"],"additionalProperties":false},"CrmTaskUpdateInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"title":{"type":"string","minLength":1,"maxLength":240},"description":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"ownerUserId":{"type":"string","minLength":1,"maxLength":100},"status":{"type":"string","enum":["open","in_progress"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"dueAt":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"dueTimezone":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]}},"required":["expectedRevision"],"additionalProperties":false},"CrmTask":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerUserId":{"type":"string"},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"dealId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["open","in_progress","completed","cancelled"]},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"dueAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"dueTimezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"recurrence":{"anyOf":[{"type":"object","properties":{"seriesId":{"type":"string"},"occurrence":{"type":"integer"},"status":{"type":"string","enum":["active","completed","cancelled"]},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"interval":{"type":"integer"},"weekdays":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}]},"dayOfMonth":{"anyOf":[{"type":"integer"},{"type":"null"}]},"anchorDueAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"endAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"maxOccurrences":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["seriesId","occurrence","status","frequency","interval","weekdays","dayOfMonth","anchorDueAt","endAt","maxOccurrences"],"additionalProperties":false},{"type":"null"}]},"nextTaskId":{"anyOf":[{"type":"string"},{"type":"null"}]},"replayed":{"type":"boolean"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archivedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","title","description","ownerUserId","contactId","accountId","dealId","status","priority","dueAt","dueTimezone","completedAt","recurrence","nextTaskId","replayed","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmTaskList":{"type":"array","items":{"$ref":"#/components/schemas/CrmTask"}},"CrmProduct":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"unit":{"type":"string"},"taxCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","archived"]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archivedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","sku","name","description","unit","taxCode","status","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmProductList":{"type":"array","items":{"$ref":"#/components/schemas/CrmProduct"}},"CrmProductCreateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"sku":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]}},"required":["name","sku"],"additionalProperties":false},"CrmCatalogMutationResult":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["id","revision"],"additionalProperties":false},"CrmPriceBook":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Código ISO 4217 normalizado a mayúsculas; los montos asociados usan unidades menores enteras."},"isDefault":{"type":"boolean"},"status":{"type":"string","enum":["active","archived"]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"archivedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","name","currency","isDefault","status","revision","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmPriceBookList":{"type":"array","items":{"$ref":"#/components/schemas/CrmPriceBook"}},"CrmPriceBookCreateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"isDefault":{"default":false,"type":"boolean"}},"required":["name","currency"],"additionalProperties":false},"CrmPriceBookItemSetInput":{"type":"object","properties":{"productId":{"type":"string","minLength":1,"maxLength":100},"unitPriceMinor":{"type":"integer","minimum":0,"maximum":9007199254740991},"taxBasisPoints":{"default":0,"type":"integer","minimum":0,"maximum":10000},"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["productId","unitPriceMinor"],"additionalProperties":false},"CrmQuoteCreateInput":{"type":"object","properties":{"opportunityId":{"type":"string","minLength":1,"maxLength":100},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["opportunityId"],"additionalProperties":false},"CrmQuoteReviseInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["expectedRevision"],"additionalProperties":false},"CrmQuoteSendInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"versionId":{"type":"string","minLength":1,"maxLength":100},"expectedChecksum":{"type":"string","pattern":"^[a-fA-F0-9]{64}$"},"contactId":{"type":"string","minLength":1,"maxLength":100},"confirmDelivery":{"type":"boolean","const":true}},"required":["expectedRevision","versionId","expectedChecksum","contactId","confirmDelivery"],"additionalProperties":false},"CrmQuoteDecisionInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"decision":{"type":"string","enum":["accepted","rejected","expired"]}},"required":["expectedRevision","decision"],"additionalProperties":false},"CrmQuoteMutationResult":{"type":"object","properties":{"id":{"type":"string"},"opportunityId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","accepted","rejected","expired"]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"version":{"type":"integer"},"versionId":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Código ISO 4217 normalizado a mayúsculas; los montos asociados usan unidades menores enteras."},"totals":{"type":"object","properties":{"subtotalMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"discountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"netMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"taxMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"totalMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."}},"required":["subtotalMinor","discountMinor","netMinor","taxMinor","totalMinor"],"additionalProperties":false},"checksum":{"type":"string"}},"required":["id","opportunityId","status","revision","version","versionId","currency","totals","checksum"],"additionalProperties":false},"CrmQuoteDeliveryResult":{"type":"object","properties":{"quote":{"$ref":"#/components/schemas/CrmQuoteMutationResult"},"delivery":{"type":"object","properties":{"state":{"type":"string","const":"sent"},"providerMessageId":{"type":"string"},"replayed":{"type":"boolean"},"linked":{"type":"boolean"}},"required":["state","providerMessageId","replayed","linked"],"additionalProperties":false},"sentVersionId":{"type":"string"},"sourceChecksum":{"type":"string"},"pdfChecksum":{"type":"string"}},"required":["quote","delivery","sentVersionId","sourceChecksum","pdfChecksum"],"additionalProperties":false},"CrmQuoteDeliveryAttempt":{"type":"object","properties":{"state":{"type":"string","enum":["blocked","failed","in_progress"]},"reason":{"type":"string"},"providerMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["state","reason","providerMessageId","replayed"],"additionalProperties":false},"CrmQuote":{"type":"object","properties":{"id":{"type":"string"},"dealId":{"type":"string"},"dealName":{"type":"string"},"quoteNumber":{"type":"string"},"status":{"type":"string","enum":["draft","approval_required","approved","sent","accepted","rejected","expired","void"]},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Código ISO 4217 normalizado a mayúsculas; los montos asociados usan unidades menores enteras."},"currentVersion":{"type":"integer"},"currentVersionId":{"type":"string"},"validUntil":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"subtotalMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"discountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"netMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"taxMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"totalMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"checksum":{"type":"string"},"sentAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"acceptedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"rejectedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","dealId","dealName","quoteNumber","status","currency","currentVersion","currentVersionId","validUntil","subtotalMinor","discountMinor","netMinor","taxMinor","totalMinor","checksum","sentAt","acceptedAt","rejectedAt","revision","createdAt","updatedAt"],"additionalProperties":false},"CrmQuoteList":{"type":"array","items":{"$ref":"#/components/schemas/CrmQuote"}},"CrmForecastSnapshot":{"type":"object","properties":{"id":{"type":"string"},"periodId":{"type":"string"},"asOf":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"sourceChecksum":{"type":"string"},"rollupChecksum":{"type":"string"},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","periodId","asOf","sourceChecksum","rollupChecksum","createdAt"],"additionalProperties":false},"CrmForecastRollup":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Código ISO 4217 normalizado a mayúsculas; los montos asociados usan unidades menores enteras."},"ownerUserId":{"type":"string"},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"pipelineId":{"type":"string"},"category":{"type":"string"},"dealCount":{"type":"integer"},"nominalMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"weightedMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."}},"required":["currency","ownerUserId","teamId","pipelineId","category","dealCount","nominalMinor","weightedMinor"],"additionalProperties":false},"CrmForecast":{"type":"object","properties":{"snapshot":{"anyOf":[{"$ref":"#/components/schemas/CrmForecastSnapshot"},{"type":"null"}]},"rollups":{"type":"array","items":{"$ref":"#/components/schemas/CrmForecastRollup"}}},"required":["snapshot","rollups"],"additionalProperties":false},"CrmPipelineReportGroup":{"type":"object","properties":{"pipelineId":{"type":"string"},"pipelineName":{"type":"string"},"stageId":{"type":"string"},"stageName":{"type":"string"},"category":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Código ISO 4217 normalizado a mayúsculas; los montos asociados usan unidades menores enteras."},"dealCount":{"type":"integer"},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"weightedMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."}},"required":["pipelineId","pipelineName","stageId","stageName","category","currency","dealCount","amountMinor","weightedMinor"],"additionalProperties":false},"CrmPipelineReport":{"type":"object","properties":{"generatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"groups":{"type":"array","items":{"$ref":"#/components/schemas/CrmPipelineReportGroup"}}},"required":["generatedAt","groups"],"additionalProperties":false},"CrmEmptyInput":{"type":"object","properties":{},"required":[],"additionalProperties":false},"CrmSequenceDraftInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"dailySendLimit":{"type":"integer","minimum":1,"maximum":10000},"definition":{"type":"object","properties":{"schemaVersion":{"type":"integer","const":1},"goal":{"type":"string","enum":["reply","booking","stage","manual"]},"communicationWindow":{"type":"object","properties":{"allowedWeekdays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"minItems":1,"maxItems":7},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"endMinute":{"type":"integer","minimum":1,"maximum":1440}},"required":["allowedWeekdays","startMinute","endMinute"],"additionalProperties":false},"steps":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"email"},"templateId":{"type":"string","minLength":1,"maxLength":128}},"required":["key","type","templateId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"task"},"title":{"type":"string","minLength":1,"maxLength":240},"ownerUserId":{"type":"string","minLength":1,"maxLength":128}},"required":["key","type","title","ownerUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"wait"},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600}},"required":["key","type","delayMinutes"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"condition"},"condition":{"type":"object","properties":{"field":{"type":"string","pattern":"^(eventType|entityType|entityId|payload\\.[A-Za-z][A-Za-z0-9_-]{0,63})$"},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"maxItems":100}]}},"required":["field","operator"],"additionalProperties":false}},"required":["key","type","condition"],"additionalProperties":false}]},"minItems":1,"maxItems":50}},"required":["schemaVersion","goal","steps"],"additionalProperties":false}},"required":["name","definition"],"additionalProperties":false},"CrmSequenceReviseInput":{"type":"object","properties":{"expectedRevision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"dailySendLimit":{"type":"integer","minimum":1,"maximum":10000},"definition":{"type":"object","properties":{"schemaVersion":{"type":"integer","const":1},"goal":{"type":"string","enum":["reply","booking","stage","manual"]},"communicationWindow":{"type":"object","properties":{"allowedWeekdays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"minItems":1,"maxItems":7},"startMinute":{"type":"integer","minimum":0,"maximum":1439},"endMinute":{"type":"integer","minimum":1,"maximum":1440}},"required":["allowedWeekdays","startMinute","endMinute"],"additionalProperties":false},"steps":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"email"},"templateId":{"type":"string","minLength":1,"maxLength":128}},"required":["key","type","templateId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"task"},"title":{"type":"string","minLength":1,"maxLength":240},"ownerUserId":{"type":"string","minLength":1,"maxLength":128}},"required":["key","type","title","ownerUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"wait"},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600}},"required":["key","type","delayMinutes"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"type":{"type":"string","const":"condition"},"condition":{"type":"object","properties":{"field":{"type":"string","pattern":"^(eventType|entityType|entityId|payload\\.[A-Za-z][A-Za-z0-9_-]{0,63})$"},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"maxItems":100}]}},"required":["field","operator"],"additionalProperties":false}},"required":["key","type","condition"],"additionalProperties":false}]},"minItems":1,"maxItems":50}},"required":["schemaVersion","goal","steps"],"additionalProperties":false}},"required":["expectedRevision","name","definition"],"additionalProperties":false},"CrmSequenceMutationResult":{"type":"object","properties":{"id":{"type":"string"},"versionId":{"type":"string"},"version":{"type":"integer"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"status":{"type":"string","const":"draft"},"checksum":{"type":"string"},"replayed":{"type":"boolean"}},"required":["id","versionId","version","revision","status","checksum","replayed"],"additionalProperties":false},"CrmSequencePublishResult":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"integer"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"status":{"type":"string","const":"active"},"replayed":{"type":"boolean"}},"required":["id","version","revision","status","replayed"],"additionalProperties":false},"CrmSequenceArchiveResult":{"type":"object","properties":{"id":{"type":"string"},"archived":{"type":"boolean","const":true},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"replayed":{"type":"boolean"}},"required":["id","archived","revision","replayed"],"additionalProperties":false},"CrmSequenceValidation":{"type":"object","properties":{"valid":{"type":"boolean"},"checksum":{"type":"string"},"stepCount":{"type":"integer"},"emailSteps":{"type":"integer"},"taskSteps":{"type":"integer"},"waitMinutes":{"type":"integer"},"errors":{"type":"array","items":{"type":"string"}}},"required":["valid","checksum","stepCount","emailSteps","taskSteps","waitMinutes","errors"],"additionalProperties":false},"CrmSequenceEnrollmentInput":{"type":"object","properties":{"contactIds":{"type":"array","items":{"type":"string"}},"opportunityId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["contactIds"],"additionalProperties":false},"CrmSequenceControlInput":{"type":"object","properties":{"action":{"type":"string","enum":["pause","resume","cancel"]},"expectedRevision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["action","expectedRevision"],"additionalProperties":false},"CrmEnrollmentPreview":{"type":"array","items":{"type":"object","additionalProperties":true}},"CrmEnrollmentConfirmation":{"type":"object","additionalProperties":true},"CrmSequence":{"type":"object","additionalProperties":true},"CrmSequenceList":{"type":"array","items":{"$ref":"#/components/schemas/CrmSequence"}},"CrmAutomationDraftInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"definition":{"type":"object","properties":{"schemaVersion":{"type":"number","const":1},"triggerType":{"type":"string","minLength":1,"maxLength":128},"conditions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false}},"actions":{"minItems":1,"maxItems":25,"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"assign"},"ownerUserId":{"type":"string"}},"required":["key","type","ownerUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"create_task"},"title":{"type":"string"},"ownerUserId":{"type":"string"},"dueInMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"priority":{"type":"string","enum":["low","normal","high","urgent"]}},"required":["key","type","title","ownerUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"set_field"},"fieldKey":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},"required":["key","type","fieldKey","value"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"propose_stage"},"stageId":{"type":"string"},"reason":{"type":"string"}},"required":["key","type","stageId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"propose_email"},"templateId":{"type":"string"},"toAddress":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["key","type","templateId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"enroll_sequence"},"sequenceId":{"type":"string"},"enrolledByUserId":{"type":"string"}},"required":["key","type","sequenceId","enrolledByUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"stop_sequence"},"sequenceId":{"type":"string"},"reason":{"type":"string","maxLength":500}},"required":["key","type","sequenceId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"create_hora_proposal"},"mode":{"type":"string","enum":["account_summary","deal_summary","meeting_prep","follow_up_draft","risk_explanation","next_best_action"]},"requestedByUserId":{"type":"string"},"instruction":{"type":"string","maxLength":1000}},"required":["key","type","mode","requestedByUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"propose_webhook"},"endpointId":{"type":"string"},"eventType":{"type":"string"}},"required":["key","type","endpointId","eventType"],"additionalProperties":false}]}},"guards":{"type":"object","properties":{"maxDepth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stormWindowMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxRunsPerEntity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"additionalProperties":false}},"required":["schemaVersion","triggerType","actions"],"additionalProperties":false}},"required":["name","definition"],"additionalProperties":false},"CrmAutomationUpdateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"definition":{"type":"object","properties":{"schemaVersion":{"type":"number","const":1},"triggerType":{"type":"string","minLength":1,"maxLength":128},"conditions":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false}},"actions":{"minItems":1,"maxItems":25,"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"assign"},"ownerUserId":{"type":"string"}},"required":["key","type","ownerUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"create_task"},"title":{"type":"string"},"ownerUserId":{"type":"string"},"dueInMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"priority":{"type":"string","enum":["low","normal","high","urgent"]}},"required":["key","type","title","ownerUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"set_field"},"fieldKey":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},"required":["key","type","fieldKey","value"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"propose_stage"},"stageId":{"type":"string"},"reason":{"type":"string"}},"required":["key","type","stageId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"propose_email"},"templateId":{"type":"string"},"toAddress":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["key","type","templateId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"enroll_sequence"},"sequenceId":{"type":"string"},"enrolledByUserId":{"type":"string"}},"required":["key","type","sequenceId","enrolledByUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"stop_sequence"},"sequenceId":{"type":"string"},"reason":{"type":"string","maxLength":500}},"required":["key","type","sequenceId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"create_hora_proposal"},"mode":{"type":"string","enum":["account_summary","deal_summary","meeting_prep","follow_up_draft","risk_explanation","next_best_action"]},"requestedByUserId":{"type":"string"},"instruction":{"type":"string","maxLength":1000}},"required":["key","type","mode","requestedByUserId"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64},"when":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":72},"operator":{"type":"string","enum":["eq","neq","in","contains","exists","gt","gte","lt","lte"]},"value":{"anyOf":[{"type":["string","number","boolean","null"]},{"maxItems":100,"type":"array","items":{"type":["string","number","boolean","null"]}}]}},"required":["field","operator"],"additionalProperties":false},"delayMinutes":{"type":"integer","minimum":1,"maximum":525600},"type":{"type":"string","const":"propose_webhook"},"endpointId":{"type":"string"},"eventType":{"type":"string"}},"required":["key","type","endpointId","eventType"],"additionalProperties":false}]}},"guards":{"type":"object","properties":{"maxDepth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stormWindowMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxRunsPerEntity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"additionalProperties":false}},"required":["schemaVersion","triggerType","actions"],"additionalProperties":false},"expectedRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["name","definition","expectedRevision"],"additionalProperties":false},"CrmAutomationPublishInput":{"type":"object","properties":{"versionId":{"type":"string"},"expectedRevision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["versionId","expectedRevision"],"additionalProperties":false},"CrmAutomationVersion":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"integer","minimum":1},"status":{"type":"string","enum":["draft","published","retired"]},"definition":{"type":"object","additionalProperties":true},"checksum":{"type":"string"},"publishedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["id","version","status","definition","checksum","publishedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmAutomation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"triggerType":{"type":"string"},"activeVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"versions":{"type":"array","items":{"$ref":"#/components/schemas/CrmAutomationVersion"}}},"required":["id","name","description","status","triggerType","activeVersion","revision","createdAt","updatedAt"],"additionalProperties":false},"CrmAutomationList":{"type":"array","items":{"$ref":"#/components/schemas/CrmAutomation"}},"CrmAutomationMutationResult":{"type":"object","properties":{"id":{"type":"string"},"versionId":{"type":"string"},"version":{"type":"integer"},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"status":{"type":"string","enum":["draft","active","paused","archived"]},"checksum":{"type":"string"}},"required":["id","versionId","version","revision","status","checksum"],"additionalProperties":false},"CrmAutomationValidation":{"type":"object","properties":{"valid":{"type":"boolean"},"checksum":{"type":"string"},"conditionCount":{"type":"integer"},"actionCount":{"type":"integer"},"delayedActionCount":{"type":"integer"},"branchedActionCount":{"type":"integer"},"errors":{"type":"array","items":{"type":"string"}}},"required":["valid","checksum","conditionCount","actionCount","delayedActionCount","branchedActionCount","errors"],"additionalProperties":false},"CrmAutomationEvent":{"type":"object","properties":{"triggerEventId":{"type":"string","minLength":1,"maxLength":180},"eventType":{"type":"string","minLength":1,"maxLength":128},"entityType":{"type":"string","enum":["contact","account","lead","opportunity"]},"entityId":{"type":"string","minLength":1,"maxLength":180},"aggregateRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"expectedEntityRevision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"contactId":{"anyOf":[{"type":"string","minLength":1,"maxLength":180},{"type":"null"}]},"opportunityId":{"anyOf":[{"type":"string","minLength":1,"maxLength":180},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]}},"depth":{"type":"integer","minimum":0,"maximum":16},"lineage":{"maxItems":16,"type":"array","items":{"type":"string","minLength":1,"maxLength":180}}},"required":["triggerEventId","eventType","entityType","entityId","aggregateRevision","expectedEntityRevision"],"additionalProperties":false},"CrmAutomationDryRun":{"type":"object","properties":{"wouldRun":{"type":"boolean"},"reason":{"type":"string","enum":["matched","trigger_mismatch","condition_false","loop_guard"]},"executionKey":{"type":"string"},"actionExecutionKeys":{"type":"array","items":{"type":"string"}},"proposalsRequireRevalidation":{"type":"boolean"}},"required":["wouldRun","reason","executionKey","actionExecutionKeys","proposalsRequireRevalidation"],"additionalProperties":false},"CrmAutomationRunStep":{"type":"object","properties":{"stepKey":{"type":"string"},"status":{"type":"string","enum":["pending","running","waiting","completed","skipped","failed","dead_letter"]},"attemptCount":{"type":"integer","minimum":0},"lastErrorCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]}},"required":["stepKey","status","attemptCount","lastErrorCode","nextAttemptAt","startedAt","completedAt"],"additionalProperties":false},"CrmAutomationRun":{"type":"object","properties":{"id":{"type":"string"},"automationId":{"type":"string"},"automationVersionId":{"type":"string"},"triggerEventId":{"type":"string"},"entityType":{"type":"string","enum":["contact","account","lead","opportunity"]},"entityId":{"type":"string"},"status":{"type":"string","enum":["pending","running","waiting","completed","failed","cancelled","dead_letter"]},"attemptCount":{"type":"integer","minimum":0},"lastErrorCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"createdAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/CrmAutomationRunStep"}}},"required":["id","automationId","automationVersionId","triggerEventId","entityType","entityId","status","attemptCount","lastErrorCode","nextAttemptAt","startedAt","completedAt","createdAt","updatedAt"],"additionalProperties":false},"CrmAutomationRunList":{"type":"array","items":{"$ref":"#/components/schemas/CrmAutomationRun"}},"CrmAutomationRequeueInput":{"type":"object","properties":{"expectedAttemptCount":{"type":"integer","minimum":0},"stepKeys":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":25}},"required":["expectedAttemptCount"],"additionalProperties":false},"CrmAutomationRequeueResult":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","const":"queued"},"selectedSteps":{"type":"integer"},"mode":{"type":"string","enum":["retry","replay"]}},"required":["id","status","selectedSteps","mode"],"additionalProperties":false},"CrmCustomFieldCreateInput":{"type":"object","additionalProperties":true},"CrmCustomFieldUpdateInput":{"type":"object","additionalProperties":true},"CrmCustomFieldDefinition":{"type":"object","additionalProperties":true},"CrmCustomFieldDefinitionList":{"type":"array","items":{"$ref":"#/components/schemas/CrmCustomFieldDefinition"}},"CrmCustomFieldValueSetInput":{"type":"object","additionalProperties":true},"CrmCustomFieldValueClearInput":{"type":"object","additionalProperties":true},"CrmCustomFieldValue":{"type":"object","additionalProperties":true},"CrmCustomFieldValueList":{"type":"array","items":{"$ref":"#/components/schemas/CrmCustomFieldValue"}},"CrmForecastPeriodInput":{"type":"object","properties":{"name":{"type":"string"},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Código ISO 4217 normalizado a mayúsculas; los montos asociados usan unidades menores enteras."}},"required":["name","startDate","endDate","currency"],"additionalProperties":false},"CrmForecastQuotaInput":{"type":"object","properties":{"periodId":{"type":"string"},"subjectType":{"type":"string","enum":["owner","team"]},"subjectId":{"type":"string"},"amountMinor":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Monto entero no negativo en la unidad menor de currency; nunca coma flotante."},"expectedRevision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."}},"required":["periodId","subjectType","subjectId","amountMinor"],"additionalProperties":false},"CrmForecastSnapshotInput":{"type":"object","properties":{"periodId":{"type":"string"},"asOf":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."}},"required":["periodId","asOf"],"additionalProperties":false},"CrmImportJob":{"type":"object","properties":{"id":{"type":"string"},"entityType":{"type":"string","enum":["contact","opportunity"]},"mode":{"type":"string","enum":["dry_run","commit"]},"status":{"type":"string","enum":["uploaded","validating","preview_ready","running","completed","partial","failed","cancelled","rolled_back"]},"totalRows":{"type":"integer","minimum":0},"acceptedRows":{"type":"integer","minimum":0},"rejectedRows":{"type":"integer","minimum":0},"processedRows":{"type":"integer","minimum":0},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"startedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"errorsDownloadUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","entityType","mode","status","totalRows","acceptedRows","rejectedRows","processedRows","revision","startedAt","completedAt","updatedAt","errorsDownloadUrl"],"additionalProperties":false},"CrmExportInput":{"type":"object","properties":{"entityType":{"type":"string","enum":["contact","opportunity"]},"fields":{"type":"array","items":{"type":"string"}},"filters":{"type":"object","additionalProperties":{"type":"string"}}},"required":["entityType","fields"],"additionalProperties":false},"CrmExportJob":{"type":"object","properties":{"id":{"type":"string"},"entityType":{"type":"string","enum":["contact","opportunity"]},"status":{"type":"string","enum":["pending","running","completed","failed","cancelled","expired"]},"fields":{"type":"array","items":{"type":"string"}},"rowCount":{"type":"integer","minimum":0},"revision":{"type":"integer","minimum":1,"description":"Revisión positiva usada para compare-and-swap."},"expiresAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},{"type":"null"}]},"updatedAt":{"type":"integer","minimum":0,"description":"Instante UTC en milisegundos desde Unix epoch."},"downloadUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","entityType","status","fields","rowCount","revision","expiresAt","startedAt","completedAt","updatedAt","downloadUrl"],"additionalProperties":false},"CrmQuotePdfReference":{"type":"object","properties":{"quoteId":{"type":"string"},"versionId":{"type":"string"},"version":{"type":"integer","minimum":1},"checksum":{"type":"string","pattern":"^[a-fA-F0-9]{64}$"},"byteSize":{"type":"integer","minimum":0},"replayed":{"type":"boolean"},"downloadUrl":{"type":"string"}},"required":["quoteId","versionId","version","checksum","byteSize","replayed","downloadUrl"],"additionalProperties":false},"CrmMetricReport":{"type":"object","properties":{"metric":{"type":"string"},"rows":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["metric","rows"],"additionalProperties":false},"CrmErrorCode":{"type":"string","enum":["CRM_DUPLICATE_CONTACT","CRM_DUPLICATE_COMPANY","CRM_VERSION_CONFLICT","CRM_INVALID_STAGE_TRANSITION","CRM_INVALID_LEAD_TRANSITION","CRM_INVALID_TASK_TRANSITION","CRM_EXPLICIT_CONFIRMATION_REQUIRED","CRM_QUOTE_IMMUTABLE","CRM_QUOTE_PDF_REQUIRED","CRM_QUOTE_NOT_FOUND","CRM_QUOTE_PDF_UNAVAILABLE","CRM_QUOTE_PDF_STORAGE_DRIFT","CRM_REVENUE_CONFLICT","CRM_REQUIRED_FIELD_MISSING","CRM_SCOPE_REQUIRED","CRM_IDEMPOTENCY_MISMATCH","CRM_SEQUENCE_BLOCKED","CRM_REPORT_NOT_FOUND","CRM_RATE_LIMITED","CRM_DUPLICATE_LEAD","CRM_PIPELINE_CONFLICT","CRM_PIPELINE_NOT_FOUND","CRM_PIPELINE_STAGE_CONFLICT","CRM_PIPELINE_STAGE_NOT_FOUND","CRM_PIPELINE_STAGE_INVALID","CRM_PIPELINE_DEFAULT_REQUIRED","CRM_PIPELINE_IN_USE","CRM_PIPELINE_STAGE_IN_USE","CRM_AUTHENTICATION_REQUIRED","CRM_RECORD_NOT_FOUND","CRM_STATE_CONFLICT","CRM_LIMIT_EXCEEDED","CRM_INPUT_INVALID","CRM_SERVICE_UNAVAILABLE"]},"CrmError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/CrmErrorCode"},"message":{"type":"string"},"requestId":{"type":"string"},"retryable":{"type":"boolean"},"docUrl":{"type":"string","format":"uri"},"details":{}},"required":["code","message","requestId","retryable","docUrl"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["booking.confirmed","booking.approval_requested","booking.approved","booking.rejected","booking.rescheduled","booking.cancelled","booking.completed","booking.no_show","crm.contact.created","crm.contact.updated","crm.contact.merged","crm.contact.archived","crm.contact.restored","crm.company.created","crm.company.updated","crm.company.merged","crm.company.archived","crm.company.restored","crm.lead.created","crm.lead.updated","crm.lead.qualified","crm.lead.converted","crm.lead.disqualified","crm.lead.archived","crm.lead.restored","crm.deal.created","crm.deal.updated","crm.deal.stage_changed","crm.deal.won","crm.deal.lost","crm.deal.archived","crm.deal.restored","crm.activity.created","crm.activity.updated","crm.activity.archived","crm.activity.restored","crm.pipeline.created","crm.pipeline.updated","crm.pipeline.archived","crm.pipeline.restored","crm.pipeline_stage.created","crm.pipeline_stage.updated","crm.pipeline_stage.archived","crm.pipeline_stage.restored","crm.task.created","crm.task.completed","crm.task.overdue","crm.sequence.enrolled","crm.sequence.step_sent","crm.sequence.replied","crm.sequence.completed","crm.sequence.failed","crm.sequence.unsubscribed","crm.sequence.created","crm.sequence.revised","crm.sequence.published","crm.sequence.archived","crm.automation.created","crm.automation.published","crm.meeting.linked","crm.meeting.link_updated","crm.meeting.unlinked","crm.meeting.outcome_recorded","crm.quote.sent","crm.quote.accepted","crm.quote.rejected","crm.quote.expired","crm.import.completed","crm.import.failed"]}},"status":{"type":"string","enum":["active","disabled"]},"lastDeliveredAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","url","events","status","lastDeliveredAt","createdAt"],"additionalProperties":false},"WebhookEndpointList":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"CreateWebhookEndpointInput":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["booking.confirmed","booking.approval_requested","booking.approved","booking.rejected","booking.rescheduled","booking.cancelled","booking.completed","booking.no_show","crm.contact.created","crm.contact.updated","crm.contact.merged","crm.contact.archived","crm.contact.restored","crm.company.created","crm.company.updated","crm.company.merged","crm.company.archived","crm.company.restored","crm.lead.created","crm.lead.updated","crm.lead.qualified","crm.lead.converted","crm.lead.disqualified","crm.lead.archived","crm.lead.restored","crm.deal.created","crm.deal.updated","crm.deal.stage_changed","crm.deal.won","crm.deal.lost","crm.deal.archived","crm.deal.restored","crm.activity.created","crm.activity.updated","crm.activity.archived","crm.activity.restored","crm.pipeline.created","crm.pipeline.updated","crm.pipeline.archived","crm.pipeline.restored","crm.pipeline_stage.created","crm.pipeline_stage.updated","crm.pipeline_stage.archived","crm.pipeline_stage.restored","crm.task.created","crm.task.completed","crm.task.overdue","crm.sequence.enrolled","crm.sequence.step_sent","crm.sequence.replied","crm.sequence.completed","crm.sequence.failed","crm.sequence.unsubscribed","crm.sequence.created","crm.sequence.revised","crm.sequence.published","crm.sequence.archived","crm.automation.created","crm.automation.published","crm.meeting.linked","crm.meeting.link_updated","crm.meeting.unlinked","crm.meeting.outcome_recorded","crm.quote.sent","crm.quote.accepted","crm.quote.rejected","crm.quote.expired","crm.import.completed","crm.import.failed"]}}},"required":["name","url","events"],"additionalProperties":false},"WebhookEndpointSecret":{"type":"object","properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"signingSecret":{"type":"string"},"replayed":{"type":"boolean"}},"required":["endpoint","signingSecret","replayed"],"additionalProperties":false},"WebhookEndpointDisabled":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","const":"disabled"},"replayed":{"type":"boolean"}},"required":["id","status","replayed"],"additionalProperties":false},"OpenApiDocument":{"type":"object"},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"retryable":{"type":"boolean"},"docUrl":{"type":"string","format":"uri"},"details":{}},"required":["code","message","requestId"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}