---
title: "Reubicar Anular Hubspot"
method: POST
path: "/api/budget/hubspot/reubicar_anular"
tags: ["copilot_frontend", "copilot_budget"]
---

# Reubicar Anular Hubspot

`POST /api/budget/hubspot/reubicar_anular`

## Request

- Base URL: `https://api.hogarsolar.es` (the document declares no server; this is the origin it was published from)
- URL: `https://api.hogarsolar.es/api/budget/hubspot/reubicar_anular`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/hogarsolar/apis/hogarsolar-backend-api/docs/api/budget/hubspot/reubicar_anular/post.ts> (a function with typed inputs; its response is checked against the schema)

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

## Request body

- ReubicarAnularHubSpotRequest: Request to mark a client as 'reubicar' or 'anular' in HubSpot.
  - `email` string, required: Client email to find the contact
  - `observaciones` string, required: Required observations about the action
  - `accion` string, required: Action type: 'reubicar' or 'anular'
  - `presupuesto_id` integer, nullable: Optional budget ID. If provided, updates existing budget. If None, creates new budget.
  - `comercial_id` integer, nullable: Comercial ID to use. Admin use only: overrides current_user.comercial_id when admin has none.

## Response `200`

Successful Response

- ReubicarAnularHubSpotResponse: Response after marking as 'reubicar' or 'anular'.
  - `contact_id` string, required: HubSpot contact ID that was updated
  - `note_created` boolean, required: Whether the note was created successfully
  - `message` string, required: Success message

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/hogarsolar/apis/hogarsolar-backend-api.md) - [All operations](https://skmtc.dev/hogarsolar/apis/hogarsolar-backend-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hogarsolar/apis/hogarsolar-backend-api/revisions/1dc9ad769f97?raw)
