---
title: "Report the outcome of a local webhook delivery attempt"
method: POST
path: "/endpoints/{id}/complete"
tags: ["Endpoints"]
---

# Report the outcome of a local webhook delivery attempt

`POST /endpoints/{id}/complete`

## Request

- Base URL: `https://api.primitive.dev/v1`
- URL: `https://api.primitive.dev/v1/endpoints/{id}/complete`
- Auth: HTTP bearer

Report normalized handling evidence for the queue, attempt and lease. Required JSON fields: queue_id, delivery_id, lease_token, mode, duration_ms. For mode=exec include exit_code; stdout includes write_succeeded; sdk includes accepted (and optional timeout/io transport_error); http includes status_code and optional transport_error, error_code, confirmed. Supply this discriminated request with --raw-body in the generated CLI. The server classifies success and retry. Duplicate identical completion is idempotent; a stale lease cannot finish a newer attempt. Exec success means durable input acceptance, not completion of agent reasoning. Only successful HTTP handling with recognized confirmation evidence can confirm content discard. Never send arbitrary handler output or HTTP response bodies.

## Headers

- `Idempotency-Key` string

## Request body

- union
  - CompleteWebhookHttpInput
    - `queue_id` string, uuid, required
    - `delivery_id` string, uuid, required
    - `lease_token` string, uuid, required
    - `duration_ms` integer, required
    - `mode` 'http', required
    - `status_code` integer, nullable, required
    - `transport_error` 'timeout' | 'network' | 'response_too_large' | 'io'
    - `error_code` string
    - `confirmed` boolean
  - CompleteWebhookExecInput
    - `queue_id` string, uuid, required
    - `delivery_id` string, uuid, required
    - `lease_token` string, uuid, required
    - `duration_ms` integer, required
    - `mode` 'exec', required
    - `exit_code` integer, nullable, required
    - `transport_error` 'timeout' | 'io'
  - CompleteWebhookStdoutInput
    - `queue_id` string, uuid, required
    - `delivery_id` string, uuid, required
    - `lease_token` string, uuid, required
    - `duration_ms` integer, required
    - `mode` 'stdout', required
    - `write_succeeded` boolean, required
    - `transport_error` 'io'
  - CompleteWebhookSdkInput
    - `queue_id` string, uuid, required
    - `delivery_id` string, uuid, required
    - `lease_token` string, uuid, required
    - `duration_ms` integer, required
    - `mode` 'sdk', required
    - `accepted` boolean, required
    - `transport_error` 'timeout' | 'io'

## Response `200`

Delivery operation result

- CompleteWebhookResponse
  - `success` true, required
  - `data` object, required
    - `result` 'completed' | 'already_completed', required
  - `meta` object
    - `total` number
    - `total_capped` boolean
    - `limit` number
    - `cursor` string, nullable

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key
- `403`: Authenticated caller lacks permission for the operation
- `404`: Resource not found
- `408`: Request was canceled
- `409`: The request conflicts with the current state of the resource
- `410`: Queued content is no longer available
- `429`: Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.
- `503`: Local receiving is unavailable

## Changes

> 32 revisions in range; 1 not diffed.

- **2026-11-03** `bce409c97acb`: 279 warning
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `400`
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `401`
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `403`
  - added the new `access_mode_unavailable` enum value to the `error/code` response property for the response status `404`
  - …275 more
  - …this revision’s changelog is incomplete
- **2026-10-21** `0360ea8d4f3d`: 117 warning
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `400`
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `401`
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `403`
  - added the new `agent_changed` enum value to the `error/code` response property for the response status `404`
  - …113 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/primitive/apis/primitive-api/changes/endpoints/:id/complete/post.md)

---

[API](https://skmtc.dev/primitive/apis/primitive-api.md) - [All operations](https://skmtc.dev/primitive/apis/primitive-api/llms.txt) - [OpenAPI document](https://skmtc.dev/primitive/apis/primitive-api/revisions/bce409c97acb?raw)
