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

# Unarchive a template

> Return an archived template to service with its versions and live version unchanged. Unarchiving an active template is a no-op.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/templates/{id}/unarchive
openapi: 3.0.0
info:
  version: 0.0.1
  title: LithoBlocks API
  description: >-

    Manage templates, compile and send Slack messages, schedule delivery, build
    batch digests, and configure interactive workflows.


    Use /v1 paths and snake_case request fields. Authenticate with an
    organization-scoped API key in the Authorization: Bearer header. Each
    operation documents its required scope; a key without it receives 403 and
    required_scopes. A user's organization role limits which scopes a key can
    receive. Compiling and sending require messages:create; read access alone
    does not allow either operation.


    Create and manage keys in Integrations → API Keys. Store credentials in a
    secret manager, grant only the scopes needed, and use separate keys for each
    environment. Resources and credentials do not transfer between environments.


    Use code and request_id to diagnose API errors. The error field can be a
    string or a schema-validation object; consult the endpoint response schema
    for details. Resource list endpoints document their pagination and
    compatibility fields individually.


    See the documentation guides for API key lifecycle, the complete scope/role
    matrix, environment availability, input-schema discovery, and idempotent
    sending. The endpoint definitions below are the source for request and
    response contracts.
                
  contact:
    name: LithoBlocks
    url: https://lithoblocks.com
    email: support@lithoblocks.com
servers:
  - url: https://api.lithoblocks.com
    description: Production (paths in this spec are rooted at /v1/...)
  - url: http://localhost:8787
    description: Local dev (paths in this spec are rooted at /v1/...)
security: []
paths:
  /v1/templates/{id}/unarchive:
    post:
      tags:
        - Templates
      summary: Unarchive a template
      description: >-
        Return an archived template to service with its versions and live
        version unchanged. Unarchiving an active template is a no-op.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Template unarchived
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateLifecycle'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Template not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: The request body, query string or path parameters failed validation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: Rate limit exceeded for this organization; see Retry-After
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth:
            - templates:update
components:
  schemas:
    TemplateLifecycle:
      type: object
      properties:
        id:
          type: string
        lifecycle:
          type: string
          enum:
            - active
            - archived
        archived_at:
          type: string
          nullable: true
        changed:
          type: boolean
          description: False when the template was already in that state
      required:
        - id
        - lifecycle
        - archived_at
        - changed
    ApiError:
      type: object
      properties:
        error:
          type: string
          description: Human-readable summary. Not stable; match on `code`.
        code:
          $ref: '#/components/schemas/ErrorCode'
        request_id:
          type: string
          description: >-
            Echoed from the request's X-Request-Id header, or generated. Quote
            it in support requests.
        message:
          type: string
        details:
          type: string
        error_details:
          type: string
        success:
          type: boolean
          enum:
            - false
        valid:
          type: boolean
          enum:
            - false
        required_scopes:
          type: array
          items:
            type: string
        user_scopes:
          type: array
          items:
            type: string
      required:
        - error
        - code
        - request_id
    ValidationError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            issues:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  path:
                    type: array
                    items:
                      anyOf:
                        - type: string
                        - type: number
                  message:
                    type: string
                required:
                  - code
                  - path
                  - message
            name:
              type: string
          required:
            - issues
            - name
        message:
          type: string
          description: >-
            The issues as one line, `path: message; path: message`, for callers
            that show a string (form builders such as Make)
        code:
          type: string
          enum:
            - validation_failed
        request_id:
          type: string
      required:
        - success
        - error
        - message
        - code
        - request_id
    ErrorCode:
      type: string
      enum:
        - unauthenticated
        - invalid_token
        - insufficient_scope
        - access_denied
        - validation_failed
        - invalid_request
        - invalid_data
        - invalid_destination
        - invalid_search_query
        - not_found
        - template_not_found
        - version_not_found
        - organization_not_found
        - entity_not_found
        - field_not_found
        - user_not_found
        - profile_not_found
        - credits_not_found
        - insufficient_credits
        - overage_limit_exceeded
        - credit_deduction_failed
        - compilation_failed
        - no_blocks_to_send
        - slack_not_connected
        - slack_user_not_found
        - slack_dm_failed
        - slack_token_decrypt_failed
        - slack_api_error
        - already_exists
        - invitation_pending
        - idempotency_conflict
        - idempotency_in_progress
        - rate_limited
        - tier_limit
        - invalid_state
        - template_archived
        - template_in_use
        - template_not_activated
        - current_version_changed
        - maintenance
        - misconfigured
        - internal_error
      description: >-
        Machine-readable reason for the failure. Match on this, not on `error`.
        New codes may be added; existing ones are stable.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        LithoBlocks API key obtained from your organization dashboard. The
        LithoBlocks MCP server also presents a Supabase-issued user session
        token here on the user's behalf; such a token acts as that user with the
        scopes their organization role allows.

````