List attachments
/api/v1/attachments
operationId: attachment.list
Base: https://portal.watcheye.com.au/api/v1/attachments
Returns the attachments on entities on the calling account. Results are paginated. To list the attachments on one entity use GET /v1/entities/{uuid}/attachments.
Filters
The following filters can be applied via the filter[...] query parameters:
entity_uuid- only attachments attached to the given entitycategory- only attachments with exactly this categoryfilename- only attachments whose name contains this text (not case sensitive)mime_type- only attachments of this type, for exampleapplication/pdfcreated_by- one ofuser(only attachments uploaded by any portal user on this account) orapi_key(only attachments uploaded by any API key on this account)created_by_user_uuid- only attachments uploaded by the given portal usercreated_by_api_key_uuid- only attachments uploaded by the given API keycreated_at_from- inclusive lower bound on the upload time (ISO 8601)created_at_to- inclusive upper bound on the upload time (ISO 8601)
The top-level archived query parameter accepts true (only archived) or false (only
non-archived); omitting it returns both.
Filters that target a uuid return an empty page when the uuid does not exist on the calling account.
Sorting
The sort query parameter accepts created_at (default: -created_at, newest first),
filename or size_bytes. Prefix with - for descending order.
Query parameters
| Field | Description |
|---|---|
page |
integer The page of results to return, starting at 1. |
per_page |
integer The number of attachments per page (defaults to 30, max 500) |
filter[entity_uuid] |
string (uuid) Only attachments attached to the given entity. |
filter[category] |
string Only attachments with exactly this category. |
filter[filename] |
string Only attachments whose name contains this text (not case sensitive). |
filter[mime_type] |
string Only attachments of this type. |
filter[created_by] |
string Only attachments uploaded by any portal user ( |
filter[created_by_user_uuid] |
string (uuid) Only attachments uploaded by a specific portal user. |
filter[created_by_api_key_uuid] |
string (uuid) Only attachments uploaded by a specific API key. |
filter[created_at_from] |
string (date-time) Inclusive lower bound on |
filter[created_at_to] |
string (date-time) Inclusive upper bound on |
sort |
string Field to sort by; prefix with |
archived |
boolean Filter by archive status.
Note: The API will accept the string 'true' or the number 1 for true and the string 'false' or the number 0 for false as well as the boolean values. |
Responses
Attachments list response
application/json
| Field | Description |
|---|---|
data |
array of objects An array of attachments |
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) |
meta |
object |
meta. |
integer |
meta. |
integer |
meta. |
integer |
meta. |
integer |
api_reference |
string (uuid) |