Documentation
Bucket
Create Bucket

Create Bucket

POST /bucket

Create a new bucket.

Request

METHOD: POST

AUTHENTICATION: required

URL: https://api.jsonstorage.online/v1/bucket

BODY:

Content-Type: application/json

  • title: string (required) - The title of the bucket.
  • documents_validation_schema: object (optional) - A schema for validation purposes that applies to all documents that have bucket_id set to this bucket. Learn More
  • documents_visibility: enum (private | public) (optional, defaults to private) - Visibility that applies to all documents that have bucket_id set to this bucket.
⚠️

Values defined for documents_validation_schema and documents_visibility will override any corresponding values set at the document level for validation_schema and visibility, respectively. This means that when creating or updating documents, if these global settings are provided, they will take precedence over any individual settings specified for each document.

Example Request
  curl -X POST \
    -H "Content-Type: application/json" \
    -H "X-secret-key: YOUR_SECRET_KEY_HERE" \
    -d '{"title":"New Bucket"}' \
    https://api.jsonstorage.online/v1/bucket

Response

  • Status: 201 Created
  • Body: JSON object containing the created bucket.
Example Response
{
  "id": "862976a2-0d02-4973-9cee-5d8841b42857",
  "title": "New Bucket",
  "documents_validation_schema": null,
  "documents_visibility": "private",
  "created_at": "2024-04-03T12:00:00Z"
}