---
title: "Document expiration"
description: "Expired documents are not allowed by default when supplied for the document_scan task. It is possible to change this behavior by providing the allowedExpiration setting. A positive number allows a document to be expired for the specified number of days, a negative number requires a document to be valid for at least the specified number of days."
canonical: "https://docs.cm.com/verification/id-scan/use-cases/document-expiration"
---

# Document expiration

> Expired documents are not allowed by default when supplied for the document_scan task. It is possible to change this behavior by providing the allowedExpiration setting. A positive number allows a document to be expired for the specified number of days, a negative number requires a document to be valid for at least the specified number of days.

Source: https://docs.cm.com/verification/id-scan/use-cases/document-expiration

Expired documents are not allowed by default when supplied for the `document_scan` task. It is possible to change this behavior by providing the `allowedExpiration` setting. A positive number allows a document to be expired for the specified number of days, a negative number requires a document to be valid for at least the specified number of days.

```text title="Request"
POST https://api.cm.com/id-scan/v1/transactions
```

```text title="Request headers"
Content-Type: application/json
Authorization: Bearer GENERATED_TOKEN_HERE
```

**Document should be valid for at least 90 days after expiration date**

```json title="Request body"
{
    "tasks": [
        "document_scan"
    ],
    "settings": {
        "documentScan": {
            "allowedExpiration": 90
        }
    }
}
```

**Document should be valid for at least 90 days before expiration date**

```json title="Request body"
{
    "tasks": [
        "document_scan"
    ],
    "settings": {
        "documentScan": {
            "allowedExpiration": -90
        }
    }
}
```
