> ## Documentation Index
> Fetch the complete documentation index at: https://talktohumans.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or replace a conversation draft

> Update a LinkedIn conversation.



## OpenAPI

````yaml /openapi.yaml patch /v1/conversations/{conversationId}
openapi: 3.0.3
info:
  title: TalkToHumans Public API
  version: 1.0.0
  license:
    name: Proprietary
  description: >
    Read and organize the LinkedIn organization data your team already manages
    in TalkToHumans: accounts, contacts, tags, notes, sequence state,
    conversations, and views.
servers:
  - url: https://api.talktohumans.app
    description: TalkToHumans API
security:
  - bearerAuth: []
tags:
  - name: Organization
    description: Organization details for the current API key.
  - name: LinkedIn
    description: LinkedIn accounts, contacts, companies, and conversations.
  - name: Activity
    description: Activity for organization reporting.
  - name: Enrich
    description: Profile enrichment for LinkedIn contacts and companies.
  - name: Views
    description: Saved TalkToHumans views.
paths:
  /v1/conversations/{conversationId}:
    patch:
      tags:
        - LinkedIn
      summary: Create or replace a conversation draft
      description: Update a LinkedIn conversation.
      operationId: updateConversation
      parameters:
        - name: conversationId
          in: path
          required: true
          description: Conversation ID returned by `GET /v1/conversations`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateConversationRequest'
            example:
              account_id: '42'
              draft_message: >-
                Hi Robin,


                Thanks for the thoughtful note. Would Tuesday work for a quick
                call?
      responses:
        '200':
          description: Draft saved in TalkToHumans. The message was not sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateConversationEnvelope'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccountScopedForbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    UpdateConversationRequest:
      type: object
      additionalProperties: false
      required:
        - account_id
        - draft_message
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`.
          pattern: ^[1-9][0-9]*$
        draft_message:
          type: string
          minLength: 1
          description: >-
            Plain-text draft reply. Surrounding whitespace is trimmed and an
            existing draft is replaced.
    UpdateConversationEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/UpdateConversationResponse'
    UpdateConversationResponse:
      type: object
      additionalProperties: false
      required:
        - draft
      properties:
        draft:
          $ref: '#/components/schemas/ConversationDraft'
    Error:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code.
          enum:
            - unauthorized
            - forbidden
            - not_found
            - bad_request
            - internal_error
            - conflict
            - rate_limit_exceeded
            - account_shared_access_required
            - billing_payment_failed
            - billing_subscription_incomplete
            - billing_subscription_expired
            - billing_grace_period
            - billing_feature_not_available
            - billing_insufficient_credits
            - billing_invalid
            - upstream_error
        message:
          type: string
          description: Human-readable error message.
        debug:
          type: string
          description: Development-only debug details.
    ConversationDraft:
      type: object
      additionalProperties: false
      required:
        - conversation_id
        - account
        - draft_message
        - app_url
        - updated_at
      properties:
        conversation_id:
          type: string
          description: TalkToHumans conversation ID.
        account:
          $ref: '#/components/schemas/AccountSummary'
        draft_message:
          type: string
          description: Normalized plain-text content saved in the conversation composer.
        app_url:
          type: string
          format: uri
        updated_at:
          type: string
          format: date-time
    AccountSummary:
      type: object
      additionalProperties: false
      required:
        - account_id
        - display_name
        - provider_account_id
        - owner_user_id
      properties:
        account_id:
          type: string
          description: TalkToHumans account ID.
        display_name:
          type: string
        provider_account_id:
          type: string
          description: LinkedIn provider account ID.
        owner_user_id:
          type: string
          description: TalkToHumans user ID that owns the account.
  responses:
    BadRequest:
      description: Invalid request parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: bad_request
            message: Invalid request parameters
    Unauthorized:
      description: Missing, malformed, invalid, or retired local API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingAuthorization:
              value:
                code: unauthorized
                message: Authorization header is required
            invalidAuthorizationFormat:
              value:
                code: unauthorized
                message: Authorization header must use Bearer scheme
            invalidAPIKey:
              value:
                code: unauthorized
                message: Invalid API key
    AccountScopedForbidden:
      description: >-
        API access is not enabled for the organization, the API key cannot
        resolve to an active organization user, or the credential cannot access
        the requested LinkedIn account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            accountSharedAccessRequired:
              summary: Requested account is not accessible to this credential
              value:
                code: account_shared_access_required
                message: >-
                  This account is not shared-access enabled for API or MCP. Ask
                  an admin to enable shared access before using this account
                  from this credential.
            forbidden:
              value:
                code: forbidden
                message: you don't have access to this organization
            featureUnavailable:
              value:
                code: billing_feature_not_available
                message: >-
                  Feature 'TalkToHumansAPI' is not available in your current
                  plan
            insufficientCredits:
              value:
                code: billing_insufficient_credits
                message: Insufficient credits
            apiKeyPrincipalInvalid:
              value:
                code: forbidden
                message: >-
                  This API key is no longer linked to an active organization
                  user. Ask an organization admin to regenerate it
    NotFound:
      description: Requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: not_found
            message: participant not found
    RateLimited:
      description: >-
        Rate limit exceeded. Public routes allow 50 requests per 10 seconds per
        IP and endpoint.
      headers:
        Retry-After:
          description: Seconds to wait before retrying the request.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: rate_limit_exceeded
            message: Rate limit exceeded
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: internal_error
            message: An internal error occurred
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Pass API key as `Authorization: Bearer <api_key>`.'

````