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

# Push a record into the tenant CRM

> Operator-initiated CRM write — public sibling of the agent-only `crm_create_record` tool. Per-tenant `tenant_crm_field_mappings` translate canonical Vorel keys to vendor-side keys before the driver call. Returns 200 + `{ok:false, error}` for the no-CRM-configured case + typed CrmError responses (auth_failed, rate_limited, validation_error, etc.) so SDK consumers handle soft failures without branching on HTTP status.



## OpenAPI

````yaml https://app.vorel.ai/api/v1/openapi.json post /api/v1/crm/create-record
openapi: 3.1.0
info:
  title: Vorel API
  version: 0.1.0
  description: >-
    Public API for Vorel — the AI receptionist for any business. Read your
    conversations, leads, appointments, and catalog; push CRM-side updates back
    into the platform. All endpoints accept bearer-auth API keys issued at
    `/settings/integrations/api-keys` in the dashboard. Per-key rate limit is
    200 req/min.
  contact:
    name: Vorel support
    email: hello@vorel.ai
  license:
    name: Proprietary
servers:
  - url: https://app.vorel.ai
    description: Production
  - url: http://localhost:3000
    description: Local dev
security:
  - BearerAuth: []
tags:
  - name: Conversations
    description: Inbound customer conversations across channels.
  - name: Leads
    description: Qualified-lead rows attached to conversations.
  - name: Appointments
    description: Scheduled customer engagements.
  - name: Offerings
    description: Tenant catalog (properties, services, treatments — vertical-specific).
  - name: Analytics
    description: >-
      Aggregate metrics for tenant + automation consumers. The around-the-brain
      workflows read these rather than mass-querying the resource endpoints.
  - name: CRM
    description: >-
      Operator-side writes into the tenant's configured CRM (HubSpot /
      Salesforce / Zoho / etc.). Per-tenant field mappings translate canonical
      Vorel keys to vendor-side keys before the driver call.
paths:
  /api/v1/crm/create-record:
    post:
      tags:
        - CRM
      summary: Push a record into the tenant CRM
      description: >-
        Operator-initiated CRM write — public sibling of the agent-only
        `crm_create_record` tool. Per-tenant `tenant_crm_field_mappings`
        translate canonical Vorel keys to vendor-side keys before the driver
        call. Returns 200 + `{ok:false, error}` for the no-CRM-configured case +
        typed CrmError responses (auth_failed, rate_limited, validation_error,
        etc.) so SDK consumers handle soft failures without branching on HTTP
        status.
      operationId: createCrmRecord
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CrmCreateRecordBody'
      responses:
        '200':
          description: CRM call completed (success OR typed soft-failure envelope).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmCreateRecordResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - BearerAuth:
            - crm:write
components:
  schemas:
    CrmCreateRecordBody:
      type: object
      required:
        - object
        - fields
        - idempotency_key
      properties:
        object:
          type: string
          enum:
            - contact
            - lead
            - deal
            - appointment
            - case
        fields:
          type: object
          additionalProperties: true
          description: >-
            Canonical Vorel field names (snake_case). Per-tenant
            `tenant_crm_field_mappings` translate these to the CRM-vendor key
            shape before the driver call.
        idempotency_key:
          type: string
          minLength: 1
          maxLength: 200
    CrmCreateRecordResponse:
      oneOf:
        - type: object
          required:
            - ok
            - external_id
          properties:
            ok:
              type: boolean
              enum:
                - true
            external_id:
              type: string
            record_url:
              type: string
              format: uri
        - type: object
          required:
            - ok
            - error
          description: >-
            Returned with HTTP 200 when the tenant has no CRM configured
            (`error='no_crm_configured'`) or the driver returned a typed
            CrmError (auth_failed, rate_limited, validation_error, etc.).
            Mirrors the internal `crm_create_record` tool envelope so SDK
            consumers handle 'operationally noisy but not server-error' cases
            without branching on HTTP status.
          properties:
            ok:
              type: boolean
              enum:
                - false
            error:
              type: string
            detail:
              type: string
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - rate_limited
                - bad_request
                - not_found
                - conflict
                - internal_error
              description: Machine-readable error category.
            message:
              type: string
              description: >-
                Human-readable error description; safe to surface in tenant
                logs.
  responses:
    BadRequest:
      description: Body validation failed. Error message names the offending field.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing, malformed, unknown, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: >-
        API key is valid but lacks the required scope for this endpoint. Issue a
        new key with the necessary scope at `/settings/integrations/api-keys`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: >-
        200 req/min per API key exceeded. `Retry-After` header carries
        seconds-until-reset.
      headers:
        Retry-After:
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix epoch seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: vapk_<env>_<48-hex>
      description: >-
        Tenant-issued API key. Format: `vapk_live_<48 hex chars>` (60 chars
        total). Issue + manage at `/settings/integrations/api-keys` in the Vorel
        dashboard. Each key has a scope set (`read`, `leads:write`,
        `appointments:write`, `offerings:write`); endpoints requiring a write
        scope reject keys without it with a 403 envelope.

````