Skip to content

client.destinations

View as Markdown

client.destinations — the destinations operations.

On AsyncKindgi every method is the same, awaited.

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

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.

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

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.

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

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

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

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.

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

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.

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
Signature

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

Newest first.

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

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.

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

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.