JavaScript
import Moonbase from '@moonbaseai/sdk';
const client = new Moonbase({
apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const item of client.views.items.list('id')) {
console.log(item.id);
}require "moonbase"
moonbase = Moonbase::Client.new(api_key: "My API Key")
page = moonbase.views.items.list("id")
puts(page)import os
from moonbase import Moonbase
client = Moonbase(
api_key=os.environ.get("MOONBASE_API_KEY"), # This is the default and can be omitted
)
page = client.views.items.list(
id="id",
)
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/moonbaseai/moonbase-sdk-go"
"github.com/moonbaseai/moonbase-sdk-go/option"
)
func main() {
client := moonbase.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Views.Items.List(
context.TODO(),
"id",
moonbase.ViewItemListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.moonbase.ai/v0/views/{id}/items \
--header 'Authorization: Bearer <token>'{
"type": "list",
"data": [
{
"id": "1CLJt2vEzvEeoG1qPRazvx",
"type": "item",
"collection": {
"id": "1CLJt2v5aNd8G5SGzEaeVU",
"type": "collection",
"ref": "test_collection_71"
},
"values": {
"name": {
"type": "value/text/single_line",
"data": "Aperture Science"
},
"created_at": {
"type": "value/datetime",
"data": "2025-02-17T16:00:00.000Z"
},
"updated_at": {
"type": "value/datetime",
"data": "2025-02-17T16:00:00.000Z"
},
"decision_maker": {
"type": "value/relation",
"data": {
"id": "1CLJt2vCmUS5cpcd8mshsy",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
}
}
}
],
"meta": {
"cursors": {}
}
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "400",
"title": "Bad Request",
"detail": "The request could not be understood due to malformed syntax or invalid parameters."
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "401",
"title": "Unauthorized",
"detail": "Invalid or missing API key or JWT. You should provide your Moonbase API Key or JWT in the authorization header, in the format: \"Authorization: Bearer MOONBASE_API_KEY\""
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "403",
"title": "Forbidden"
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "404",
"title": "Not Found"
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "429",
"title": "Too Many Requests"
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "500",
"title": "Internal Server Error"
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "503",
"title": "Service Unavailable",
"detail": "The service is temporarily unavailable, please try again later."
}
]
}Views
List Items
Returns a list of items that are part of the specified view.
GET
/
views
/
{id}
/
items
JavaScript
import Moonbase from '@moonbaseai/sdk';
const client = new Moonbase({
apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const item of client.views.items.list('id')) {
console.log(item.id);
}require "moonbase"
moonbase = Moonbase::Client.new(api_key: "My API Key")
page = moonbase.views.items.list("id")
puts(page)import os
from moonbase import Moonbase
client = Moonbase(
api_key=os.environ.get("MOONBASE_API_KEY"), # This is the default and can be omitted
)
page = client.views.items.list(
id="id",
)
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/moonbaseai/moonbase-sdk-go"
"github.com/moonbaseai/moonbase-sdk-go/option"
)
func main() {
client := moonbase.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Views.Items.List(
context.TODO(),
"id",
moonbase.ViewItemListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.moonbase.ai/v0/views/{id}/items \
--header 'Authorization: Bearer <token>'{
"type": "list",
"data": [
{
"id": "1CLJt2vEzvEeoG1qPRazvx",
"type": "item",
"collection": {
"id": "1CLJt2v5aNd8G5SGzEaeVU",
"type": "collection",
"ref": "test_collection_71"
},
"values": {
"name": {
"type": "value/text/single_line",
"data": "Aperture Science"
},
"created_at": {
"type": "value/datetime",
"data": "2025-02-17T16:00:00.000Z"
},
"updated_at": {
"type": "value/datetime",
"data": "2025-02-17T16:00:00.000Z"
},
"decision_maker": {
"type": "value/relation",
"data": {
"id": "1CLJt2vCmUS5cpcd8mshsy",
"type": "item",
"collection": {
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
}
}
}
}
],
"meta": {
"cursors": {}
}
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "400",
"title": "Bad Request",
"detail": "The request could not be understood due to malformed syntax or invalid parameters."
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "401",
"title": "Unauthorized",
"detail": "Invalid or missing API key or JWT. You should provide your Moonbase API Key or JWT in the authorization header, in the format: \"Authorization: Bearer MOONBASE_API_KEY\""
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "403",
"title": "Forbidden"
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "404",
"title": "Not Found"
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "429",
"title": "Too Many Requests"
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "500",
"title": "Internal Server Error"
}
]
}{
"type": "errors",
"errors": [
{
"type": "error",
"status": "503",
"title": "Service Unavailable",
"detail": "The service is temporarily unavailable, please try again later."
}
]
}Authorizations
Your Moonbase API key.
Path Parameters
The ID of the view.
Query Parameters
When specified, returns results starting immediately before the item identified by this cursor. Use the cursor value from the response's metadata to fetch the previous page of results.
When specified, returns results starting immediately after the item identified by this cursor. Use the cursor value from the previous response's metadata to fetch the next page of results.
Maximum number of items to return per page. Must be between 1 and 100. Defaults to 20 if not specified.
Required range:
1 <= x <= 100Response
Successful response.
⌘I

