Assets

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}

Request

  • Base URL: https://api.adcrunch.dev
  • URL: https://api.adcrunch.dev/assets/{id}
  • Auth: HTTP bearer

Path parameters

idstring required

The Asset id.

Request body

namestring required

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

Example request

{
  "name": "Spring sale 9:16"
}

Response

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

contentHashstring required

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.

createdAtnumber required

Milliseconds since the Unix epoch, UTC.

createdBystring required

The user who reserved the upload.

deletedAtnumber nullable required

Always null here. A deleted Asset is not answered.

durationMsnumber nullable required

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.

filenamestring required

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

heightnumber nullable required

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.

idstring required

The id of the Asset, ast_….

keystring required

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

kind'image' | 'video' required

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

mimeTypestring required

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

namestring nullable required

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.

organizationIdstring required

The organization that owns the Asset.

sizeBytesnumber required

Read from the stored object at finalize.

status'pending' | 'ready' required

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

updatedAtnumber nullable required

When the Asset last changed, in milliseconds since the Unix epoch, UTC: at finalize, or at the last rename.

widthnumber nullable required

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.

Example 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
}

Changes

No recorded changes to this operation across all 1 revision of this API.