> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gumnut.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Restore a library from trash

> Restores a previously-trashed library so it reappears in default list/search results. Works as long as the library row still exists — once `get_library` returns 404 the row is gone and restore is no longer possible. If the background drain has already started purging assets, restore succeeds but recovers only the assets the drain hasn't gotten to yet.

Pairs with `trash_library`. To restore individual trashed assets within an untrashed library, use `restore_assets` instead.



## OpenAPI

````yaml https://api.gumnut.ai/openapi.json post /api/libraries/{library_id}/restore
openapi: 3.1.0
info:
  title: Gumnut API
  description: API for using Gumnut to manage photos and videos
  version: 0.1.0
servers: []
security: []
paths:
  /api/libraries/{library_id}/restore:
    post:
      tags:
        - libraries
      summary: Restore a library from trash
      description: >-
        Restores a previously-trashed library so it reappears in default
        list/search results. Works as long as the library row still exists —
        once `get_library` returns 404 the row is gone and restore is no longer
        possible. If the background drain has already started purging assets,
        restore succeeds but recovers only the assets the drain hasn't gotten to
        yet.


        Pairs with `trash_library`. To restore individual trashed assets within
        an untrashed library, use `restore_assets` instead.
      operationId: restore_library
      parameters:
        - name: library_id
          in: path
          required: true
          schema:
            type: string
            description: Library ID (with `lib_` prefix) of the trashed library to restore.
            title: Library Id
          description: Library ID (with `lib_` prefix) of the trashed library to restore.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LibraryResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique library identifier with 'lib_' prefix
        name:
          type: string
          title: Name
          description: Display name of the library
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description text for the library
        user_id:
          type: string
          title: User Id
          description: ID of the user who owns this library
        asset_count:
          type: integer
          title: Asset Count
          description: Total number of assets in this library
        storage_used_bytes:
          type: integer
          title: Storage Used Bytes
          description: Bytes of assets currently stored in this library
        storage_limit_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Storage Limit Bytes
          description: >-
            Maximum bytes this library may store, or null if no per-library
            limit applies
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When this library was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When this library was last updated
      type: object
      required:
        - id
        - name
        - user_id
        - asset_count
        - storage_used_bytes
        - created_at
        - updated_at
      title: LibraryResponse
      description: Represents a user's photo library.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````