DriftConnected data, kept portable

Persisted model reference

Use this reference when designing request payloads, mapping Drift records into an application, or implementing a compatible storage adapter. It defines the API-facing model; the OpenAPI document remains canonical for HTTP validation, and src/interfaces/repository.ts is canonical for adapter method signatures.

Ownership and guarantees

Drift owns tenant IDs, record IDs, timestamps, versions, and deletion markers. Clients own domain fields and the meaning of flexible JSON. An adapter owns only the representation and persistence mechanics.

Guaranteed behavior across adapters includes tenant isolation, UUIDv7 record IDs, UTC date-time strings, optimistic versions, soft deletion, and lossless round trips for valid Drift JSON. SQLite's tables and validated JSON-text columns are adapter-specific and are not a client contract.

Common record fields

FieldInput/defaultOutput and invariant
idNever accepted from graph clients.UUIDv7 generated by Drift and stable for the record lifetime.
tenantIdNever accepted from graph clients.Derived from the authenticated key and immutable.
versionOmitted on create; current value on mutation.Starts at 1; each successful mutation increments it.
createdAtNever accepted.UTC date-time set at creation and never changed.
updatedAtNever accepted.UTC date-time refreshed by a successful mutation.
deletedAtNever accepted.null while active; UTC soft-delete time while deleted.
dataOptional; defaults to {}.Any valid JSON value owned by the client application.
metadataOptional; defaults to {}.Any valid JSON value for explicit source, sync, or control information.

PATCH updates only supplied client-owned fields; it does not merge nested JSON objects. A caller that replaces data or metadata owns the complete replacement value. Invalid JSON or undeclared mutation fields fail request validation without a persisted change.

Vertex fields

FieldRequired on createDefaultDefinition and ownership
typeyesnoneNon-empty client-defined domain kind, such as device or service.
slugnonullClient-defined human-readable identifier.
externalIdnonullClient-defined identifier from another system.
titlenonullClient-defined display label.
statusnoactiveClient-defined lifecycle state; Drift does not infer transitions.
datano{}Primary flexible payload.
metadatano{}Explicit system/control payload.

Drift guarantees storage and exact-match filtering for top-level type and status; it does not assign business semantics to either value. Automation may copy or validate an explicitly supplied value but must not infer a status transition, record type, or identity match from content.

Edge fields

FieldRequired on createDefaultDefinition and invariant
fromVertexIdyesnoneSource vertex UUIDv7; must identify an active vertex in the tenant.
toVertexIdyesnoneDestination vertex UUIDv7; must identify an active vertex in the tenant.
typeyesnoneNon-empty client-defined relationship kind.
statusnoactiveClient-defined relationship lifecycle state.
datano{}Relationship-specific JSON, such as role, quantity, or order.
metadatano{}Explicit system/control JSON for the relationship.

Both endpoints must be active and belong to the authenticated tenant when an edge is created or restored. A deleted vertex atomically soft-deletes its active incident edges. Restoring a vertex never restores edges automatically. A missing, inactive, or foreign endpoint fails without creating or restoring the edge.

Tenant fields

Operators create tenants through the bootstrap CLI, not through the v1 HTTP API.

FieldInput/defaultOutput and invariant
slugRequired and unique.Stable operator-facing tenant identifier.
nameRequired.Operator-defined display name.
statusDefaults to active.Tenant lifecycle value; no public v1 mutation route.
idGenerated by Drift.Internal tenant identifier bound to keys and graph data.
createdAt, updatedAtGenerated by Drift.UTC audit timestamps.

Bootstrap with an existing slug fails and does not issue another key. Tenant deletion, rename, export, and cross-tenant reassignment are not public v1 capabilities.

API-key fields

FieldInput/defaultOutput and invariant
labelRequired, non-empty.Operator-owned purpose label.
scopesAt least one explicit scope required.Array containing read, write, and/or admin.
idGenerated by Drift.Stable key-record identifier used for rotation or revocation.
tenantIdDerived from the admin key.Immutable owning tenant.
prefixGenerated by Drift.Non-secret lookup component of the raw credential.
createdAtGenerated by Drift.UTC creation time.
lastUsedAtDefaults to null.Most recently recorded successful credential verification.
revokedAtDefaults to null.UTC revocation time; non-null keys cannot authenticate.

The complete raw secret is returned only at creation or rotation. Drift persists a cryptographic hash and cannot recover the secret. A client or operator owns secure distribution and storage. See tenants, bootstrap, and API keys for the security model and Architecture for the complete persistence boundary.