/Thread
Overview
The /thread
endpoint retrieves a reply thread that starts from a specified event. It returns an array of events, along with the profiles of the authors involved.
Endpoint Details
URL:
/thread
Method: GET
Auth Required: No
Permissions Required: None
Request Parameters
id
The ID of the event whose replies are requested in hexadecimal format.
Yes
depth
The maximum depth of replies to fetch.
No
limit
The maximum number of events to return.
No
Response Schema
The response is a JSON object with the following structure:
id
: The ID of the event whose comment thread is being retrieved.events
: An array of events in the thread, including the original event.profiles
: A map of author profiles, keyed by pubkey.depth
: The actual depth reached in the thread.
Example Call
Notes
If
depth
is not provided, it defaults to 2.Once the server collects as many events as are allowed by the
limit
constraint, it returns that set even though it may not have reached the maximum alloweddepth
. Similarly, once all replies up to the specifieddepth
have been collected, the set is returned even if thelimit
has not been reached.
Error Responses
400 Bad Request: If the root event ID is missing or invalid.
404 Not Found: If the root event cannot be found.
500 Internal Server Error: If there's an issue processing the request.
Last updated