JavaScript
import Moonbase from '@moonbaseai/sdk';
const client = new Moonbase({
apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});
await client.collections.items.delete('id', { collection_id: 'collection_id' });require "moonbase"
moonbase = Moonbase::Client.new(api_key: "My API Key")
result = moonbase.collections.items.delete("id", collection_id: "collection_id")
puts(result)import os
from moonbase import Moonbase
client = Moonbase(
api_key=os.environ.get("MOONBASE_API_KEY"), # This is the default and can be omitted
)
client.collections.items.delete(
id="id",
collection_id="collection_id",
)package main
import (
"context"
"github.com/moonbaseai/moonbase-sdk-go"
"github.com/moonbaseai/moonbase-sdk-go/option"
)
func main() {
client := moonbase.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Collections.Items.Delete(
context.TODO(),
"id",
moonbase.CollectionItemDeleteParams{
CollectionID: "collection_id",
},
)
if err != nil {
panic(err.Error())
}
}
curl --request DELETE \
--url https://api.moonbase.ai/v0/collections/{collection_id}/items/{id} \
--header 'Authorization: Bearer <token>'{
"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": "409",
"title": "Conflict",
"detail": "Cannot delete record because of dependent user"
}
]
}{
"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."
}
]
}Items
Delete an Item
Permanently deletes an item.
DELETE
/
collections
/
{collection_id}
/
items
/
{id}
JavaScript
import Moonbase from '@moonbaseai/sdk';
const client = new Moonbase({
apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});
await client.collections.items.delete('id', { collection_id: 'collection_id' });require "moonbase"
moonbase = Moonbase::Client.new(api_key: "My API Key")
result = moonbase.collections.items.delete("id", collection_id: "collection_id")
puts(result)import os
from moonbase import Moonbase
client = Moonbase(
api_key=os.environ.get("MOONBASE_API_KEY"), # This is the default and can be omitted
)
client.collections.items.delete(
id="id",
collection_id="collection_id",
)package main
import (
"context"
"github.com/moonbaseai/moonbase-sdk-go"
"github.com/moonbaseai/moonbase-sdk-go/option"
)
func main() {
client := moonbase.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Collections.Items.Delete(
context.TODO(),
"id",
moonbase.CollectionItemDeleteParams{
CollectionID: "collection_id",
},
)
if err != nil {
panic(err.Error())
}
}
curl --request DELETE \
--url https://api.moonbase.ai/v0/collections/{collection_id}/items/{id} \
--header 'Authorization: Bearer <token>'{
"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": "409",
"title": "Conflict",
"detail": "Cannot delete record because of dependent user"
}
]
}{
"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."
}
]
}⌘I

