API reference
Unless you use a programming language that is not officially supported by Tggl, we recommend using one of our SDKs to interact with the API. They are all open-source and should help you get started quickly.
The Tggl API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
You can query the API from the user's browser (CORS is enabled), mobile device, or from your servers.
OpenAPI specification
The documentation you are reading is the official in-depth documentation. We also provide an OpenAPI specification if you need to generate code. You can find the latest version of the specification at the following URL:
Authentication
All API calls must be authenticated with your API key in the X-Tggl-API-Key
header. You will find your API key in the
Tggl dashboard.
Client vs. Server key
Each project has its own set of client and server key which allows you to perform different actions:
Client key | Server key | |
---|---|---|
Evaluate flags via API | ✅ | ✅ |
Fetch flags configuration and evaluate flags locally | ❌ | ✅ |
Introspection | ❌ | ✅ |
Never publish the server key to your client apps, or you risk exposing sensitive information. Client applications do not need to evaluate flags locally since Tggl is already optimised to perform a single API call when the app starts.