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

# Get User's Template Library

> Retrieve all templates in the authenticated user's library with basic information.



## OpenAPI

````yaml api-reference/openapi.json get /library
openapi: 3.0.3
info:
  title: Senderr Email Template API
  description: >-
    API for accessing and managing email templates in your library. Supports
    both session-based authentication and API key authentication with rate
    limiting based on subscription plans.
  version: 1.0.0
  contact:
    name: Senderr Support
    url: https://senderr.dev/contact
    email: support@senderr.dev
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  termsOfService: https://senderr.dev/terms
servers:
  - url: https://senderr.dev/api/v1
    description: Production server
  - url: http://localhost:3000/api/v1
    description: Development server
security:
  - BearerAuth: []
  - SessionAuth: []
tags:
  - name: Library
    description: Operations related to user's template library
  - name: Templates
    description: Operations for template rendering and source code access
  - name: Email
    description: Operations for sending emails using templates
  - name: Usage
    description: Operations for checking API usage and limits
paths:
  /library:
    get:
      tags:
        - Library
      summary: Get User's Template Library
      description: >-
        Retrieve all templates in the authenticated user's library with basic
        information.
      operationId: getUserLibrary
      responses:
        '200':
          description: Successfully retrieved user's template library
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  templates:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        name:
                          type: string
                        description:
                          type: string
                        is_public:
                          type: boolean
                          description: Whether the template is publicly available
                        price:
                          type: number
                          description: Template price in USD
              example:
                success: true
                templates:
                  - id: 550e8400-e29b-41d4-a716-446655440000
                    name: Welcome Email Template
                    description: >-
                      Perfect for onboarding new users with a warm, professional
                      welcome message.
                    is_public: true
                    price: 0
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
        - SessionAuth: []
components:
  responses:
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Authentication required
            success: false
    RateLimitExceeded:
      description: Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          description: The number of allowed requests in the current period
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: The number of remaining requests in the current period
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: The time when the rate limit resets
          schema:
            type: string
            format: date-time
        X-RateLimit-Plan:
          description: The user's current subscription plan
          schema:
            type: string
            enum:
              - free
              - monthly
              - annual
        Retry-After:
          description: Number of seconds to wait before retrying
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Internal server error
            code: INTERNAL_ERROR
            success: false
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          description: Error code
        success:
          type: boolean
          example: false
        details:
          type: object
          description: Additional error details
      required:
        - error
        - success
    RateLimitErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: API usage limit exceeded
        code:
          type: string
          example: RATE_LIMIT_EXCEEDED
        message:
          type: string
          description: Detailed error message with upgrade suggestions
        details:
          type: object
          properties:
            limit:
              type: integer
              description: Monthly API call limit
            remaining:
              type: integer
              example: 0
            reset:
              type: string
              format: date-time
              description: When the limit resets
            plan:
              type: string
              enum:
                - free
                - monthly
                - annual
            resetInSeconds:
              type: integer
              description: Seconds until limit resets
        upgrade_url:
          type: string
          nullable: true
          description: URL to upgrade plan (for free users)
        documentation:
          type: string
          format: uri
          description: Link to rate limiting documentation
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use your API key from the dashboard. Format: `Bearer your-api-key-here`'
    SessionAuth:
      type: apiKey
      in: cookie
      name: supabase-auth-token
      description: Session-based authentication using browser cookies

````