KosmoKrator

media

Vimeo Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Vimeo KosmoKrator integration.

6 functions 5 read 1 write Bearer token auth

Lua Namespace

Agents call this integration through app.integrations.vimeo.*. Use lua_read_doc("integrations.vimeo") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Vimeo — Lua API Reference

list_videos

List videos for the authenticated Vimeo user with pagination, search, and filters.

Parameters

NameTypeRequiredDescription
per_pageintegernoVideos per page (1–100, default: 25)
pageintegernoPage number (default: 1)
querystringnoFull-text search by name or description
filterstringnoFilter category: "embeddable", "playable", "purchase_price", "privacy"
filter_embeddablebooleannoWhen filter is "embeddable": true = only embeddable
filter_playablebooleannoWhen filter is "playable": true = only playable
directionstringnoSort direction: "asc" or "desc"
sortstringnoSort field: "alphabetical", "comments", "date", "duration", "likes", "plays"

Example

-- List recent videos
local result = app.integrations.vimeo.list_videos({per_page = 10, sort = "date", direction = "desc"})

for _, video in ipairs(result.videos) do
  print(video.name .. " (" .. video.duration .. "s)")
end

-- Search for a video
local result = app.integrations.vimeo.list_videos({query = "product demo"})

get_video

Get detailed information about a single video by ID.

Parameters

NameTypeRequiredDescription
video_idstringyesVimeo video ID (e.g. "123456789")

Example

local video = app.integrations.vimeo.get_video({video_id = "123456789"})
print(video.name)
print("Duration: " .. (video.duration or 0) .. "s")
print("Plays: " .. (video.stats.plays or 0))

create_video

Create a new video upload slot on Vimeo. Choose an upload approach:

  • pull — Vimeo downloads from a URL you provide (simplest for hosted files)
  • post — You POST the file to the returned upload link (direct upload)
  • streaming — Use the Tus protocol for large or resumable uploads

Parameters

NameTypeRequiredDescription
upload_approachstringnoUpload method: "pull", "post", or "streaming" (default: "post")
upload_linkstringconditionalRequired when approach is "pull". URL Vimeo will download from
namestringnoVideo title
descriptionstringnoVideo description
privacystringnoPrivacy: "anybody", "nobody", "contacts", "password", "unlisted", "disable"
passwordstringconditionalRequired when privacy is "password"
folder_uristringnoFolder (project) URI to add the video to

Examples

-- Pull a video from a URL
local result = app.integrations.vimeo.create_video({
  upload_approach = "pull",
  upload_link = "https://example.com/video.mp4",
  name = "Product Demo",
  description = "Latest product walkthrough",
  privacy = "anybody"
})
print("Video created: " .. result.uri)

-- Create an upload slot for direct upload
local result = app.integrations.vimeo.create_video({
  upload_approach = "post",
  name = "My New Video"
})
-- Use result.upload.upload_link to POST the file bytes

list_albums

List albums (showcases) for the authenticated user.

Parameters

NameTypeRequiredDescription
per_pageintegernoAlbums per page (1–100, default: 25)
pageintegernoPage number (default: 1)
querystringnoSearch albums by name or description
sortstringnoSort field: "alphabetical", "date", "duration", "manual", "modified_time", "name"
directionstringnoSort direction: "asc" or "desc"

Example

local result = app.integrations.vimeo.list_albums({per_page = 10})

for _, album in ipairs(result.albums) do
  local videoCount = album.metadata.connections.videos or 0
  print(album.name .. " (" .. videoCount .. " videos)")
end

list_folders

List folders (projects) for the authenticated user.

Parameters

NameTypeRequiredDescription
per_pageintegernoFolders per page (1–100, default: 25)
pageintegernoPage number (default: 1)
querystringnoSearch folders by name

Example

local result = app.integrations.vimeo.list_folders()

