# client.destinations

> client.destinations — the destinations operations.

`client.destinations` — the `destinations` operations.

On `AsyncKindgi` every method is the same, awaited.

## `client.destinations.list()`

```python signature
list(
    *,
    project_id: str | UUID | None = None,
    limit: int | None = None,
    cursor: str | None = None,
    timeout: float | None = None,
) -> DestinationCollectionPage
```

List destinations. `GET /v1/destinations`

A tenant admin's. With `projectId`: the destinations that project's schedules may use, for anyone who may make a schedule there (`run` on the project), without `people`, `host`, `urlRef`, `secretRef` and `projects`.

## `client.destinations.create()`

```python signature
create(
    body: CreateDestinationBody | Mapping[str, Any] | None = None,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
    **fields: Any,
) -> Destination
```

Make a destination. `POST /v1/destinations`

Makes a named place outside Kindgi that schedules send their results to: a Slack, Teams, Google Chat or Discord channel's incoming webhook, a signed webhook, or workspace members' email. A chat webhook URL lets anyone who has it post to that channel, so `url` is write-only: the runtime keeps it in its secrets store, and the API shows only its `host`. Or name a secret you stored with `urlRef`. A `webhook` destination signs its requests as webhook endpoints do, with the secret `secretRef` names. `content: "answer"` sends the run's answer too, up to its first 1,000 characters: it needs `projects`, and the `webhook` kind never takes it.

## `client.destinations.get()`

```python signature
get(destination_id: str | UUID, /, *, timeout: float | None = None) -> Destination
```

Fetch a destination. `GET /v1/destinations/{destinationId}`

## `client.destinations.update()`

```python signature
update(
    destination_id: str | UUID,
    body: UpdateDestinationBody | Mapping[str, Any] | None = None,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
    **fields: Any,
) -> Destination
```

Update a destination. `PATCH /v1/destinations/{destinationId}`

Absent fields are kept, and `kind` never changes. A new `url` replaces the stored one; `urlRef` replaces where it's kept. `projects: null` lets every project's schedules use it again. The kind's rules hold for the result: `content: "answer"` still needs `projects`.

## `client.destinations.remove()`

```python signature
remove(
    destination_id: str | UUID,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> None
```

Remove a destination (soft delete). `DELETE /v1/destinations/{destinationId}`

Its stored URL is revoked. Schedules that still name it send it nothing: each of their messages is recorded `skipped`, with the reason `destination-removed`.

## `client.destinations.list_deliveries()`

```python signature
list_deliveries(
    destination_id: str | UUID,
    /,
    *,
    status: Literal['pending', 'delivered', 'failed', 'skipped'] | None = None,
    limit: int | None = None,
    cursor: str | None = None,
    timeout: float | None = None,
) -> DestinationDeliveryCollectionPage
```

List a destination's deliveries. `GET /v1/destinations/{destinationId}/deliveries`

Newest first.

## `client.destinations.redeliver()`

```python signature
redeliver(
    destination_id: str | UUID,
    delivery_id: str | UUID,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> DestinationDelivery
```

Redeliver a message. `POST /v1/destinations/{destinationId}/deliveries/{deliveryId}/redeliver`

Queues the delivery again now, whatever its status: its attempts start over, and so does its retry window. It's checked again as when it was queued (`destination-removed`, `not-for-this-project`) and as when it's sent (`no-access`, `project-deleted`), so a delivery skipped for one of those is skipped again with that reason. One skipped for `rate-cap` goes.

## `client.destinations.send_test()`

```python signature
send_test(
    destination_id: str | UUID,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> DestinationDelivery
```

Send a test message to a destination. `POST /v1/destinations/{destinationId}/test`

Queues a `destination.test` message, to check the destination end to end; follow it in the delivery log. A `failing` destination the test reaches goes back to `active`, and its held deliveries still inside their retry window go out, oldest first.
