openapi: 3.1.0 info: title: Agentprint API version: 1.0.0 description: Privacy-safe ingestion and profile API. Content-bearing fields are rejected. servers: - url: https://agentprint.tech paths: /v1/device/code: post: summary: Start device authorization requestBody: required: true content: application/json: schema: type: object additionalProperties: false required: [client_name] properties: client_name: { type: string, maxLength: 100 } responses: "200": description: Pending device code content: application/json: schema: { $ref: "#/components/schemas/DeviceCode" } /v1/device/token: post: summary: Poll device authorization responses: "200": { description: Short-lived registration token } "428": { description: Authorization pending } /v1/devices/register: post: summary: Register an approved machine responses: "201": { description: Per-device bearer credential } /v1/device: delete: summary: Revoke the authenticated device security: [{ deviceBearer: [] }] responses: "204": { description: Revoked } /v1/sync/batches: post: summary: Ingest an idempotent usage batch security: [{ deviceBearer: [] }] requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/SyncBatch" } responses: "200": description: Stable acknowledgement and counts /v1/sync/batches/{id}: get: summary: Read a device-owned sync receipt security: [{ deviceBearer: [] }] parameters: - in: path name: id required: true schema: { type: string, format: uuid } responses: "200": { description: Sync receipt } "404": { description: Not found for this device } /v1/me: get: summary: Current web account security: [{ sessionCookie: [] }] responses: "200": { description: Account and profile settings } /v1/me/devices: get: summary: Connected devices and sources security: [{ sessionCookie: [] }] responses: "200": { description: Device list } /v1/me/devices/{id}: delete: summary: Revoke an owned device security: [{ sessionCookie: [] }] responses: "204": { description: Revoked } /v1/me/profile: patch: summary: Update profile identity and public metric choices security: [{ sessionCookie: [] }] responses: "200": { description: Saved } /v1/me/friends: get: summary: List accepted friends and pending requests security: [{ sessionCookie: [] }] responses: "200": { description: Friends grouped by relationship state } post: summary: Send a friend request by exact handle security: [{ sessionCookie: [] }] requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/FriendRequest" } responses: "201": { description: Friend request created } "404": { description: Exact handle not found } "409": { description: Friendship or request already exists } /v1/me/friends/search: get: summary: Find a friend candidate by exact handle security: [{ sessionCookie: [] }] parameters: - in: query name: handle required: true schema: { type: string, pattern: "^[a-z0-9](?:[a-z0-9-]{1,28}[a-z0-9])?$" } responses: "200": { description: Minimal profile identity and relationship state } "404": { description: Missing, blocked, or self profile } /v1/me/friends/{id}: parameters: - in: path name: id required: true schema: { type: string, format: uuid } patch: summary: Accept, decline, block, or unblock a friendship security: [{ sessionCookie: [] }] requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/FriendshipAction" } responses: "200": { description: Friendship updated } "404": { description: Friendship not available to this user } delete: summary: Cancel an outgoing request or remove an accepted friend security: [{ sessionCookie: [] }] responses: "204": { description: Friendship removed } "404": { description: Friendship not available to this user } /v1/me/friends/{id}/comparison: get: summary: Compare mutually shared friend metrics security: [{ sessionCookie: [] }] parameters: - in: path name: id required: true schema: { type: string, format: uuid } - in: query name: window schema: { type: integer, enum: [7, 30, 90], default: 30 } responses: "200": { description: Paired activity with query-boundary metric intersection } "404": { description: Accepted friendship not found } /v1/me/export: get: summary: Export normalized personal data security: [{ sessionCookie: [] }] responses: "200": { description: JSON export } /v1/me/account: delete: summary: Permanently delete the account and server-side data security: [{ sessionCookie: [] }] responses: "204": { description: Deleted } /v1/me/shares: get: summary: List the sessions this account has published description: >- Accepts either a browser session cookie or a device bearer token, so the dashboard and the CLI manage the same shares. security: [{ deviceBearer: [] }] responses: "200": { description: Shared sessions owned by this account } "401": { description: Authentication required } post: summary: Legacy synchronous session publication deprecated: true description: >- Disabled after CLI 0.4.0. Clients must reserve a bounded private object, upload directly to object storage, and finalize the upload instead. security: [{ deviceBearer: [] }] responses: "426": { description: Upgrade to a client that supports direct uploads } /v1/me/shares/uploads: post: summary: Reserve a bounded private session upload description: >- Accepts signed integrity metadata plus bounded owner-only display hints. Transcript turns upload directly to the returned private object-storage form and never pass through the Next.js request body. security: [{ deviceBearer: [] }] parameters: - in: header name: X-Agentprint-Timestamp required: true schema: { type: string } - in: header name: X-Agentprint-Signature required: true schema: { type: string } requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/ShareUploadReservationRequest" } responses: "201": description: Time-limited private upload form content: application/json: schema: { $ref: "#/components/schemas/ShareUploadReservation" } "400": { description: Invalid reservation metadata } "401": { description: Missing or invalid device signature } "429": { description: Account, address, or byte budget exhausted } "503": { description: Object storage unavailable } /v1/me/shares/uploads/{id}: get: summary: Read an owned background upload status security: [{ deviceBearer: [] }] parameters: - in: path name: id required: true schema: { type: string, format: uuid } responses: "200": description: Current upload and publication state content: application/json: schema: { $ref: "#/components/schemas/ShareUploadStatus" } "401": { description: Authentication required } "404": { description: Upload not found for this account } /v1/me/shares/uploads/{id}/finalize: post: summary: Verify a private upload and enqueue publication description: >- The signed request contains no transcript. The server verifies object metadata and enqueues a task carrying only the upload identifier. security: [{ deviceBearer: [] }] parameters: - in: path name: id required: true schema: { type: string, format: uuid } - in: header name: X-Agentprint-Timestamp required: true schema: { type: string } - in: header name: X-Agentprint-Signature required: true schema: { type: string } requestBody: required: true content: application/json: schema: { type: object, additionalProperties: false } responses: "202": { description: Publication queued idempotently } "400": { description: The signed finalize body was not an empty object } "401": { description: Missing or invalid device signature } "404": { description: Upload not found for this device } "409": { description: Upload incomplete or previously failed } "410": { description: Upload reservation expired } "422": { description: Stored object does not match its reservation } "429": { description: Finalization rate limit exhausted } "503": { description: Object storage or background queue unavailable } /v1/me/shares/{id}: patch: summary: Change a shared session's title, visibility, or expiry security: [{ sessionCookie: [] }] parameters: - in: path name: id required: true schema: { type: string, format: uuid } requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/SharePatch" } responses: "200": { description: The updated share } "404": { description: Not found for this account } delete: summary: Delete a shared session and its transcript description: >- A hard delete. Withdrawing consent has to actually remove the content, so the turns are removed and the link stops resolving. security: [{ deviceBearer: [] }] parameters: - in: path name: id required: true schema: { type: string, format: uuid } responses: "204": { description: Deleted } "404": { description: Not found for this account } /v1/shares/{slug}: get: summary: Read a shared session description: >- Public for `public` and `unlisted` shares. A `friends` share resolves only for the owner and their accepted friends; anyone else receives 404, the same as an unknown or expired slug. parameters: - in: path name: slug required: true schema: { type: string } - in: query name: offset schema: { type: integer, minimum: 0 } - in: query name: limit schema: { type: integer, minimum: 1, maximum: 500 } responses: "200": { description: The share, its author, and a page of turns } "404": { description: Unknown, expired, revoked, or not visible to you } /v1/profiles/search: get: summary: Search public profiles by handle or display name parameters: - in: query name: q required: true schema: { type: string, minLength: 2, maxLength: 80 } responses: "200": { description: Minimal identities for matching public profiles } "400": { description: Invalid search query } "429": { description: Rate limited } /v1/profiles/{handle}: get: summary: Read a public profile with query-boundary redaction responses: "200": { description: Public profile } "404": { description: Private or missing profile } /v1/profiles/{handle}/activity: get: summary: Read public activity responses: "200": { description: Redacted activity and summary } /v1/profiles/{handle}/card.svg: get: summary: Render an embeddable SVG profile card responses: "200": description: SVG card content: image/svg+xml: {} components: securitySchemes: deviceBearer: type: http scheme: bearer sessionCookie: type: apiKey in: cookie name: pm_session schemas: DeviceCode: type: object additionalProperties: false required: [device_code, user_code, verification_uri, verification_uri_complete, expires_in, interval] properties: device_code: { type: string } user_code: { type: string } verification_uri: { type: string, format: uri } verification_uri_complete: { type: string, format: uri } expires_in: { type: integer } interval: { type: integer } UsageRecord: type: object additionalProperties: false required: - event_id - schema_version - occurred_at - local_date - harness_id - input_tokens - output_tokens - total_tokens - source_fingerprint properties: event_id: { type: string, minLength: 16, maxLength: 128 } schema_version: { const: 1 } occurred_at: { type: string, format: date-time } local_date: { type: string, format: date } harness_id: { enum: [codex, claude-code, opencode, synthetic] } harness_version: { type: string, maxLength: 80 } provider_id: { type: string, maxLength: 80 } model_id: { type: string, maxLength: 120 } input_tokens: { type: integer, minimum: 0 } output_tokens: { type: integer, minimum: 0 } cached_input_tokens: { type: integer, minimum: 0 } reasoning_tokens: { type: integer, minimum: 0 } total_tokens: { type: integer, minimum: 0 } estimated_cost_micros: { type: integer, minimum: 0, deprecated: true, description: Legacy compatibility field; ignored by the server. } cost_basis: { enum: [reported, price-table, unavailable], deprecated: true, description: Legacy compatibility field; ignored by the server. } source_fingerprint: { type: string, minLength: 16, maxLength: 128 } SyncBatch: type: object additionalProperties: false required: [batch_id, schema_version, timezone, records] properties: batch_id: { type: string, format: uuid } schema_version: { const: 1 } timezone: { type: string, minLength: 1, maxLength: 100 } records: type: array minItems: 1 maxItems: 2000 items: { $ref: "#/components/schemas/UsageRecord" } ShareUploadReservationRequest: type: object additionalProperties: false required: [content_length, content_sha256] properties: content_length: { type: integer, minimum: 1, maximum: 8388608 } content_sha256: { type: string, pattern: "^[a-f0-9]{64}$" } title: { type: string, minLength: 1, maxLength: 140 } harness_id: { enum: [codex, claude-code, opencode, kimi-code, synthetic] } ShareUploadReservation: type: object additionalProperties: false required: [upload_id, upload_url, fields, expires_at] properties: upload_id: { type: string, format: uuid } upload_url: { type: string, format: uri } fields: type: object additionalProperties: { type: string } expires_at: { type: string, format: date-time } ShareUploadStatus: type: object additionalProperties: false required: [upload_id, status, failure_code, share_id, share_url, expires_at] properties: upload_id: { type: string, format: uuid } status: { enum: [created, queued, processing, published, failed] } failure_code: { type: [string, "null"] } share_id: { type: [string, "null"], format: uuid } share_url: { type: [string, "null"], format: uri } expires_at: { type: string, format: date-time } TranscriptBlock: description: >- A closed vocabulary. Content the viewer cannot render is content nobody reviewed before it was published, so an unrecognised kind is rejected. oneOf: - type: object additionalProperties: false required: [kind, text] properties: kind: { enum: [text] } text: { type: string, maxLength: 120000 } truncated: { type: boolean } - type: object additionalProperties: false required: [kind, text] properties: kind: { enum: [thinking] } text: { type: string, maxLength: 120000 } truncated: { type: boolean } - type: object additionalProperties: false required: [kind, name, input] properties: kind: { enum: [tool_use] } id: { type: string, maxLength: 200 } name: { type: string, maxLength: 120 } input: { type: string, maxLength: 120000 } truncated: { type: boolean } - type: object additionalProperties: false required: [kind, ok, output] properties: kind: { enum: [tool_result] } tool_use_id: { type: string, maxLength: 200 } ok: { type: boolean } output: { type: string, maxLength: 120000 } truncated: { type: boolean } - type: object additionalProperties: false required: [kind, reason] properties: kind: { enum: [omitted] } reason: { enum: [image, attachment, excluded, oversize, redaction_level] } TranscriptTurn: type: object additionalProperties: false required: [index, role, blocks] properties: index: { type: integer, minimum: 0 } role: { enum: [user, assistant, system] } at: { type: string, format: date-time } model_id: { type: string, maxLength: 120 } blocks: type: array maxItems: 400 items: { $ref: "#/components/schemas/TranscriptBlock" } SessionShare: type: object additionalProperties: false required: [schema_version, harness_id, session_fingerprint, title, visibility, redaction_level, redaction, started_at, ended_at, model_ids, totals, turns] properties: schema_version: { enum: [1] } harness_id: { enum: [codex, claude-code, opencode, kimi-code, synthetic] } harness_version: { type: string, maxLength: 80 } session_fingerprint: { type: string, minLength: 16, maxLength: 128 } title: { type: string, minLength: 1, maxLength: 140 } summary: { type: string, maxLength: 400 } visibility: { enum: [unlisted, public, friends] } redaction_level: { enum: [strict, balanced, full] } redaction: type: object additionalProperties: false required: [secrets_removed, paths_rewritten, blocks_truncated, turns_excluded] properties: secrets_removed: { type: integer, minimum: 0 } paths_rewritten: { type: integer, minimum: 0 } blocks_truncated: { type: integer, minimum: 0 } turns_excluded: { type: integer, minimum: 0 } started_at: { type: string, format: date-time } ended_at: { type: string, format: date-time } expires_at: { type: string, format: date-time, nullable: true } model_ids: type: array maxItems: 24 items: { type: string, maxLength: 120 } totals: type: object additionalProperties: false required: [input_tokens, output_tokens, total_tokens] properties: input_tokens: { type: integer, minimum: 0 } output_tokens: { type: integer, minimum: 0 } cached_input_tokens: { type: integer, minimum: 0 } reasoning_tokens: { type: integer, minimum: 0 } total_tokens: { type: integer, minimum: 0 } estimated_cost_micros: { type: integer, minimum: 0, deprecated: true, description: Legacy compatibility field; ignored by the server. } cost_basis: { enum: [reported, price-table, unavailable], deprecated: true, description: Legacy compatibility field; ignored by the server. } turns: type: array minItems: 1 maxItems: 4000 items: { $ref: "#/components/schemas/TranscriptTurn" } SharePatch: type: object additionalProperties: false properties: title: { type: string, minLength: 1, maxLength: 140 } visibility: { enum: [unlisted, public, friends] } expires_at: { type: string, format: date-time, nullable: true } FriendRequest: type: object additionalProperties: false required: [handle] properties: handle: type: string pattern: "^[a-z0-9](?:[a-z0-9-]{1,28}[a-z0-9])?$" FriendshipAction: type: object additionalProperties: false required: [action] properties: action: { enum: [accept, decline, block, unblock] }