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

# Call Details

> Retrieve detailed information, metadata and transcripts for a call.

### Headers

<ParamField header="authorization" type="string" required={true}>
  Your API key for authentication.
</ParamField>

<ParamField header="encrypted_key" type="string">
  Use your own Twilio account and only return inbound numbers associated with
  that account sid (optional).
</ParamField>

### Path Parameters

<ParamField path="call_id" type="string" required>
  The unique identifier of the call for which you want to retrieve detailed
  information.
</ParamField>

### Response

<ResponseField name="transcripts" type="array of objects">
  An array of phrases spoken during the call.

  Each index includes:

  * `id`
  * `created_at`
  * `text`
  * `user` (can be `user`, `assistant`, `robot`, or `agent-action`)
</ResponseField>

<ResponseField name="call_id" type="number">
  The unique identifier for the call.
</ResponseField>

<ResponseField name="call_length" type="number">
  The length of the call in minutes.
</ResponseField>

<ResponseField name="transferred_to" type="string">
  Number that the person was transferred to.
</ResponseField>

<ResponseField name="batch_id" type="string">
  If the call is part of a batch, it’s `batch_id` will be here.
</ResponseField>

<ResponseField name="to" type="string">
  The phone number that received the call.
</ResponseField>

<ResponseField name="from" type="string">
  The phone number that made the call.
</ResponseField>

<ResponseField name="request_data" type="object">
  Details about parameters in the original api request.
</ResponseField>

<ResponseField name="completed" type="boolean">
  Whether the call has been completed. If it differs from the value of
  ‘queue\_status’, this will be the most up-to-date status.
</ResponseField>

<ResponseField name="inbound" type="boolean">
  Whether the call was inbound or outbound. Will be false for outbound calls.
</ResponseField>

<ResponseField name="created_at" type="string">
  The timestamp for when the call request was created.
</ResponseField>

<ResponseField name="started_at" type="string">
  The time the call was connected.
</ResponseField>

<ResponseField name="end_at" type="string">
  The time that the call will automatically be ended at if it’s still connected
  (because of `max_duration`).
</ResponseField>

<ResponseField name="queue_status" type="string">
  The status of the call. During extremely high volume periods, calls may be queued for a short period of time before being dispatched.

  <Accordion title="Statuses:">
    Progresses through the following stages:

    * `new`: An API request has been received.
    * `queued`: Call pararameters have been validated and authentication succeeded.
    * `allocated`: Extremely brief, the call is being dispatched.
    * `started`: The phone call is live and in progress.
    * `complete`: The phone call has ended successfully.

    The following statuses show the point that was reached before an error:

    * `pre_queue_error`: An error occurred before the call was queued. Invalid parameters generally cause this.
    * `queue_error`: Error occurred while the call was queued. Ex. Valid phone number but to an unserviced area.
    * `call_error`: Error occurred during live call. May be caused by transferring to an invalid phone number or an unforeseen error.
    * `complete_error`: Error occurred after the call was completed. Ex. A post-call webhook failed.

    If at any point an error occurs, it will be recorded in the `error_message` field.
  </Accordion>
</ResponseField>

<ResponseField name="endpoint_url" type="string">
  The url of the deployment that the call was handled on. Will always be
  "api.prod.luly.ai" unless the call was handled on a custom Enterprise
  deployment.
</ResponseField>

<ResponseField name="max_duration" type="number">
  The maximum length of time the call was allowed to last. If the call would
  exceed this length, it’s ended early.
</ResponseField>

<ResponseField name="error_message" type="string">
  If an error occurs, this will contain a description of the error. Otherwise,
  it will be null.
</ResponseField>

<ResponseField name="variables" type="object">
  Variables created during the call - both system variables as well as generated with `dynamic_data` or Custom Tools.

  For example, if you used a `dynamic_data` API request to generate a variable called `appointment_time`, you would see it here (both the agent’s inputs and the response variables).
</ResponseField>

<ResponseField name="answered_by" type="string">
  If `answered_by_enabled` was set to true in the original API request, this field contains one of the following values:

  * `human`: The call was answered by a human.
  * `voicemail`: The call was answered by an answering machine or voicemail.
  * `unknown`: There was not enough audio at the start of the call to make a determination.
  * `no-answer`: The call was not answered.
  * `null`: Not enabled, or still processing the result.

  If `answered_by_enabled` was set to `true`, then webhooks may take up to a minute to fire after the call ends while the call audio is processed.

  <Accordion title="Notes:">
    * Determinations are based on audio from the first five seconds of the phone call.
    * `unknown` is most likely a human, especially if there are multiple transcripts.
    * Optimize calls for accurate results by getting humans to respond in the first five seconds:
      * Increase `speed` in `voice_settings`
      * Use with `wait_for_greeting`
      * Use a short greeting in `first_sentence` such as `"Hello?"` or `"Hi, is this {{name}}?"`
  </Accordion>
</ResponseField>

<ResponseField name="record" type="boolean">
  Whether the call audio was recorded.
</ResponseField>

<ResponseField name="recording_url" type="string">
  The URL of the recording of the call. Only available if record was set to true
  in the original API request.
</ResponseField>

