# Models: D

> API models starting with D.

## `Dag`

- `nodes: list[kindgi.client.Node]`
- `edges: list[kindgi.client.Edge]`

## `Data`

- `run: kindgi.client.FinishedRun`

## `Data1`

- `pass_: kindgi.client.ImprovementPass` (`pass` on the wire)

## `Data2`

- `endpoint_id: str` (`endpointId` on the wire)

## `Datum`

- `id: uuid.UUID`
- `tenant_id: uuid.UUID` (`tenantId` on the wire)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)
- `flow_id: str` (`flowId` on the wire)
- `flow_version: str` (`flowVersion` on the wire)
- `status: Literal['pending', 'running', 'suspended', 'completed', 'failed', 'cancelled']`
- `dry_run: bool` (`dryRun` on the wire)
- `created_at: AwareDatetime` (`createdAt` on the wire)
- `updated_at: AwareDatetime` (`updatedAt` on the wire)
- `completed_at: AwareDatetime | None` (`completedAt` on the wire) (optional)
- `failure_message: str | None` (`failureMessage` on the wire) (optional)
- `failure: kindgi.client.RunFailure | None` (optional)
- `output: Any | None` (optional)
- `content_erased_at: AwareDatetime | None` (`contentErasedAt` on the wire) (optional)
- `parent_run_id: uuid.UUID | None` (`parentRunId` on the wire) (optional)
- `parent_node_id: str | None` (`parentNodeId` on the wire) (optional)
- `agent: kindgi.client.RunAgent | None` (optional)
- `waiting_for: kindgi.client.RunWaitingFor | None` (`waitingFor` on the wire) (optional)
- `trigger: kindgi.client.RunTrigger | None` (optional)
- `replay_of: uuid.UUID | None` (`replayOf` on the wire) (optional)
- `eval_run_id: str | None` (`evalRunId` on the wire) (optional)
- `versions: kindgi.client.FlowVersionOverrides | None` (optional)
- `segments: list[kindgi.client.ScopeSegment] | None` (optional)
- `trace_id: str | None` (`traceId` on the wire) (optional)
- `public_access_token: str | None` (`publicAccessToken` on the wire) (optional)
- `public_access_token_expires_at: AwareDatetime | None` (`publicAccessTokenExpiresAt` on the wire) (optional)

## `Datum1`

- `sequence: int`
- `kind: str`
- `node_id: str | None` (`nodeId` on the wire) (optional)
- `payload: Any | None` (optional)
- `timestamp: AwareDatetime | str`

## `Datum2`

A system key (`kgi_sy_…`): the operator's, acting in no tenant. Never its secret.

- `id: str`
- `label: str | None` (optional)
- `scopes: list[Literal['system:tenants', 'system:tenants:create', 'system:tenants:image-prefix', 'system:tenants:production', 'system:tenants:limits', 'system:tenants:contacts', 'system:tenants:purge', 'system:suspend', 'system:deployments', 'system:license', 'kindgi:system']]`
- `created_at: AwareDatetime` (`createdAt` on the wire)
- `expires_at: AwareDatetime | None` (`expiresAt` on the wire) (optional)
- `revoked_at: AwareDatetime | None` (`revokedAt` on the wire) (optional)
- `minted_by: str` (`mintedBy` on the wire)

## `Datum3`

- `user_id: str` (`userId` on the wire)
- `email: str`
- `display_name: str | None` (`displayName` on the wire) (optional)

## `Datum4`

An API key. Never includes the secret. `principal` is whom it acts for; absent on a key that is a service account of its own (`service_account:<tokenId>`), as keys minted before principals are.

- `token_id: uuid.UUID` (`tokenId` on the wire)
- `principal: kindgi.client.ApiKeyPrincipal | None` (optional)
- `role: Literal['admin', 'member']`
- `capabilities: list[kindgi.client.Capability]`
- `label: str | None` (optional)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)
- `created_by: str | None` (`createdBy` on the wire) (optional)
- `created_at: AwareDatetime` (`createdAt` on the wire)
- `expires_at: AwareDatetime | None` (`expiresAt` on the wire) (optional)
- `revoked_at: AwareDatetime | None` (`revokedAt` on the wire) (optional)
- `last_used_at: AwareDatetime | None` (`lastUsedAt` on the wire) (optional)

## `Datum5`

- `blob_id: str` (`blobId` on the wire)
- `tenant_id: uuid.UUID` (`tenantId` on the wire)
- `name: str`
- `content_type: str` (`contentType` on the wire)
- `size: int`
- `hash: str`
- `tags: dict[str, str]`
- `owner_run_id: uuid.UUID | None` (`ownerRunId` on the wire) (optional)
- `project_id: str | None` (`projectId` on the wire) (optional)
- `created_by: str | None` (`createdBy` on the wire) (optional)
- `created_at: AwareDatetime` (`createdAt` on the wire)

