> For the complete documentation index, see [llms.txt](https://docs.talkstack.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talkstack.ai/call/get-call-data.md).

# Get call data

**Step 1: Prepare Your Request**

* **Endpoint:** `/call`
* **Method:** `POST`
* **URL:** `https://api.talkstackai.com/call`
* **Headers:** Include `Content-Type: application/json`.
* **Authorization:** Bearer token or x-api-key in headers

**Step 2: Construct the JSON Body with Dynamic Variables**

* `sid`: The sid of the call for which you want to fetch details.
* `projectId`: The id of the project with which the call is associated.

**Step 3: Send the Request**

Use your preferred HTTP client to send the POST request with the above JSON body.

**Step 4: Handle the Response**

The response will provide detailed information about the call associated with the `callSid`.

**Success Response:**

* **Status Code:** `200 OK`
* **Body:** The response includes details like status, from, to, date, recordingUrls, and additional call data.

```json
{   
    "seconds": 23,
    "cost": 0.077,
    "status": "completed",
    "from": "+14152148508",
    "to": "+12068091239",
    "date": "Tue, 30 Jan 2024 13:39:53 +0000",
    "recordingUrls": [
        "https://api.twilio.com/2010-04-01/Accounts/xxxxxx/Recordings/xxxxx.mp3"
    ],
    "phoneNumber": "+12068091239",
    "callSid": "CA26e39c970fd416515799f5a165718be3",
    "partnerId": "partner-id",
    "shiftId": "shift-id",
    "assignmentId": "assignment-id",
    "data": {
        "employeeGoToWork": "false",
        "reasonOfCancellation": "Please keep in mind that canceling your shift within 12 hours of shift start will negatively impact your ability to see shifts in the future. Are you sure you want to cancel?",
        "newDate": ""
    }
}

```

* Confirm that the `callSid` is correctly included in the request body.
* Ensure that the `callSid` is valid and corresponds to a call made through your system.
* Contact our support team for further assistance in case of persistent issues or errors.

**Troubleshooting**

* `400 Bad Request`: If the `callSid` is missing in the request.
* `404 Not Found`: If the call details for the provided `callSid` are not found.
* `500 Internal Server Error`: For errors in fetching the call status.

**Error Responses:**

* `ringing` - temporary
* `in-progress` - temporary
* `voicemail` - permanent
* `busy` - permanent
* `silence` - permanent (if there is silence > 6s during the call or voicemail, we close the call)
* `queued` - temporary (our systems still do not trigger the call)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.talkstack.ai/call/get-call-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
