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

# Listar ligações

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"total\": 1,\n  \"page_index\": 0,\n  \"page_size\": 15,\n  \"results\": [\n    {\n      \"id\": 1,\n      \"event_date\": \"2023-03-02T16:21:47Z\",\n      \"duration\": \"00:00:06\",\n      \"duration_seconds\": 6,\n      \"user_id\": 1,\n      \"user_phone\": \"+55 55 999999999\",\n      \"user_ramal\": \"36856002\",\n      \"phone\": \"+55 55 999999999\",\n      \"call_id\": \"xxx-xxx-xxx\",\n      \"status\": 3,\n      \"creation_date\": \"2023-03-02T13:21:41Z\",\n\n      \"audio\": {\n        \"path\": \"https://atendare.storage.googleapis.com/audio.mp3\"\n      },\n      \"author_id\": 1,\n      \"author\": {\n        \"id\": 1,\n        \"detail\": \"Nome do autor\",\n        \"type\": 1,\n        \"user_id\": 1\n      }\n    }\n  ]\n}\n",
      "language": "json"
    }
  ]
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Atendare API - v2",
    "version": "2.0"
  },
  "servers": [
    {
      "url": "https://api.atendare.com/v2"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/calls": {
      "get": {
        "summary": "Listar ligações",
        "description": "",
        "operationId": "list-calls",
        "parameters": [
          {
            "name": "Access-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_index",
            "in": "query",
            "description": "Para paginação, representa o primeiro elemento da lista.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "Para paginação, define o total de contatos que ira ser retornado em uma lista. O limite é 100",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 15
            }
          },
          {
            "name": "search_text",
            "in": "query",
            "description": "Termo usado para pesquisar",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_field",
            "in": "query",
            "description": "Tipo de ordenação crescente (ASC) ou decrescente (DESC), o padrão é crescente",
            "schema": {
              "type": "string",
              "default": "asc"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "properties": {
                "condition": {
                  "type": "string",
                  "description": "Or - And"
                },
                "conditions": {
                  "type": "array",
                  "items": {
                    "properties": {
                      "field": {
                        "type": "string",
                        "description": "Campo que você deseja filtrar"
                      },
                      "operation": {
                        "type": "string",
                        "enum": [
                          "equal",
                          "not_equal",
                          "less",
                          "less_or_equal",
                          "greater",
                          "greater_or_equal",
                          "begins_with",
                          "does_not_begin_with",
                          "is_in",
                          "is_not_in",
                          "ends_with",
                          "does_not_end_with",
                          "contains",
                          "does_not_contains",
                          "is_empty",
                          "is_not_empty",
                          "between",
                          "does_not_between"
                        ]
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  }
                }
              },
              "type": "object"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"total\": 1,\n  \"page_index\": 0,\n  \"page_size\": 15,\n  \"results\": [\n    {\n      \"id\": 1,\n      \"event_date\": \"2023-03-02T16:21:47Z\",\n      \"duration\": \"00:00:06\",\n      \"duration_seconds\": 6,\n      \"user_id\": 1,\n      \"user_phone\": \"+55 55 999999999\",\n      \"user_ramal\": \"36856002\",\n      \"phone\": \"+55 55 999999999\",\n      \"call_id\": \"xxx-xxx-xxx\",\n      \"status\": 3,\n      \"creation_date\": \"2023-03-02T13:21:41Z\",\n\n      \"audio\": {\n        \"path\": \"https://atendare.storage.googleapis.com/audio.mp3\"\n      },\n      \"author_id\": 1,\n      \"author\": {\n        \"id\": 1,\n        \"detail\": \"Nome do autor\",\n        \"type\": 1,\n        \"user_id\": 1\n      }\n    }\n  ]\n}\n"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "page_index": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "page_size": {
                      "type": "integer",
                      "example": 15,
                      "default": 0
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "event_date": {
                            "type": "string",
                            "example": "2023-03-02T16:21:47Z"
                          },
                          "duration": {
                            "type": "string",
                            "example": "00:00:06"
                          },
                          "duration_seconds": {
                            "type": "integer",
                            "example": 6,
                            "default": 0
                          },
                          "user_id": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "user_phone": {
                            "type": "string",
                            "example": "+55 55 999999999"
                          },
                          "user_ramal": {
                            "type": "string",
                            "example": "36856002"
                          },
                          "phone": {
                            "type": "string",
                            "example": "+55 55 999999999"
                          },
                          "call_id": {
                            "type": "string",
                            "example": "xxx-xxx-xxx"
                          },
                          "status": {
                            "type": "integer",
                            "example": 3,
                            "default": 0
                          },
                          "creation_date": {
                            "type": "string",
                            "example": "2023-03-02T13:21:41Z"
                          },
                          "audio": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string",
                                "example": "https://atendare.storage.googleapis.com/audio.mp3"
                              }
                            }
                          },
                          "author_id": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "author": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "example": 1,
                                "default": 0
                              },
                              "detail": {
                                "type": "string",
                                "example": "Nome do autor"
                              },
                              "type": {
                                "type": "integer",
                                "example": 1,
                                "default": 0
                              },
                              "user_id": {
                                "type": "integer",
                                "example": 1,
                                "default": 0
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"success\": false\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "61f3f7309a3abf0010b92516:6401efff7fe52a000b2ac978"
}
```