for _, folder in ipairs(result.folders) do
  local videos = folder.metadata.connections.videos or 0
  local subs = folder.metadata.connections.subfolders or 0
  print(folder.name .. " — " .. videos .. " videos, " .. subs .. " subfolders")
end

get_current_user

Get the authenticated user’s Vimeo profile.

Parameters

None.

Example

local user = app.integrations.vimeo.get_current_user()
print("Connected as: " .. user.name)
print("Account type: " .. user.account)
print("Videos: " .. (user.metadata.connections.videos or 0))
print("Upload quota: " .. (user.upload_quota.space.free or 0) .. " / " .. (user.upload_quota.space.max or 0) .. " bytes free")

Common Workflows

Search for a video and get its details

local results = app.integrations.vimeo.list_videos({query = "onboarding", per_page = 5})

if #results.videos > 0 then
  local video = app.integrations.vimeo.get_video({video_id = results.videos[1].id})
  print("Found: " .. video.name)
  print("Duration: " .. (video.duration or 0) .. "s")
  print("Plays: " .. (video.stats.plays or 0))
end

Browse all videos with pagination

local page = 1
local all_videos = {}

repeat
  local result = app.integrations.vimeo.list_videos({page = page, per_page = 100})
  for _, v in ipairs(result.videos) do
    table.insert(all_videos, v)
  end
  page = page + 1
until not result.paging.next or #result.videos == 0

