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

# Unarchive Customer

> Restore a previously archived customer.



## OpenAPI

````yaml POST /api/v1/customers/{customer_key}/unarchive
openapi: 3.0.1
info:
  title: Metrifox API Documentation
  version: v1
  description: >-
    Welcome to Metrifox Platform's API documentation. This comprehensive API
    suite enables seamless integration with our platform, providing secure and
    efficient access to our services.
servers:
  - url: https://{defaultHost}
    variables:
      defaultHost:
        default: api.metrifox.com
security:
  - api_key: []
paths:
  /api/v1/customers/{customer_key}/unarchive:
    post:
      tags:
        - Customers
      summary: Unarchive a customer
      description: >
        Restores a previously archived customer, clearing the `archived_at`
        timestamp.


        The customer's history (subscriptions, invoices, usage events, wallets)
        is preserved across archive/unarchive cycles.
      operationId: unarchiveCustomer
      parameters:
        - name: customer_key
          in: path
          required: true
          description: The unique identifier for the customer
          schema:
            type: string
          example: cust-mit7k5v8obzs
      responses:
        '200':
          description: Customer unarchived successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: Customer unarchived successfully
                  data:
                    type: object
                    description: >-
                      The restored customer record (same shape as Get Customer),
                      with `archived_at` set to `null`
                    properties:
                      customer_key:
                        type: string
                      archived_at:
                        type: string
                        format: date-time
                        nullable: true
                        description: '`null` once the customer is unarchived'
              examples:
                unarchived:
                  summary: Customer unarchived
                  value:
                    statusCode: 200
                    message: Customer unarchived successfully
                    meta: {}
                    data:
                      customer_key: cust-mit7k5v8obzs
                      archived_at: null
                    errors: {}
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |
            from metrifox_sdk import MetrifoxClient

            client = MetrifoxClient(api_key="your_api_key")

            result = client.customers.unarchive("cust-mit7k5v8obzs")
            # archived_at is now None
        - lang: javascript
          label: Javascript SDK
          source: >
            import { init } from "metrifox-js";


            const metrifoxClient = init({
              apiKey: process.env.METRIFOX_API_KEY
            });


            const result = await
            metrifoxClient.customers.unarchive("cust-mit7k5v8obzs");

            // result.data.archived_at is now null
        - lang: ruby
          label: Ruby SDK
          source: |
            require 'metrifox-sdk'

            METRIFOX_SDK = MetrifoxSDK.init({ api_key: "your-api-key" })

            result = METRIFOX_SDK.customers.unarchive("cust-mit7k5v8obzs")
            # result["data"]["archived_at"] is now nil
        - lang: curl
          label: cURL
          source: >
            curl -X POST
            "https://api.metrifox.com/api/v1/customers/cust-mit7k5v8obzs/unarchive"
            \
              -H "x-api-key: your-api-key"
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
        errors:
          type: object
          additionalProperties: true
          description: Detailed error information
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header

````