<!-- Markdown twin of https://pixelvault.dev/docs/api/share-links/ -->

[API reference](/docs/api/)

# Share Links

Password-protected links to one private image or MP4 video, for Starter and Pro projects. The link (pixelvault.dev/s/{id}) opens a page that asks for the password and then shows the media through a short-lived signed URL. Links expire after 1 hour to 90 days (default 7 days) and can be revoked at any time.

-   [The Share link object](#object)
-   GET [List share links](#list_share_links)
-   POST [Create a share link](#create_share_link)
-   GET [Get a share link](#get_share_link)
-   DELETE [Revoke a share link](#revoke_share_link)
-   POST [Unlock a share link](#unlock_share_link)

## The Share link object

A password-protected link to one private image or MP4 video. The password is never returned.

### Properties

The Share link object properties

Property

Type

Description

`id`

string

Share-link id (`shr_` prefix).

`url`

string (uri)

The page to send the recipient. Send the password separately.

`asset_id`

string

The shared image (`img_`) or video (`vid_`).

`asset_kind`

string

One of: `image`, `video`

`status`

string

`revoked` once revoked, else `expired` once `expires_at` has passed, else `active`.

One of: `active`, `expired`, `revoked`

`expires_at`

string (date-time)

`revoked_at`

string (date-time) nullable

`created_at`

string (date-time)

`origin`

string

Where the link was created.

One of: `api`, `dashboard`, `mcp`, `cli`

The Share link object

```
{
  "id": "shr_abc123def456",
  "url": "https://pixelvault.dev/s/shr_abc123def456",
  "asset_id": "img_abc123def456",
  "asset_kind": "image",
  "status": "active",
  "expires_at": "2026-11-29T12:00:00.000Z",
  "revoked_at": null,
  "created_at": "2026-11-22T12:00:00.000Z",
  "origin": "api"
}
```

## List share links

GET `/v1/share-links`

Lists the project's share links, newest first, including expired and revoked ones. Filter to one asset with `asset_id`.

### Authentication

API key, or a dashboard session token, sent as `Authorization: Bearer <token>`.

### Query parameters

Query parameters

Name

Type

Required

Description

`asset_id`

string

Optional

Only links to this image or video.

`limit`

integer

Optional

Maximum number of links to return.

Default: `50`

min 1 · max 100

### Responses

-   200
    
    Share links, newest first
    
-   400
    
    [`validation_error`](/docs/errors/#validation_error): `limit` is not an integer from 1 to 100.
    
-   401
    
    [`unauthorized`](/docs/errors/#unauthorized): no Bearer token, or the dashboard session is invalid or expired. [`invalid_api_key`](/docs/errors/#invalid_api_key): the API key is unknown or revoked.
    
-   403
    
    [`share_link_management_forbidden`](/docs/errors/#share_link_management_forbidden): publishable keys cannot manage share links. [`account_suspended`](/docs/errors/#account_suspended): the account is suspended.
    
-   429
    
    [`rate_limit_exceeded`](/docs/errors/#rate_limit_exceeded): more than 60 requests per minute for this key (or dashboard session) or 300 per minute for the project. Honour `Retry-After`.
    

Request

curlNode.jsPython

```
curl https://api.pixelvault.dev/v1/share-links \
  -H "Authorization: Bearer $PIXELVAULT_API_KEY"
```

Response 200

```
{
  "data": [
    {
      "id": "shr_abc123def456",
      "url": "https://pixelvault.dev/s/shr_abc123def456",
      "asset_id": "img_abc123def456",
      "asset_kind": "image",
      "status": "active",
      "expires_at": "2026-11-29T12:00:00.000Z",
      "revoked_at": null,
      "created_at": "2026-11-22T12:00:00.000Z",
      "origin": "api"
    }
  ]
}
```

## Create a share link

POST `/v1/share-links`

Creates a password-protected link to one private image or MP4 video in the project (Starter and Pro). The caller chooses the password; it is stored only as a hash and never returned, so share it with the recipient separately. The recipient opens `url`, enters the password and sees the media through a signed URL that lasts 10 minutes for images and 1 hour for videos. Public media already has a share page at pixelvault.dev/i/; audio and PDFs are not supported.

### Authentication

API key, or a dashboard session token, sent as `Authorization: Bearer <token>`.

### Request body

`application/json`, required

Request body

Name

Type

Required

Description

`asset_id`

string

Required

A private image (`img_`) or video (`vid_`) in the project.

`password`

string

Required

8 to 128 characters, used as sent (not trimmed).

min length 8 · max length 128

`expires_in`

integer

Optional

Link lifetime in seconds: 1 hour to 90 days, default 7 days.

Default: `604800`

min 3600 · max 7776000

### Responses

-   201
    
    Share link created
    
-   400
    
    [`invalid_json`](/docs/errors/#invalid_json) or [`validation_error`](/docs/errors/#validation_error): `asset_id` missing, `password` not 8 to 128 characters, or `expires_in` outside 3600 to 7776000. [`share_asset_unsupported`](/docs/errors/#share_asset_unsupported): the asset is audio or a PDF.
    
-   401
    
    [`unauthorized`](/docs/errors/#unauthorized): no Bearer token, or the dashboard session is invalid or expired. [`invalid_api_key`](/docs/errors/#invalid_api_key): the API key is unknown or revoked.
    
-   402
    
    [`share_links_require_paid_plan`](/docs/errors/#share_links_require_paid_plan): share links are available on Starter and Pro.
    
-   403
    
    [`share_link_management_forbidden`](/docs/errors/#share_link_management_forbidden): publishable keys cannot manage share links. [`account_suspended`](/docs/errors/#account_suspended): the account is suspended.
    
-   404
    
    [`image_not_found`](/docs/errors/#image_not_found) or [`video_not_found`](/docs/errors/#video_not_found): no such asset in the project. [`account_not_found`](/docs/errors/#account_not_found): the account no longer exists.
    
-   409
    
    [`share_asset_not_private`](/docs/errors/#share_asset_not_private): the asset is public; share links protect private media only.
    
-   429
    
    [`rate_limit_exceeded`](/docs/errors/#rate_limit_exceeded): more than 60 requests per minute for this key (or dashboard session) or 300 per minute for the project. Honour `Retry-After`.
    

Request

curlNode.jsPython

```
curl -X POST https://api.pixelvault.dev/v1/share-links \
  -H "Authorization: Bearer $PIXELVAULT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "asset_id": "img_abc123def456",
  "password": "correct-horse-battery",
  "expires_in": 604800
}'
```

Response 201

```
{
  "data": {
    "id": "shr_abc123def456",
    "url": "https://pixelvault.dev/s/shr_abc123def456",
    "asset_id": "img_abc123def456",
    "asset_kind": "image",
    "status": "active",
    "expires_at": "2026-11-29T12:00:00.000Z",
    "revoked_at": null,
    "created_at": "2026-11-22T12:00:00.000Z",
    "origin": "api"
  }
}
```

## Get a share link

GET `/v1/share-links/{id}`

Returns one share link of the project with its current status.

### Authentication

API key, or a dashboard session token, sent as `Authorization: Bearer <token>`.

### Path parameters

Path parameters

Name

Type

Required

Description

`id`

string

Required

Share-link id (`shr_` prefix).

pattern ^shr\_\[a-z0-9\]{12}$

### Responses

-   200
    
    The share link
    
-   401
    
    [`unauthorized`](/docs/errors/#unauthorized): no Bearer token, or the dashboard session is invalid or expired. [`invalid_api_key`](/docs/errors/#invalid_api_key): the API key is unknown or revoked.
    
-   403
    
    [`share_link_management_forbidden`](/docs/errors/#share_link_management_forbidden): publishable keys cannot manage share links. [`account_suspended`](/docs/errors/#account_suspended): the account is suspended.
    
-   404
    
    [`share_link_not_found`](/docs/errors/#share_link_not_found): no share link with this id belongs to the project.
    
-   429
    
    [`rate_limit_exceeded`](/docs/errors/#rate_limit_exceeded): more than 60 requests per minute for this key (or dashboard session) or 300 per minute for the project. Honour `Retry-After`.
    

Request

curlNode.jsPython

```
curl https://api.pixelvault.dev/v1/share-links/shr_abc123def456 \
  -H "Authorization: Bearer $PIXELVAULT_API_KEY"
```

Response 200

```
{
  "data": {
    "id": "shr_abc123def456",
    "url": "https://pixelvault.dev/s/shr_abc123def456",
    "asset_id": "img_abc123def456",
    "asset_kind": "image",
    "status": "active",
    "expires_at": "2026-11-29T12:00:00.000Z",
    "revoked_at": null,
    "created_at": "2026-11-22T12:00:00.000Z",
    "origin": "api"
  }
}
```

## Revoke a share link

DELETE `/v1/share-links/{id}`

Turns the link off immediately: the next unlock attempt gets [`share_link_not_found`](/docs/errors/#share_link_not_found). Signed URLs already handed out keep working until they expire (at most 1 hour). Idempotent: revoking a revoked link returns it unchanged.

### Authentication

API key, or a dashboard session token, sent as `Authorization: Bearer <token>`.

### Path parameters

Path parameters

Name

Type

Required

Description

`id`

string

Required

Share-link id (`shr_` prefix).

pattern ^shr\_\[a-z0-9\]{12}$

### Responses

-   200
    
    The revoked share link (`status: revoked`)
    
-   401
    
    [`unauthorized`](/docs/errors/#unauthorized): no Bearer token, or the dashboard session is invalid or expired. [`invalid_api_key`](/docs/errors/#invalid_api_key): the API key is unknown or revoked.
    
-   403
    
    [`share_link_management_forbidden`](/docs/errors/#share_link_management_forbidden): publishable keys cannot manage share links. [`account_suspended`](/docs/errors/#account_suspended): the account is suspended.
    
-   404
    
    [`share_link_not_found`](/docs/errors/#share_link_not_found): no share link with this id belongs to the project.
    
-   429
    
    [`rate_limit_exceeded`](/docs/errors/#rate_limit_exceeded): more than 60 requests per minute for this key (or dashboard session) or 300 per minute for the project. Honour `Retry-After`.
    

Request

curlNode.jsPython

```
curl -X DELETE https://api.pixelvault.dev/v1/share-links/shr_abc123def456 \
  -H "Authorization: Bearer $PIXELVAULT_API_KEY"
```

Response 200

```
{
  "data": {
    "id": "shr_abc123def456",
    "url": "https://pixelvault.dev/s/shr_abc123def456",
    "asset_id": "img_abc123def456",
    "asset_kind": "image",
    "status": "active",
    "expires_at": "2026-11-29T12:00:00.000Z",
    "revoked_at": null,
    "created_at": "2026-11-22T12:00:00.000Z",
    "origin": "api"
  }
}
```

## Unlock a share link

POST `/v1/share-links/{id}/unlock`

Public, no credentials: the pixelvault.dev/s/{id} page calls it with the password the recipient typed. On success it returns a signed CDN URL for the media (10 minutes for images, 1 hour for videos, plus a signed poster URL for videos). A link that does not exist, has expired, was revoked, lost its media or whose owner left the paid plan answers the same [`share_link_not_found`](/docs/errors/#share_link_not_found). Attempts are limited to 10 per minute per IP and 30 per hour per link.

### Authentication

None. This endpoint is public.

### Path parameters

Path parameters

Name

Type

Required

Description

`id`

string

Required

Share-link id (`shr_` prefix).

pattern ^shr\_\[a-z0-9\]{12}$

### Request body

`application/json`, required

Request body

Name

Type

Required

Description

`password`

string

Required

### Responses

-   200
    
    Unlocked
    
-   400
    
    [`invalid_json`](/docs/errors/#invalid_json) or [`validation_error`](/docs/errors/#validation_error): no `password` in the body.
    
-   401
    
    [`invalid_share_password`](/docs/errors/#invalid_share_password): wrong password.
    
-   404
    
    [`share_link_not_found`](/docs/errors/#share_link_not_found): the link doesn't exist, has expired or was turned off.
    
-   429
    
    [`rate_limit_exceeded`](/docs/errors/#rate_limit_exceeded): more than 10 attempts per minute from this IP or 30 per hour on this link. Honour `Retry-After`.
    

Request

curlNode.jsPython

```
curl -X POST https://api.pixelvault.dev/v1/share-links/shr_abc123def456/unlock \
  -H "Content-Type: application/json" \
  -d '{"password":"correct-horse-battery"}'
```

Response 200

```
{
  "data": {
    "kind": "image",
    "mime_type": "image/png",
    "url": "https://img.pixelvault.dev/proj_abc123/cp/i/img_abc123def456.png?token=abc&expires=1795449600",
    "expires": 1795449600,
    "link_expires_at": "2026-11-29T12:00:00.000Z"
  }
}
```
