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

# Restore Contact — POST /v1/contacts/{contactId}/unarchive

> POST /v1/contacts/{contactId}/unarchive restores an archived contact to active status. Revoked contacts cannot be unarchived through this endpoint.

Use this endpoint to restore an archived contact to `active` status. Once unarchived, the contact will appear again in the default results of `GET /v1/contacts` and can be used in new payments.

## Base URL

```
POST https://api.cleo-pay.com/v1/contacts/{contactId}/unarchive
```

## Authentication

All requests must include a Bearer token in the `Authorization` header.

```http theme={null}
Authorization: Bearer <token>
```

## Path Parameters

<ParamField path="contactId" type="string" required>
  The unique identifier of the contact to restore.
</ParamField>

## Request Body

This endpoint does not accept a request body.

<Warning>
  This endpoint only works for contacts with `status: "archived"`. Contacts with `status: "revoked"` cannot be restored through the API. Attempting to unarchive a revoked contact will return an error.
</Warning>

## Response

Returns the updated `Contact` object with HTTP status `200 OK` and `status: "active"`.

<ResponseField name="id" type="string">
  Unique identifier for the contact.
</ResponseField>

<ResponseField name="type" type="string">
  The contact type: `payee` or `business`.
</ResponseField>

<ResponseField name="status" type="string">
  The contact's updated status. Will be `active`.
</ResponseField>

<ResponseField name="displayName" type="string | null">
  The contact's display name.
</ResponseField>

<ResponseField name="emails" type="string[]">
  Email addresses associated with the contact.
</ResponseField>

<ResponseField name="phone" type="string | null">
  Phone number for the contact.
</ResponseField>

<ResponseField name="paymentDirection" type="string">
  Allowed payment direction: `bidirectional`, `can_pay`, `can_be_paid`, or `none`.
</ResponseField>

<ResponseField name="netTerms" type="number | null">
  Net payment terms in days, if configured.
</ResponseField>

<ResponseField name="bankAccount" type="object | null">
  Summary of the contact's linked bank account.

  <Expandable title="bankAccount fields">
    <ResponseField name="last4" type="string">
      Last four digits of the bank account number.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="taxInfo" type="object | null">
  Tax information for the contact.

  <Expandable title="taxInfo fields">
    <ResponseField name="legalName" type="string | null">
      Legal name associated with the tax ID.
    </ResponseField>

    <ResponseField name="taxIdType" type="string | null">
      Type of tax ID: `ein` or `ssn`.
    </ResponseField>

    <ResponseField name="taxIdMask" type="string | null">
      Last four digits of the tax ID.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="paymentReady" type="boolean">
  Whether this contact can currently receive payments.
</ResponseField>

<ResponseField name="createdAt" type="datetime">
  ISO 8601 timestamp of when the contact was created.
</ResponseField>

<ResponseField name="updatedAt" type="datetime | null">
  ISO 8601 timestamp of this update.
</ResponseField>

<ResponseField name="archivedAt" type="datetime | null">
  Will be `null` after a successful unarchive.
</ResponseField>

## Example Request

```bash curl theme={null}
curl --request POST \
  --url "https://api.cleo-pay.com/v1/contacts/cnt_01hq1z2k3m4n5p6q7r8s9t0u/unarchive" \
  --header "Authorization: Bearer <token>"
```

## Example Response

```json 200 theme={null}
{
  "id": "cnt_01hq1z2k3m4n5p6q7r8s9t0u",
  "type": "payee",
  "status": "active",
  "displayName": "Acme Supplies LLC",
  "emails": ["billing@acmesupplies.com"],
  "phone": "+15550001234",
  "paymentDirection": "can_be_paid",
  "netTerms": 30,
  "bankAccount": {
    "last4": "7890"
  },
  "taxInfo": {
    "legalName": "Acme Supplies LLC",
    "taxIdType": "ein",
    "taxIdMask": "6789"
  },
  "paymentReady": true,
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-04-10T14:30:00Z",
  "archivedAt": null
}
```

<Note>
  After unarchiving, the contact's `archivedAt` field is reset to `null` and the contact resumes appearing in the default results of `GET /v1/contacts`.
</Note>
