Skip to main content
GET
/
api
/
stats
/
hit
Track Event
curl --request GET \
  --url https://api.example.com/api/stats/hit
{
  "ok": true
}

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/subratomandal/dyeink/llms.txt

Use this file to discover all available pages before exploring further.

Authentication

This is a public endpoint and does not require authentication.

Query Parameters

id
string
required
The ID of the post to track the event for
type
string
required
The type of event to track. Must be either view or share

Response

Returns a confirmation that the event was tracked successfully.
ok
boolean
required
Indicates whether the event was tracked successfully

Example Request

cURL
curl -X GET "https://api.dyeink.com/api/stats/hit?id=507f1f77bcf86cd799439011&type=view"

Example Response

{
  "ok": true
}

Error Responses

400 Bad Request
Invalid parameters provided
{
  "error": "Invalid parameters"
}
404 Not Found
Post with the specified ID does not exist
{
  "error": "Post not found"
}
500 Internal Server Error
Failed to track the event
{
  "error": "Failed to track event"
}

Notes

  • This endpoint updates both the post’s total counters and creates/updates daily statistics for analytics
  • Events are tracked transactionally to ensure data consistency
  • The endpoint validates that the post exists before recording the event

Build docs developers (and LLMs) love