Upload an attachment to an entity
/api/v1/entities/{entity_uuid}/attachments
operationId: attachment.create
Base: https://portal.watcheye.com.au/api/v1/entities/{entity_uuid}/attachments
Upload a file and attach it to the specified entity, for example a trust deed, an ASIC extract, a signed declaration or a contract. The attachment inherits the entity's program and account, and is attributed to the calling API key.
Send the request as multipart/form-data with the file in the file field:
curl -X POST https://watcheye.globaldata.net.au/api/v1/entities/{entity_uuid}/attachments \
-H "Authorization: Bearer {api_key}|{api_secret}" \
-F "file=@Smith Family Trust Deed.pdf" \
-F "category=Trust Deed" \
-F "description=Signed copy received from the trustee"
Accepted files
Files can be up to 10 MB. The type is detected from the file contents, and these formats
are accepted: PDF, images (JPEG, PNG, WEBP, GIF, HEIC), Word (DOC, DOCX), Excel (XLS,
XLSX), CSV, plain text, RTF and email (EML, MSG). Any other type is rejected with 400.
Duplicates
The response includes a duplicates array listing every other attachment on the account with
exactly the same contents (an empty array when there are none). The upload is accepted
either way.
Attachments cannot be added to an archived entity; the request is rejected with 409.
Unarchive the entity first to add an attachment.
Idempotency
This endpoint accepts the Idempotency-Key header so that retries on network failure are
safe. A retry with the same key and the same file returns the original response; the same
key sent with a different file is rejected with 422. See the
Idempotency section of the API guide for the full
contract.
Path parameters
| Field | Description |
|---|---|
entity_uuidrequired |
string (uuid) The entity UUID |
Header parameters
| Field | Description |
|---|---|
Idempotency-Key |
string [max 255 characters] Optional client-generated key (typically a UUID) that lets you safely retry a write
request without risk of duplicate work or duplicate billing. A retry with the same key
and body returns the original response verbatim, with the Honoured on |
Request body
Content type application/json.
The file and its details
Responses
Attachment uploaded
application/json
| Field | Description |
|---|---|
data |
object An attachment: a file attached to an entity, such as a trust deed, an ASIC extract, a signed declaration or a contract. The contents are stored encrypted and are returned by the download endpoint. Deleting an attachment is a soft-delete: subsequent show or list calls for it return |
data. |
string (uuid) The attachment's UUID |
data. |
string A short public identifier for the attachment, shown in the portal |
data. |
string (uuid) UUID of the entity the attachment is on |
data. |
string (uuid) UUID of the program the entity belongs to |
data. |
string The name of the file as uploaded |
data. |
string What the file is. Any text up to 100 characters; |
data. |
string or null An optional description of the file (max 2000 characters) |
data. |
string The type of the file, detected from its contents |
data. |
string A readable name for the type of file |
data. |
integer The size of the file in bytes |
data. |
string SHA-256 hash of the file contents, as lowercase hex. Files with the same hash have identical contents. |
data. |
object or null Identifies who uploaded the file. The
|
data. |
string Discriminator for the actor type. |
data. |
string (uuid) UUID of the user or API key that uploaded the file. |
data. |
string Username of the portal user. Present only when |
data. |
string Label of the API key. Present only when |
data. |
string (date-time) or null ISO 8601 timestamp at which the attachment was archived with its entity (null if not archived) |
data. |
string (date-time) |
data. |
string (date-time) |
duplicates |
array of objects Other attachments on this account with exactly the same contents |
duplicates[]. |
string (uuid) UUID of the matching attachment |
duplicates[]. |
string Public identifier of the matching attachment |
duplicates[]. |
string (uuid) UUID of the entity the matching attachment is on |
api_reference |
string (uuid) |
Conflict - either the entity is archived, or a request with this Idempotency-Key is currently being processed
application/json
| Field | Description |
|---|---|
message |
string |
Idempotency-Key was reused with a different request body
application/json
| Field | Description |
|---|---|
message |
string |