# Set an uploaded file's location or mockup flag

```http
PUT https://secure.yoprint.com/v1/api/store/{team_slug}/async_upload/{hash_id}
```

- API version: v1
- Operation ID: `v1_public_async_upload_update_put`
- Section: Imports and exports › [Uploads](https://developer.yoprint.com/reference/uploads.md)
- Web page: https://developer.yoprint.com/reference/uploads/v1-async-upload-update-put/
- Authentication: `Authorization: Bearer YOUR_API_KEY`

Saves `location` and `show_mockup` on a file, as custom properties. Use `PUT` with a JSON body.

Only values that are not empty or false are saved: you can set `show_mockup` to `true` but not back to `false`, and you can't clear `location`.

## Permission

Any member of the team.

## Business rules

- `location` is text; `show_mockup` is a boolean.

## Path parameters

- `team_slug` (string, required): Your team slug, shown as Team ID next to your API key in Profile. Example `your-team`.
- `hash_id` (string, required): The file's `id`, from the upload answer. A hash id; unique keys and document numbers are refused with 404. Example `b0l2VJxwa3ppc7`.

## Request body

Content type `application/json`, required.

Fields:

- `location` (string, optional): Where the artwork goes, such as "Front".
- `show_mockup` (boolean, optional)

### Example request

```bash
curl -X PUT 'https://secure.yoprint.com/v1/api/store/your-team/async_upload/b0l2VJxwa3ppc7' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'X-Yoprint-Decimal-Format: exact-v1' \
  -H 'Content-Type: application/json' \
  -d '{
    "location": "Front",
    "show_mockup": true
  }'
```

## Response

`200` Successful response.

Fields:

- `data` (object, required): A file attached to a record has extra fields for it: `job_id` (with `job_service` and the current approval fields), `job_preset_id` (a job preset's file, with `job_service`: the preset's service ids), `order_id`, `po_id` or `customer_id`.
  - `assetUrl` (string, optional): Images that are unattached uploads or job mockups only: a signed link the mockup editor uses. It expires; don't store it.
  - `collection` (string, optional): An upload is `default`, `mockup` or `production_file`. A file attached to a record can be in another collection of that record.
  - `created_at` (string (date-time), optional)
  - `custom_properties` (object | array, optional): Saved properties such as `location` and `show_mockup`. An empty list `[]` when there are none.
  - `dimensions` (object | null, optional): Pixel size of an image, read from its header; null for other files and for images uploaded before the size was recorded.
    - `height` (integer, optional)
    - `width` (integer, optional)
  - `file_name` (string, optional)
  - `id` (string, optional): The upload id. Pass it as `attachment[].id` to attach the file.
  - `is_image` (boolean, optional)
  - `mime_type` (string, optional)
  - `name` (string, optional): The original file name without its extension.
  - `position` (integer | null, optional): The file's place in its list.
  - `preview` (object | null, optional): Preview links `small`, `medium` and `large` (250, 800 and 1200 px). Images up to 10 MB are their own preview, so they have these at once; a larger image has them once `preview_state` is `ready`. Other files have null while they are unattached uploads; once attached, some records (such as jobs) give them links to a converted preview.
    - `large` (string, optional)
    - `medium` (string, optional)
    - `small` (string, optional)
  - `previewUrl` (string, optional): Same images only: a signed preview link for the mockup editor. It expires; don't store it.
  - `preview_state` (string, optional): `ready`: the preview links work. `processing`: an image over 10 MB whose stored preview a worker is still making (seconds); read the file again, or in the web app wait for `media.preview_state_changed` on the team channel. `too_large`: an image over 120 megapixels; it never gets a preview. `failed`: the worker gave up, or the converter could not read the original (missing, broken or unsupported); it is not retried. `none`: not an image. One of: `"ready"`, `"processing"`, `"too_large"`, `"failed"`, `"none"`.
  - `show_in_pdf` (boolean | null, optional)
  - `size` (integer, optional): Bytes.
  - `source_media_id` (string | null, optional): The file this one was copied from, when it is a copy. Always null on job and job preset files.
  - `url` (string, optional): A signed download link. It expires; don't store it.
  - `view_url` (string, optional): A signed link to view the file. It expires; don't store it.
- `status` (integer, required)
- `success` (boolean, required)

Example response:

```json
{
  "data": {
    "assetUrl": "https://secure.yoprint.com/api/store/your-team/mockup-design-asset/b0l2VJxwa3ppc7/view",
    "collection": "mockup",
    "created_at": "2026-11-03T09:30:00+00:00",
    "custom_properties": {
      "location": "Front",
      "show_mockup": true
    },
    "file_name": "front-logo.png",
    "id": "b0l2VJxwa3ppc7",
    "is_image": true,
    "mime_type": "image/png",
    "name": "front-logo",
    "position": 1,
    "preview": {
      "large": "https://example.com/media/front-logo-1200.png",
      "medium": "https://example.com/media/front-logo-800.png",
      "small": "https://example.com/media/front-logo-250.png"
    },
    "previewUrl": "https://secure.yoprint.com/api/store/your-team/mockup-design-asset/b0l2VJxwa3ppc7/preview?size=preview",
    "show_in_pdf": null,
    "size": 182044,
    "source_media_id": null,
    "url": "https://example.com/media/front-logo.png?download=1",
    "view_url": "https://example.com/media/front-logo.png"
  },
  "status": 200,
  "success": true
}
```

## Errors

- `401` The API key is missing or wrong (`unauthenticated`).
- `403` You are not allowed to do this. `api_access_not_in_plan`: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only `{"message": "Insufficient Permission"}`. Other refusals use the error envelope, with `unauthorized` or `user_is_not_authorized`.
- `404` Not found. `page_not_found`: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. `code: null`, with a message that starts "No query results for": there is no record with that id.
  - When: No file of this team has this id. Fix: Use the `id` the upload returned.
- `422` Validation failed, or the image was refused by the media rules: a mockup that is not an image a preview can be made of (`mockup_type_not_allowed`), or an image over a size limit (`image_not_allowed`), or a file that is a web page, a script or a program (`validation_failed` on `media`, or `upload_not_allowed`: "This type of file cannot be uploaded."); `error.message` is one sentence naming the limit.
  - When: A new `media` file is a web page, a script or a program, judged by its extension and by its detected type (for example .html, .js, .php, .py, .sh, .exe, .bat, .jar, .apk, .app, .dmg). `error.fields.media` says "This type of file cannot be uploaded." (`validation_failed`). Fix: Put the file in a .zip, or send a different file type.
  - When: A value has the wrong type, or you used `PATCH` without a `media` file (`validation_failed`; `error.fields` names the field). Fix: Use `PUT` with JSON.

## Notes

- It works on any file of your team, including files already attached to a job.

## Related

- [Get an uploaded file](https://developer.yoprint.com/reference/uploads/v1-async-upload-show.md): `GET /v1/api/store/{team_slug}/async_upload/{hash_id}`
