Skip to main content
PARIXDocs
Connecting

Gateway

Integrate with the Parix TigerBeetle operations API, including authentication, responses, limits, and retry behavior.

The Parix gateway is the public data boundary for every database plan. Applications send HTTPS requests to Parix; they never connect directly to TigerBeetle replicas, provider hosts, tunnels, or private gateway routes.

Prerequisites

Before integrating, obtain:

  • a Ready database and its immutable database ID
  • an active API key that can reach the database
  • db:read for read operations and db:write for write operations
  • the production API origin, https://parix.io

For a first request, complete Connect to a database.

Endpoint

All supported TigerBeetle operations use one public route:

POST /api/v1/databases/{databaseId}/tb/{operation}

Authenticate with an API key in x-api-key:

curl --request POST \
  "https://parix.io/api/v1/databases/$PARIX_DATABASE_ID/tb/lookup_accounts" \
  --header "content-type: application/json" \
  --header "x-api-key: $PARIX_API_KEY" \
  --data '["1"]'

Bearer authentication is also accepted:

Authorization: Bearer px_...

Use one authentication form per request. Prefer x-api-key in direct HTTP integrations because it makes the credential type explicit.

Supported operations

OperationRequired scopeRequest purpose
create_accountsdb:writeCreate a batch of accounts.
create_transfersdb:writeCreate a batch of transfers.
lookup_accountsdb:readLook up accounts by ID.
lookup_transfersdb:readLook up transfers by ID.
get_account_balancesdb:readRetrieve balance history for one account filter.
get_account_transfersdb:readRetrieve transfers for one account filter.
query_accountsdb:readSearch accounts using a query filter.
query_transfersdb:readSearch transfers using a query filter.

Request bodies follow TigerBeetle field, flag, and integer rules, represented as JSON. Use TigerBeetle operations for operation examples and the generated API reference for the current schemas.

Implement a request

  1. Keep the API origin, database ID, and secret in environment-specific configuration.
  2. Select an operation and validate the request body before sending it.
  3. Send the request to the database-ID route with content-type: application/json and one authentication header.
  4. Require HTTP 200 before parsing the successful response envelope.
  5. Confirm that databaseId and operation match the request.
  6. Read the TigerBeetle operation result from responsePayload.
  7. For a write, accept the operation as committed only when persisted is true.

Do not derive an endpoint from provider, targetHost, or any address visible in diagnostics. Those values describe gateway routing and are not stable customer connection targets.

Response contract

A successful response includes:

FieldMeaning
databaseId, databaseNameThe resolved Parix database.
clusterIdThe managed TigerBeetle cluster identifier.
operation, operationLabelThe operation that was executed.
requestPayloadThe validated request payload.
responsePayloadThe TigerBeetle result to consume.
modeThe gateway execution mode reported for diagnostics.
persistedWhether the result represents a persisted operation.
provider, replicaCount, targetHostRouting diagnostics; do not use them as connection configuration.
docsUrl, messageOperation guidance returned by the gateway.

The gateway can report stub or live mode. Do not equate HTTP 200 with a committed write: a stub or any other response with persisted: false is non-persistent and must not be recorded as a successful ledger mutation.

Limits and batching

  • Array-based create and lookup payloads accept at most 8,190 items at the schema boundary.
  • Plan entitlements can impose a lower events-per-request limit, request rate, or concurrency limit. Developer shared databases use shared-plan limits.
  • Split work into bounded batches below the effective plan limit and avoid synchronized retry bursts.
  • Keep TigerBeetle IDs stable across a write retry. Generating new IDs can turn a retry into a second logical operation.

Review the active values in Plans and limits rather than hard-coding a catalog limit into your application.

Errors and retries

StatusMeaningClient action
400Invalid operation payload.Correct the payload; do not retry unchanged.
401Missing, malformed, disabled, or unknown credential.Replace or reactivate the credential.
403The key lacks database reach or the required read/write scope.Correct the key scope or requested database.
404The route or database cannot be resolved for the credential context.Verify the database ID, organization, and public path.
409A TigerBeetle batch write returned conflicting item results.Inspect tbResults, which contains index and numeric result entries. Reconcile the batch before retrying.
429A request, event, or concurrency quota was exceeded.Reduce load and retry with bounded exponential backoff and jitter.
503The target is temporarily unavailable.Retry reads with backoff. For writes, preserve the same IDs and first determine whether the previous attempt persisted.
500The gateway could not complete the operation.Capture the response and request context, then retry only when the operation is safe to repeat.

Never retry an invalid payload or authorization failure in a tight loop. Do not log API-key secrets or complete request payloads that contain sensitive ledger data.

Security boundary

Public clients must use the documented /api/v1 route. Private health, ping, tenant-resolution, signed provider, and replica-management routes are operator infrastructure and are not supported customer interfaces. A Dedicated or Production database provides isolation and additional operational surfaces; it does not create a direct TigerBeetle protocol path.

Troubleshooting

Use API keys and authentication for credential and database-scope failures. Use Observability, backups, and CDC to understand which diagnostics are available on shared and dedicated plans.

Next steps