API Reference

Get Storage types

List Storage Types

Retrieves a list of storage types supported by Claid.

get

/v1-beta1/storage/storage-types

Authorizations
Responses
curl -L \
  --url '/v1-beta1/storage/storage-types'
{
  "data": [
    "web_folder",
    "s3",
    "gcs"
  ]
}

Request

GET /v1-beta1/storage/storage-types HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}

Response body

{
  "data": [
    "web_folder",
    "s3",
    "gcs"
  ]
}

Get Connected Storages

List Storages

Retrieves a list of storages connected to your Claid account, as well as their id, name, type, and parameters.

get

/v1-beta1/storage/storages

Authorizations
Responses
curl -L \
  --url '/v1-beta1/storage/storages'
{
  "data": [
    {
      "id": 1,
      "name": "text",
      "type": "web_folder",
      "created_at": "2025-02-21T18:25:19.804Z",
      "parameters": {
        "path": "",
        "bucket": "text"
      }
    }
  ]
}

Request

GET /v1-beta1/storage/storages HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}

Response body

{
  "data": [
    {
      "id": 1,
      "name": "s3-playground",
      "type": "s3",
      "parameters": {
        "path": "/input/",
        "bucket": "playground"
      },
      "created_at": "2022-01-10T18:27:16.362118+00:00"
    },
    {
      "id": 2,
      "name": "designer-uploads",
      "type": "gcs",
      "parameters": {
        "path": "",
        "bucket": "image-uploads"
      },
      "created_at": "2022-01-10T18:28:22.100041+00:00"
    }
  ]
}

Create a new Claid Storage

Create Storage

Connects storage to Claid. You can connect your AWS S3 or GCP bucket, or your own web folder.

post

/v1-beta1/storage/storages

Authorizations
Body
nameThe unique name of storagerequired

The name of storage in Claid. Note: it doesn't have to be the same as a global name of a bucket.

typeStorageTyperequired

An enumeration.

Options: web_folder, s3, gcs
parametersParametersrequired

Global parameters of storage (as opposed to Claid's internal properties, such as name and type)

Responses
curl -L \
  --request POST \
  --url '/v1-beta1/storage/storages' \
  --header 'Content-Type: application/json' \
  --data '{"name":"text","type":"web_folder","parameters":{"path":"","bucket":"text","credentials":{"access_key":"text","secret_access_key":"text"}}}'
{
  "data": {
    "id": 1,
    "name": "text",
    "type": "web_folder",
    "created_at": "2025-02-21T18:25:19.804Z",
    "parameters": {
      "path": "",
      "bucket": "text",
      "credentials": {
        "access_key": "text"
      }
    }
  }
}

Here is an example of creating AWS storage via API:

Request

POST /v1-beta1/storage/storages
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}
Content-Type: application/json

{
  "name": "s3-playground",
  "type": "s3",
  "parameters": {
    "bucket": "playground",
    "credentials": {
      "access_key": "AKIAXXXXXXX",
      "secret_access_key": "YourSecretAccessKey"
    }
  }
}

Response body

{
  "data": {
    "id": 1,
    "name": "s3-playground",
    "type": "s3",
    "parameters": {
      "path": "",
      "bucket": "playground"
    },
    "created_at": "2022-05-10T10:29:12.754824+00:00"
  }
}

parameters supported by the AWS S3 storage:

Parameter
Type

name

string

bucket

string

prefix

string

credentials.access_key

string

credentials.secret_access_key

string

parameters supported by the GCS storage: #todo

name

string

bucket

string

prefix

string

credentials.access_key

string

credentials.secret_access_key

string

parameters supported by the Web Folder storage:

name

string

base_url

string

Describe storage by id

Get Storage

Retrieves information about particular storage, including its id, name, type, and parameters.

get

/v1-beta1/storage/storages/{storage_id}

Authorizations
Path parameters
storage_idStorage Idrequired
Responses
curl -L \
  --url '/v1-beta1/storage/storages/{storage_id}'
{
  "data": {
    "id": 1,
    "name": "text",
    "type": "web_folder",
    "created_at": "2025-02-21T18:25:19.804Z",
    "parameters": {
      "path": "",
      "bucket": "text",
      "credentials": {
        "access_key": "text"
      }
    }
  }
}

Request

GET /v1-beta1/storage/storages/1 HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}

Response body

{
  "data": {
    "id": 1,
    "name": "s3-playground",
    "type": "s3",
    "parameters": {
      "path": "",
      "bucket": "playground"
    },
    "created_at": "2022-05-10T10:29:12.754824+00:00"
  }
}

Delete Storage

Disconnects storage from Claid. Note: It doesn't delete your bucket on your cloud platform.

delete

/v1-beta1/storage/storages/{storage_id}

Authorizations
Path parameters
storage_idStorage Idrequired
Responses
curl -L \
  --request DELETE \
  --url '/v1-beta1/storage/storages/{storage_id}'
{
  "data": null
}

Request

DELETE /v1-beta1/storage/storages/1 HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}

Patch Storage

Changes storage name, type, and/or parameters.

patch

/v1-beta1/storage/storages/{storage_id}

Authorizations
Path parameters
storage_idStorage Idrequired
Body
nameThe unique name of storage
typeStorageType

An enumeration.

Options: web_folder, s3, gcs
parametersParameters
Responses
curl -L \
  --request PATCH \
  --url '/v1-beta1/storage/storages/{storage_id}' \
  --header 'Content-Type: application/json' \
  --data '{"type":"web_folder","parameters":{"credentials":{}}}'
{
  "data": {
    "id": 1,
    "name": "text",
    "type": "web_folder",
    "created_at": "2025-02-21T18:25:19.804Z",
    "parameters": {
      "path": "",
      "bucket": "text",
      "credentials": {
        "access_key": "text"
      }
    }
  }
}

Request

PATCH /v1-beta1/storage/storages/1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}
Content-Type: application/json

{
  "name": "s3-playground",
  "type": "s3",
  "parameters": {
    "bucket": "playground",
    "credentials": {
      "access_key": "AKIAXXXXXXX",
      "secret_access_key": "YourSecretAccessKey"
    }
  }
}

Response body

{
  "data": {
    "id": 1,
    "name": "s3-playground",
    "type": "s3",
    "parameters": {
      "path": "",
      "bucket": "playground"
    },
    "created_at": "2022-05-10T10:29:12.754824+00:00"
  }
}

Last updated