Skip to main content

Overview

The Qovery API uses Bearer token authentication. You need an API token to make authenticated requests to the API.

Creating an API Token

Via Qovery Console

  1. Log in to the Qovery Console
  2. Navigate to Organization Settings
  3. Click on API token
  4. Click Add new
  5. Give your token a descriptive name
  6. Pick the role that sets its permissions
  7. Create it and save the token securely
API tokens are displayed only once. Store them securely - treat them like passwords.

Token permissions

A token has no scopes of its own: it gets the permissions of the role you pick when you create it, a default role or a custom role. For an agent that needs a narrower footprint than any role, use an API Policy Token, managed in Agents → Settings → Policy tokens.

Making Authenticated Requests

Include your API token in the Authorization header:

Authentication Methods

Using cURL

Using Python

Using JavaScript/TypeScript

Using Go

Using Official SDKs

Python SDK

JavaScript/TypeScript SDK

Environment Variables

Store your API token securely using environment variables:

Linux/macOS

Add to your .bashrc, .zshrc, or .env file:
Load environment variables:

Windows PowerShell

Docker

Pass as environment variable:

Kubernetes

Create a secret:
Use in deployment:

Authentication Errors

401 Unauthorized

Token is missing or invalid:
Solution: Verify your token is correct and included in the Authorization header.

403 Forbidden

Token doesn’t have required permissions:
Solution: Check token scopes and ensure you have the required permissions.

Token Security Best Practices

Always use environment variables or secrets management tools. Add .env files to .gitignore.
Create tokens with only the permissions needed for their specific use case.
Set expiration dates and rotate tokens periodically for security.
Regularly review API token activity in the Qovery Console.
Delete tokens that are no longer needed or potentially compromised.
Create different tokens for development, staging, and production.

Testing Authentication

Test your authentication setup:
Expected response:

Next Steps

API Examples

See practical examples of using the authenticated API