UTA DevHub

API Headers

Overview of API header customization patterns and implementation guides

API Headers

Overview

API headers provide essential context to backend services, enabling critical functionality including multi-tenancy, device identification, session tracking, and user preference customization. Our header architecture provides a consistent, extensible pattern for implementing and managing headers across your application.

This section includes our core architecture document along with specific implementation guides for common header types.

Header Architecture

Our header implementation uses a modular provider pattern that integrates with Zustand for state management and our API client architecture for request handling.

The header provider pattern creates a clear separation of concerns: state management is handled by Zustand stores, while the logic for transforming state into headers lives in providers.

Key Principles

  • Modularity: Each header category is implemented as a separate provider
  • Priority-Based Resolution: Conflicting headers are resolved based on provider priority
  • State Integration: Zustand stores provide the state that powers dynamic headers
  • Testability: Each header provider can be tested independently
  • Extensibility: New header types can be added without modifying existing code

Implementation Guides

Header Types Overview

Identity Headers provide organizational context for multi-tenant applications.

  • X-ORG-ID: Organization identifier
  • X-PROJECT-ID: Project identifier within an organization
  • X-TENANT-ID: Generic tenant identifier

These headers enable proper data segmentation and access control in multi-tenant environments.

On this page