# Shared links API

Source: https://frameleaf.app/docs/api/reference/shared-links/

Use your own server and its scoped API keys.

## Retrieve all shared links

GET /api/shared-links

Retrieve a list of all shared links.

```json
{
  "description": "Retrieve a list of all shared links.",
  "operationId": "getAllSharedLinks",
  "parameters": [
    {
      "name": "albumId",
      "required": false,
      "in": "query",
      "description": "Filter by album ID",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    },
    {
      "name": "id",
      "required": false,
      "in": "query",
      "description": "Filter by shared link ID",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/SharedLinkResponseDto"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve all shared links",
  "tags": [
    "Shared links"
  ],
  "x-frameleaf-permission": "sharedLink.read"
}
```

## Create a shared link

POST /api/shared-links

Create a new shared link.

```json
{
  "description": "Create a new shared link.",
  "operationId": "createSharedLink",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/SharedLinkCreateDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SharedLinkResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Create a shared link",
  "tags": [
    "Shared links"
  ],
  "x-frameleaf-permission": "sharedLink.create"
}
```

## Delete a shared link

DELETE /api/shared-links/{id}

Delete a specific shared link by its ID.

```json
{
  "description": "Delete a specific shared link by its ID.",
  "operationId": "removeSharedLink",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "204": {
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Delete a shared link",
  "tags": [
    "Shared links"
  ],
  "x-frameleaf-permission": "sharedLink.delete"
}
```

## Retrieve a shared link

GET /api/shared-links/{id}

Retrieve a specific shared link by its ID.

```json
{
  "description": "Retrieve a specific shared link by its ID.",
  "operationId": "getSharedLinkById",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SharedLinkResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve a shared link",
  "tags": [
    "Shared links"
  ],
  "x-frameleaf-permission": "sharedLink.read"
}
```

## Update a shared link

PATCH /api/shared-links/{id}

Update an existing shared link by its ID.

```json
{
  "description": "Update an existing shared link by its ID.",
  "operationId": "updateSharedLink",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/SharedLinkEditDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SharedLinkResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Update a shared link",
  "tags": [
    "Shared links"
  ],
  "x-frameleaf-permission": "sharedLink.update"
}
```

## Remove assets from a shared link

DELETE /api/shared-links/{id}/assets

Remove assets from a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.

```json
{
  "description": "Remove assets from a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.",
  "operationId": "removeSharedLinkAssets",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AssetIdsDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/AssetIdsResponseDto"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Remove assets from a shared link",
  "tags": [
    "Shared links"
  ],
  "x-frameleaf-permission": "sharedLink.update"
}
```

## Add assets to a shared link

PUT /api/shared-links/{id}/assets

Add assets to a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.

```json
{
  "description": "Add assets to a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.",
  "operationId": "addSharedLinkAssets",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AssetIdsDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/AssetIdsResponseDto"
            },
            "type": "array"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Add assets to a shared link",
  "tags": [
    "Shared links"
  ],
  "x-frameleaf-permission": "sharedLink.update"
}
```
