---
agentTools:
  projectIndex: https://uspacy.readme.io/llms.txt
---

# Update call event

Updates a call event. Typically used to finalize call data (duration, recording link, notes).

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "CRM service",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://{domain}.uspacy.ua",
      "description": "Ukrainian server"
    },
    {
      "url": "https://{domain}.uspacy.eu",
      "description": "EU server"
    },
    {
      "url": "https://{domain}.uspacy.com.br",
      "description": "Brazilian server"
    },
    {
      "url": "https://{domain}.uspacy.com",
      "description": "International server"
    }
  ],
  "tags": [
    {
      "name": "call events",
      "description": "Call event tracking and telephony integration"
    }
  ],
  "paths": {
    "/crm/v1/events/call/{call_event_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/call_event_id"
        }
      ],
      "patch": {
        "tags": [
          "call events"
        ],
        "summary": "Update call event",
        "description": "Updates a call event. Typically used to finalize call data (duration, recording link, notes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallEventDto"
              },
              "example": {
                "integration_code": "your_integration_code",
                "call_type": "incoming",
                "from": "380632232232",
                "status": "ended",
                "ended_call_status": "successed",
                "end_time": 1681893685,
                "duration": 350,
                "call_record_link": "https://storage.example.com/recordings/call_1.mp3",
                "note": "Updated call notes - client agreed to terms",
                "summary": "Updated call summary",
                "transcription": "Client agreed to the proposed terms and asked for a follow-up email with the revised offer.",
                "crm_settings": [
                  {
                    "setting_name": "incoming_unknown",
                    "setting_value": "do_nothing"
                  },
                  {
                    "setting_name": "incoming_unknown_responsible",
                    "setting_value": "current_operator"
                  },
                  {
                    "setting_name": "incoming_unknown_source",
                    "setting_value": null
                  },
                  {
                    "setting_name": "missed_known",
                    "setting_value": "create_task"
                  },
                  {
                    "setting_name": "missed_known_responsible",
                    "setting_value": "base_entity_responsible"
                  },
                  {
                    "setting_name": "missed_known_source",
                    "setting_value": null
                  },
                  {
                    "setting_name": "missed_responsible",
                    "setting_value": 1
                  },
                  {
                    "setting_name": "missed_unknown",
                    "setting_value": "do_nothing"
                  },
                  {
                    "setting_name": "missed_unknown_responsible",
                    "setting_value": "missed_responsible"
                  },
                  {
                    "setting_name": "missed_unknown_source",
                    "setting_value": null
                  },
                  {
                    "setting_name": "outgoing_unknown",
                    "setting_value": "do_nothing"
                  },
                  {
                    "setting_name": "outgoing_unknown_responsible",
                    "setting_value": "current_operator"
                  },
                  {
                    "setting_name": "outgoing_unknown_source",
                    "setting_value": null
                  },
                  {
                    "setting_name": "binding_version",
                    "setting_value": "1.0.0"
                  }
                ],
                "utm_tags": {
                  "utm_source": "google",
                  "utm_medium": "cpc",
                  "utm_campaign": "summer_sale",
                  "utm_term": "crm_software",
                  "utm_content": "banner_ad"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "UnauthorizedError": {
        "description": "Access token is missing or invalid"
      },
      "ValidationError": {
        "description": "Validation error response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "errors": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "example": {
                    "field_name": [
                      "The field_name field is required."
                    ]
                  }
                },
                "status": {
                  "type": "boolean",
                  "example": true
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "call_event_id": {
        "name": "call_event_id",
        "in": "path",
        "description": "Call event ID",
        "required": true,
        "schema": {
          "type": "integer"
        }
      }
    },
    "schemas": {
      "CallEventDto": {
        "type": "object",
        "properties": {
          "integration_code": {
            "type": "string",
            "example": "your_integration_code",
            "description": "It could be integration_code or unique code of source where data are imported from"
          },
          "external_id": {
            "type": "string",
            "example": 1,
            "description": "It should be unique for one particular integration_code or null if adding call event directly (e.g. import)"
          },
          "task_id": {
            "type": "integer",
            "example": null,
            "description": "If task_id is provided the task's creation for missed incoming call is passing away"
          },
          "contact_id": {
            "type": "integer",
            "example": null,
            "description": "If one of dynamic binding fields (deal_id, lead_id, contact_id, company_id) is provided the automatic binding with existing crm entities is passing away"
          },
          "company_id": {
            "type": "integer",
            "example": null,
            "description": "If one of dynamic binding fields (deal_id, lead_id, contact_id, company_id) is provided the automatic binding with existing crm entities is passing away"
          },
          "lead_id": {
            "type": "integer",
            "example": null,
            "description": "If one of dynamic binding fields (deal_id, lead_id, contact_id, company_id) is provided the automatic binding with existing crm entities is passing away"
          },
          "deal_id": {
            "type": "integer",
            "example": null,
            "description": "If one of dynamic binding fields (deal_id, lead_id, contact_id, company_id) is provided the automatic binding with existing crm entities is passing away"
          },
          "entity_table": {
            "type": "string",
            "description": "The base entity the call event connected to could be provided or could be omitted in a case if just have usual call. In this the \"empty\" value will be automatically filled and the call event will be shown just in call logs history",
            "enum": [
              "empty",
              "leads,",
              "deals",
              "contacts",
              "companies"
            ]
          },
          "employees": {
            "type": "array",
            "description": "Employees that have been dialed during the call. Could be omitted if don't have such information",
            "example": [
              1,
              2,
              3
            ]
          },
          "contacts": {
            "type": "array",
            "description": "The contacts that have connection with particulat call event. Could be omitted if don't have such information",
            "example": [
              1,
              2,
              3
            ]
          },
          "companies": {
            "type": "array",
            "description": "The companies that have connection with particulat call event. Could be omitted if don't have such information",
            "example": [
              1,
              2,
              3
            ]
          },
          "subject": {
            "type": "string",
            "example": "First call",
            "description": "Could be omitted. In such case the default value will be \"Call\""
          },
          "call_type": {
            "type": "string",
            "enum": [
              "outgoing",
              "incoming"
            ]
          },
          "status": {
            "type": "string",
            "example": "initiated",
            "enum": [
              "initiated",
              "talking",
              "ended"
            ]
          },
          "ended_call_status": {
            "type": "string",
            "enum": [
              null,
              "successed",
              "missed",
              "declined",
              "call_failure"
            ]
          },
          "from": {
            "type": "string",
            "example": 380632232232
          },
          "to": {
            "type": "string",
            "example": null,
            "description": "Could be null cause on new event call from telephony we don't have \"to\" value for sure"
          },
          "begin_time": {
            "type": "integer",
            "example": 1681893335
          },
          "end_time": {
            "type": "integer",
            "example": 1681893685
          },
          "duration": {
            "type": "integer",
            "example": 350
          },
          "call_record_link": {
            "type": "string",
            "example": null,
            "description": "It could be call link that telephony provides or link issued by import flow (via files-backend)"
          },
          "note": {
            "type": "string",
            "example": "Fixed agenda"
          },
          "summary": {
            "type": "string",
            "example": "Follow-up call summary",
            "description": "Optional short summary of the call content"
          },
          "transcription": {
            "type": "string",
            "example": "Hello, this is a customer calling about the order. Please contact me back at your earliest convenience.",
            "description": "Optional transcription of the call content from audio or video"
          },
          "crm_settings": {
            "type": "array",
            "description": "Optional CRM settings used to create or bind CRM entities for different call scenarios",
            "items": {
              "$ref": "#/components/schemas/CallEventCrmSetting"
            }
          },
          "utm_tags": {
            "$ref": "#/components/schemas/CallEventUtmTags"
          }
        },
        "required": [
          "integration_code",
          "call_type",
          "from"
        ]
      },
      "CallEventUtmTags": {
        "type": "object",
        "nullable": true,
        "description": "Optional UTM tags associated with the call event",
        "properties": {
          "utm_source": {
            "type": "string",
            "example": "google"
          },
          "utm_medium": {
            "type": "string",
            "example": "cpc"
          },
          "utm_campaign": {
            "type": "string",
            "example": "summer_sale"
          },
          "utm_term": {
            "type": "string",
            "nullable": true,
            "example": "crm_software"
          },
          "utm_content": {
            "type": "string",
            "nullable": true,
            "example": "banner_ad"
          }
        },
        "required": [
          "utm_source",
          "utm_medium",
          "utm_campaign"
        ]
      },
      "CallEventCrmSetting": {
        "type": "object",
        "description": "Optional scenario-specific CRM setting for call events.\nThis payload is sent to CRM so it can create or bind CRM entities for different call scenarios.\n\n- `incoming_unknown`: `create_lead`, `create_contact`, `do_nothing`\n- `incoming_unknown_responsible`: `base_entity_responsible`, `missed_responsible`, `current_operator`\n- `incoming_unknown_source`: source name or `null`\n\n- `missed_known`: `create_task`, `create_lead`, `create_deal`, `create_task_and_lead`, `create_task_and_deal`, `do_nothing`\n- `missed_known_responsible`: `base_entity_responsible`, `missed_responsible`, `current_operator`\n- `missed_known_source`: source name or `null`\n- `missed_responsible`: default responsible user ID\n\n- `missed_unknown`: `create_lead`, `create_contact`, `create_task_and_lead`, `create_task_and_contact`, `do_nothing`\n- `missed_unknown_responsible`: `base_entity_responsible`, `missed_responsible`, `current_operator`\n- `missed_unknown_source`: source name or `null`\n\n- `outgoing_unknown`: `create_lead`, `create_contact`, `do_nothing`\n- `outgoing_unknown_responsible`: `base_entity_responsible`, `missed_responsible`, `current_operator`\n- `outgoing_unknown_source`: source name or `null`\n\n- `binding_version`: always `1.0.0`\n",
        "properties": {
          "setting_name": {
            "type": "string",
            "enum": [
              "incoming_unknown",
              "incoming_unknown_responsible",
              "incoming_unknown_source",
              "missed_known",
              "missed_known_responsible",
              "missed_known_source",
              "missed_responsible",
              "missed_unknown",
              "missed_unknown_responsible",
              "missed_unknown_source",
              "outgoing_unknown",
              "outgoing_unknown_responsible",
              "outgoing_unknown_source",
              "binding_version"
            ],
            "example": "incoming_unknown"
          },
          "setting_value": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": null
              }
            ],
            "example": "do_nothing",
            "description": "Value depends on setting_name; allowed values include do_nothing, create_lead, create_contact, create_task, create_deal, create_task_and_lead, create_task_and_contact, create_task_and_deal, base_entity_responsible, missed_responsible, current_operator, null, and 1.0.0 for binding_version."
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 105,
      "1": 145,
      "2": 108,
      "3": 28,
      "4": 165,
      "5": 162,
      "6": 20,
      "7": 148,
      "8": 43,
      "9": 242,
      "10": 235,
      "11": 56
    }
  }
}
```