file:query
Description: Retrieve a single file/document by its ID or import_id.
Request Schema
{
"payload": {
"type": "file:query",
"id": 123
},
"signature": "payload_ed25519_hex_signature",
"source_public_key": "your_client_public_key"
}
Or using import_id:
{
"payload": {
"type": "file:query",
"import_id": "DOC-001"
},
"signature": "payload_ed25519_hex_signature",
"source_public_key": "your_client_public_key"
}
Request Attributes
- See global request attributes
-
payload.id- Integer - The file ID (optional if import_id is provided) -
payload.import_id- String - The file’s import_id (optional if id is provided)
At least one of id or import_id must be provided.
Authentication Behavior
This endpoint follows Pattern A: Full Account Access.
All authentication methods see the same data - no person filtering is applied.
Response Schema
{
"source_public_key": "community_public_key",
"source_site": {
"protocol": "https",
"fqdn": "arkipel.localhost:3000"
},
"created_at": "2025-03-18T10:30:00Z",
"signature": "8b6392d5550605bd6ccddf9c21ebec470de4b44e4b4deb746076e37ab61c5346e07e7c7c7cebb5bbee41cdd92a476bcd3f02373d146ec165b31c31fc31c9ce0d",
"payload": {
"type": "file:query",
"resource": {
"id": 123,
"import_id": "DOC-001",
"title": "Project Proposal",
"description": "Q2 2026 project proposal document",
"attachable_type": "Organization",
"attachable_id": 456,
"created_at": "2025-03-17T09:00:00Z",
"updated_at": "2025-03-17T09:00:00Z"
}
}
}
Response Attributes
-
payload.resource- Object - The requested file:-
id- Integer - Unique identifier -
import_id- String - External reference ID -
title- String - File title -
description- String - File description (optional) -
attachable_type- String - The type of entity this file is attached to (e.g., Person, Organization) -
attachable_id- Integer - The ID of the attached entity -
created_at- ISO 8601 timestamp - Creation time -
updated_at- ISO 8601 timestamp - Last update time
-
Error Responses
File Not Found
{
"source_public_key": "community_public_key",
"source_site": {
"protocol": "https",
"fqdn": "arkipel.localhost:3000"
},
"created_at": "2025-03-18T10:30:00Z",
"signature": "...",
"payload": {
"type": "file:query"
},
"error": "File not found for id: 999999 or import_id: ",
"status": "not_found"
}
Missing Parameters
{
"payload": {
"type": "file:query"
},
"error": "File not found for id: or import_id: ",
"status": "not_found"
}
Real Life Example
{
"source_public_key": "bwyexzko74pnnjn741936fnaujxyhib9rpx8rggtejwnc3cz6ans",
"source_site": {
"protocol": "https",
"fqdn": "arkipel.co"
},
"created_at": "2026-02-14T14:14:22Z",
"signature": "0b7cf3e421c4d7e4212e2069fbfbfd6734d0809fa3603e492949dc5b948da691f277c601d48b9cbac2bebbfdf697e8e01aa93ff54ae53afab4c5c2272dea0400",
"payload": {
"type": "file:query",
"resource": {
"id": 456,
"import_id": "DOC-2024-045",
"title": "Annual Report 2024",
"description": "Annual financial report for the community",
"attachable_type": "Organization",
"attachable_id": 789,
"created_at": "2025-03-10T14:30:00Z",
"updated_at": "2025-03-10T14:30:00Z"
}
}
}
Usage Notes
- This is an ephemeral query - no message is persisted to the database
- Soft-deleted files return a “not_found” error
- Authentication can be via token, whitelist, or membership
- The file is findable by either
idorimport_id - Both
idandimport_idare checked - the first matching file is returned