Documentation Index

Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt

Use this file to discover all available pages before exploring further.

Image & Video APIs

Why do I get HTML responses instead of JSON from the Admin API?

Last updated: May-20-2026

The Admin API requires authentication using your API Key and API Secret. When authentication fails, you may receive unexpected responses that can be confusing to debug.

The problem

When your Admin API call returns HTML content instead of the expected JSON response, this typically indicates an authentication problem.

Expected JSON response:

HTML error response (authentication failure):

Common causes

Missing credentials

Your API Key and API Secret aren't included in the request, or are in the wrong format.

Incorrect - missing credentials:

Correct - credentials included:

Incorrect Base64 encoding

When manually creating Authorization headers, ensure proper Base64 encoding of api_key:api_secret.

Incorrect - wrong encoding:

Correct - proper Base64 encoding:

Wrong API Key or Secret

Double-check your credentials in the Console Settings.

The solution

Step 1: Verify your credentials

Ensure you're using the correct API Key and API Secret from the API Keys page of the Console Settings.

Step 2: Choose the correct authentication method

Method 1: URL authentication (recommended for cURL)

Include credentials directly in the URL:

Method 2: Authorization header

Encode your API key and API secret as a Base64 string in the format:

Then include the encoded value in the Authorization header using the Basic scheme:

Example

Using SDKs (recommended)

The easiest way to avoid authentication issues is to use one of Cloudinary's official SDKs, which handle authentication automatically:

Note
SDKs automatically handle the proper formatting and encoding of your credentials, eliminating most authentication issues.

Related topics

✔️ Feedback sent!

Rate this page:

one star two stars three stars four stars five stars