---
title: My API key does not work with Object Storage
description: Fix issues with non-functional API keys in Object Storage.
tags: api key bucket object storage aws cli
dates:
  validation: 2025-08-11
  posted: 2023-12-15
---
import Requirements from '@macros/iam/requirements.mdx'


<Requirements />

- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization

## Problem

When using third-party API or CLI tools, such as the [AWS CLI](/object-storage/api-cli/object-storage-aws-cli/), [MinIO Client](/object-storage/api-cli/installing-minio-client/), or [Rclone](/object-storage/api-cli/installing-rclone/) to manage your Object Storage resources, you may experience one of the following issues connecting to the Scaleway API or listing your resources:

- Listing your buckets with a third-party tool returns nothing, but you have at least one bucket created in the [Scaleway console](https://console.scaleway.com/object-storage/buckets).

- The tool returns `An error occurred (Forbidden) when calling the ListObjectsV2 operation: Forbidden` or a similar message.

- The tool returns a `403` error.

## Cause

The API key you used to configure the Amazon S3 third-party tool has a [preferred Project](/iam/concepts/#preferred-project) assigned.

If you try to perform Object Storage operations in a Project that is **NOT** the [preferred Project](/iam/concepts/#preferred-project) using a third-party tool, you will not be able to access your resources, resulting in an error message or an empty response.

## Solution

1. Make sure that you are using a valid [API key](https://console.scaleway.com/iam/api-keys).

2. Make sure that the bearer of the API key (IAM [user](/iam/concepts/#user) or [application](/iam/concepts/#application)) has the appropriate [IAM permissions](/iam/how-to/view-permission-sets/) to perform the desired actions.

3. Make sure that the API key's [preferred Project](/iam/concepts/#preferred-project) is the same as the one where you are performing actions. You can change the preferred project of your API key:
    - by editing it from the [Scaleway console](/iam/how-to/manage-api-keys/#how-to-edit-an-api-key)
    - by [overriding it while making an API call](/iam/api-cli/using-api-key-object-storage/#overriding-the-preferred-project-when-making-a-call)
4. Make sure that there is no [bucket policy](/object-storage/concepts/#bucket-policy) preventing the action. If there is one, [update the bucket policy](/object-storage/how-to/create-bucket-policy/) to allow the desired actions to the bearer of the API key.

You should now be able to list your buckets using a supported Amazon S3-compatible third-party tool.

## Going further

- Refer to the documentation on [using IAM API keys with Object Storage](/iam/api-cli/using-api-key-object-storage/) for more information.

- Refer to the documentation on [bucket policies](/object-storage/api-cli/bucket-policy/) for more information.

- If you did not manage to identify the error and solve it by yourself, [open a support ticket](/account/how-to/open-a-support-ticket/), and provide as many details as possible, along with the necessary information below:
    - Object Storage Endpoint (e.g. `s3.fr-par.scw.cloud`)
    - Bucket name
    - Object name (if the request concerns an object)
    - Request type (PUT, GET, etc.)
    - HTTP status code
    - Date and time (timestamp)
    - User-agent (SDK, client, console, etc.)
    - Transaction ID (if possible)
    - Log / trace of the error (if possible)