Skip to main content

Tenant scope

Every request is scoped to the tenant that owns the API key you use. Use this section to verify which tenant you’re authenticated as and to configure tenant-wide settings like webhooks and defaults.

Base URL

Use the correct base URL for your environment. Sandbox: https://sandbox.travelbase.ai

Authentication

Include your API key in the Authorization header.

Get tenant

GET /v1/tenant

Returns the tenant associated with the API key used in the request.

Example request

curl -X GET "https://sandbox.travelbase.ai/v1/tenant" \
  -H "Authorization: Bearer tb_live_xxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json"

Tenant Configuration

The Tenant object defines the organizational context for all resources in the Travelbase API. This section covers how to retrieve and update your tenant-wide settings.

The Tenant Object

Tenant Schema

The tenant object serves as the root configuration for your API integration, managing identity, defaults, and connectivity.

Fields

Identity

  • id (string) β€” immutable
  • name (string)
  • slug (string) β€” immutable

Environment & Status

  • environment (sandbox | live) β€” immutable
  • status (active | suspended | disabled)

Defaults

  • default_currency (ISO 4217)
  • timezone (IANA timezone)

Webhooks

  • webhook_url (string | null)
  • webhook_enabled (boolean)

Metadata

  • metadata (object) β€” arbitrary key/value pairs

Timestamps

  • created_at (ISO 8601)
  • updated_at (ISO 8601)

Update Tenant

What you can update

This endpoint is intended for tenant-wide configuration (e.g., webhooks and defaults). You cannot update immutable identity fields like id, slug, or environment.

PATCH /v1/tenant

Updates tenant configuration fields.

Updatable Fields

Webhook Settings

webhook_url, webhook_enabled

Defaults

default_currency, timezone

Example Request

curl -X PATCH "[https://api.travelbase.ai/v1/tenant](https://api.travelbase.ai/v1/tenant)" \
  -H "Authorization: Bearer tb_live_xxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "webhook_url": "[https://acme.com/webhooks/travelbase](https://acme.com/webhooks/travelbase)",
    "webhook_enabled": true,
    "default_currency": "USD",
    "timezone": "Asia/Qatar",
    "metadata": { "plan": "enterprise" }
  }'

Example Response

{
  "id": "ten_8f3a2c1b",
  "name": "Acme Travel",
  "slug": "acme-travel",
  "environment": "live",
  "status": "active",
  "default_currency": "USD",
  "timezone": "Asia/Qatar",
  "webhook_url": "[https://acme.com/webhooks/travelbase](https://acme.com/webhooks/travelbase)",
  "webhook_enabled": true,
  "created_at": "2026-02-23T12:00:00Z",
  "updated_at": "2026-02-23T12:05:21Z",
  "metadata": { "plan": "enterprise" }
}

401 Unauthorized

The API key is missing, invalid, expired, or has been rotated.

403 Forbidden

Your tenant is suspended or disabled.

422 Unprocessable Entity

One or more fields are invalid (for example, an invalid timezone).
Next Steps

API Keys

Learn how to create and rotate API keys.

Webhooks

Configure webhooks and verify signatures.