print("Total videos fetched: " .. #all_videos)

Privacy Values

ValueMeaning
anybodyPublic — anyone can view
nobodyPrivate — only the owner
contactsOnly contacts of the owner
passwordPassword-protected
unlistedUnlisted — only those with the link
disableHide from Vimeo

Multi-Account Usage

If you have multiple Vimeo accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.vimeo.list_videos({per_page = 10})

-- Explicit default (portable across setups)
app.integrations.vimeo.default.list_videos({per_page = 10})

-- Named accounts
app.integrations.vimeo.work.list_videos({per_page = 10})
app.integrations.vimeo.personal.list_videos({per_page = 10})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Vimeo — Lua API Reference

## list_videos

List videos for the authenticated Vimeo user with pagination, search, and filters.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `per_page` | integer | no | Videos per page (1–100, default: 25) |
| `page` | integer | no | Page number (default: 1) |
| `query` | string | no | Full-text search by name or description |
| `filter` | string | no | Filter category: `"embeddable"`, `"playable"`, `"purchase_price"`, `"privacy"` |
| `filter_embeddable` | boolean | no | When filter is `"embeddable"`: true = only embeddable |
| `filter_playable` | boolean | no | When filter is `"playable"`: true = only playable |
| `direction` | string | no | Sort direction: `"asc"` or `"desc"` |
| `sort` | string | no | Sort field: `"alphabetical"`, `"comments"`, `"date"`, `"duration"`, `"likes"`, `"plays"` |

### Example

```lua
-- List recent videos
local result = app.integrations.vimeo.list_videos({per_page = 10, sort = "date", direction = "desc"})

for _, video in ipairs(result.videos) do
  print(video.name .. " (" .. video.duration .. "s)")
end

-- Search for a video
local result = app.integrations.vimeo.list_videos({query = "product demo"})
```

---

## get_video

Get detailed information about a single video by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `video_id` | string | yes | Vimeo video ID (e.g. `"123456789"`) |

### Example

```lua
local video = app.integrations.vimeo.get_video({video_id = "123456789"})
print(video.name)
print("Duration: " .. (video.duration or 0) .. "s")
print("Plays: " .. (video.stats.plays or 0))
```

---

## create_video

Create a new video upload slot on Vimeo. Choose an upload approach:

- **`pull`** — Vimeo downloads from a URL you provide (simplest for hosted files)
- **`post`** — You POST the file to the returned upload link (direct upload)
- **`streaming`** — Use the Tus protocol for large or resumable uploads

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `upload_approach` | string | no | Upload method: `"pull"`, `"post"`, or `"streaming"` (default: `"post"`) |
| `upload_link` | string | conditional | Required when approach is `"pull"`. URL Vimeo will download from |
| `name` | string | no | Video title |
| `description` | string | no | Video description |
| `privacy` | string | no | Privacy: `"anybody"`, `"nobody"`, `"contacts"`, `"password"`, `"unlisted"`, `"disable"` |
| `password` | string | conditional | Required when privacy is `"password"` |
| `folder_uri` | string | no | Folder (project) URI to add the video to |

### Examples

```lua
-- Pull a video from a URL
local result = app.integrations.vimeo.create_video({
  upload_approach = "pull",
  upload_link = "https://example.com/video.mp4",
  name = "Product Demo",
  description = "Latest product walkthrough",
  privacy = "anybody"
})
print("Video created: " .. result.uri)

-- Create an upload slot for direct upload
local result = app.integrations.vimeo.create_video({
  upload_approach = "post",
  name = "My New Video"
})
-- Use result.upload.upload_link to POST the file bytes
```

---

## list_albums

List albums (showcases) for the authenticated user.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `per_page` | integer | no | Albums per page (1–100, default: 25) |
| `page` | integer | no | Page number (default: 1) |
| `query` | string | no | Search albums by name or description |
| `sort` | string | no | Sort field: `"alphabetical"`, `"date"`, `"duration"`, `"manual"`, `"modified_time"`, `"name"` |
| `direction` | string | no | Sort direction: `"asc"` or `"desc"` |

### Example

```lua
local result = app.integrations.vimeo.list_albums({per_page = 10})

for _, album in ipairs(result.albums) do
  local videoCount = album.metadata.connections.videos or 0
  print(album.name .. " (" .. videoCount .. " videos)")
end
```

---

## list_folders

List folders (projects) for the authenticated user.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `per_page` | integer | no | Folders per page (1–100, default: 25) |
| `page` | integer | no | Page number (default: 1) |
| `query` | string | no | Search folders by name |

### Example

```lua
local result = app.integrations.vimeo.list_folders()

for _, folder in ipairs(result.folders) do
  local videos = folder.metadata.connections.videos or 0
  local subs = folder.metadata.connections.subfolders or 0
  print(folder.name .. " — " .. videos .. " videos, " .. subs .. " subfolders")
end
```

---

## get_current_user

Get the authenticated user's Vimeo profile.

### Parameters

None.

### Example

```lua
local user = app.integrations.vimeo.get_current_user()
print("Connected as: " .. user.name)
print("Account type: " .. user.account)
print("Videos: " .. (user.metadata.connections.videos or 0))
print("Upload quota: " .. (user.upload_quota.space.free or 0) .. " / " .. (user.upload_quota.space.max or 0) .. " bytes free")
```

---

## Common Workflows

### Search for a video and get its details

```lua
local results = app.integrations.vimeo.list_videos({query = "onboarding", per_page = 5})

if #results.videos > 0 then
  local video = app.integrations.vimeo.get_video({video_id = results.videos[1].id})
  print("Found: " .. video.name)
  print("Duration: " .. (video.duration or 0) .. "s")
  print("Plays: " .. (video.stats.plays or 0))
end
```

### Browse all videos with pagination

```lua
local page = 1
local all_videos = {}

repeat
  local result = app.integrations.vimeo.list_videos({page = page, per_page = 100})
  for _, v in ipairs(result.videos) do
    table.insert(all_videos, v)
  end
  page = page + 1
until not result.paging.next or #result.videos == 0

print("Total videos fetched: " .. #all_videos)
```

---

## Privacy Values

| Value | Meaning |
|-------|---------|
| `anybody` | Public — anyone can view |
| `nobody` | Private — only the owner |
| `contacts` | Only contacts of the owner |
| `password` | Password-protected |
| `unlisted` | Unlisted — only those with the link |
| `disable` | Hide from Vimeo |

---

## Multi-Account Usage

If you have multiple Vimeo accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.vimeo.list_videos({per_page = 10})

-- Explicit default (portable across setups)
app.integrations.vimeo.default.list_videos({per_page = 10})

-- Named accounts
app.integrations.vimeo.work.list_videos({per_page = 10})
app.integrations.vimeo.personal.list_videos({per_page = 10})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.vimeo.vimeo_create_video({
  upload_approach = "example_upload_approach",
  upload_link = "example_upload_link",
  name = "example_name",
  description = "example_description",
  privacy = "example_privacy",
  password = "example_password",
  folder_uri = "example_folder_uri"
})
print(result)

Functions

vimeo_create_video

Create a new video upload slot on Vimeo. Choose an upload approach: "pull" (Vimeo downloads from a URL), "post" (you POST to an upload link), or "streaming" (Tus protocol). Returns the video URI and upload target.

Operation
Write write
Full name
vimeo.vimeo_create_video
ParameterTypeRequiredDescription
upload_approach string no Upload method: "pull" (Vimeo fetches from URL), "post" (direct upload), or "streaming" (Tus). Default: "post".
upload_link string no Required when upload_approach is "pull". The URL Vimeo will download the video from.
name string no Title of the video.
description string no Description of the video.
privacy string no Privacy setting: "anybody", "nobody", "contacts", "password", "unlisted", "disable".
password string no Required when privacy is "password".
folder_uri string no URI of a folder (project) to add the video to after creation.

vimeo_get_current_user

Get the authenticated Vimeo user's profile information. Returns name, bio, location, account type, upload quota, and profile pictures.

Operation
Read read
Full name
vimeo.vimeo_get_current_user
ParameterTypeRequiredDescription
No parameters.

vimeo_get_video

Get detailed information about a single Vimeo video by its ID. Returns name, description, duration, thumbnails, privacy, stats, and playback links.

Operation
Read read
Full name
vimeo.vimeo_get_video
ParameterTypeRequiredDescription
video_id string yes The Vimeo video ID (e.g., "123456789").

vimeo_list_albums

List albums (showcases) for the authenticated Vimeo user. Supports pagination, query search, sorting, and direction. Returns album names, descriptions, thumbnails, and video counts.

Operation
Read read
Full name
vimeo.vimeo_list_albums
ParameterTypeRequiredDescription
per_page integer no Number of albums per page (1–100, default: 25).
page integer no Page number for pagination (default: 1).
query string no Full-text search query to filter albums by name or description.
sort string no Sort field: "alphabetical", "date", "duration", "manual", "modified_time", "name".
direction string no Sort direction: "asc" or "desc".

vimeo_list_folders

List folders (projects) for the authenticated Vimeo user. Supports pagination and query search. Returns folder names, descriptions, and item counts.

Operation
Read read
Full name
vimeo.vimeo_list_folders
ParameterTypeRequiredDescription
per_page integer no Number of folders per page (1–100, default: 25).
page integer no Page number for pagination (default: 1).
query string no Search query to filter folders by name.

vimeo_list_videos

List videos for the authenticated Vimeo user. Supports pagination, full-text search via query, and filters (e.g., embeddable, playable, privacy). Returns video URIs, names, durations, thumbnails, and metadata.

Operation
Read read
Full name
vimeo.vimeo_list_videos
ParameterTypeRequiredDescription
per_page integer no Number of videos per page (1–100, default: 25).
page integer no Page number for pagination (default: 1).
query string no Full-text search query to filter videos by name or description.
filter string no Filter category: "embeddable", "playable", "purchase_price", "privacy".
filter_embeddable boolean no When filter is "embeddable": true = only embeddable, false = only non-embeddable.
filter_playable boolean no When filter is "playable": true = only playable, false = only non-playable.
direction string no Sort direction: "asc" or "desc".
sort string no Sort field: "alphabetical", "comments", "date", "duration", "likes", "plays".