# Retrieve a delivery (/docs/api-reference/webhook-endpoints/get-webhook-delivery)

One delivery of the endpoint, with every HTTP attempt and the payload as sent.

`GET https://api.coss.com/v1/webhook_endpoints/{id}/deliveries/{delivery_id}`

Authenticate with your API key as a bearer token (`Authorization: Bearer coss_test_…`). Responses are JSON with snake_case fields; errors are `{ error: { type, code, message, param?, issues?, request_id } }` (https://coss.com/docs/api-reference/errors.md).

## Path parameters

- `id` (string, required): The webhook endpoint's id.
- `delivery_id` (string, required): The delivery's id.

## Example request

TypeScript (the `coss` package):

```ts
import { Coss } from "coss";

const coss = new Coss({
  apiKey: process.env.COSS_API_KEY,
  baseUrl: "https://api.coss.com",
});

const { data, error } = await coss.webhookEndpoints.deliveries.get("whep_01k7c8m4q2f3e9v6t5r1n0p8yz", "whdel_01k7c8n2b5d7f9h1k3m5p7r9tv");
```

HTTP:

```sh
curl -X GET "https://api.coss.com/v1/webhook_endpoints/whep_01k7c8m4q2f3e9v6t5r1n0p8yz/deliveries/whdel_01k7c8n2b5d7f9h1k3m5p7r9tv" \
  -H "Authorization: Bearer $COSS_API_KEY"
```

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.webhook_endpoints.deliveries.get(
    id="whep_01k7c8m4q2f3e9v6t5r1n0p8yz",
    delivery_id="whdel_01k7c8n2b5d7f9h1k3m5p7r9tv",
)
```

Go:

```go
import (
	"context"

	cossclient "github.com/cosscom/coss-go/client"
	webhookendpoints "github.com/cosscom/coss-go/webhookendpoints"
)

client := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY

request := &webhookendpoints.GetDeliveriesRequest{
    ID: "whep_01k7c8m4q2f3e9v6t5r1n0p8yz",
    DeliveryID: "whdel_01k7c8n2b5d7f9h1k3m5p7r9tv",
}
client.WebhookEndpoints.Deliveries.Get(
    context.TODO(),
    request,
)
```

Ruby:

```ruby
require "coss"

client = Coss::Client.new # api_key: or COSS_API_KEY

client.webhook_endpoints.deliveries.get(
  id: "whep_01k7c8m4q2f3e9v6t5r1n0p8yz",
  delivery_id: "whdel_01k7c8n2b5d7f9h1k3m5p7r9tv"
)
```

PHP:

```php
<?php

use Coss\Coss;

$client = new Coss(); // apiKey: or COSS_API_KEY

$client->webhookEndpoints->deliveries->get(
    'whep_01k7c8m4q2f3e9v6t5r1n0p8yz',
    'whdel_01k7c8n2b5d7f9h1k3m5p7r9tv',
);
```

Java:

```java
import com.coss.Coss;

Coss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY

client.webhookEndpoints().deliveries().get(
    "whep_01k7c8m4q2f3e9v6t5r1n0p8yz",
    "whdel_01k7c8n2b5d7f9h1k3m5p7r9tv",
    GetDeliveriesRequest
        .builder()
        .build()
);
```

.NET:

```csharp
using Coss;

var client = new CossClient(); // apiKey: or COSS_API_KEY

await client.WebhookEndpoints.Deliveries.GetAsync(
    new Coss.WebhookEndpoints.GetDeliveriesRequest
    {
        Id = "whep_01k7c8m4q2f3e9v6t5r1n0p8yz",
        DeliveryId = "whdel_01k7c8n2b5d7f9h1k3m5p7r9tv",
    }
);
```

## Response 200

The delivery.

- `object` ("webhook_delivery", required)
- `id` (string, required)
- `endpoint_id` (string, required): The id of the endpoint it's delivered to.
- `event_id` (string, required): The event's id: the `id` of the payload and the `webhook-id` header.
- `event_type` (string, required)
- `status` ("pending" | "succeeded" | "failed", required): `pending`: waiting for its next attempt. `succeeded`: the endpoint answered with a 2xx status. `failed`: every attempt failed, or the endpoint was disabled.
- `attempt_count` (integer, required): How many attempts were made so far.
- `next_attempt_at` (string | null, required, date-time): When the next attempt is due; `null` once the delivery is finished.
- `last_status_code` (integer | null, required): The endpoint's HTTP status on the latest attempt. `null`: no response arrived, or no attempt yet.
- `last_error` (string | null, required): Why the latest attempt failed. `null`: it didn't, or no attempt yet.
- `payload` (map of any, required): The event body, exactly as posted to the endpoint.
- `attempts` (object[], required): Every HTTP attempt of this delivery, oldest first.
  - `object` ("webhook_attempt", required)
  - `id` (string, required)
  - `attempted_at` (string, required, date-time): When the attempt ran.
  - `status_code` (integer | null, required): The endpoint's HTTP status; `null` when no response arrived.
  - `duration_ms` (integer, required): How long it took, in milliseconds.
  - `error` (string | null, required): Why the attempt failed (e.g. `HTTP 500`, a timeout); `null` on success.
  - `response_excerpt` (string | null, required): At most 1 KB of the response body, as text.
- `created_at` (string, required, date-time)
- `updated_at` (string, required, date-time)

Example:

```json
{
  "object": "webhook_delivery",
  "id": "whdel_01k7c8n2b5d7f9h1k3m5p7r9tv",
  "endpoint_id": "whep_01k7c8m4q2f3e9v6t5r1n0p8yz",
  "event_id": "evt_01k7c8n1z4c6e8g0j2l4n6q8sa",
  "event_type": "email.delivered",
  "status": "succeeded",
  "attempt_count": 1,
  "next_attempt_at": null,
  "last_status_code": 200,
  "last_error": null,
  "payload": {
    "id": "evt_01k7c8n1z4c6e8g0j2l4n6q8sa",
    "object": "event",
    "type": "email.delivered",
    "created_at": "2026-01-15T09:30:00.000Z",
    "data": {
      "email_id": "email_01k7c8m9x3a5c7e9g1j3l5n7q9",
      "recipient": "user@example.com"
    }
  },
  "attempts": [
    {
      "object": "webhook_attempt",
      "id": "whatt_01k7c8n2c9e1g3j5l7n9q1s3uw",
      "attempted_at": "2026-01-15T09:30:01.000Z",
      "status_code": 200,
      "duration_ms": 182,
      "error": null,
      "response_excerpt": "ok"
    }
  ],
  "created_at": "2026-01-15T09:30:00.000Z",
  "updated_at": "2026-01-15T09:30:01.000Z"
}
```

## Errors

- `400`: The `Coss-Version` header names an unknown API version (`invalid_api_version`).
- `401`: The API key is missing, invalid, revoked or expired (`authentication_error`).
- `403`: The API key lacks the permission this endpoint needs (`permission_error`), or its organization is suspended (`organization_suspended`).
- `404`: No webhook endpoint with this id exists in the API key's environment, or the endpoint has no delivery with this id (`not_found`).
- `429`: Too many requests with this API key (`rate_limited`), or too many requests with invalid keys from this address (`too_many_failed_authentications`). Retry after `Retry-After` seconds. Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the limit is fully restored).
- `500`: Unexpected server error (`api_error` / `internal_error`).
- `503`: The API key could not be verified right now; retry (`service_unavailable`).