API Reference

Get Storage types

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

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

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

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"
  }
}

Request

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

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