06 Line
API

Hang up a call

Ends the call, or declines it while it rings. Hanging up an ended call is not an error.

POST
/v1/calls/{call_id}/hangup

Ends the call, or declines it while it rings. Hanging up an ended call is not an error.

Authorization

headerAuthorizationBearer <token>

Your API key, 06l_…. For servers only.

Path Parameters

call_id*string
Match^call_[0-9a-z]{26}$

Response Body

Ended.

application/json
  1. response
id*CallId
Match^call_[0-9a-z]{26}$
line_id*LineId
Match^line_[0-9a-z]{26}$
direction*string
Value in"outbound""inbound"
from*PhoneNumber

E.164, e.g. +33612345678.

Match^\+[1-9][0-9]{6,14}$
to*PhoneNumber

E.164, e.g. +33612345678.

Match^\+[1-9][0-9]{6,14}$
state*string

dialing → ringing → active → ended. Incoming calls start at ringing.

Value in"dialing""ringing""active""ended"
end_reason?string
Value in"hangup""remote_hangup""no_answer""busy""failed""line_offline"
client_ref?ClientRef

Your own identifier. Sending the same client_ref twice returns the first result instead of acting twice.

Lengthlength <= 255
created_by*

Who did it. user from the 06 Line dashboard, api_key from your code, agent for what the network sent you, system for 06 Line itself.

started_at*Timestamp

RFC 3339, UTC.

Formatdate-time
answered_at?Timestamp

RFC 3339, UTC.

Formatdate-time
ended_at?Timestamp

RFC 3339, UTC.

Formatdate-time
duration_s?integer

Talk time, from answered_at to ended_at.

Example Request
curl -X POST 'https://api.06line.com/v1/calls/string/hangup'
Example Response
{  "id": "string",  "line_id": "string",  "direction": "outbound",  "from": "string",  "to": "string",  "state": "dialing",  "end_reason": "hangup",  "client_ref": "string",  "created_by": {    "type": "user",    "id": "string"  },  "started_at": "2019-08-24T14:15:22Z",  "answered_at": "2019-08-24T14:15:22Z",  "ended_at": "2019-08-24T14:15:22Z",  "duration_s": 0}