API Reference
Get Storage types
Request
GET /v1-beta1/storage/storage-types HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}
curl -X GET --location "https://api.claid.ai/v1-beta1/storage/storage-types" --http1.1 \
-H "Host: api.claid.ai" \
-H "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}
curl -X GET --location "https://api.claid.ai/v1-beta1/storage/storages" --http1.1 \
-H "Host: api.claid.ai" \
-H "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"
}
}
}
curl -X POST --location "https://api.claid.ai/v1-beta1/storage/storages" \
-H "Host: api.claid.ai" \
-H "Authorization: Bearer {YOUR_API_KEY}" \
-H "Content-Type: application/json" \
-d "{
\"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:
parameters
supported by the GCS storage: #todo
parameters
supported by the Web Folder storage:
Describe storage by id
Request
GET /v1-beta1/storage/storages/1 HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}
curl -X GET --location "https://api.claid.ai/v1-beta1/storage/storages/1" --http1.1 \
-H "Host: api.claid.ai" \
-H "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}
curl -X DELETE --location "https://api.claid.ai/v1-beta1/storage/storages/1" --http1.1 \
-H "Host: api.claid.ai" \
-H "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"
}
}
}
curl -X PATCH --location "https://api.claid.ai/v1-beta1/storage/storages/1" \
-H "Host: api.claid.ai" \
-H "Authorization: Bearer {YOUR_API_KEY}" \
-H "Content-Type: application/json" \
-d "{
\"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