Skip to content
AdCrunch
Esc
↑↓navigate↵open⌘Jpreview

Rename an Asset

Renames an Asset. The name is what the console shows and what a provider receives at future registrations. AdCrunch trims the name, and a name that is empty after the trim clears it back to the original filename. A Registration already made keeps the name it was given. An Asset belonging to another organization is reported as missing, so the surface cannot be used to discover that an id is real.

PATCH/assets/{id}
Authorization
AuthorizationBearer token · headerrequired

Send Authorization: Bearer <credential>.

Use an API key (acr_…), from the AdCrunch console under Settings → API keys.

The credential names the organization, and no operation takes an organization parameter.

See https://docs.adcrunch.dev/api/authentication.

Path parameters
idstringrequired
matches ^(ast_)[\s\S]{0,}$
Request body
requiredapplication/json
namestringrequired

The name to show. AdCrunch trims it. Send an empty string to clear it back to the original filename.

max length 255
Responses
200

The Asset, with its new name. It carries no Registration — read the Asset for those.

contentHashstringrequired

AdCrunch’s own hash of the stored bytes. A hint for de-duplication, never an identity, and never a provider’s hash. Empty when the store reports none.

createdAtnumberrequired

Milliseconds since the Unix epoch, UTC.

createdBystringrequired

The user who reserved the upload.

deletedAtnumber | nullrequired

Always null here. A deleted Asset is not answered.

durationMsnumber | nullrequired

How long the video runs, in milliseconds, read from the header of the file at finalize. null for an image. For a video, null when the file does not state it, or for an Asset uploaded before AdCrunch read it.

filenamestringrequired

The name the file was uploaded under. Never a lookup key.

heightnumber | nullrequired

The height in pixels as the file is displayed, with its rotation applied, read from the header of the file at finalize. null when the file does not state it, or for an Asset uploaded before AdCrunch read it.

idstringrequired
keystringrequired

Where the bytes are held. Read-only, and never sent by you.

kindstringrequired

Follows from mimeType, so the stored bytes verify it at finalize. It selects how a provider takes the file.

Allowed:imagevideo
mimeTypestringrequired

The Content-Type the file was uploaded with, verified against the stored bytes at finalize.

namestring | nullrequired

The name a person gave this Asset, and what a provider receives at a future registration. null until somebody renames it, and the filename is the fallback.

organizationIdstringrequired
sizeBytesnumberrequired

Read from the stored object at finalize.

statusstringrequired

ready once the bytes have been inspected. A pending Asset is a reservation whose bytes have not arrived, and no operation here answers one.

Allowed:pendingready
updatedAtnumber | nullrequired

Milliseconds since the Unix epoch, UTC.

widthnumber | nullrequired

The width in pixels as the file is displayed, with its rotation applied, read from the header of the file at finalize. null when the file does not state it, or for an Asset uploaded before AdCrunch read it.

400

The request does not match the schema of this operation: a field is missing or has the wrong type, or the body is not valid JSON. error is invalid_request, and issues names each field. Nothing was changed.

issuesobject[]required

One entry for each field that does not match.

Show properties
Array of object
instringrequired

The part of the request that holds the field.

Allowed:bodycookieheadersparamsquery
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

pathstringrequired

A JSON Pointer into that part of the request, such as /filename. An empty string is the whole part.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:invalid_request
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

401

No API key, or one that does not resolve. See the security scheme. error is unauthorized.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:unauthorized
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

403

The caller does not hold asset:write. error is forbidden.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:forbidden
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

404

No stored Asset with that id in this organization. A reservation answers this too, until finalize promotes it to ready. error is not_found.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

Request
curl -X PATCH "https://api.pr-701.adcrunch.dev/assets/string" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Spring sale 9:16"
}'
Response
{
  "contentHash": "9d2f41b7c6e8a35014f7b2d9c3e6a810",
  "createdAt": 1790000000000,
  "createdBy": "usr_2e5b84",
  "deletedAt": null,
  "durationMs": 15000,
  "filename": "spring-sale.mp4",
  "height": 1920,
  "id": "ast_7c1e9a",
  "key": "org_3a7f10/ast_7c1e9a",
  "kind": "video",
  "mimeType": "video/mp4",
  "name": "Spring sale 9:16",
  "organizationId": "org_3a7f10",
  "sizeBytes": 24117248,
  "status": "ready",
  "updatedAt": 1790000120000,
  "width": 1080
}