The Realtime API is a RESTful web service that allows developers to interact with Realtime programmatically. It provides a set of endpoints that enable developers to read and delete documents. The Realtime API follows the principles of REST architecture. It uses standard HTTP methods (GET, POST, PUT, DELETE) to interact with resources and returns data in JSON format.
It's worth noting that Realtime is constantly working on improving its platform, and as such, new endpoints and features may be added in the future. Scheduled updates may include new functionality for creating and updating documents, and more.
Authentication
All endpoints in the Realtime API require the use of a
Secret Key to authenticate requests. This key can be found in the settings of a Realtime project and should be treated as confidential information. To use the Realtime API, you must include the secret key in the X-API-KEY header of each API request. This ensures that only authorized users can access and modify data in your project.Get document
This endpoint retrieves a document with the specified documentId. If the document exists, it will be returned as the root of the API response in JSON format. If the document does not exist, the API will return a 404 error.
shellcurl --request GET \ --url 'https://worker.inrealtime.app/api/documents/:documentId' \ --header 'X-API-KEY: YOUR_SECRET_KEY'
If you are using groups, you should use the groups endpoint which is specified below.
Get document in a group
This endpoint retrieves a document with the specified groupId and documentId. If the document exists, it will be returned as the root of the API response in JSON format. If the document does not exist, the API will return a 404 error.
shellcurl --request GET \ --url 'https://worker.inrealtime.app/api/groups/:groupId/documents/:documentId' \ --header 'X-API-KEY: YOUR_SECRET_KEY'
Delete document
This endpoint deletes the document with the specified documentId from Realtime.
shellcurl --request DELETE \ --url 'https://worker.inrealtime.app/api/documents/:documentId' \ --header 'X-API-KEY: YOUR_SECRET_KEY'
Delete document in a group
This endpoint deletes the document with the specified groupId and documentId from Realtime.
shellcurl --request DELETE \ --url 'https://worker.inrealtime.app/api/groups/:groupId/documents/:documentId' \ --header 'X-API-KEY: YOUR_SECRET_KEY'