# OrkesioCall

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da ligação."
    },
    "chat": {
      "$ref": "#/components/schemas/OrkesioChat"
    },
    "author": {
      "$ref": "#/components/schemas/OrkesioParticipant"
    },
    "direction": {
      "type": "string",
      "enum": [
        "in",
        "out"
      ],
      "description": "`in` (recebida) ou `out` (feita pela inbox)."
    },
    "sent_by_api": {
      "type": "boolean",
      "description": "A ligação foi feita por `POST /calls` (não pelo celular). Dá para ignorar as próprias ligações no webhook."
    },
    "video": {
      "type": "boolean",
      "description": "`true` em chamada de vídeo; `false` em chamada de voz. Só vem em `offered`: nos outros estados o campo não sai."
    },
    "status": {
      "type": "string",
      "enum": [
        "offered",
        "accepted",
        "rejected",
        "ended",
        "missed"
      ],
      "description": "`offered` (tocando), `accepted` (atendida), `rejected` (recusada), `ended` (encerrada) ou `missed` (não atendida)."
    },
    "duration_seconds": {
      "type": "integer",
      "description": "Duração em segundos, quando encerrada."
    },
    "at": {
      "type": "string",
      "format": "date-time",
      "description": "Quando mudou. ISO 8601 em UTC com milissegundos."
    }
  },
  "required": [
    "id",
    "chat",
    "direction",
    "status",
    "at",
    "sent_by_api"
  ],
  "additionalProperties": false,
  "description": "Ligação."
}
```
