> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/products/product-videos/create-a-product-video.md).

# Create a product video

Attaches a video to a product. Provide **at least one** of `video` (inline content) or `video_path` (a path to an already-uploaded file); if neither is supplied the request is rejected with error code `product_image_500_1`.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Product Videos","description":"Administrative endpoints for **product videos** — video files attached to a product and shown alongside its images on the storefront.\n\n## Core Capabilities\n\n**1. Product Video Listing & Filtering**\n* Retrieve a paginated list of product videos, ordered by `order` ascending by default.\n* Filter by product and by the stored video file reference.\n\n**2. Product Video Lifecycle Management**\n* Attach a video to a product, supplying either inline video content or the storage path of an already-uploaded file.\n* Retrieve, update (PUT/PATCH), or delete a single product video.\n\n## Supplying the Video\n\nA product video is defined by exactly one of two mutually complementary inputs — at least one **must** be provided on create:\n\n| Field | Description |\n|-------|-------------|\n| `video` | Inline video file content sent as a string. It is wrapped into a file and stored. |\n| `video_path` | The storage path of a video file that has already been uploaded to the media backend. The record simply points at that path. |\n\nWhen updating, the `product` and inline `video` fields cannot be changed; only `video_path` (to repoint the file), `order`, and other writable fields are applied.\n\n## Dynamic Settings & Environment Variables\n\nNo dynamic settings (`dj_dynamic_settings`) and no environment variables affect these endpoints."}],"servers":[{"description":"Omnitron Remote Proxy (external access — recommended)","url":"https://{omnitron_url}/api/v1/remote/{channel_id}","variables":{"omnitron_url":{"default":"sandbox.akinon.com","description":"Omnitron server URL (e.g., {omnitron.akinon.com})"},"channel_id":{"default":"1","description":"The channel identifier the remote request is routed through"}}},{"description":"Commerce API Server (internal / direct access only)","url":"https://{commerce_url}/api/v1","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Internal commerce server URL, reachable only from within the Omnitron network"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token credential sent in the Authorization header, in the form: `Token <your-token>`. Requires a staff (admin) account."}},"schemas":{"ProductVideoRequest":{"type":"object","description":"Fields for creating or fully replacing a product video. At least one of `video` or `video_path` must be supplied on create. On update, `product` and `video` are ignored; use `video_path` to repoint the stored file.","required":["product"],"properties":{"product":{"type":"integer","description":"Identifier of the product the video belongs to. Ignored on update."},"video":{"type":"string","description":"Inline video file content, sent as a string. Ignored on update."},"video_path":{"type":"string","description":"Storage path of an already-uploaded video file to point the record at."},"order":{"type":"integer","minimum":0,"description":"Sort order. Lower values appear first. Defaults to `0`.","default":0}}},"ProductVideo":{"type":"object","description":"A product video record.","properties":{"pk":{"type":"integer","readOnly":true,"description":"Unique identifier of the product video."},"product":{"type":"integer","description":"Identifier of the product the video belongs to."},"video":{"type":"string","description":"Reference to the stored video file."},"order":{"type":"integer","minimum":0,"description":"Sort order used when listing a product's videos. Lower values appear first.","default":0}},"required":["pk","product","video","order"]},"ValidationError":{"type":"object","description":"Returned when the request contains invalid or missing data. Errors are grouped by the field they apply to: each key is the name of a field from the request and its value is a list of one or more messages describing what is wrong with that field. Messages that do not belong to any single field are grouped under `non_field_errors`.","properties":{"non_field_errors":{"type":"array","description":"Error messages that apply to the request as a whole rather than to a specific field.","items":{"type":"string"}}},"additionalProperties":{"type":"array","description":"The list of error messages for the field named by the key.","items":{"type":"string"}}},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true},"ProductVideoBusinessError":{"type":"object","description":"Returned with HTTP `406` when a product video request violates a business rule — on create, neither `video` nor `video_path` was provided.","properties":{"non_field_errors":{"type":"string","description":"A human-readable message describing the business rule that was violated."},"error_code":{"type":"string","description":"A stable code identifying the violation."}},"additionalProperties":true}},"responses":{"ValidationError":{"description":"The request contains invalid or missing data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"Unauthorized":{"description":"Authentication credentials were not provided or are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The authenticated user does not have administrator privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ProductVideoBusinessError":{"description":"The request is well-formed but violates a business rule — for creation, neither `video` nor `video_path` was provided (`product_image_500_1`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVideoBusinessError"}}}}}},"paths":{"/product_video/":{"post":{"tags":["Product Videos"],"operationId":"createProductVideo","summary":"Create a product video","description":"Attaches a video to a product. Provide **at least one** of `video` (inline content) or `video_path` (a path to an already-uploaded file); if neither is supplied the request is rejected with error code `product_image_500_1`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVideoRequest"}}}},"responses":{"201":{"description":"The product video was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVideo"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"406":{"$ref":"#/components/responses/ProductVideoBusinessError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/products/product-videos/create-a-product-video.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
