data
Cloudinary Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Cloudinary KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.cloudinary.*.
Use lua_read_doc("integrations.cloudinary") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Cloudinary workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.cloudinary.api_get({path = "example_path", params = "example_params"}))' --json kosmo integrations:lua --eval 'print(docs.read("cloudinary"))' --json
kosmo integrations:lua --eval 'print(docs.read("cloudinary.api_get"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local cloudinary = app.integrations.cloudinary
local result = cloudinary.api_get({path = "example_path", params = "example_params"})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.cloudinary, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.cloudinary.default.* or app.integrations.cloudinary.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Cloudinary, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Cloudinary Lua API Reference
Namespace: app.integrations.cloudinary
Cloudinary tools cover signed uploads and Admin API operations for assets, folders, tags, transformations, upload presets, usage, and read-only long-tail endpoints.
Uploads
local result = app.integrations.cloudinary.upload({
file = "https://example.test/photo.jpg",
public_id = "blog/hero",
folder = "blog",
resource_type = "image",
options = {
tags = "hero,blog",
context = "alt=Hero image"
}
})
resource_type can be image, video, or raw. options accepts signed Upload API parameters.
Assets
local resources = app.integrations.cloudinary.list_resources({
type = "image",
delivery_type = "upload",
prefix = "blog/",
max_results = 20
})
local search = app.integrations.cloudinary.search_resources({
params = {
expression = "folder=blog",
max_results = 20
}
})
local asset = app.integrations.cloudinary.get_resource({
type = "image",
delivery_type = "upload",
public_id = "blog/hero"
})
Resource detail and delete calls require the Cloudinary resource type and delivery type. The default delivery type is upload.
Tags
local tags = app.integrations.cloudinary.list_tags({
resource_type = "image",
params = { prefix = "he" }
})
local tagged = app.integrations.cloudinary.list_resources_by_tag({
tag = "hero",
resource_type = "image"
})
Folders
local folders = app.integrations.cloudinary.list_folders({})
local subfolders = app.integrations.cloudinary.list_subfolders({
folder = "blog"
})
local found = app.integrations.cloudinary.search_folders({
params = { expression = "name:blog" }
})
create_folder and delete_folder are write tools. delete_folder only deletes empty folders.
Transformations, Presets, Usage
local transformations = app.integrations.cloudinary.list_transformations({})
local presets = app.integrations.cloudinary.list_upload_presets({})
local usage = app.integrations.cloudinary.get_usage({})
local ping = app.integrations.cloudinary.ping({})
Long-Tail GET Endpoints
local result = app.integrations.cloudinary.api_get({
path = "/resources/search",
params = { expression = "resource_type:image" }
})
api_get accepts only relative Admin API paths, not full URLs.
Multi-Account Usage
app.integrations.cloudinary.upload({...})
app.integrations.cloudinary.default.upload({...})
app.integrations.cloudinary.production.search_resources({
params = { expression = "folder=blog" }
})
All functions are identical across accounts; only credentials differ.
Raw agent markdown
# Cloudinary Lua API Reference
Namespace: `app.integrations.cloudinary`
Cloudinary tools cover signed uploads and Admin API operations for assets, folders, tags, transformations, upload presets, usage, and read-only long-tail endpoints.
## Uploads
```lua
local result = app.integrations.cloudinary.upload({
file = "https://example.test/photo.jpg",
public_id = "blog/hero",
folder = "blog",
resource_type = "image",
options = {
tags = "hero,blog",
context = "alt=Hero image"
}
})
```
`resource_type` can be `image`, `video`, or `raw`. `options` accepts signed Upload API parameters.
## Assets
```lua
local resources = app.integrations.cloudinary.list_resources({
type = "image",
delivery_type = "upload",
prefix = "blog/",
max_results = 20
})
local search = app.integrations.cloudinary.search_resources({
params = {
expression = "folder=blog",
max_results = 20
}
})
local asset = app.integrations.cloudinary.get_resource({
type = "image",
delivery_type = "upload",
public_id = "blog/hero"
})
```
Resource detail and delete calls require the Cloudinary resource type and delivery type. The default delivery type is `upload`.
## Tags
```lua
local tags = app.integrations.cloudinary.list_tags({
resource_type = "image",
params = { prefix = "he" }
})
local tagged = app.integrations.cloudinary.list_resources_by_tag({
tag = "hero",
resource_type = "image"
})
```
## Folders
```lua
local folders = app.integrations.cloudinary.list_folders({})
local subfolders = app.integrations.cloudinary.list_subfolders({
folder = "blog"
})
local found = app.integrations.cloudinary.search_folders({
params = { expression = "name:blog" }
})
```
`create_folder` and `delete_folder` are write tools. `delete_folder` only deletes empty folders.
## Transformations, Presets, Usage
```lua
local transformations = app.integrations.cloudinary.list_transformations({})
local presets = app.integrations.cloudinary.list_upload_presets({})
local usage = app.integrations.cloudinary.get_usage({})
local ping = app.integrations.cloudinary.ping({})
```
## Long-Tail GET Endpoints
```lua
local result = app.integrations.cloudinary.api_get({
path = "/resources/search",
params = { expression = "resource_type:image" }
})
```
`api_get` accepts only relative Admin API paths, not full URLs.
## Multi-Account Usage
```lua
app.integrations.cloudinary.upload({...})
app.integrations.cloudinary.default.upload({...})
app.integrations.cloudinary.production.search_resources({
params = { expression = "folder=blog" }
})
```
All functions are identical across accounts; only credentials differ. local result = app.integrations.cloudinary.api_get({path = "example_path", params = "example_params"})
print(result) Functions
api_get Read
Call a read-only Cloudinary Admin API GET endpoint not covered by a first-class tool.
- Lua path
app.integrations.cloudinary.api_get- Full name
cloudinary.cloudinary_api_get
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Admin API path such as /resources/search or /usage. |
params | object | no | Query parameters. |
create_folder Write
Create a Cloudinary asset folder.
- Lua path
app.integrations.cloudinary.create_folder- Full name
cloudinary.cloudinary_create_folder
| Parameter | Type | Required | Description |
|---|---|---|---|
folder | string | yes | Folder path to create. |
delete_folder Write
Delete an empty Cloudinary asset folder.
- Lua path
app.integrations.cloudinary.delete_folder- Full name
cloudinary.cloudinary_delete_folder
| Parameter | Type | Required | Description |
|---|---|---|---|
folder | string | yes | Folder path to delete. |
params | object | no | Optional delete parameters such as skip_backup. |
delete_resource Write
Delete a media resource from Cloudinary by its type and public ID. This permanently removes the asset and all its derived resources.
- Lua path
app.integrations.cloudinary.delete_resource- Full name
cloudinary.cloudinary_delete_resource
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | yes | Resource type: "image", "video", or "raw". |
public_id | string | yes | The public ID of the resource to delete (e.g. "blog/old-photo"). |
delivery_type | string | no | Delivery type such as upload, private, or authenticated. Default: upload. |
invalidate | boolean | no | Whether to request CDN invalidation where enabled for the account. |
get_resource Read
Get details of a specific Cloudinary resource by its type and public ID. Returns full asset metadata including dimensions, format, URL, tags, and derived resources.
- Lua path
app.integrations.cloudinary.get_resource- Full name
cloudinary.cloudinary_get_resource
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | yes | Resource type: "image", "video", or "raw". |
public_id | string | yes | The public ID of the resource (e.g. "blog/hero-image"). |
delivery_type | string | no | Delivery type such as upload, private, or authenticated. Default: upload. |
get_usage Read
Get Cloudinary product environment usage details.
- Lua path
app.integrations.cloudinary.get_usage- Full name
cloudinary.cloudinary_get_usage
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional date parameter in yyyy-mm-dd format. |
list_folders Read
List all folders in your Cloudinary cloud. Returns folder names and paths with pagination support.
- Lua path
app.integrations.cloudinary.list_folders- Full name
cloudinary.cloudinary_list_folders
| Parameter | Type | Required | Description |
|---|---|---|---|
max_results | integer | no | Maximum number of folders to return (default 10). |
next_cursor | string | no | Pagination cursor from a previous response to get the next page. |
list_resources Read
List media resources in your Cloudinary cloud. Filter by resource type (image, video, raw) and prefix. Supports pagination with max_results and next_cursor.
- Lua path
app.integrations.cloudinary.list_resources- Full name
cloudinary.cloudinary_list_resources
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | no | Resource type to list: "image", "video", or "raw". Defaults to "image". |
max_results | integer | no | Maximum number of resources to return (max 500, default 10). |
next_cursor | string | no | Pagination cursor from a previous response to get the next page. |
prefix | string | no | Only include resources whose public ID starts with this prefix (e.g. "blog/"). |
delivery_type | string | no | Delivery type such as upload, private, or authenticated. Default: upload. |
list_resources_by_tag Read
List Cloudinary assets that have a specific tag.
- Lua path
app.integrations.cloudinary.list_resources_by_tag- Full name
cloudinary.cloudinary_list_resources_by_tag
| Parameter | Type | Required | Description |
|---|---|---|---|
tag | string | yes | Tag name. |
resource_type | string | no | Resource type: image, video, or raw. Default: image. |
params | object | no | Optional max_results, next_cursor, and direction. |
list_subfolders Read
List subfolders under a Cloudinary folder path.
- Lua path
app.integrations.cloudinary.list_subfolders- Full name
cloudinary.cloudinary_list_subfolders
| Parameter | Type | Required | Description |
|---|---|---|---|
folder | string | yes | Parent folder path. |
params | object | no | Optional max_results and next_cursor. |
list_tags Read
List tag names used by Cloudinary assets for a resource type.
- Lua path
app.integrations.cloudinary.list_tags- Full name
cloudinary.cloudinary_list_tags
| Parameter | Type | Required | Description |
|---|---|---|---|
resource_type | string | no | Resource type: image, video, or raw. Default: image. |
params | object | no | Optional prefix, max_results, and next_cursor. |
list_transformations Read
List Cloudinary named transformations with pagination.
- Lua path
app.integrations.cloudinary.list_transformations- Full name
cloudinary.cloudinary_list_transformations
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional max_results and next_cursor. |
list_upload_presets Read
List Cloudinary upload presets with pagination.
- Lua path
app.integrations.cloudinary.list_upload_presets- Full name
cloudinary.cloudinary_list_upload_presets
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional max_results and next_cursor. |
ping Read
Ping Cloudinary servers to test API reachability.
- Lua path
app.integrations.cloudinary.ping- Full name
cloudinary.cloudinary_ping
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
search_folders Read
Search Cloudinary asset folders with optional expression and pagination parameters.
- Lua path
app.integrations.cloudinary.search_folders- Full name
cloudinary.cloudinary_search_folders
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Optional expression, sort_by, max_results, and next_cursor. |
search_resources Read
Search Cloudinary assets using the Admin API search expression language.
- Lua path
app.integrations.cloudinary.search_resources- Full name
cloudinary.cloudinary_search_resources
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as expression, sort_by, max_results, next_cursor, aggregate, with_field. |
upload Read
Upload an image to Cloudinary. Provide a file URL or base64 data URI, an optional public ID, and an optional folder path. Returns the uploaded asset details.
- Lua path
app.integrations.cloudinary.upload- Full name
cloudinary.cloudinary_upload
| Parameter | Type | Required | Description |
|---|---|---|---|
file | string | yes | The file to upload — a remote URL (e.g. "https://example.test/photo.jpg") or a base64 data URI (e.g. "data:image/png;base64,..."). |
public_id | string | no | The public ID to assign to the uploaded asset. If omitted, Cloudinary generates a random ID. |
folder | string | no | The folder to store the asset in (e.g. "blog/images"). |
resource_type | string | no | Resource type: image, video, or raw. Default: image. |
options | object | no | Additional signed upload parameters such as tags, context, eager, overwrite, or upload_preset. |