# POST Resend SMS

### Endpoint

```
POST https://openapi.paveapi.com/v2/capture/sessions/{{session_key}}/resend
```

Replace `session_key` with the unique key for the existing session to trigger an SMS resend.

### Path Parameters

| Name         | Type   | Description                                 |
| ------------ | ------ | ------------------------------------------- |
| session\_key | string | Unique session key (e.g., `TOA-XYCBCSR6DD`) |

### Header

| Name             | Type   | Description        |
| ---------------- | ------ | ------------------ |
| API-Access-Token | string | Your API key       |
| Content-Type     | string | `application/json` |

### Request Body (Optional)

```json
{
  "phone": "+84989137086"
}
```

| Field | Type   | Description                                                                |
| ----- | ------ | -------------------------------------------------------------------------- |
| phone | string | Override destination number. If omitted, PAVE uses the original recipient. |

**Business Rules**

* Session must exist and belong to your API key.
* Session cannot resend if status is QC\_PASSED, CONFIRM, COMPLETE, or EXPIRED ( Valid statuses for resend: PEDING, IN\_PROGRESS, SUBMITTED )
* Session age ≤ **7 days**
* Original SMS must have been logged as **delivered** (legacy sessions allowed during grace period).
* **One** resend per session.
* Subject to rate limiting.
* All attempts are audit-logged.

**Sample Request**

```bash
curl --location --request POST 'https://openapi.paveapi.com/v2/capture/sessions/TOA-XYCBCSR6DD/resend' \
  --header 'API-Access-Token: <your-token>' \
  --header 'Content-Type: application/json'
```

**Sample Request (with custom phone)**

```bash
curl --location --request POST 'https://openapi.paveapi.com/v2/capture/sessions/TOA-XYCBCSR6DD/resend' \
  --header 'API-Access-Token: <your-token>' \
  --header 'Content-Type: application/json' \
  --data-raw '{ "phone": "+84989137086" }'
```

**Sample Response (200: Ok)**

```json
{
  "status": "success",
  "message": "SMS resend has been processed",
  "session_key": "TOA-XYCBCSR6DD",
  "phone": "+18005550123",
  "session_age_days": 2,
  "days_remaining": 5
}
```

**Sample Response (404: Not Found)**

```json
{
  "status": "error",
  "message": "Session not found",
  "session_key": "TOA-INVALID"
}
```

**Sample Response (400: Finalized)**

```json
{
  "status": "error",
  "message": "Session is already finalized and cannot be resent",
  "session_key": "TOA-XYCBCSR6DD",
  "session_status": "QC_PASSED"
}
```

**Sample Response (400: Expired)**

```json
{
  "status": "error",
  "message": "Session has expired (older than 7 days)",
  "session_key": "TOA-XYCBCSR6DD",
  "age_days": 9,
  "max_days": 7
}
```

**Sample Response (400: Already Resent)**

```json
{
  "status": "error",
  "message": "SMS resend already attempted for this session",
  "session_key": "TOA-XYCBCSR6DD",
  "previous_resend_at": "2025-09-08T10:00:00Z",
  "total_attempts": 2
}
```

**Notes**

* “delivered” indicates the SMS was accepted by the provider (not handset confirmation).
* For sessions created before SMS logging, resend may pass during a limited grace period.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paveapi.com/integrations/developer-docs/api-details/post-resend-sms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
