> For the complete documentation index, see [llms.txt](https://virtualcontact.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://virtualcontact.gitbook.io/docs/developers/build-an-integration/contact-center-api/callback.md).

# Callback

## FindAllCallbacks

> Return list of Callbacks.

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback":{"get":{"description":"Return list of Callbacks.","tags":["Callback"],"summary":"FindAllCallbacks","parameters":[{"schema":{"type":"string"},"description":"Parameter for order","name":"sortField","in":"query"},{"schema":{"type":"string"},"description":"Type order ASC or DESC","name":"sortOrder","in":"query"},{"schema":{"type":"string"},"description":"Filter field","name":"filterField","in":"query"},{"schema":{"type":"string"},"description":"Filter value","name":"filterValue","in":"query"},{"schema":{"type":"integer"},"description":"Page number","name":"page","in":"query"},{"schema":{"type":"integer"},"description":"Page size","name":"pageSize","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}}}}}
```

## CreateCallback

> Save callback data in Db.

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback":{"post":{"description":"Save callback data in Db.","tags":["Callback"],"summary":"CreateCallback","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/request_mongo.CallbackRequest"}}},"description":"Create Callback","required":true}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}},"request_mongo.CallbackRequest":{"type":"object","required":["target_number"],"properties":{"assigned_to":{"type":"string"},"config":{"$ref":"#/components/schemas/modelmongo.CallbackConfig"},"contact_id":{"type":"string"},"contact_name":{"type":"string"},"notes":{"type":"string"},"scheduled_at":{"type":"string"},"source_id":{"type":"string"},"source_type":{"$ref":"#/components/schemas/modelmongo.CallbackSourceType"},"tags":{"type":"array","items":{"type":"string"}},"target_number":{"type":"string"},"username":{"type":"string"}}},"modelmongo.CallbackConfig":{"type":"object","properties":{"maximum_ring_time_seconds":{"description":"in seconds","type":"integer"},"on_busy_redial_after_minutes":{"description":"in minutes","type":"integer"},"on_no_answer_redial_after_minutes":{"description":"in minutes","type":"integer"},"total_redial_attempts":{"type":"integer"}}},"modelmongo.CallbackSourceType":{"type":"string","enum":["Endpoint","Queue"]}}}}
```

## Get Callback Analytics

> API to get call analytics data

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback-analytics":{"get":{"description":"API to get call analytics data","tags":["CallbackAnalytics"],"summary":"Get Callback Analytics","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/request_mongo.CallbackAnalyticsRequest"}}},"description":"Get Analytics Request","required":true}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}},"request_mongo.CallbackAnalyticsRequest":{"type":"object","properties":{"end_time":{"type":"string"},"source_id":{"description":"Optional field, can be nil","type":"string"},"source_type":{"$ref":"#/components/schemas/modelmongo.CallbackSourceType"},"start_time":{"type":"string"},"status":{"$ref":"#/components/schemas/modelmongo.CallbackStatus"}}},"modelmongo.CallbackSourceType":{"type":"string","enum":["Endpoint","Queue"]},"modelmongo.CallbackStatus":{"type":"string","enum":["WaitingToAssign","Assigned","Scheduled","InProgress","Success","Failed"]}}}}
```

## GetActiveCallbacks

> Return list of active callbacks (WaitingToAssign, Assigned, Scheduled, InProgress)

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback/active":{"get":{"description":"Return list of active callbacks (WaitingToAssign, Assigned, Scheduled, InProgress)","tags":["Callback"],"summary":"GetActiveCallbacks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}}}}}
```

## GetActiveCallbacks

> Return list of all assigned callbacks

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback/assigned":{"get":{"description":"Return list of all assigned callbacks","tags":["Callback"],"summary":"GetActiveCallbacks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}}}}}
```

## Get Historical Callback Records for pbx Id

> Return list of Historical Callback records

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback/history":{"get":{"description":"Return list of Historical Callback records","tags":["Callback"],"summary":"Get Historical Callback Records for pbx Id","parameters":[{"schema":{"type":"integer"},"description":"Page number","name":"page","in":"query"},{"schema":{"type":"integer"},"description":"Page size","name":"pageSize","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}}}}}
```

## GetCallbackById

> Retrieve callback data by its ID.

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback/{id}":{"get":{"description":"Retrieve callback data by its ID.","tags":["Callback"],"summary":"GetCallbackById","parameters":[{"schema":{"type":"string"},"description":"Callback ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}}}}}
```

## DeleteCallback

> Remove callback data by ID.

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback/{id}":{"delete":{"description":"Remove callback data by ID.","tags":["Callback"],"summary":"DeleteCallback","parameters":[{"schema":{"type":"string"},"description":"Callback ID","name":"CallbackID","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}}}}}
```

## UpdateCallback

> Update callback data by ID.

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback/{id}":{"patch":{"description":"Update callback data by ID.","tags":["Callback"],"summary":"UpdateCallback","parameters":[{"schema":{"type":"string"},"description":"Callback ID","name":"CallbackID","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/request_mongo.CallbackRequest"}}},"description":"Update Callback","required":true}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}},"request_mongo.CallbackRequest":{"type":"object","required":["target_number"],"properties":{"assigned_to":{"type":"string"},"config":{"$ref":"#/components/schemas/modelmongo.CallbackConfig"},"contact_id":{"type":"string"},"contact_name":{"type":"string"},"notes":{"type":"string"},"scheduled_at":{"type":"string"},"source_id":{"type":"string"},"source_type":{"$ref":"#/components/schemas/modelmongo.CallbackSourceType"},"tags":{"type":"array","items":{"type":"string"}},"target_number":{"type":"string"},"username":{"type":"string"}}},"modelmongo.CallbackConfig":{"type":"object","properties":{"maximum_ring_time_seconds":{"description":"in seconds","type":"integer"},"on_busy_redial_after_minutes":{"description":"in minutes","type":"integer"},"on_no_answer_redial_after_minutes":{"description":"in minutes","type":"integer"},"total_redial_attempts":{"type":"integer"}}},"modelmongo.CallbackSourceType":{"type":"string","enum":["Endpoint","Queue"]}}}}
```

## RejectCallback

> Reject an assigned callback by an agent.

```json
{"openapi":"3.1.1","info":{"title":"Contact Center API","version":"1.0"},"servers":[{"url":"/api/pbx"}],"paths":{"/callback/{id}/reject":{"post":{"description":"Reject an assigned callback by an agent.","tags":["Callback"],"summary":"RejectCallback","parameters":[{"schema":{"type":"string"},"description":"Callback ID","name":"CallbackID","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.Response"}}}}}}}},"components":{"schemas":{"response.Response":{"type":"object","properties":{"code":{"type":"integer"},"data":{},"status":{"type":"string"}}}}}}
```


---

# 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://virtualcontact.gitbook.io/docs/developers/build-an-integration/contact-center-api/callback.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.
