---
title: "Create or update an asset record"
method: POST
path: "/admin/assets"
tags: ["assets"]
---

# Create or update an asset record

`POST /admin/assets`

If `id` is provided the existing record is updated; otherwise a new asset is created.

## Request body

- object
  - `id` number — Asset ID — provide to update an existing asset
  - `type` string — Asset type (e.g. static, folder)
  - `name` string — Filename
  - `url` string — URL of the uploaded file
  - `parent_id` number — Parent folder ID (null for root)
  - `position` number — Sort position
  - `size` number — File size in bytes
  - `width` number — Image width in pixels
  - `height` number — Image height in pixels
  - `caption` string
  - `description` string
  - `link` string — Product link to associate with the asset
  - `metadata` object — Arbitrary metadata to store with the asset

## Response `200`

- object
  - `success` number
  - `id` number — ID of the created or updated asset

## Other responses

- `403` — Not authenticated

---

[API](https://skmtc.dev/goaffpro/apis/goaffpro-api.md) · [All operations](https://skmtc.dev/goaffpro/apis/goaffpro-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/goaffpro/goaffpro-api/revisions/832de9c7d0ae/schema)
