---
title: "Media from the library on the phone as if shot with it (push), remove what we put (clean), or list it"
method: POST
path: "/devices/{name}/media"
tags: ["Files and media"]
---

# Media from the library on the phone as if shot with it (push), remove what we put (clean), or list it

`POST /devices/{name}/media`

## Request

- Base URL: `https://api.clousd.com/v1`
- URL: `https://api.clousd.com/v1/devices/{name}/media`
- Auth: HTTP bearer

push writes the file to /sdcard/<dir>/ under a gallery-style name of the phone's brand, re-encoded for this phone (EXIF make/model, capture time in the exit time zone, exit-city GPS when geo is true) and registers it in MediaStore. Media is uploaded from the dashboard (POST /api/media/upload) and referenced by id and owner.

## Request body

- object
  - `action` 'push' | 'clean' | 'list', required
  - `id` string
  - `owner` string
  - `geo` boolean
  - `unique` boolean
  - `dir` string

## Response `200`

OK

- object
  - `ok` boolean
  - `path` string
  - `name` string
  - `kind` string
  - `unique` boolean
  - `geo` boolean
  - `taken_at` string
  - `make` string
  - `model` string
  - `removed` integer
  - `pushed` object[]

## Other responses

- `404`: Error
- `409`: Error

---

[API](https://skmtc.dev/clousd/apis/clousd-api.md) · [All operations](https://skmtc.dev/clousd/apis/clousd-api/llms.txt) · [OpenAPI document](https://skmtc.dev/clousd/apis/clousd-api/revisions/0291ffd26ae3?raw)
