Verify bucket connectivity

Verify bucket connectivity

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.

post

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

Authorizations
Path parameters
organizationIdintegerrequired

Organization ID

Body
storageProviderstring · enum

The type of storage backend to use. Supported options are:

  • 's3': Amazon S3
  • 'google': Google Cloud Storage
  • 'azure': Azure Blob Storage
  • 'other': Other S3-compatible storage If not specified, defaults to 's3'
Options: s3, google, azure, other
accessKeystringrequired

Access key for the storage service:

  • For S3 and GCS: Use the access key.
  • For Azure: Use the Storage Account Name.
secretKeystring

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.
bucketIdinteger

ID of an existing bucket. If provided, the credentials from this bucket will be used unless overridden by the secretKey property.

bucketstringrequired

Name of the storage bucket or container.

endpointstringrequired

Endpoint URL for the storage service. For S3-compatible services, Azure, or custom endpoints.

regionstring

Optional region of the storage service (if applicable).

prefixstring

Optional prefix within the bucket. Set this if you don't have access to the full bucket or want to limit the scope.

Responses
curl -L \
  --request POST \
  --url 'https://studio.edgeimpulse.com/v1/api/organizations/{organizationId}/buckets/verify' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"storageProvider":"s3","accessKey":"text","bucket":"text","endpoint":"text"}'
{
  "success": true,
  "error": "text",
  "connectionError": "text",
  "connectionStatusSince": "2025-02-21T18:11:52.031Z",
  "hasInfoLabelsFile": true,
  "signedUrl": "text",
  "endpoint": "text",
  "connectionStatus": "connected",
  "files": [
    {
      "name": "text",
      "size": 1,
      "folderName": "text"
    }
  ]
}

Last updated

Was this helpful?