files:query

Description: Retrieve a list of files/documents for the authenticated account.


Request Schema

{
  "payload": {
    "type": "files:query",
    "q": {
      "per_page": 25,
      "page": 1,
      "title_cont": "report"
    }
  },
  "signature": "payload_ed25519_hex_signature",
  "source_public_key": "your_client_public_key"
}

Request Attributes

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": "files:query",
    "q": {
      "per_page": 25,
      "page": 1,
      "total": 10
    },
    "resources": [
      {
        "id": 1,
        "import_id": "DOC-001",
        "title": "Annual Report 2024",
        "description": "Annual financial report for the community",
        "attachable_type": "Organization",
        "attachable_id": 456,
        "created_at": "2025-03-17T09:00:00Z",
        "updated_at": "2025-03-17T09:00:00Z"
      }
    ]
  }
}

Response Attributes

  • payload.q - Object - Query metadata including pagination info
    • per_page - Integer - Items per page
    • page - Integer - Current page number
    • total - Integer - Total number of matching files
  • payload.resources - Array of file objects:
    • 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
    • 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

When an invalid query parameter is provided:

{
  "source_public_key": "community_public_key",
  "source_site": {
    "protocol": "https",
    "fqdn": "arkipel.localhost:3000"
  },
  "created_at": "2025-03-18T10:30:00Z",
  "signature": "...",
  "payload": {
    "type": "files:query",
    "q": { "invalid_param" => "value" }
  },
  "error": "Error message",
  "status": "bad_request"
}

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": "files:query",
    "q": {
      "per_page": 10,
      "page": 1,
      "total": 5,
      "title_cont": "report"
    },
    "resources": [
      {
        "id": 123,
        "import_id": "DOC-2024-001",
        "title": "Annual Report 2024",
        "description": "Annual financial report for the community",
        "attachable_type": "Organization",
        "attachable_id": 456,
        "created_at": "2025-03-15T10:00:00Z",
        "updated_at": "2025-03-15T10:00:00Z"
      }
    ]
  }
}

Usage Notes

  • This is an ephemeral query - no message is persisted to the database
  • Files are ordered by updated_at DESC (newest first) by default
  • Soft-deleted files are automatically excluded from results
  • Authentication can be via token, whitelist, or membership
  • All files in the account are accessible regardless of authentication method

Back to top

Welcome to the Arkipel DevKit! This documentation will guide you through everything you need to build clients for Arkipel communities.

Contact: devkit@arkipel.co | Page URLs

Copyright © 2026 Arkipel. Distributed under an MIT license.