{
 "openapi": "3.1.0",
 "info": {
  "title": "Interactions (CRM)",
  "version": "20261030b",
  "description": "Every call, chat, meeting and message with a customer. The disposition is the field that makes a desk countable and the one most often left empty."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "calls": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "call_no": {
      "type": "string",
      "description": "Call no",
      "readOnly": true
     },
     "connection_id": {
      "type": "string",
      "format": "uuid",
      "description": "Through"
     },
     "queue_id": {
      "type": "string",
      "format": "uuid",
      "description": "Queue"
     },
     "channel": {
      "type": "string",
      "description": "Channel"
     },
     "direction": {
      "type": "string",
      "description": "Direction",
      "enum": [
       "inbound",
       "outbound",
       "internal"
      ]
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Customer"
     },
     "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contact"
     },
     "lead_id": {
      "type": "string",
      "format": "uuid",
      "description": "Lead id"
     },
     "case_id": {
      "type": "string",
      "format": "uuid",
      "description": "Case"
     },
     "opportunity_id": {
      "type": "string",
      "format": "uuid",
      "description": "Opportunity id"
     },
     "from_address": {
      "type": "string",
      "description": "From"
     },
     "to_address": {
      "type": "string",
      "description": "To"
     },
     "caller_name": {
      "type": "string",
      "description": "Caller"
     },
     "agent_user_id": {
      "type": "string",
      "format": "uuid",
      "description": "Taken by"
     },
     "external_id": {
      "type": "string",
      "description": "External id",
      "readOnly": true
     },
     "conference_url": {
      "type": "string",
      "description": "Conference url",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status"
     },
     "started_at": {
      "type": "string",
      "format": "date-time",
      "description": "Started at",
      "readOnly": true
     },
     "queued_at": {
      "type": "string",
      "format": "date-time",
      "description": "Queued at",
      "readOnly": true
     },
     "answered_at": {
      "type": "string",
      "format": "date-time",
      "description": "Answered at",
      "readOnly": true
     },
     "ended_at": {
      "type": "string",
      "format": "date-time",
      "description": "Ended at",
      "readOnly": true
     },
     "wait_seconds": {
      "type": "integer",
      "description": "Wait seconds",
      "readOnly": true
     },
     "talk_seconds": {
      "type": "integer",
      "description": "Talk seconds",
      "readOnly": true
     },
     "hold_seconds": {
      "type": "integer",
      "description": "Hold seconds",
      "readOnly": true
     },
     "wrap_seconds": {
      "type": "integer",
      "description": "Wrap seconds",
      "readOnly": true
     },
     "transfer_count": {
      "type": "integer",
      "description": "Transfer count",
      "readOnly": true
     },
     "within_target": {
      "type": "boolean",
      "description": "Within target",
      "readOnly": true
     },
     "disposition": {
      "type": "string",
      "description": "What it was about"
     },
     "outcome": {
      "type": "string",
      "description": "Outcome"
     },
     "subject": {
      "type": "string",
      "description": "Subject"
     },
     "subject_local": {
      "type": "string",
      "description": "Local subject"
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "notes_local": {
      "type": "string",
      "description": "Local notes"
     },
     "sentiment": {
      "type": "string",
      "description": "Sentiment"
     },
     "created_case_id": {
      "type": "string",
      "format": "uuid",
      "description": "Created case id",
      "readOnly": true
     },
     "created_opportunity_id": {
      "type": "string",
      "format": "uuid",
      "description": "Created opportunity id",
      "readOnly": true
     },
     "created_lead_id": {
      "type": "string",
      "format": "uuid",
      "description": "Created lead id",
      "readOnly": true
     },
     "interaction_id": {
      "type": "string",
      "format": "uuid",
      "description": "Interaction id",
      "readOnly": true
     },
     "recorded": {
      "type": "boolean",
      "description": "Recorded",
      "readOnly": true
     },
     "recording_url": {
      "type": "string",
      "description": "Recording url",
      "readOnly": true
     },
     "transcript_id": {
      "type": "string",
      "format": "uuid",
      "description": "Transcript id",
      "readOnly": true
     },
     "cost": {
      "type": "string",
      "format": "decimal",
      "description": "Cost",
      "readOnly": true
     },
     "currency": {
      "type": "string",
      "description": "Currency",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "ai_voice": {
      "type": "boolean",
      "description": "Ai voice",
      "readOnly": true
     },
     "voice_profile_id": {
      "type": "string",
      "format": "uuid",
      "description": "Voice profile id",
      "readOnly": true
     },
     "call_script_id": {
      "type": "string",
      "format": "uuid",
      "description": "Call script id",
      "readOnly": true
     },
     "call_script_version": {
      "type": "integer",
      "description": "Call script version",
      "readOnly": true
     },
     "ai_token_hash": {
      "type": "string",
      "description": "Ai token hash",
      "readOnly": true
     },
     "ai_token_expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Ai token expires at",
      "readOnly": true
     },
     "ai_transfer": {
      "type": "boolean",
      "description": "Ai transfer",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/crm/calls": {
   "get": {
    "summary": "list calls",
    "operationId": "list_calls_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create calls",
    "operationId": "create_calls_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/calls/{id}": {
   "get": {
    "summary": "get calls",
    "operationId": "get_calls_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change calls",
    "operationId": "change_calls_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete calls",
    "operationId": "delete_calls_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/calls/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_calls_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}