> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dialflo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Dockets

> Dockets are defined as business tasks. One docket can have multiple type of communications which is needed to complete a business task.

When you trigger the below endpoint, it initiates a call.

### **API Endpoint:**

```markdown theme={null}
POST https://api.dialflo.ai/api/v1/dockets
```

### **Headers:**

```markdown theme={null}
auth_token: Bearer <auth_token>
Content-Type: application/json
```

### **Request Payload:**

```json theme={null}
{
  
	"agent_id": 225,
	"to_phone_number": "917504429919", // 12 Digit Phone Number with Country Code
     "extra_config": {
     	"call_context": { // context or attributes for the AI agent to use 
			"tripId" : "123ABC",
           	"from_destination" : "Mumbai",
			"to_destination": "Delhi",
			"name" : "Praful",
			"bookingId" : "ABC123"
		}
    }
}
```

### **Response Payload:**

Success Response

Status: 200 with body

```json theme={null}
{
    "docket_id": "a005bda2-2fb2-4cea-b019-df7a2e10821a",
    "status": "IN_PROGRESS"
}
```

The docket uuid is unique identifier for this docket which can be used to get status of this and associated calls with this docket.

### Webhook Delivery -

On Completion of docket ( i.e no more further calls to be made), we will send docket details to the webhook.

Important Fields -

```markdown theme={null}
docket_id → can be use to map to original docket created

call_insights.call_disposition → final outcome of calls made in the docket

call_insights.call_metadata → extracted call details map based on the agent (if configured).

call_context → contains the context variables sent originally.

attempts → contains the details of call attempts made in this docket.

dashboard_url → url of last answered call if any (can be null if no calls were answered)

**Note: call_insights would be null if user did not pick call in any call attempt.**
```

### Retry

> We recommend to track status code of APIs at your end as well and to have a exponential backoff based retry for 5xx statuses so that any brief downtime does not affect the API.

## **Fetch Docket Details**

This can be used to fetch the current state of docket using the docket ID.

status: COMPLETED → the docket is completed

status: IN\_PROGRESS → the docket is still pending to be completed.

```markdown theme={null}
GET https://api.dialflo.ai/api/v1/dockets/{docket_id}
```

Sample Curl -

```shellscript theme={null}
curl --location --globoff 'https://api.dialflo.ai/api/v1/dockets/{docket_id}' \
--header 'Accept: application/json' \
--header 'auth_token: Bearer <auth_token>' \
--header 'Content-Type: application/json'
```

Sample response -

```json theme={null}
{
    "docket_id": "81664fe3-cabf-4720-8cda-8a3a1a1d6a46",
    "agent_name": "InstaBus_feedback_OUTGOING",
    "status": "COMPLETED",
    "call_type": "DIALFLO_INTERNAL_TEST",
    "from_number": "918071583200",
    "to_phone_number": "917504429196",
    "call_context": {
        "route": "bangalore",
        "agency": "Redbus",
        "call_id": "xyz123",
        "name_ji": "Saswat",
        "booking_id": "1234567",
        "booking_source": "Paytm"
    },
    "external_id": null,
    "closed_call_id": "f632b050-4f3a-47d0-a914-04e73a98b8d1",
    "latest_call_id": "f632b050-4f3a-47d0-a914-04e73a98b8d1",
    "closure_reason": "DISPOSITION",
    "outbound_call_count": 1,
    "notification_status": "SKIPPED",
    "first_called_at": "2026-08-11T12:31:17.889766",
    "closed_at": "2026-08-11T12:32:33.333911",
    "created_at": "2026-08-11T12:31:14.989407",
    "updated_at": "2026-08-11T12:32:33.351692"
}
```
