Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with API Authentication on Confluence Server

Yasmine EL ABBAR
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 23, 2025

Hello everyone,

I’m currently facing an issue while trying to interact with the Confluence Server API using a GET request.

I’ve found examples in the documentation that describe authentication for Confluence Cloud, where they use an API Token and Bearer authentication. However, I am working with a Confluence Server instance (self-hosted), and I haven't found any examples that directly apply to my case. Does the Basic Auth method (using my email and password) still work, or do I need to use a different kind of token?

I’ve already tried using API tokens in my GET requests, but I keep receiving 403 (Unauthorized) or 404 (Not Found) errors, indicating that the resource is not accessible.

Could someone clarify:

  1. The correct authentication method for Confluence Server (email/password vs token)?

  2. The difference in API URL structure between Cloud and Server instances?

  3. How to check if my user has the necessary permissions to access the API?

Thanks in advance for your help!

1 answer

1 vote
Pavel Junek
Community Champion
April 29, 2025

Hi @Yasmine EL ABBAR,

Welcome to Atlassian community!

When working with the Confluence Server API, there are some key differences and specific methods for authentication and accessing resources compared to Confluence Cloud. Here are the details to help you resolve your issues:

Correct Authentication Method for Confluence Server

For Confluence Server (self-hosted), the recommended authentication method is Basic Authentication using your email and password. Here’s how you can do it:

  1. Basic Authentication:

    • Use the Authorization HTTP header containing Basic username:password where username:password must be base64 encoded 

Example:

GET /rest/api/content HTTP/1.1

Host: your-confluence-server.com

Authorization: Basic base64encoded(username:password)

2. API Tokens:

  • Confluence Server does not support API tokens for authentication. API tokens are specific to Confluence Cloud 
  1. Difference in API URL Structure

    The URL structure for Confluence Server and Confluence Cloud APIs differs slightly:

    1. Confluence Cloud:

    2. Confluence Server:

    Checking User Permissions

    To ensure your user has the necessary permissions to access the API, you can follow these steps:

    1. Inspect Permissions:

      • Go to the Administration menu in Confluence, then navigate to General Configuration > Inspect permissions.
      • Enter the person's name or username and the spaces you want to view, then select Show 
    2. Using the REST API:

      • You can also use the REST API to check permissions. For example, to get space permissions:

GET /rest/api/space/{spaceKey}?expand=permissions
  • This will return the permissions for the specified space 

Summary

  • Authentication: Use Basic Authentication with your email and password for Confluence Server.
  • API URL Structure: Ensure you are using the correct base URL for your Confluence Server instance.
  • Permissions: Check permissions via the Confluence administration interface or use the REST API to verify access.

If you continue to face issues, ensure that your credentials are correct and that your user has the necessary permissions to access the resources you are trying to retrieve.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events