This guide follows the Console getting started tutorial: create a Space, ingest a JSON event, wait for transformation, and query records from ClickHouse.
SELECT * FROM evt__records LIMIT 10 returns at least one rowSpaces page.curl: verify it is installed with curl --version.source in examples is for bash/zsh. On Windows, use WSL or set variables manually in your shell.Create.my-app-events).Create space.Your Space is the pipeline that transforms incoming JSON events into typed SQL tables backed by ClickHouse.
Success check:
Space "<name>" successfully created.On the result page, copy these values:
Inject tokenClickHouse endpointClickHouse databaseClickHouse usernameClickHouse passwordRecommended first:
Download .env and save it as .my-app-events.env in your working directory. The next snippets use this exact filename.Optional:
Download CSV: exports credentials as a table for secure storage.Note:
Recommended:
Ingest example event and run the exact generated command.Template (for scripting):
source .my-app-events.env
curl -X POST "https://api.trailstack.io/v1/Spaces/AppendRecords?spaceName=$TRAILSTACK_SPACE_NAME&fireAndForget=false" \
-H "Authorization: Bearer $TRAILSTACK_INJECT_TOKEN" \
-H "Content-Type: text/plain" \
--data-binary '{"source":"example","event":"test_event","attrs":{"str":"Hello TrailStack!"}}'Success check:
0.TrailStack transforms JSON into typed SQL tables. This usually takes a couple of minutes.
Success check:
Recommended:
Make a database query and run the exact generated command.Template (for scripting):
source .my-app-events.env
curl -X POST "https://api.trailstack.io:8443?database=$TRAILSTACK_CLICKHOUSE_DB" \
-u "$TRAILSTACK_CLICKHOUSE_USER:$TRAILSTACK_CLICKHOUSE_PASSWORD" \
-d "SELECT * FROM evt__records LIMIT 10 FORMAT Pretty"Success check:
0.evt__records.Click Complete to return to the Spaces list.
You can reopen the Space later to view endpoint and connection details.
401 or 403 on ingest:
Use the new Space Inject token from the result page and retry.ClickHouse username, ClickHouse password, and ClickHouse database are from the same Space.AppendRecords.TTL months) if needed.