API Keys
Logfire provides public APIs that allow you to programmatically manage your organizations, projects, and other resources. To access these APIs, you’ll need to create an API key.
Complete API reference (Swagger docs):
- US Region: https://api-us.pydantic.dev/api/docs
- EU Region: https://api-eu.pydantic.dev/api/docs
Choose the endpoint that matches your account’s data region.
Navigate to your organization, then Settings → API Keys → New API Key.
Organization API keys can be scoped to all projects or a specific project. See API Key Scopes for available permissions.
Navigate to your project, then Settings → API Keys → New API Key.
Project API keys are limited to the project where they were created.
When creating an API key, set the scope to define which actions the key can perform. Available scopes depend on whether you’re creating an organization or project API key:
| Scope | Organization API Key | Project API Key |
|---|---|---|
| Organization management | ✓ | — |
| Notification channels | ✓ | — |
| Audit logs | ✓ | — |
| SCIM provisioning | ✓ | — |
| Billing usage | ✓ | — |
| Project settings | ✓ | ✓ |
| Write tokens management | ✓ | ✓ |
| Read tokens management | ✓ | ✓ |
| Alerts management | ✓ | ✓ |
| Dashboards management | ✓ | ✓ |
| Variables management | ✓ | ✓ |
Once you have an API key, you can use it to authenticate requests to the Logfire public APIs.
Include the API key in the Authorization header as a Bearer token.
Here’s an example using curl to list all projects in your organization:
curl -X GET "https://api-us.pydantic.dev/api/v1/projects/" \
-H "Authorization: Bearer YOUR_API_KEY"
curl -X GET "https://api-eu.pydantic.dev/api/v1/projects/" \
-H "Authorization: Bearer YOUR_API_KEY"
Replace YOUR_API_KEY with your actual API key.
A successful request will return a JSON response with your projects:
[
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"project_name": "my-project",
"created_at": "2024-05-24T11:18:22.704455Z",
"description": null,
"organization_name": "my-organization",
"visibility": "public"
}
]