(document): Update created_at and data.

2025-06-07 05:29:51 +10:00
parent 2c3583f160
commit 27f54efabe

@@ -41,15 +41,16 @@ However, `Document` also supports CRUD operations separately for storing arbitra
| field | type | required | description |
| --------------- | --------- | -------- | -------------------------------------------------------------- |
| `document_id` | integer | - | UID for this document |
| `document_data` | file | yes | Image data (not sure about the encoding yet) |
| `document_data` | string | yes | Image data encoded in Base64 |
| `seal` | integer | yes | Seal integer |
| `created_at` | timestamp | no | When this document was created. Automatically set on creation. |
| `created_at` | timestamp | - | When this document was created. Automatically set on creation. |
| `metadata` | string? | no | Optional arbitrary associated metadata. |
| `stamps` | [`Stamp`] | no | List of stamps attached to this document. |
- `POST` `/documents`
- Create and return a `Document`.
- Stamps may be added to the document by passing a list of `Stamp`s in the `stamps` field.
- These stamps should not include `document_id`, as this will be automatically added.
- `GET` `/documents`
- Get all `Document`s matching the given parameters. If no parameters are given, returns all documents.
- Supported filter parameters:
@@ -63,8 +64,9 @@ However, `Document` also supports CRUD operations separately for storing arbitra
- Returns a `Document` with the given `document_id`.
- `PATCH` `/documents/{document_id}`
- Updates the given `Document`.
- Supports updating `document_data`, `seal`, `metadata`.
- To update the stamps, use `/documents/{document_id}/stamps`
- Supports updating `document_data`, `seal`, `metadata`, and `stamps`.
- If `stamps` is provided, it must be a list of creation arguments for `Stamp`s. These will *replace* the existing document stamps.
- To update individual stamps, use `/documents/{document_id}/stamps`
- Returns the updated `Document`.
- `DELETE` `/documents/{document_id}`
- Delete the given document, and all associated `Stamp`s.