> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.usglobalmail.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.usglobalmail.com/_mcp/server.

# Unarchive mail item

POST https://api.usglobalmail.com/v1/mails/{id}/unarchive

Restore an archived item back to its previous inbox status

Reference: https://docs.usglobalmail.com/api/api-reference/mails/unarchive

## Authentication

- `Authorization` header (bearer token, required) — Your API key, sent as `Authorization: Bearer usgmk_live_…` in production or `usgmk_test_…` in the sandbox.

## Servers

- `https://api.usglobalmail.com` (Production, default)
- `https://api-sandbox.usglobalmail.com` (Sandbox)

## Request

### Path parameters

- `id` (string, required)

## Response

### 200

- `id` (string, required) — Mail item id (numeric string).
- `is_read` (boolean, required)
- `mail_status` (string, required) — Lifecycle status as reported by the mailroom.
- `mail_type` (string, required)
- `mail_type_label` (string, required) — Human-readable form of `mail_type` (e.g. "Large Letter").
- `measurement` (MailDetailDtoMeasurement, required) — Item dimensions, in inches.
- `weight` (double, required) — Item weight, in pounds.
- `has_storage_charges` (boolean, required) — Whether the item is currently accruing storage charges.
- `sender_name` (string, optional, nullable)
- `recipient_name` (string, optional, nullable)
- `arrival_date` (datetime, optional, nullable) — When the item arrived at the facility.
- `envelope_image_url` (string, optional, nullable) — Photo of the item/envelope.
- `quarantine_reason` (string, optional, nullable)
- `scan` (MailDetailDtoScan, optional, nullable) — The scan requested for this item, when one exists.
- `tracking_number` (string, optional, nullable) — Inbound carrier tracking number, when one was captured.
- `sender_address` (string, optional, nullable)
- `folder` (MailDetailDtoFolder, optional, nullable)

## Errors

### 400 Bad Request Error

Bad request.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 401 Unauthorized Error

Authentication is required or the API key is invalid.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 403 Forbidden Error

You are not permitted to perform this action.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 404 Not Found Error

Resource not found.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 409 Conflict Error

The request conflicts with the current state of the resource.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 422 Unprocessable Entity Error

Validation failed.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 429 Too Many Requests Error

Rate limit exceeded.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 500 Internal Server Error

Internal error.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

## Types

### MailDetailDtoMeasurement

Item dimensions, in inches.

- `width` (double, required) — Inches.
- `height` (double, required) — Inches.
- `length` (double, required) — Inches.

### MailDetailDtoScan

The scan requested for this item, when one exists.

- `uuid` (string, required) — Scan id — fetch it via `/v1/scans/{uuid}`.
- `status` (string, required) — `IN_PROCESS`, `COMPLETED`, `CANCELLED`, `REJECTED`, `DELETED` or `RESTORING`.
- `category` (string, required) — `SCAN_REQUEST` or `UNBOXING_REQUEST`.
- `label` (string, optional, nullable) — Short AI-generated label of the scanned document (e.g. "Insurance"). Null until generated; requires a plan that includes scan labeling.

### MailDetailDtoFolder

- `id` (string, required)
- `name` (string, required)
- `color` (string, optional, nullable)

### ProblemDetailsDtoErrorsItems

- `field` (string, required)
- `message` (string, required)
- `code` (string, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "1023456789",
  "is_read": false,
  "mail_status": "INBOX",
  "mail_type": "LARGE_ENVELOPE",
  "mail_type_label": "Large Envelope",
  "measurement": {
    "width": 9.5,
    "height": 4,
    "length": 12
  },
  "weight": 0.75,
  "has_storage_charges": false,
  "sender_name": "John Doe",
  "recipient_name": "Jane Smith",
  "arrival_date": "2024-01-15T09:30:00Z",
  "envelope_image_url": "https://usglobalmail.com/images/envelopes/1023456789.jpg",
  "quarantine_reason": null,
  "scan": {
    "uuid": "a3f1c9e2-4b7d-4f8a-9c3e-2d5f7b8a9c1e",
    "status": "COMPLETED",
    "category": "SCAN_REQUEST",
    "label": "Invoice"
  },
  "tracking_number": "9400110200881234567890",
  "sender_address": "123 Main St, Springfield, IL 62704, USA",
  "folder": {
    "id": "2001",
    "name": "Personal Mail",
    "color": "#4A90E2"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.usglobalmail.com/v1/mails/id/unarchive"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.usglobalmail.com/v1/mails/id/unarchive';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.usglobalmail.com/v1/mails/id/unarchive"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.usglobalmail.com/v1/mails/id/unarchive")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.usglobalmail.com/v1/mails/id/unarchive")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.usglobalmail.com/v1/mails/id/unarchive', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.usglobalmail.com/v1/mails/id/unarchive");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.usglobalmail.com/v1/mails/id/unarchive")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```