GET /v1/assets: list library assets
GET /v1/assets is the endpoint to list approved library assets. Approved, unarchived assets of the workspace, most recently used first. Filter by kind and search; page with before. Use an asset in a request by its handle, e.g. "assets": ["@maya"].
At a glance
- Endpoint
GET /v1/assets- Base URL
https://bobabanana.com/api/v1- Auth
Authorization: Bearer bb_...- Success
200- Safe to retry
- yes, a read
- Guide
- Assets
Request#
Query parameters#
| Name | Type | Required | Default | Limits | Description |
|---|---|---|---|---|---|
kind |
string | no | Only assets of this kind, e.g. human, nonhuman, object, place, scene or voice. | ||
search |
string | no | 0 to 100 characters | Text to find in the name, handle or description (up to 100 characters). | |
limit |
integer | no | 50 |
1 to 200 | Assets per page (1 to 200). |
before |
string | no | next_cursor from the previous page: returns the items after it. | ||
include |
"sample" |
no | sample: add each voice's sample_url (a signed link to its recording). |
Headers#
| Header | Required | Description |
|---|---|---|
Authorization |
yes | Bearer bb_...: your API key (or send X-API-Key: bb_...) |
Example request#
curl https://bobabanana.com/api/v1/assets?kind=human&limit=50 \
-H "Authorization: Bearer $BOBABANANA_API_KEY"
import os
import requests
r = requests.get(
"https://bobabanana.com/api/v1/assets?kind=human&limit=50",
headers={"Authorization": f"Bearer {os.environ['BOBABANANA_API_KEY']}"},
timeout=60,
)
r.raise_for_status()
print(r.json())
const res = await fetch("https://bobabanana.com/api/v1/assets?kind=human&limit=50", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.BOBABANANA_API_KEY}`,
},
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
console.log(await res.json());
Response#
200: Successful Response
{
"object": "list",
"data": [
{
"id": "a_19be7c3d5f20",
"object": "asset",
"handle": "@maya",
"name": "Maya",
"kind": "human",
"description": "A woman in her thirties with short red hair",
"tags": [
"cast"
],
"version": 3,
"preview_url": "https://bobabanana.com/api/v1/files/content/..."
}
],
"has_more": false
}
Errors#
Errors use the error object. The codes this endpoint can return (what to do about each is in Error codes):
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_cursor |
before is not a cursor from this list. |
| 400 | invalid_request |
A field is missing, has the wrong type or breaks a rule. param names the field. Type and range problems found while reading the body are 422 with the same code. |
| 401 | invalid_api_key |
The key is wrong, revoked or belongs to no workspace. |
| 401 | missing_api_key |
No API key was sent. |
| 403 | workspace_suspended |
The workspace that owns the key is suspended. |
| 429 | too_many_attempts |
Too many requests with wrong keys came from your address. Retry-After is set. |
| 500 | internal_error |
Something went wrong on our side. |
Related#
- Guide: Assets
- All endpoints
- Objects
- Error codes