---
title: "Create a share"
method: PUT
path: "/shares"
tags: ["Shares"]
---

# Create a share

`PUT /shares`

Create a public url that can be used by anyone to stream media. Takes the file id with optional description and expires parameters.

## Query parameters

- `filter` string
- `type` 'album' | 'artist' | 'playlist' | 'podcast' | 'podcast_episode' | 'song' | 'video'
- `description` string
- `expires` integer

## Request body

- ShareCreateSharesRequest
  - `filter` string, required — Object id
  - `type` 'album' | 'artist' | 'playlist' | 'podcast' | 'podcast_episode' | 'song' | 'video', required
  - `description` string — Filled in for you if empty
  - `expires` integer — Days to keep active

## Response `200`

Share created

- ShareObject
  - `id` string, required
  - `name` string, required
  - `owner` string, required
  - `allow_stream` boolean, required
  - `allow_download` boolean, required
  - `creation_date` integer, required
  - `lastvisit_date` integer, required
  - `object_type` string, nullable, required — The kind of object referenced, as a bare string. The set is intentionally open so a new media type is not a breaking change; values seen today include `song`, `album`, `artist`, `playlist`, `podcast`, `podcast_episode` and `video`.
  - `object_id` string, required
  - `expire_days` integer, required
  - `max_counter` integer, required
  - `counter` integer, required
  - `secret` string, nullable, required
  - `public_url` string, nullable, required
  - `description` string, nullable, required

## Other responses

- `400` — HTTP 400 Bad Request (errors 4705, 4710).
- `401` — HTTP 401 Unauthorized (error 4701).
- `403` — HTTP 403 Forbidden (errors 4700, 4703, 4742).
- `404` — HTTP 404 Not Found (error 4704).
- `500` — HTTP 500 Internal Server Error (error 4702).

---

[API](https://skmtc.net/ampache/apis/ampache-rest-api.md) · [All operations](https://skmtc.net/ampache/apis/ampache-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ampache/ampache-rest-api/revisions/535feee32afb/schema)
