---
title: "Post Hubspot Reply Draft"
method: POST
path: "/api/v1/public/hubspot/reply-draft"
tags: ["hubspot-crm-card"]
---

# Post Hubspot Reply Draft

`POST /api/v1/public/hubspot/reply-draft`

## Request

- Base URL: `https://api.getanana.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getanana.com/api/v1/public/hubspot/reply-draft`
- Auth: none declared

Draft a reply for the open record. The person sends it themselves.

HubSpot appends ``portalId``, ``userId``, ``userEmail``, and ``appId``
to the query. After the signature check, ``userEmail`` is read only to
look up that HubSpot owner's display name when the body has no
``viewerName``. The address is not logged and is not sent to Sentry.
The body is ``objectType``, ``objectId``, an optional ``hubspotThreadId``,
and an optional ``viewerName``. A HubSpot thread id that is not on this
record is rejected. The follow-up id drafts the phone call or website
chat that wrote the record, and that draft is not sent.

## Query parameters

- `portalId` string, required
- `appId` string, nullable

## Response `200`

Successful Response

- HubSpotReplyDraftResponse: One reviewed draft, or an empty state the card can render. ``ok`` is the only status that includes reply text. The draft is not sent. ``sources`` is returned for a ready draft and for an empty draft, so a hollow result can still be checked. Other statuses carry none. ``content_hash`` is the trimmed draft. ``reviewed`` is true only when a person approved that hash and a later edit has not cleared it. ``confidence`` is the code-computed label. Copy stays off until review. ``highlights`` are the template lines still in ``draft``. An empty list means the assembler emitted none. The card does not invent more.
  - `status` 'ok' | 'portal_not_connected' | 'ambiguous_portal' | 'thread_not_found' | 'not_email_thread' | 'list_incomplete' | 'ambiguous_thread' | 'ambiguous_inbox' | 'unrelated_thread' | 'draft_unavailable' | 'hotel_replied_last', required
  - `draft` string, nullable
  - `hubspot_thread_id` string, nullable
  - `limits` string, nullable
  - `sources` HubSpotDraftSources: Internal audit of what the draft was allowed to use. The card copies ``draft`` only. These fields are for verifying that hotel rules and knowledge were injected. They are not shown to the guest. ``debug`` is optional so a snapshot stored before it existed still loads.
    - `rules_hash` string, required
    - `model` string, nullable
    - `rules` HubSpotDraftRuleSource[], required
      - `kind` 'phone' | 'chat', required
      - `name` string, required
      - `agent_id` string, required
    - `chunks` HubSpotDraftChunkSource[], required
      - `knowledge_base_id` string, required
      - `chunk_id` string, required
      - `document_title` string, required
    - `debug` HubSpotDraftDebug: Inputs for a live retest. The card does not render this. ``latest_guest`` is the guest message the language and the answer gates used. ``stay_text`` is the message the stay facts were read from. ``model_json`` is the raw model object as a string. ``answers`` includes kept and dropped answers. ``dropped`` is what the property gate removed before the model ran.
      - `latest_guest` string, required
      - `stay_text` string, required
      - `facts` HubSpotDraftDebugFact, required: Stay facts the template used. Internal. Not shown to the guest.
        - `language` string, required
        - `property_code` string, nullable
        - `property_name` string, nullable
        - `stay_label` string, nullable
        - `night_range` string, nullable
        - `rooms` string[]
        - `checkin` string, nullable
        - `checkout` string, nullable
        - `quote_reason` string, nullable
        - `guest_requested` boolean
      - `model_json` string, required
      - `answers` HubSpotDraftDebugAnswer[]
        - `text` string, required
        - `source_id` string, required
        - `source_property` string, nullable
        - `language` string, nullable
        - `kept` boolean, required
        - `gate` string, nullable
      - `dropped` HubSpotDraftDebugDrop[]
        - `gate` string, required
        - `source_id` string, required
        - `source_property` string, nullable
  - `content_hash` string, nullable
  - `snapshot_id` string, nullable
  - `reviewed` boolean
  - `confidence` HubSpotDraftConfidence: Deterministic label for the draft. The model does not set it. ``Ready to review`` has an empty ``missing`` list. ``Needs checking`` names each gap. The card shows both before the person approves.
    - `label` 'Ready to review' | 'Needs checking', required
    - `missing` string[]
  - `highlights` HubSpotDraftHighlight[]
    - `text` string, required
    - `kind` 'price' | 'date' | 'availability', required
    - `source` string, required
  - `notice` string, nullable

## Other responses

- `400`: Error
- `401`: Error
- `422`: Validation Error
- `502`: Error

## Changes

> 55 revisions in range; 1 not diffed.

- **2026-10-22** `4d9d38769a75`: 8 info
  - added the optional property `confidence` to the response with the `200` status
  - added the optional property `content_hash` to the response with the `200` status
  - added the optional property `highlights` to the response with the `200` status
  - added the optional property `notice` to the response with the `200` status
  - …4 more
- **2026-10-21** `857f532fee0d`: 1 info
  - added the optional property `sources/anyOf[subschema #1: HubSpotDraftSources]/debug` to the response with the `200` status
- **2026-10-16** `8054afef2003`: 1 info
  - added the optional property `sources` to the response with the `200` status
- **2026-10-16** `9454f10581b0`: 1 warning
  - added the new `hotel_replied_last` enum value to the `status` response property for the response status `200`
- **2026-10-16** `4f0170dcfa72`: 1 info
  - added the optional property `limits` to the response with the `200` status

[Operation history](https://skmtc.dev/getanana/apis/cleon-api/changes/api/v1/public/hubspot/reply-draft/post.md)

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getanana/apis/cleon-api/revisions/4d9d38769a75?raw)