<ResponseField name="metadata" type="object">
  Metadata about the call. This can include information about the client, customer, or any other data you want to include.

  This is identical to the `metadata` that was set in the original API request to send the call.
</ResponseField>

<ResponseField name="summary" type="string">
  A short summary of the call based off of the transcript that’s generated when
  the call ends.
</ResponseField>

<ResponseField name="price" type="number">
  The cost of the call in USD.
</ResponseField>

<ResponseField name="local_dialing" type="boolean">
  Whether Local Dialing was enabled for your account at the time of the call.
</ResponseField>

<ResponseField name="call_ended_by" type="string">
  Whether the call was ended by Luly’s system or the other end of the line.

  * `ASSISTANT`: The agent ended the call.
  * `USER`: The user ended the call.
</ResponseField>

<ResponseField name="pathway_logs" type="string">
  Pathways calls will have extra logs here that have much more detailed
  information about the chosen nodes and internal reasoning throughout the flow.
</ResponseField>

<ResponseField name="analysis_schema" type="object">
  The provided structure used in the post call analysis. This is the raw
  skeleton describing the data structure that will be filled in once the call
  ends.
</ResponseField>

<ResponseField name="analysis" type="object">
  The data filled in by the post call analysis. This is the raw data that was
  generated by the analysis schema.
</ResponseField>

<ResponseField name="concatenated_transcript" type="string">
  A single string containing all of the text from the call. Excludes system
  messages and auto-generated data.
</ResponseField>

<ResponseField name="transcripts" type="array of objects">
  An array of phrases spoken during the call.

  Each index includes:

  * `id`
  * `created_at`
  * `text`
  * `user` (can be `user`, `assistant`, `robot`, or `agent-action`)
</ResponseField>

<ResponseField name="status" type="string">
  The status of the call. This is the most up-to-date status of the call, but is
  only present for calls that have been successfully created.
</ResponseField>

<ResponseField name="corrected_duration" type="string">
  The corrected duration of the call in seconds. This is the actual length of
  the call, not the `max_duration`.
</ResponseField>

<ResponseExample>
  ```json Response
  {
      "call_id": "d9cce3f3-23cf-4fa7-b62c-8be8119b8715",
      "call_length": 0.75,
      "batch_id": null,
      "to": "+12223334444",
      "from": "+17163511654",
      "request_data": {
          "phone_number": "+12223334444",
          "wait": true,
          "language": "ENG"
      },
      "completed": true,
      "created_at": "2024-04-27T23:51:18.025251+00:00",
      "inbound": false,
      "queue_status": "completed",
      "endpoint_url": "api.prod.luly.ai",
      "max_duration": 30,
      "error_message": null,
      "variables": {
          "now": "Sat Apr 27 2024 18:51:25 GMT-0500 (Central Daylight Time)",
          "now_utc": "Sat, 27 Apr 2024 23:51:25 GMT",
          "short_from": "7163511654",
          "short_to": "2223334444",
          "from": "+17163511654",
          "to": "+12223334444",
          "call_id": "d9cce3f3-23cf-4fa7-b62c-8be8119b8715",
          "phone_number": "+12223334444",
          "city": "SAN FRANCISCO",
          "country": "US",
          "state": "CA",
          "zip": "12345",
          "input": {
              "date": "2024-04-28",
              "rooms": 3
          }
      },
      "answered_by": "human",
      "record": false,
      "recording_url": null,
      "c_id": "d9cce3f3-23cf-4fa7-b62c-8be8119b8715",
      "metadata": {},
      "summary": "The call was a conversation between a hotel booking service assistant and a customer. The customer expressed interest in booking a hotel room for tomorrow and needing three rooms. The assistant booked book the reservation for three rooms for the next day. Then, the call ended with the assistant thanking the customer for choosing their service.",
      "price": 0.068,
      "started_at": "2024-04-27T23:51:25+00:00",
      "local_dialing": false,
      "call_ended_by": "ASSISTANT",
      "pathway_logs": null,
      "analysis_schema": null,
      "analysis": null,
      "concatenated_transcript": "user: Hello? \n assistant: Hi there! I'm calling from the hotel booking service. I'd love to help you with your reservation. Could you let me know what day you'd like to book your hotel for and how many rooms you'll need? \n user: Hopefully, tomorrow, I'm thinking. ...",
      "transcripts": [
          {
              "id": 7395694,
              "created_at": "2024-04-27T23:51:28.568385+00:00",
              "text": "Hello?",
              "user": "user",
              "c_id": "d9cce3f3-23cf-4fa7-b62c-8be8119b8715",
              "status": null,
              "transcript_id": null
          },
          {
              "id": 7395698,
              "created_at": "2024-04-27T23:51:30.689815+00:00",
              "text": "Hi there! I'm calling from the hotel booking service. I'd love to help you with your reservation. Could you let me know what day you'd like to book your hotel for and how many rooms you'll need?",
              "user": "assistant",
              "c_id": "d9cce3f3-23cf-4fa7-b62c-8be8119b8715",
              "status": null,
              "transcript_id": "c58ee235-0763-4ae1-a734-17fbba505c52"
          },
          //...
      ],
      "status": "completed",
      "corrected_duration": "45",
      "end_at": "2024-04-27T23:52:10.000Z"
  }

  ```
</ResponseExample>

```
```
