Crego APIs
APIs DocHome Page
Web Apps
  • Jupiter
  • Venus
APIs DocHome Page
Web Apps
  • Jupiter
  • Venus
  1. Storage
  • Omni
  • Document APIs
  • Storage
    • Create Storage
      POST
    • Update Storage
      PATCH
    • List Storage
      GET
    • Get Storage
      GET
    • Test Credential
      GET
  • Category
    • Create Category
      POST
    • Update Category
      PATCH
    • List Category
      GET
    • Get Category
      GET
  • Document
    • Create Document
      POST
    • Update Document
      PATCH
    • List Document
      GET
    • Delete Document
      DELETE
    • Get Document
      GET
    • Upload Files
      POST
    • Downlaod Files
      GET
    • Delete File
      DELETE
    • Get all tags
      GET
    • Inactive
      PUT
    • Reject
      PUT
    • Approve
      PUT
  • Sharing
    • Share Document
      POST
    • Preview Shared Document
      GET
    • List Shared Documents
      GET
    • Get Shared Document
      GET
    • Update Shared Document
      PATCH
    • Delete Document Share
      DELETE
  1. Storage

Create Storage

Developing
preprod
https://preprod.api.crego.io
preprod
https://preprod.api.crego.io
POST
/storages/
Last modified:2025-05-23 07:00:42

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
name
string 
required
A user-defined name for the storage configuration.
<= 100 characters
provider
enum<string> 
required
Cloud storage provider.
Allowed values:
aws_s3gcp_storageazure_blob
bucket
string 
required
Name of the storage bucket.
Match pattern:
^[a-z0-9][a-z0-9\-]{1,61}[a-z0-9]$
config
object 
optional
Provider-specific configuration settings.
credentials
object 
required
Provider-specific credentials for authentication.
managed
boolean 
optional
Default:
false
Example
{
  "name": "KYC Document Storage",
  "provider": "aws_s3",
  "bucket": "kiii",
  "managed": true,
  "config": {
    "Tags": [
      {
        "Key": "Environment",
        "Value": "Testing"
      }
    ],
    "CORSConfiguration": {
      "CORSRules": [
        {
          "MaxAgeSeconds": 3000,
          "AllowedHeaders": [
            "*"
          ],
          "AllowedMethods": [
            "GET",
            "POST"
          ],
          "AllowedOrigins": [
            "*"
          ]
        }
      ]
    },
    "LoggingConfiguration": {
      "LogFilePrefix": "logs/",
      "DestinationBucketName": "my-logging-bucket"
    },
    "LifecycleConfiguration": {
      "Rules": [
        {
          "ID": "DeleteOldFiles",
          "Prefix": "old/",
          "Status": "Enabled",
          "Expiration": {
            "Days": 30
          }
        }
      ]
    },
    "ObjectLockConfiguration": {
      "ObjectLockEnabled": "Enabled"
    },
    "VersioningConfiguration": {
      "Status": "Enabled"
    },
    "PublicAccessBlockConfiguration": {
      "BlockPublicAcls": true,
      "IgnorePublicAcls": true,
      "BlockPublicPolicy": true,
      "RestrictPublicBuckets": true
    },
    "ServerSideEncryptionConfiguration": {
      "Rules": [
        {
          "ApplyServerSideEncryptionByDefault": {
            "SSEAlgorithm": "AES256"
          }
        }
      ]
    }
  },
  "credentials": {
    "region": "ap-south-1",
    "aws_access_key_id": "AKIAYGN6PTDNSD4ZWH6O",
    "aws_secret_access_key": "E5+TFG381uJ5NZL2+IoqXX6N7r47XndK6SKYDtj3"
  },
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://preprod.api.crego.io/storages/' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "KYC Document Storage",
  "provider": "aws_s3",
  "bucket": "kiii",
  "managed": true,
  "config": {
    "Tags": [
      {
        "Key": "Environment",
        "Value": "Testing"
      }
    ],
    "CORSConfiguration": {
      "CORSRules": [
        {
          "MaxAgeSeconds": 3000,
          "AllowedHeaders": [
            "*"
          ],
          "AllowedMethods": [
            "GET",
            "POST"
          ],
          "AllowedOrigins": [
            "*"
          ]
        }
      ]
    },
    "LoggingConfiguration": {
      "LogFilePrefix": "logs/",
      "DestinationBucketName": "my-logging-bucket"
    },
    "LifecycleConfiguration": {
      "Rules": [
        {
          "ID": "DeleteOldFiles",
          "Prefix": "old/",
          "Status": "Enabled",
          "Expiration": {
            "Days": 30
          }
        }
      ]
    },
    "ObjectLockConfiguration": {
      "ObjectLockEnabled": "Enabled"
    },
    "VersioningConfiguration": {
      "Status": "Enabled"
    },
    "PublicAccessBlockConfiguration": {
      "BlockPublicAcls": true,
      "IgnorePublicAcls": true,
      "BlockPublicPolicy": true,
      "RestrictPublicBuckets": true
    },
    "ServerSideEncryptionConfiguration": {
      "Rules": [
        {
          "ApplyServerSideEncryptionByDefault": {
            "SSEAlgorithm": "AES256"
          }
        }
      ]
    }
  },
  "credentials": {
    "region": "ap-south-1",
    "aws_access_key_id": "AKIAYGN6PTDNSD4ZWH6O",
    "aws_secret_access_key": "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"
  },
}'

