{"openapi":"3.1.0","info":{"title":"Storage APIs","summary":"Cloudinary-shaped API keys and signed uploads on top of Cloudflare R2.","description":"\nA minimal, Cloudinary-shaped storage API backed by Cloudflare R2.\n\n* `api_key` / `api_secret` pairs, scoped to a *cloud*.\n* Signed uploads (`timestamp` + HMAC-SHA256 `signature`) so browsers never\n  hold a secret.\n* Presigned PUT URLs for direct-to-R2 transfers.\n* Folders, tags, listing, and public delivery URLs.\n\n## Using the Cloudinary SDK\n\nAny official Cloudinary SDK works here unmodified. Set `upload_prefix` to this\nhost, use your key pair, and the cloud name from `GET /v1/me`:\n\n```js\ncloudinary.config({\n  cloud_name: \"buildberg\",\n  api_key: STORAGE_KEY,\n  api_secret: STORAGE_SECRET,\n  upload_prefix: \"https://storage.buildberg.co\",\n});\nawait cloudinary.uploader.upload(\"./logo.png\", { public_id: \"acme-corp/logo\" });\n```\n\nThe SDK signs with SHA-1 and posts to `/v1_1/{cloud}/{resource_type}/upload`;\nboth are accepted, and responses carry `secure_url`, `format`, `width`,\n`height`, `version` and the rest of what it reads. Errors carry\n`error.message`. Delivery URLs in Cloudinary's shape\n(`/{cloud}/image/upload/w_400,c_fill/v123/{public_id}.png`) resolve as well.\n\n## Authenticating\n\nManagement and read endpoints take **HTTP Basic**, `api_key` as the username\nand `api_secret` as the password:\n\n```bash\ncurl -u \"$API_KEY:$API_SECRET\" https://storage.buildberg.co/v1/demo/assets\n```\n\nNot sure your credentials work, or which cloud they belong to? `GET /v1/me`\nanswers both, needs no scope, and reports the server clock:\n\n```bash\ncurl -u \"$API_KEY:$API_SECRET\" https://storage.buildberg.co/v1/me\n```\n\nUpload endpoints take **signed parameters** instead, so an untrusted client can\npost a file directly without ever holding the secret. Sign on your backend:\n\n```python\nimport hashlib, hmac, time\n\nUNSIGNED = {\"file\", \"api_key\", \"signature\", \"resource_type\"}\n\ndef canonical(params: dict) -> str:\n    parts = []\n    for key in sorted(params):\n        if key in UNSIGNED:\n            continue\n        value = params[key]\n        if value is None:\n            continue\n        if isinstance(value, bool):\n            value = \"true\" if value else \"false\"\n        elif isinstance(value, (list, tuple)):\n            value = \",\".join(str(v) for v in value)\n        else:\n            value = str(value)\n        if value == \"\":\n            continue\n        parts.append(f\"{key}={value}\")\n    return \"&\".join(parts)\n\ndef sign(params: dict, api_secret: str) -> dict:\n    params = {**params, \"timestamp\": int(time.time())}\n    signature = hmac.new(\n        api_secret.encode(), canonical(params).encode(), hashlib.sha256\n    ).hexdigest()\n    return {**params, \"signature\": signature}\n```\n\nThree signatures over that payload are accepted: `HMAC-SHA256(secret, payload)`\n(the snippet above), `SHA-1(payload + secret)` (Cloudinary's default and every\nCloudinary SDK), and `SHA-256(payload + secret)`. A mismatch therefore means\nthe string differs or the secret is wrong, never the choice of hash.\n\nThe three rules that are easy to get wrong, and that every `Signature mismatch`\ntraces back to: booleans render lowercase (`true`, not `True`), lists join with\ncommas (`a,b`, not a language's list repr), and empty or null values are\ndropped entirely rather than signed as blanks.\n\n`timestamp` must be within one hour of the server clock. When a signature is\nrejected the error echoes the exact string the server hashed, so diff it\nagainst yours.\n\n## Delivery and transformations\n\n`GET /{cloud}/{public_id}` needs no credentials and redirects to the object.\nAdd `?download=true` to force a download with the original filename.\n\nImages transform through query parameters, cached in R2 after the first hit:\n\n```\n/{cloud}/{public_id}?w=400&h=300&c=fill&f=auto&q=80\n/{cloud}/{public_id}?t=w_400,h_300,c_fill      # Cloudinary-style shorthand\n```\n\n`c` is `fit` (default, preserves aspect), `fill` (crop to cover), `pad`, or\n`scale`. `f=auto` negotiates AVIF or WebP from the request's Accept header.\n\n## Retention\n\nFolders drive retention and it is **off by default**. Set a folder's\n`idle_expiry_days` and its assets are soft-deleted once they go that long\nwithout being fetched — delivery stops but the bytes are recoverable via\n`POST /v1/{cloud}/assets/{public_id}/restore`. After the folder's\n`purge_after_days` they are deleted from R2 for good. Serving an asset resets\nthe clock, so anything still in use is never collected. Individual assets can\nalso carry an explicit `expires_at`.\n","version":"0.1.0"},"servers":[{"url":"https://storage.buildberg.co","description":"Production"},{"url":"http://localhost:8000","description":"Local development"}],"paths":{"/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/v1/me":{"get":{"tags":["meta"],"summary":"Verify credentials","description":"Confirm a key pair works and report the cloud, scopes and server clock.\n\nDeliberately requires no scope, so even the narrowest upload-only key can\ncheck itself.","operationId":"whoami_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Identity"}}}}}}},"/v1_1/{cloud_name}/{resource_type}/upload":{"post":{"tags":["cloudinary"],"summary":"Cloudinary Upload API: upload","description":"`POST /v1_1/{cloud}/{resource_type}/upload`, exactly as the SDKs call it.\n\nSame multipart body as `/v1/{cloud}/upload`. `resource_type` in the path is\naccepted for compatibility and otherwise ignored: the stored type is\nderived from the file itself, and the response reports that.","operationId":"cloudinary_upload_v1_1__cloud_name___resource_type__upload_post","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"resource_type","in":"path","required":true,"schema":{"type":"string","description":"image, video, raw, or auto","title":"Resource Type"},"description":"image, video, raw, or auto"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1_1/{cloud_name}/{resource_type}/destroy":{"post":{"tags":["cloudinary"],"summary":"Cloudinary Upload API: destroy","description":"Signed delete. Answers `{\"result\": \"ok\"}` or `{\"result\": \"not found\"}`.\n\nCloudinary's destroy is permanent, so this one is too - it skips the\nsoft-delete grace period the native `DELETE /v1/{cloud}/assets/...` gives.","operationId":"cloudinary_destroy_v1_1__cloud_name___resource_type__destroy_post","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"resource_type","in":"path","required":true,"schema":{"type":"string","title":"Resource Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloudinary Destroy V1 1  Cloud Name   Resource Type  Destroy Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1_1/{cloud_name}/resources/{resource_type}":{"get":{"tags":["cloudinary"],"summary":"Cloudinary Admin API: list resources","description":"`GET /v1_1/{cloud}/resources/{resource_type}[/upload]?prefix=&max_results=`.","operationId":"cloudinary_resources_v1_1__cloud_name__resources__resource_type__get","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"resource_type","in":"path","required":true,"schema":{"type":"string","title":"Resource Type"}},{"name":"prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix"}},{"name":"max_results","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":10,"title":"Max Results"}},{"name":"next_cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloudinary Resources V1 1  Cloud Name  Resources  Resource Type  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1_1/{cloud_name}/resources/{resource_type}/upload/{public_id}":{"get":{"tags":["cloudinary"],"summary":"Cloudinary Admin API: one resource","operationId":"cloudinary_resource_v1_1__cloud_name__resources__resource_type__upload__public_id__get","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"resource_type","in":"path","required":true,"schema":{"type":"string","title":"Resource Type"}},{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloudinary Resource V1 1  Cloud Name  Resources  Resource Type  Upload  Public Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1_1/{cloud_name}/ping":{"get":{"tags":["cloudinary"],"summary":"Cloudinary Admin API: ping","operationId":"cloudinary_ping_v1_1__cloud_name__ping_get","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Cloudinary Ping V1 1  Cloud Name  Ping Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{cloud_name}/folders":{"post":{"tags":["folders"],"summary":"Create Folder","operationId":"create_folder_v1__cloud_name__folders_post","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["folders"],"summary":"List Folders","operationId":"list_folders_v1__cloud_name__folders_get","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"client","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by client label","title":"Client"},"description":"Filter by client label"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{cloud_name}/folders/{path}":{"get":{"tags":["folders"],"summary":"Get Folder","operationId":"get_folder_v1__cloud_name__folders__path__get","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["folders"],"summary":"Update Folder","operationId":"update_folder_v1__cloud_name__folders__path__patch","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["folders"],"summary":"Delete Folder","description":"Only ever removes empty folders — assets must be deleted explicitly.","operationId":"delete_folder_v1__cloud_name__folders__path__delete","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Folder V1  Cloud Name  Folders  Path  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{cloud_name}/upload":{"post":{"tags":["upload"],"summary":"Upload","description":"Multipart upload proxied through this service.\n\nForm fields: ``file``, ``api_key``, ``timestamp``, ``signature`` and any of\n``public_id``, ``folder``, ``tags``, ``overwrite``.","operationId":"upload_v1__cloud_name__upload_post","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{cloud_name}/upload/presign":{"post":{"tags":["upload"],"summary":"Presign","description":"Hand back a presigned PUT so the client uploads straight to R2.\n\nThe asset row is created up front with ``uploaded=false``; call\n``/upload/confirm`` once the PUT succeeds to fill in size and ETag.","operationId":"presign_v1__cloud_name__upload_presign_post","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{cloud_name}/upload/confirm":{"post":{"tags":["upload"],"summary":"Confirm","description":"Verify the object really landed in R2 and finalize its metadata.","operationId":"confirm_v1__cloud_name__upload_confirm_post","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{cloud_name}/upload/test":{"post":{"tags":["upload"],"summary":"Dry-run a signed upload","description":"Validate a signed upload request without storing anything.\n\nSend exactly what you would send to `/upload` (multipart) or\n`/upload/presign` (JSON). The response lists every check with its verdict,\nechoes the canonical payload the server signed, and reports the clock\ndrift - the three things a failing integration needs to see at once.","operationId":"upload_test_v1__cloud_name__upload_test_post","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadTestResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{cloud_name}/assets":{"get":{"tags":["assets"],"summary":"List Assets","operationId":"list_assets_v1__cloud_name__assets_get","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"folder","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact folder match","title":"Folder"},"description":"Exact folder match"},{"name":"prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"public_id starts with","title":"Prefix"},"description":"public_id starts with"},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Assets carrying this tag","title":"Tag"},"description":"Assets carrying this tag"},{"name":"cursor","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Row id to resume after","default":0,"title":"Cursor"},"description":"Row id to resume after"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include soft-deleted assets awaiting purge","default":false,"title":"Include Deleted"},"description":"Include soft-deleted assets awaiting purge"},{"name":"only_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Only soft-deleted assets","default":false,"title":"Only Deleted"},"description":"Only soft-deleted assets"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{cloud_name}/assets/{public_id}":{"get":{"tags":["assets"],"summary":"Get Asset","operationId":"get_asset_v1__cloud_name__assets__public_id__get","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["assets"],"summary":"Update Asset","description":"Set a per-asset expiry date, or retag. Expiry is unset by default.","operationId":"update_asset_v1__cloud_name__assets__public_id__patch","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["assets"],"summary":"Delete Asset","description":"Soft-deletes by default: delivery stops, but the bytes stay recoverable.\n\nThe retention sweep purges soft-deleted assets once the folder's grace\nperiod lapses. Pass `permanent=true` to skip straight to a hard delete.","operationId":"delete_asset_v1__cloud_name__assets__public_id__delete","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"permanent","in":"query","required":false,"schema":{"type":"boolean","description":"Skip soft delete and remove the object immediately","default":false,"title":"Permanent"},"description":"Skip soft delete and remove the object immediately"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{cloud_name}/assets/{public_id}/restore":{"post":{"tags":["assets"],"summary":"Restore Asset","description":"Undo a soft delete. Only possible before the purge grace period lapses.","operationId":"restore_asset_v1__cloud_name__assets__public_id__restore_post","parameters":[{"name":"cloud_name","in":"path","required":true,"schema":{"type":"string","title":"Cloud Name"}},{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApiKeyCreate":{"properties":{"cloud_name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_-]*$","title":"Cloud Name"},"name":{"type":"string","maxLength":128,"title":"Name","default":""},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"}},"type":"object","required":["cloud_name"],"title":"ApiKeyCreate"},"ApiKeyCreated":{"properties":{"api_key":{"type":"string","title":"Api Key"},"cloud_name":{"type":"string","title":"Cloud Name"},"name":{"type":"string","title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"revoked":{"type":"boolean","title":"Revoked"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"api_secret":{"type":"string","title":"Api Secret"}},"type":"object","required":["api_key","cloud_name","name","scopes","revoked","created_at","last_used_at","api_secret"],"title":"ApiKeyCreated","description":"Returned once, at creation. The secret is never retrievable again."},"ApiKeyOut":{"properties":{"api_key":{"type":"string","title":"Api Key"},"cloud_name":{"type":"string","title":"Cloud Name"},"name":{"type":"string","title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"revoked":{"type":"boolean","title":"Revoked"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["api_key","cloud_name","name","scopes","revoked","created_at","last_used_at"],"title":"ApiKeyOut"},"AssetList":{"properties":{"assets":{"items":{"$ref":"#/components/schemas/AssetOut"},"type":"array","title":"Assets"},"next_cursor":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["assets"],"title":"AssetList"},"AssetOut":{"properties":{"public_id":{"type":"string","title":"Public Id"},"asset_id":{"type":"string","title":"Asset Id"},"cloud_name":{"type":"string","title":"Cloud Name"},"folder":{"type":"string","title":"Folder"},"bytes":{"type":"integer","title":"Bytes"},"content_type":{"type":"string","title":"Content Type"},"resource_type":{"type":"string","title":"Resource Type"},"type":{"type":"string","title":"Type","default":"upload"},"format":{"type":"string","title":"Format"},"version":{"type":"integer","title":"Version"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height"},"etag":{"type":"string","title":"Etag"},"original_filename":{"type":"string","title":"Original Filename"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"uploaded":{"type":"boolean","title":"Uploaded"},"url":{"type":"string","title":"Url"},"secure_url":{"type":"string","title":"Secure Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"last_accessed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Accessed At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At"},"deleted_reason":{"type":"string","title":"Deleted Reason","default":""}},"type":"object","required":["public_id","asset_id","cloud_name","folder","bytes","content_type","resource_type","format","version","etag","original_filename","tags","uploaded","url","secure_url","created_at","updated_at"],"title":"AssetOut","description":"One asset, carrying both our fields and the ones a Cloudinary client reads.\n\n`url` / `secure_url`, `resource_type`, `type`, `format`, `version`,\n`width` / `height` and `asset_id` are what the Cloudinary SDKs pull out\nof an upload response, so they are present on every asset everywhere."},"AssetUpdate":{"properties":{"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"clear_expires_at":{"type":"boolean","title":"Clear Expires At","default":false},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","title":"AssetUpdate","description":"Per-asset overrides. `expires_at` defaults to none, as folders drive retention."},"DeleteResponse":{"properties":{"public_id":{"type":"string","title":"Public Id"},"deleted":{"type":"boolean","title":"Deleted"},"soft":{"type":"boolean","title":"Soft","default":false}},"type":"object","required":["public_id","deleted"],"title":"DeleteResponse"},"FolderCreate":{"properties":{"path":{"type":"string","maxLength":512,"minLength":1,"title":"Path"},"client":{"type":"string","maxLength":255,"title":"Client","default":""},"description":{"type":"string","title":"Description","default":""},"idle_expiry_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Idle Expiry Days"},"purge_after_days":{"type":"integer","maximum":3650.0,"minimum":1.0,"title":"Purge After Days","default":30}},"type":"object","required":["path"],"title":"FolderCreate"},"FolderList":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/FolderOut"},"type":"array","title":"Folders"}},"type":"object","required":["folders"],"title":"FolderList"},"FolderOut":{"properties":{"path":{"type":"string","title":"Path"},"cloud_name":{"type":"string","title":"Cloud Name"},"client":{"type":"string","title":"Client"},"description":{"type":"string","title":"Description"},"idle_expiry_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Idle Expiry Days"},"purge_after_days":{"type":"integer","title":"Purge After Days"},"asset_count":{"type":"integer","title":"Asset Count","default":0},"deleted_count":{"type":"integer","title":"Deleted Count","default":0},"total_bytes":{"type":"integer","title":"Total Bytes","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["path","cloud_name","client","description","idle_expiry_days","purge_after_days","created_at","updated_at"],"title":"FolderOut"},"FolderUpdate":{"properties":{"client":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Client"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"idle_expiry_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Idle Expiry Days"},"purge_after_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Purge After Days"},"clear_idle_expiry":{"type":"boolean","title":"Clear Idle Expiry","default":false}},"type":"object","title":"FolderUpdate"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Identity":{"properties":{"api_key":{"type":"string","title":"Api Key","description":"Masked - enough to identify the key, not to use it"},"cloud_name":{"type":"string","title":"Cloud Name","description":"Put this in the path of every other call"},"name":{"type":"string","title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"revoked":{"type":"boolean","title":"Revoked"},"server_time":{"type":"integer","title":"Server Time","description":"Unix seconds. Compare with your own clock before signing uploads."},"signature_ttl_seconds":{"type":"integer","title":"Signature Ttl Seconds","description":"How far a signed request's timestamp may drift from server_time"},"max_upload_bytes":{"type":"integer","title":"Max Upload Bytes"},"require_folder":{"type":"boolean","title":"Require Folder","description":"When true, a public_id must sit inside a folder created beforehand"}},"type":"object","required":["api_key","cloud_name","name","scopes","revoked","server_time","signature_ttl_seconds","max_upload_bytes","require_folder"],"title":"Identity","description":"What `GET /v1/me` answers: who you are and what the server expects."},"PresignResponse":{"properties":{"public_id":{"type":"string","title":"Public Id"},"upload_url":{"type":"string","title":"Upload Url"},"method":{"type":"string","title":"Method","default":"PUT"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["public_id","upload_url","headers","expires_in"],"title":"PresignResponse"},"UploadCheck":{"properties":{"name":{"type":"string","title":"Name"},"ok":{"type":"boolean","title":"Ok"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["name","ok","detail"],"title":"UploadCheck","description":"One verdict from `POST /v1/{cloud}/upload/test`."},"UploadTestResult":{"properties":{"ok":{"type":"boolean","title":"Ok"},"checks":{"items":{"$ref":"#/components/schemas/UploadCheck"},"type":"array","title":"Checks"},"canonical_payload":{"type":"string","title":"Canonical Payload","description":"The exact string the server signed. Diff it against yours."},"server_time":{"type":"integer","title":"Server Time"},"timestamp_drift_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timestamp Drift Seconds","description":"Your timestamp minus the server clock; None if unparseable"},"cloud_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cloud Name"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key","description":"Masked"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"public_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Id"},"folder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"}},"type":"object","required":["ok","checks","canonical_payload","server_time"],"title":"UploadTestResult","description":"Everything the real upload would have checked, with the write left out.\n\n`checks` runs in the order the upload endpoint applies them. Checks that\nneed a verified signature (folder, conflict) are omitted, not failed, when\nan earlier check fails - a bare public api_key must not be able to probe\nwhich client folders exist."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"tags":[{"name":"upload","description":"Signed uploads. Post through the service for ordinary files, or use `presign` + `confirm` to send large files straight to R2. Between those two calls the asset exists but is not yet served."},{"name":"assets","description":"List, inspect, and delete assets. Listing filters by folder, tag, or prefix and pages through an opaque `next_cursor`."},{"name":"folders","description":"Client folders. Every asset lives in one, so create the client's folder before uploading. A folder also carries the retention policy its assets inherit: leave `idle_expiry_days` unset to keep files forever, or set it to soft-delete anything that goes unfetched that long."},{"name":"cloudinary","description":"Cloudinary's URL surface, so their SDKs work here unmodified: set `upload_prefix` to this host and the SDK signs with SHA-1 and posts to `/v1_1/{cloud}/{resource_type}/upload`. Thin aliases over the native `/v1/` routes; both are supported and documented."},{"name":"meta","description":"Liveness, and `GET /v1/me` - the call to make first. It confirms a key pair is live, names the cloud to put in every other path, lists the scopes the key holds, and reports the server clock so a signed upload's `timestamp` can be checked against it."}]}