Export event by ID
Export a single event by ID.
Example
Here is an example of how to export a single event by ID:
const eventId = '924f6c8f-3b5b-47ea-b483-25a0506dc436';const url = new URL(`https://api.croct.io/export/events/${eventId}`);
const response = await fetch(url, { headers: { 'X-Api-Key': '<API KEY>', },});
const {metadata, event} = await response.json();Headers
This endpoint requires the following HTTP headers:
Parameters
This endpoint accepts the following path parameters:
- eventIdstring
The ID of the event in UUID format.
Response
This endpoint returns a JSON response with the following properties:
- metadataobject
Metadata about the workspace and application.
- organizationNamestring
The name of the organization.
- organizationSlugstring
The URL-friendly identifier of the organization.
- workspaceNamestring
The name of the workspace.
- workspaceSlugstring
The URL-friendly identifier of the workspace.
- applicationNamestring
The name of the application.
- applicationSlugstring
The URL-friendly identifier of the application.
- organizationName
- event
The exported event.
See the Event types reference for the complete event structure.
Example response
Here is an example of a JSON response from this endpoint:
{ "metadata": { "organizationName": "Lolaza", "organizationSlug": "lolaza", "workspaceName": "Boost CA", "workspaceSlug": "boost-ca", "applicationName": "Blog", "applicationSlug": "blog" }, "event": { "id": "924f6c8f-3b5b-47ea-b483-25a0506dc436", "sessionId": "964e328d-5459-4229-9565-0aef9fe0fca8", "userId": "43bca1da-8a1a-4f87-be2a-23d802b860b8", "timestamp": 1440979201000, "context": null, "payload": { "type": "userSignedIn", "externalUserId": "foo" } }}If no event matches the given ID, the endpoint responds with a resource not found error.