Skip to content

API | Enhancement | Add bulk fetch payload specifications to openapi.yaml - #98

Open
Namasivaayam-L wants to merge 1 commit into
anyproto:mainfrom
Namasivaayam-L:36-batch-object-retrieval
Open

API | Enhancement | Add bulk fetch payload specifications to openapi.yaml#98
Namasivaayam-L wants to merge 1 commit into
anyproto:mainfrom
Namasivaayam-L:36-batch-object-retrieval

Conversation

@Namasivaayam-L

@Namasivaayam-L Namasivaayam-L commented Aug 7, 2026

Copy link
Copy Markdown

API documentation for #36

Add POST /v1/spaces/{space_id}/objects/batch endpoint for fetching multiple objects by their IDs in a single request.
Adds BatchGetObjectsRequest schema with required ids array (min 1, max 100).

Description

This PR adds OpenAPI documentation for a batch object fetch endpoint. It allows a client to retrieve multiple objects by ID within a space in one request, avoiding N sequential GET calls when operating on a known set of objects (e.g., a list of tasks or commitments). Unfound IDs are represented by null entries, preserving the order of the requested IDs.

Changes:

  • Added POST /v1/spaces/{space_id}/objects/batch endpoint documentation (operationId get_objects_batch, tag Objects)
  • Added apimodel.BatchGetObjectsRequest schema definition (ids array, min 1 / max 100)
  • 200 response array of ObjectResponse or null; 400 / 401 / 429 / 500 error responses
  • Regenerated per-endpoint docs (docs/reference/2025-11-08/get-objects-batch.*)
  • Added get-objects-batch entry to the Objects category in sidebar.ts

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

N/A - OpenAPI specification and documentation update only.

Example usage:

curl -X POST http://localhost:31009/v1/spaces/{space_id}/objects/batch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Anytype-Version: 2025-11-08" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["<object_id_1>", "<object_id_2>"]}'

Example response:

[
  { "id": "bafyreid1...", "name": "Task A", ... },
  null
]

Verification:

  • bun run lint passes
  • bun run build (Docusaurus production build) succeeds
  • OpenAPI YAML parses cleanly; $ref/constraints verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant