resourcepack.ai
DOCS

Packs

Set an item's look for one state

Gives an item a look of its own for one state: another of the pack's models (model, a model's name), or a picture (file, a PNG up to 256KB). clear: true puts that state back to the item's ordinary look. A 2D reskin's states are pictures only. Free.

POST/packs/{pack}/items/{item}/states

Path parameters

packstringrequired

The pack's slug, as returned by the packs endpoints.

itemstringrequired

The item's name.

Body

statestringrequired

The state's key.

modelstring

One of the pack's models, by name. Send one of this, file or clear.

fileobject

The state's picture, a PNG. Exactly one of upload, url, base64 or text.

uploadstring

The upload id from POST /uploads, after PUTting the file to its URL. The way to send anything big, or anything already on disk.

urlstring

A public https URL to fetch the file from.

base64string

The file's bytes as base64 (a data: URI is fine). Up to 8MB.

textstring

The file as text, for formats that are text (model JSON, .bbmodel). Up to 8MB.

clearboolean

Put the state back to the item's ordinary look.

Response · 200

Saved: every state that has a look of its own.

packstringrequired

The pack.

itemstringrequired

The item's name.

statesobjectrequired

State key to {model} or {sprite: true}.

Error codes

Branch on error.code, never on the message.

file_fetch_failed400

A file given by url couldn't be downloaded.

invalid_request400

Something in the body or query is wrong. message says what.

invalid_api_key401

The key isn't one of ours, or it has been revoked.

missing_api_key401

No Authorization: Bearer header was sent.

wrong_key_kind401

An MCP key sent to the REST API, or an API key sent to the MCP server. Each only opens its own.

account_suspended403

The account is suspended, so its keys open nothing. message says until when, if the suspension has an end date.

forbidden403

Valid key, but not permitted to do this in this pack.

plan_required403

The key is valid, but its account's plan does not include the API.

not_found404

No such pack, asset or job.

upload_not_found404

No upload by that id. Uploads expire after fifteen minutes and are used once.

file_too_large413

The file is over the limit for what it's being used as. message says the limit.