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.inboxMessages.attachments.delete('id', { inbox_message_id: 'inbox_message_id' });require "moonbase"
moonbase = Moonbase::Client.new(api_key: "My API Key")
result = moonbase.inbox_messages.attachments.delete("id", inbox_message_id: "inbox_message_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.inbox_messages.attachments.delete(
id="id",
inbox_message_id="inbox_message_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.InboxMessages.Attachments.Delete(
context.TODO(),
"id",
moonbase.InboxMessageAttachmentDeleteParams{
InboxMessageID: "inbox_message_id",
},
)
if err != nil {
panic(err.Error())
}
}
curl --request DELETE \
--url https://api.moonbase.ai/v0/inbox_messages/{inbox_message_id}/attachments/{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": "422",
"title": "Unprocessable Entity",
"detail": "Attachments can only be managed on draft messages."
}
]
}{
"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."
}
]
}Messages
Remove an attachment
Removes an attachment from a draft message.
DELETE
/
inbox_messages
/
{inbox_message_id}
/
attachments
/
{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.inboxMessages.attachments.delete('id', { inbox_message_id: 'inbox_message_id' });require "moonbase"
moonbase = Moonbase::Client.new(api_key: "My API Key")
result = moonbase.inbox_messages.attachments.delete("id", inbox_message_id: "inbox_message_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.inbox_messages.attachments.delete(
id="id",
inbox_message_id="inbox_message_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.InboxMessages.Attachments.Delete(
context.TODO(),
"id",
moonbase.InboxMessageAttachmentDeleteParams{
InboxMessageID: "inbox_message_id",
},
)
if err != nil {
panic(err.Error())
}
}
curl --request DELETE \
--url https://api.moonbase.ai/v0/inbox_messages/{inbox_message_id}/attachments/{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": "422",
"title": "Unprocessable Entity",
"detail": "Attachments can only be managed on draft messages."
}
]
}{
"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

