Skip to content

Delete a library item

POST
/open/v1/image/delete
curl --request POST \
--url https://api.harperharbor.com/open/v1/image/delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "imageId": "example" }'

Deletes one library item owned by the caller. imageId is the item id returned by the list endpoint (an opaque string). Unknown ids and items owned by someone else return 404. An item still used by one of your cards as portrait or background is not deleted: the response is 400 image_in_use and detail.cards lists each card as {roleId, name} so you can change its image first. Success body {code:0,data:{imageId}}.

Media typeapplication/json
object
imageId
required

Item id from the list endpoint.

string
Examplegenerated
{
"imageId": "example"
}

Deleted item.

Media typeapplication/json
object
code
required
integer
Allowed values: 0
data
required
object
imageId
required

Id of the deleted item.

string
Example
{
"code": 0
}

invalid_param (empty list / bad JSON) or image_in_use with imageUrls.

Media typeapplication/json
object
error
required
string
Allowed values: invalid_param image_in_use
imageUrls

URLs still referenced by a card (only with image_in_use).

Array<string>
Example
{
"error": "invalid_param"
}

unauthorized.

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}

Resource unavailable.

generic_error.

Media typeapplication/json
object
error
required

Error code (snake_case) or, for legacy handlers, a free-text/localized message.

string
message

Human-readable sentence. Present only on middleware errors and /me, /me/wallet.

string
retryable

Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.

boolean
required_context_tier

Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.

integer
>= 1 <= 5
required_context_tokens

The token budget of required_context_tier for the selected model, for display.

integer
constant_lore_trim_fits

Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.

boolean
credits_needed

Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.

integer
credits_available

Only on insufficient_credits: the credits the wallet could set aside for it.

integer
Examplegenerated
{
"error": "example",
"message": "example",
"retryable": true,
"required_context_tier": 1,
"required_context_tokens": 1,
"constant_lore_trim_fits": true,
"credits_needed": 1,
"credits_available": 1
}