> ## Documentation Index
> Fetch the complete documentation index at: https://onextel-09023014.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Resend a PIN

> Issue a fresh PIN on an existing pinId, optionally on a different channel.

Use this when the user says they never got the code, or when the PIN has expired and you want to
keep them in the same flow rather than starting over.

<Warning>
  A resend is **not** a re-delivery of the earlier code. The PIN is only ever stored hashed, so
  there is no original to send again — every resend generates a new PIN and resets its expiry and
  its attempt allowance. Any code the user is still holding stops working the moment this call
  succeeds.
</Warning>

## Switching channel

The most useful thing about a resend is that it does not have to use the channel the original
went out on. If SMS was rejected, resend on WhatsApp against the same `pinId`:

```json Request theme={null}
{
  "channels": ["whatsapp"]
}
```

Omit `channels` to reuse the original send's channels.

## Cooldown

Each template sets a `resendCooldown`. A resend inside that window is rejected with
`resend_cooldown` (429) — surface a "try again in a moment" state rather than retrying
automatically. Read the current value off
[List templates](/api-reference/verify/list-templates).

The PIN must also still be resendable: a PIN that is already verified returns
`pin_already_verified`, and one whose attempts are exhausted returns `pin_blocked`. Both are
`409` — start a new send instead.


## OpenAPI

````yaml POST /v1/pins/{pinId}/resend
openapi: 3.1.0
info:
  title: Onextel Verify API
  version: 1.0.0
  description: >
    Generate, dispatch and verify one-time PINs across SMS, WhatsApp and email.


    Every request is authenticated with an API key created from the OneXtel
    portal's

    **Developers → API Keys** page, sent as a bearer token.


    Every error response carries the same shape — see

    [Verify Error Codes](/api-reference/verify/error-codes) for the full list:


    ```json

    { "error": { "code": "pin_expired", "message": "...", "details": {},
    "requestId": "req_..." } }

    ```
servers:
  - url: https://api.onexaura.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Pins
    description: Create, resend and verify one-time PINs.
  - name: Templates
    description: The templates a PIN can be sent under.
  - name: Channel Accounts
    description: The provider accounts a channel dispatches through.
paths:
  /v1/pins/{pinId}/resend:
    post:
      tags:
        - Pins
      summary: Resend a PIN
      description: >
        Issues a new PIN on the same `pinId`, optionally on a different channel
        than the original send. Every resend regenerates the PIN, its expiry and
        its attempt allowance — the PIN is only ever stored hashed, so there is
        no earlier code to re-send. A resend cooldown applies.
      operationId: resendPin
      parameters:
        - $ref: '#/components/parameters/PinId'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResendPinRequest'
      responses:
        '201':
          description: At least one channel accepted the message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PinDispatchResponse'
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: '`not_found` / `pin_not_found` / `template_not_found`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            `pin_already_verified` / `pin_blocked` / `template_disabled` /
            `channel_not_configured` / `channel_account_disabled` /
            `idempotency_key_reuse` / `idempotency_in_progress`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '`resend_cooldown` / `rate_limited` / `daily_cap_exceeded`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: '`dispatch_failed`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    PinId:
      name: pinId
      in: path
      required: true
      schema:
        type: string
        examples:
          - pin_x9k2m1qz
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: >
        Protects a send/resend against duplicate dispatch on retry. Replaying
        the same key + body within 24h returns the original response verbatim;
        the same key with a different body is rejected
        (`idempotency_key_reuse`); a concurrent request with the same key still
        in flight is rejected (`idempotency_in_progress`).
      schema:
        type: string
  schemas:
    ResendPinRequest:
      type: object
      properties:
        channels:
          type: array
          minItems: 1
          description: >-
            Channels to resend on. Omit to reuse the channels of the original
            send.
          items:
            $ref: '#/components/schemas/ChannelType'
          examples:
            - - whatsapp
        templateParams:
          $ref: '#/components/schemas/TemplateParams'
    PinDispatchResponse:
      type: object
      properties:
        pinId:
          type: string
          examples:
            - pin_x9k2m1qz
        status:
          type: string
          enum:
            - PENDING
            - VERIFIED
            - EXPIRED
            - BLOCKED
          examples:
            - PENDING
        expiresAt:
          type: string
          format: date-time
          examples:
            - '2026-08-04T10:22:03.221Z'
        attemptsRemaining:
          type: integer
          examples:
            - 3
        channels:
          type: array
          items:
            $ref: '#/components/schemas/ChannelDispatch'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              examples:
                - pin_expired
            message:
              type: string
            requestId:
              type: string
              examples:
                - req_9f3a2c
            details:
              type: object
              additionalProperties: true
    ChannelType:
      type: string
      enum:
        - sms
        - whatsapp
        - email
    TemplateParams:
      type: object
      description: >
        Per-send override for a WhatsApp template's non-OTP placeholders, by
        position. Omitted positions fall back to the template's stored default.
      additionalProperties:
        type: string
      examples:
        - '1': Jane Doe
          '2': ORD-1234
    ChannelDispatch:
      type: object
      properties:
        channel:
          $ref: '#/components/schemas/ChannelType'
        status:
          type: string
          enum:
            - accepted
            - rejected
            - error
          description: >
            `accepted` — the provider took the message. `rejected` — the
            provider refused it. `error` — the dispatch itself failed (timeout,
            transport, unexpected response).
        providerMessageId:
          type: string
          description: The provider's id for the message, when it returned one.
        errorCode:
          type: string
        errorMessage:
          type: string
  responses:
    ValidationFailed:
      description: '`validation_failed`'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthenticated:
      description: '`unauthenticated`'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: '`forbidden` / `workspace_disabled`'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key from the OneXtel portal, **Developers → API Keys**, sent as
        `Authorization: Bearer <key>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.