Annotations
The object annotation protocol is a Preview extension in the MVP release. Policy evaluation for the four s3:*ObjectAnnotation actions depends on the unpublished silo-pkg revision (27697e8) compiled into the pgsilo branch.
An object annotation is a named UTF-8 text payload attached to a specific parent object version—such as OCR text, classification labels, or review notes. Introduced in schema 13 and retained in schema 14, annotations are stored separately from S3 user metadata (x-amz-meta-*) and object tags. Updating an annotation neither rewrites the parent object body nor creates a new parent version.
HTTP requests and permissions
Target the parent object key and sign the full path, query string, and headers with AWS SigV4:
| Operation | HTTP request | Required IAM action | Additional bucket privilege (iam_and_pg) |
|---|---|---|---|
| Write or replace | PUT /{bucket}/{key}?annotation=&annotationName=labels.json | s3:PutObjectAnnotation | INSERT |
| Read payload | GET /{bucket}/{key}?annotation=&annotationName=labels.json | s3:GetObjectAnnotation | SELECT |
| List names | GET /{bucket}/{key}?annotation= | s3:ListObjectAnnotations | SELECT |
| Delete | DELETE /{bucket}/{key}?annotation=&annotationName=labels.json | s3:DeleteObjectAnnotation | DELETE |
- Standard
s3:GetObjectands3:PutObjectpermissions do not grant annotation access. IAM policy resources reference the parent object ARN (arn:aws:s3:::bucket/keyor prefix). - The
annotationquery parameter must appear once with an empty value.PUTandDELETErequire a non-emptyannotationName.GETwithoutannotationNamelists all annotations on the selected parent version;GETwithannotationNamereturns that annotation’s body. There is no annotationHEADendpoint. - Successful
PUTreturns HTTP200,DELETEreturns HTTP204, andGETreturnsContent-Type: text/plain; charset=utf-8along with the annotation’s ownETag,Last-Modified, and parentx-amz-version-id.
Size and naming bounds
| Property | Limit |
|---|---|
| Annotations per parent object version | 1000 |
| Plaintext payload size | 1 byte – 1 MiB |
Annotation name (annotationName) | 1 – 512 UTF-8 bytes (no XML-invalid control characters) |
| Payload encoding | Valid UTF-8 |
Annotation names are treated as flat identifiers rather than filesystem paths. Annotation bytes count toward the bucket’s hard logical quota.
A list request (GET /{bucket}/{key}?annotation=) returns up to 1000 entries in a single response without pagination parameters:
Parent version selection and conditional writes
Pass versionId to target a specific historical parent version; omitting versionId targets the current visible object (excluding delete markers).
PUT and DELETE accept x-amz-object-if-match: "<PARENT_ETAG>" to verify the parent object’s ETag atomically (requires SELECT under iam_and_pg mode). Note that x-amz-object-if-match checks the parent object body’s ETag, not the previous annotation’s ETag.
For runnable Python signing examples, see Annotations & ZIP Extraction.
Lifecycle, copying, and encryption
- Independent mutability: annotations have no version history of their own. Updating an annotation leaves the parent object’s body, ETag, modification time, tags, Object Lock retention, and legal hold untouched. Parent Object Lock does not make annotations immutable.
- Unlinking and cleanup: overwriting an unversioned object discards its previous annotation set; deleting a specific parent version unlinks only that version’s annotations. Unlinking releases logical bucket quota immediately, while a writable gateway’s background maintenance worker deletes the unlinked physical rows in batches.
- Copy directives: S3
CopyObjectacceptsx-amz-annotation-directive: COPY(default) orEXCLUDE. Copying a non-empty annotation set requiress3:GetObjectAnnotationon the source ands3:PutObjectAnnotationon the destination. SQLsilo_api.copy_objectalways copies plaintext annotations atomically and has noEXCLUDEoption. - Encryption: annotations inherit the parent version’s SSE-C or static SSE-S3 protection and require the matching key on
PUTandGET. Public SQL functions have no annotation CRUD endpoints and reject copying objects with encrypted annotations.
Error responses
| Error or status | Meaning |
|---|---|
InvalidArgument (HTTP 400) | Malformed query parameters, invalid UTF-8 name/body, or unsupported headers |
TooManyAnnotations (HTTP 400) | Parent version already has 1000 annotations |
NoSuchAnnotation (HTTP 404) | Requested annotationName does not exist on the selected parent version |
AccessDenied (HTTP 403) | Missing s3:*ObjectAnnotation action, parent policy denial, or missing native bucket privilege |
PreconditionFailed (HTTP 412) | x-amz-object-if-match does not match the parent version’s ETag |