Responses

🟢201Created
application/json
Body
Schema defining storage configurations for different cloud providers.
id
string 
optional
Unique identifier for the storage configuration.
Match pattern:
^[a-zA-Z0-9._-]{8,40}$
tenant_id
string 
optional
Identifier for the tenant.
Match pattern:
^[a-zA-Z0-9._-]{8,40}$
created_by
string <uuid>
optional
UUID of the user who created the storage configuration.
updated_by
string <uuid>
optional
UUID of the user who last updated the storage configuration.
created_at
string <date-time>
optional
Timestamp when the storage configuration was created.
Default:
1970-01-01T00:00:00Z
updated_at
string <date-time>
optional
Timestamp when the storage configuration was last updated.
Default:
1970-01-01T00:00:00Z
name
string 
required
A user-defined name for the storage configuration.
<= 100 characters
provider
enum<string> 
required
Cloud storage provider.
Allowed values:
aws_s3gcp_storageazure_blob
bucket
string 
required
Name of the storage bucket.
Match pattern:
^[a-z0-9][a-z0-9\-]{1,61}[a-z0-9]$
config
object 
optional
Provider-specific configuration settings.
credentials
object 
required
Provider-specific credentials for authentication.
managed
boolean 
optional
Default:
false
Example
{
    "id": "01JNK2H9PXMJP56WP082YCNNSP",
    "tenant_id": "60371b35-d8f5-4a7f-beee-97aada4bb8a8",
    "created_by": "9b46aea4-33c8-41ee-841f-97358ef0b10e",
    "updated_by": "9b46aea4-33c8-41ee-841f-97358ef0b10e",
    "created_at": "2025-03-05T17:24:55.077816Z",
    "updated_at": "2025-03-05T17:24:55.077839Z",
    "name": "Lori Batz",
    "provider": "aws_s3",
    "bucket": "ldkrk15bv65elx05l5e3hx-vb53ocz16nshf-d-rweb168p",
    "config": {
        "Tags": [
            {
                "Key": "Environment",
                "Value": "Testing"
            }
        ],
        "CORSConfiguration": {
            "CORSRules": [
                {
                    "MaxAgeSeconds": 3000,
                    "AllowedHeaders": [
                        "*"
                    ],
                    "AllowedMethods": [
                        "GET",
                        "POST"
                    ],
                    "AllowedOrigins": [
                        "*"
                    ]
                }
            ]
        },
        "LoggingConfiguration": {
            "LogFilePrefix": "logs/",
            "DestinationBucketName": "my-logging-bucket"
        },
        "LifecycleConfiguration": {
            "Rules": [
                {
                    "ID": "DeleteOldFiles",
                    "Prefix": "old/",
                    "Status": "Enabled",
                    "Expiration": {
                        "Days": 30
                    }
                }
            ]
        },
        "ObjectLockConfiguration": {
            "ObjectLockEnabled": "Enabled"
        },
        "VersioningConfiguration": {
            "Status": "Enabled"
        },
        "PublicAccessBlockConfiguration": {
            "BlockPublicAcls": true,
            "IgnorePublicAcls": true,
            "BlockPublicPolicy": true,
            "RestrictPublicBuckets": true
        },
        "ServerSideEncryptionConfiguration": {
            "Rules": [
                {
                    "ApplyServerSideEncryptionByDefault": {
                        "SSEAlgorithm": "AES256"
                    }
                }
            ]
        }
    },
    "credentials": {
        "region": "",
        "aws_access_key_id": "",
        "aws_secret_access_key": ""
    }
}
Next
Update Storage
Built with