{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeliner/json-schema/pipeliner-call-schema.json",
  "title": "Call",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeliner-call-api-openapi.yml#/components/schemas/Call",
  "properties": {
    "is_delete_protected": {
      "type": "boolean",
      "description": "Tells if the entity instance is protected against delete (Entities that need to be present in the system at any time). Delete action still may fail if entity is deletable, due some other additional validations.",
      "readOnly": true
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier of entity.",
      "readOnly": true
    },
    "is_deleted": {
      "type": "boolean",
      "description": "Specifies if the entity is considered deleted.",
      "readOnly": true
    },
    "modified": {
      "type": "string",
      "format": "date-time",
      "description": "Last modification time.",
      "readOnly": true
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "description": "Creation time.",
      "readOnly": true
    },
    "account": {
      "type": "string",
      "format": "uri",
      "description": "Account the call is linked to, when applicable.\n\nRelation to Account. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Account' object for properties."
    },
    "caller": {
      "type": "string",
      "format": "uri",
      "description": "User who initiated the call.\n\nRelation to Client. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Client' object for properties."
    },
    "client": {
      "type": "string",
      "format": "uri",
      "description": "User the call was made with, when the call was an internal user-to-user call.\n\nRelation to Client. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Client' object for properties."
    },
    "contact": {
      "type": "string",
      "format": "uri",
      "description": "Contact the call is linked to, when applicable.\n\nRelation to Contact. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Contact' object for properties."
    },
    "lead": {
      "type": "string",
      "format": "uri",
      "description": "Lead the call is linked to, when the call is associated with a lead.\n\nRelation to Lead. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Lead' object for properties."
    },
    "oppty": {
      "type": "string",
      "format": "uri",
      "description": "Opportunity the call is linked to, when the call is associated with an opportunity.\n\nRelation to Opportunity. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Opportunity' object for properties."
    },
    "oppty_product_relation": {
      "type": "string",
      "format": "uri",
      "description": "Specific opportunity line-item discussed on the call, when applicable.\n\nRelation to OpptyProductRelation. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'OpptyProductRelation' object for properties."
    },
    "product": {
      "type": "string",
      "format": "uri",
      "description": "Product discussed on the call, when applicable.\n\nRelation to Product. By default it is returned as URI to related resource. Using parameter 'expand', it will return full entity. See: 'Product' object for properties."
    },
    "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the linked account."
    },
    "caller_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the calling user."
    },
    "client_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the user the call was made with."
    },
    "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the linked contact."
    },
    "lead_oppty_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the linked lead or opportunity, or empty when not linked."
    },
    "oppty_product_relation_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the linked opportunity product line-item."
    },
    "phone_number": {
      "type": "string",
      "description": "External phone number called or received, in E.164 format."
    },
    "product_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the linked product."
    },
    "transcription_id": {
      "type": "string",
      "description": "External transcription identifier from the calling provider."
    },
    "transcription_language": {
      "type": "string",
      "description": "Language requested for the transcription as a BCP-47 locale tag (e.g. \"en-US\")."
    },
    "transcription_summary": {
      "type": "string",
      "description": "AI-generated summary of the call transcription."
    },
    "twilio_call_log_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the call-log record from the calling provider that this call is associated with."
    },
    "transcription_file_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the cloud object holding the transcription payload, when available."
    },
    "audio_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the cloud object holding the call audio recording, when available."
    },
    "twilio_call_sid": {
      "type": "string",
      "description": "External call identifier from the calling provider (e.g. Twilio Call SID)."
    },
    "audio_status": {
      "type": "string",
      "enum": [
        "NoRecording",
        "TranscriptionCompleted",
        "TranscriptionEmpty",
        "TranscriptionError",
        "TranscriptionInProgress",
        "UploadError",
        "Uploaded",
        "Uploading"
      ],
      "description": "This is a small hack to force creation of MediaEntity upon Call creation.\n        This field cannot be actually set. Instead, CallRepository.create method handles media creation,\n        if requested."
    }
  },
  "required": [
    "is_delete_protected",
    "id",
    "caller",
    "caller_id",
    "twilio_call_log_id",
    "twilio_call_sid",
    "audio_status"
  ]
}