API EndpointsEntitiesFetch Many Entities

Fetch Entities

Endpoint

URL: /:projectId/entities

Method: GET

Authentication Required: Optional


Description

Fetches a list of entities with full support for pagination, sorting, and advanced filtering. Can be accessed with or without authentication.


Request

Headers

HeaderTypeRequiredDescription
AuthorizationstringNoBearer token to identify the user (optional).

Query Parameters

ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1).
limitnumberNoNumber of results per page (max: 100).
sortBystringNoSorting strategy: hot (default), top, new, or controversial.
timeFramestringNoFilter by creation time: hour, day, week, month, year.
sourceIdstringNoFilter entities by a specific sourceId.
userIdstringNoFilter by a specific userId.
followedOnlystringNotrue to only show entities by followed users (requires auth).
keywordsFiltersobjectNoFilter entities by keyword inclusion/exclusion.
metadataFiltersobjectNoFilter entities by metadata keys and values.
titleFiltersobjectNoFilter by title presence or matching values.
contentFiltersobjectNoFilter by content presence or matching values.
attachmentsFiltersobjectNoFilter based on whether attachments exist.
locationFiltersobjectNoFilter by location with radius, latitude, and longitude.

Example Request

GET /proj1234/entities?sortBy=top&limit=10&page=1&followedOnly=true
Authorization: Bearer <ACCESS_TOKEN>

Response

Success Response (200 OK)

[
  {
    "id": "entity_123",
    "userId": "user_abc",
    "title": "First Post",
    "content": "This is a sample entity.",
    ...
  },
  ...
]

Error Responses

Invalid Limit (400 Bad Request)

{
  "error": "Invalid request: limit must be a positive number.",
  "code": "entity/invalid-limit"
}

Invalid Page (400 Bad Request)

{
  "error": "Invalid request: page must be a whole number greater than 0.",
  "code": "entity/invalid-page"
}

Server Error (500 Internal Server Error)

{
  "error": "Internal server error.",
  "code": "entity/server-error",
  "details": "<Error message>"
}

Notes

  • Sort options include:

    • hot: Ranked by score (default).
    • top: Most upvoted.
    • new: Most recent.
    • controversial: Balanced upvotes/downvotes.
  • When followedOnly is true, the response includes only posts by followed users (must be logged in).

  • Supports complex filters including geospatial queries, keyword matching, content presence, and metadata rules.