Entity Object Documentation

The Entity object represents a core item within Replyke. It can model anything from a social media post or product listing to a static page or location-based record. It supports rich metadata, votes, mentions, optional location tagging and more.

Properties

PropertyTypeDescription
idstringUnique identifier for the entity (UUID).
projectIdstringIdentifier of the project this entity belongs to (UUID).
foreignIdstring | nullOptional external or static identifier (e.g., "about-page"). May not be a UUID.
shortIdstringAuto-generated unique short identifier used for sharing or routing.
userUserLean | nullOptional lightweight user object representing the creator.
titlestring | nullOptional title or heading for the entity.
contentstring | nullOptional main content or description.
mentionsMention[]Array of users mentioned in the content. Each item includes user ID (UUID) and username.
attachmentsRecord<string, any>[]Flexible array of media/info objects (e.g., URLs, sizes, formats).
keywordsstring[]Tags or keywords associated with the entity.
upvotesstring[]Array of user IDs (UUIDs) who upvoted the entity.
downvotesstring[]Array of user IDs (UUIDs) who downvoted the entity.
repliesCountnumberTotal number of comments and replies associated with the entity.
viewsnumberTotal view count.
scorenumberActivity-based score (“hotness”) used for ranking.
scoreUpdatedAtDateTimestamp of the last score calculation.
location{ type: "Point", coordinates: [number, number] } | nullOptional GeoJSON-style location ([longitude, latitude]).
metadataRecord<string, any>Flexible metadata (up to 10KB) to store additional project-specific info.
topCommentTopComment | nullTop-rated comment for this entity, if one exists.
createdAtDateTimestamp when the entity was created.
updatedAtDateTimestamp of the most recent update.
deletedAtDate | nullTimestamp when the entity was deleted, if applicable.

Supporting Types

TopComment

PropertyTypeDescription
idstringID of the comment (UUID).
userUserLeanUser who posted the comment.
upvotesCountnumberNumber of upvotes the comment received.
contentstringText content of the comment.
createdAtstringTimestamp the comment was created.

Example Use Cases

Social Media Post

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "content": "Check out this amazing sunset!",
  "attachments": [{ "url": "https://example.com/media/sunset.jpg", "size": "2MB" }],
  "keywords": ["sunset", "nature"],
  "user": { "id": "550e8400-e29b-41d4-a716-446655440001", "name": "John Doe" }
}

Marketplace Product

{
  "id": "550e8400-e29b-41d4-a716-446655440002",
  "title": "Wireless Earbuds",
  "content": "Experience high-quality sound with our new earbuds.",
  "attachments": [],
  "keywords": ["electronics", "audio"]
}

Static Page (About Us)

{
  "id": "550e8400-e29b-41d4-a716-446655440003",
  "foreignId": "about-page",
  "title": "About Us",
  "content": "Welcome to our platform. Here is what we do.",
  "attachments": [],
  "user": null
}

Location-Based Listing (Hotel)

{
  "id": "550e8400-e29b-41d4-a716-446655440004",
  "title": "Cozy Beachside Hotel",
  "content": "Enjoy your stay at our beautiful beachside hotel.",
  "location": { "type": "Point", "coordinates": [34.0522, -118.2437] },
  "metadata": { "rating": 4.5, "price": "199.99" },
  "user": { "id": "550e8400-e29b-41d4-a716-446655440005", "name": "Sunrise Hotels" }
}

Integration Notes

  • The Entity structure is intentionally flexible for integration into varied content pipelines, including static, dynamic, or externally referenced data.
  • foreignId enables mapping to external datasets without requiring UUIDs.
  • attachments, metadata, and location provide extensibility without schema changes.

Ready to move on to Mention or UserLean next?