Skip to main content
GuideMultiple

REST API Authentication Example

Learn how to authenticate with the Convert Fleet REST API using API keys in cURL, Node.js, and Python. Includes best security practices.

LanguageMultiple
API ReferenceView Endpoint →

You need an API key to follow this guide. Get a free API key →

1Generate Your API Key

Go to your Convert Fleet dashboard and click "Generate API Key". Copy the key — it will only be shown once.

2Include the Key in Every Request

Add the Authorization header to every API request. All Convert Fleet API endpoints require this header.

bash
# cURL example
curl -X POST https://convertfleet.com/api/convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@input.pdf" \
  -F "to=docx" \
  -o output.docx

3Node.js Authentication

Pass the API key in the headers object when using axios.

javascript
const axios = require('axios');

const API_KEY = process.env.CONVERTFLEET_API_KEY; // Store in env vars, never hardcode

const response = await axios.post('https://convertfleet.com/api/convert', form, {
  headers: {
    ...form.getHeaders(),
    'Authorization': `Bearer ${API_KEY}`,  // Always use template literal
  },
});

4Python Authentication

Set the Authorization header in Python requests.

python
import requests
import os

API_KEY = os.environ.get("CONVERTFLEET_API_KEY")  # Load from environment

headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.post(
    "https://convertfleet.com/api/convert",
    files={"file": open("input.pdf", "rb")},
    data={"to": "docx"},
    headers=headers
)

5Security Best Practices

Never hardcode your API key in source code. Use environment variables, secrets managers, or CI/CD secret injection. Rotate your key immediately if it is exposed.

That's it!

You've successfully integrated the Convert Fleet API. Check the API reference for the full list of parameters and error codes.

Related API Endpoints

More Integration Guides

Start Building Today

Free tier includes 200 free credits (valid 30 days from signup). Pro plan unlocks unlimited API access.