copilot_frontend
copilot_budget

Reubicar Anular Hubspot

Marca 'reubicar' o 'anular' en HubSpot: actualiza propiedad y crea nota. También guarda un registro en presup_presupuestos con el estado correspondiente.

🔒 Protected Endpoint: Requires JWT authentication and 'ui_comercial' or 'admin' role

Args: data: ReubicarAnularHubSpotRequest con email, accion y observaciones current_user: Current authenticated user db: Database session

Returns: ReubicarAnularHubSpotResponse con contact_id, note_created y mensaje

Raises: ErrValidation: Si el usuario no tiene comercial_id asignado o si la acción no es válida

post/api/budget/hubspot/reubicar_anular

Request

Request body

emailstring required

Client email to find the contact

observacionesstring required

Required observations about the action

accionstring required

Action type: 'reubicar' or 'anular'

presupuesto_idinteger nullable

Optional budget ID. If provided, updates existing budget. If None, creates new budget.

comercial_idinteger nullable

Comercial ID to use. Admin use only: overrides current_user.comercial_id when admin has none.

Example request

{
  "accion": "reubicar",
  "email": "cliente@example.com",
  "observaciones": "Cliente solicita cambio de provincia",
  "presupuesto_id": 123
}

Response

Successful Response

contact_idstring required

HubSpot contact ID that was updated

note_createdboolean required

Whether the note was created successfully

messagestring required

Success message

Changes

No recorded changes to this operation across all 2 revisions of this API.