## `Datum6`

- `id: str`
- `tenant_id: str` (`tenantId` on the wire)
- `timestamp: AwareDatetime`
- `actor_subject: str` (`actorSubject` on the wire)
- `on_behalf_subject: str | None` (`onBehalfSubject` on the wire) (optional)
- `action: str`
- `resource: str`
- `outcome: Literal['allowed', 'denied']`
- `reason: str`
- `failing: str | None` (optional)
- `evidence: dict[str, Any] | None` (optional)
- `correlation_id: str | None` (`correlationId` on the wire) (optional)
- `run_id: str | None` (`runId` on the wire) (optional)
- `latency_ms: float | None` (`latencyMs` on the wire) (optional)

## `DeleteArtifactResult`

- `blob_id: str` (`blobId` on the wire)
- `deleted: bool`

## `DeploymentCollectionPage`

- `data: list[kindgi.client.DeploymentRecord]`
- `next_cursor: str | None` (`nextCursor` on the wire) (optional)
- `has_more: bool` (`hasMore` on the wire)

## `DeploymentContents`

- `tools: list[kindgi.client.Tool3]`
- `guardrails: list[kindgi.client.Guardrail1]`
- `agents: list[kindgi.client.Agent1]`
- `flows: list[kindgi.client.Flow2]`

## `DeploymentEndpoint`

Its pack service's status, when the server routes each pack call to the deployment that shipped the tool (`KINDGI_PACK_ROUTING=per-deployment`). Absent otherwise. `pending`: no pack service yet, and calls to its tools fail (`pack-endpoint-pending`) rather than go to another deployment. `ready`: calls go to its own pack service. `cleared`: its pack service was taken down, and calls fail (`pack-endpoint-cleared`). Carries no URL and no token.

- `status: Literal['pending', 'ready', 'cleared']`
- `since: AwareDatetime`
- `problem: kindgi.client.DeploymentEndpointProblem | None` (optional)

## `DeploymentEndpointProblem`

With `pending` only: the last reason the deployment has no pack service yet, gone once the status changes. A fixed code, never free text.

- `code: str`
- `since: AwareDatetime`

## `DeploymentPrimitiveCounts`

- `tools: int`
- `guardrails: int`
- `agents: int`
- `flows: int`

## `DeploymentRecord`

- `deployment_id: str` (`deploymentId` on the wire)
- `tenant_id: uuid.UUID` (`tenantId` on the wire)
- `image_ref: str` (`imageRef` on the wire)
- `image_digest: str` (`imageDigest` on the wire)
- `artifact_version: str` (`artifactVersion` on the wire)
- `index_hash: str` (`indexHash` on the wire)
- `signer_key_id: str` (`signerKeyId` on the wire)
- `signer_public_key: str` (`signerPublicKey` on the wire)
- `signature: str`
- `published_at: AwareDatetime` (`publishedAt` on the wire)
- `activated_at: AwareDatetime` (`activatedAt` on the wire)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)
- `endpoint: kindgi.client.DeploymentEndpoint | None` (optional)
- `primitives: kindgi.client.DeploymentPrimitiveCounts`
- `contents: kindgi.client.DeploymentContents`

## `DeploymentRegistrationBody`

- `image_ref: str` (`imageRef` on the wire)
- `artifact_version: str` (`artifactVersion` on the wire)
- `index_hash: str` (`indexHash` on the wire)
- `signer_key_id: str` (`signerKeyId` on the wire)
- `signer_public_key: str` (`signerPublicKey` on the wire)
- `signature: str`
- `published_at: AwareDatetime` (`publishedAt` on the wire)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)

## `DeploymentSecretsSyncRequest`

- `env_name: str` (`envName` on the wire)
- `secrets: list[kindgi.client.Secrets | kindgi.client.Secrets1]`

## `DeploymentSecretsSyncResponse`

- `resolved: int`
- `added: int`
- `references: list[kindgi.client.Reference]`

## `DeploymentValidationDetails`

- `primitive: Literal['tool', 'guardrail', 'agent', 'flow']`
- `index: int`
- `id: str | None` (optional)
- `path: str`
- `message: str`

## `DeriveAgentVersionBody`

Derive a new agent version from a pinned one with some data-block pins swapped: an expert's edit reaching an agent with no code change.

- `from_: str` (`from` on the wire)
- `pins: kindgi.client.AgentPinSwaps`
- `label: str | None` (optional)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)

## `Domain`

- `root: str`

## `DroppedItem`

- `key: str`
- `rank_before: int | None` (`rankBefore` on the wire) (optional)
