---
title: "Verify bucket connectivity"
method: POST
path: "/api/organizations/{organizationId}/buckets/verify"
tags: ["OrganizationData"]
---

# Verify bucket connectivity

`POST /api/organizations/{organizationId}/buckets/verify`

## Request

- Base URL: `https://studio.edgeimpulse.com/v1`
- URL: `https://studio.edgeimpulse.com/v1/api/organizations/{organizationId}/buckets/verify`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in cookie `jwt`
  - API key in header `x-jwt-token`
  - OAuth 2
    - Authorization code: `/v1/oauth/authorize`
    - Client credentials
    - Implicit: `/v1/oauth/authorize`
    - Password
    - Token URL: `/v1/oauth/token`
- TypeScript: <https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/docs/api/organizations/:organizationId/buckets/verify/post.ts> (a function with typed inputs; its response is checked against the schema)

Verify connectivity to a storage bucket and optionally list its contents. This endpoint allows you to:
1. Check if the provided bucket credentials are valid and the bucket is accessible.
2. Optionally list files in the bucket up to a specified limit.
3. Validate the bucket configuration before adding it to the organization.

The request can include details such as the bucket name, region, credentials, and listing options.
The response provides information about the bucket's accessibility and, if requested, a list of files in the bucket.

Important note on verification process:
- For S3-compatible storage backends: Verification is expected to be immediate.
- For Azure buckets: Verification takes longer. Users are required to poll this endpoint
until the connectionStatus changes from 'connecting' to 'connected'.

When dealing with Azure buckets, implement a polling mechanism to check the status
periodically until it's confirmed as connected.

## Path parameters

- `organizationId` integer, required

## Request body

- VerifyOrganizationBucketRequest
  - `storageProvider` 's3' | 'google' | 'azure' | 'other' | 'edgeimpulse' | 'huggingface'
  - `accessKey` string, required: Access key for the storage service: - For S3 and GCS: Use the access key. - For Azure: Use the Storage Account Name.
  - `secretKey` string: Secret key for the storage service: - For S3 and GCS: Use the secret key. - For Azure: Use the Storage Account Access Key. Note: You should either pass a `secretKey` value or a `bucketId` value.
  - `bucketId` integer: ID of an existing bucket. If provided, the credentials from this bucket will be used unless overridden by the `secretKey` property.
  - `bucket` string, required: Name of the storage bucket or container.
  - `endpoint` string, required: Endpoint URL for the storage service. For S3-compatible services, Azure, or custom endpoints.
  - `region` string: Optional region of the storage service (if applicable).
  - `prefix` string: Optional prefix within the bucket. Set this if you don't have access to the full bucket or want to limit the scope.

## Response `200`

OK

- VerifyOrganizationBucketResponse: Response object for verifying an organization's bucket connectivity. Workflow: 1. The client initiates verification by sending a GET request to /api/organizations/{organizationId}/buckets/verify with bucket and credential details. 2. The server responds with this VerifyOrganizationBucketResponse object. 3. The client checks the connectionStatus: - If "connected": Verification is complete. Other properties (files, hasInfoLabelsFile, signedUrl) are available. - If "connecting": Verification is in progress. The client should continue polling. Other properties are not yet available. - If "error": Verification failed. Check connectionError for details. Other properties are not available. 4. If connectionStatus is "connecting", the client should periodically poll the endpoint until the status changes to "connected" or "error".
  - `success` boolean, required: Whether the operation succeeded
  - `error` string: Optional error description (set if 'success' was false)
  - `connectionStatus` 'connected' | 'connecting' | 'error', required: Indicates the current state of the connectivity verification process. - "connected": Verification successful, other properties are available. - "connecting": Verification in progress, continue polling. - "error": Verification failed, check connectionError for details.
  - `connectionError` string, nullable: Provides additional details if connectionStatus is "error". Helps diagnose verification failures.
  - `connectionStatusSince` string, date-time, nullable: Timestamp of when the connectionStatus last changed.
  - `files` object[]: Random files from the bucket. Only available when connectionStatus is "connected".
    - `name` string, required: The name of the file.
    - `size` integer, required: The size of the file in bytes.
    - `folderName` string, required: The name of the folder containing the file.
  - `hasInfoLabelsFile` boolean: Indicates whether there are any info.labels files in this bucket. If so, those are used for category/labels. Only available when connectionStatus is "connected".
  - `signedUrl` string: A signed URL that allows you to PUT an item, to check whether CORS headers are set up correctly for this bucket. Only available when connectionStatus is "connected".
  - `endpoint` string: An alternative endpoint URL. Only returned and required for Azure storage accounts, where the endpoint must be reformatted. This field will be undefined for other storage providers.

---

[API](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api.md) - [All operations](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/llms.txt) - [OpenAPI document](https://skmtc.dev/edgeimpulse/apis/edge-impulse-api/revisions/e2a976d38427?raw)
