---
title: "Commit Attachment Upload"
method: POST
path: "/attachments/{attachmentId}/commit"
---

# Commit Attachment Upload

`POST /attachments/{attachmentId}/commit`

Finalizes an upload after the file bytes have been PUT to the signed upload URL. Verifies the object landed in storage before the attachment starts describing the new content. Committing an already-committed attachment is a no-op.

## Path parameters

- `attachmentId` string, uuid, required

## Response `200`

The committed attachment.

- Attachment — A file attached to a session. Bytes live in object storage; this describes the last committed content.
  - `id` string, uuid, required — The ID of the Attachment.
  - `sessionId` string, required — The session ID the attachment belongs to. Matches the `session.id` emitted on OTel spans, which is how attachments are joined to traces and records.
  - `filePath` string, required — The logical file path of the attachment (e.g. the path the agent wrote on disk). Together with the session ID it identifies the attachment: re-uploading the same path in the same session updates the existing attachment in place.
  - `filename` string, nullable, required — Display filename, if provided.
  - `contentType` string, nullable, required — MIME type of the last committed content. Null until the first commit.
  - `sizeBytes` integer, nullable, required — Size in bytes of the last committed content. Null until the first commit.
  - `sha256` string, nullable, required — SHA-256 of the last committed content. Null until the first commit.
  - `status` 'pending' | 'uploaded', required — `uploaded` once a commit has succeeded; `pending` while an initiated upload has not been committed yet.
  - `uploadedAt` string, nullable, required — ISO 8601 timestamp of the last successful commit. Null until the first commit.
  - `metadata` object, nullable, required — Arbitrary caller-supplied metadata.

## Other responses

- `401` — Error indicating that the request is not authenticated.
- `500` — An internal service error indicating an issue with the Scorecard service.

---

[API](https://skmtc.dev/scorecard-ai/apis/scorecard-api.md) · [All operations](https://skmtc.dev/scorecard-ai/apis/scorecard-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scorecard-ai/scorecard-api/revisions/121aaa257802/schema)
