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

# Resend message

> Resend a previously sent message. The original send request is loaded from storage and a brand-new send is enqueued for the same recipient and content, producing a **new** `messageId` — the original message is not modified.
Throttled by a per-message rate limit; a repeat inside the limit window returns `429 Too Many Requests`.



## OpenAPI

````yaml /openapi-specs/openapi.documented.yml post /messages/{message_id}/resend
openapi: 3.0.1
info:
  title: Courier
  description: The Courier REST API for sending and managing notifications across channels.
  version: 0.0.1
servers:
  - url: https://api.courier.com
    description: Production
security: []
paths:
  /messages/{message_id}/resend:
    post:
      tags:
        - Sent Messages
      summary: Resend message
      description: >-
        Resend a previously sent message. The original send request is loaded
        from storage and a brand-new send is enqueued for the same recipient and
        content, producing a **new** `messageId` — the original message is not
        modified.

        Throttled by a per-message rate limit; a repeat inside the limit window
        returns `429 Too Many Requests`.
      operationId: messages_resend
      parameters:
        - name: message_id
          in: path
          description: >-
            A unique identifier representing the message ID of the original
            message to resend.
          required: true
          schema:
            type: string
      responses:
        '202':
          description: >-
            The resend request was accepted. A brand-new send has been enqueued
            and its `messageId` is returned in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResendMessageResponse'
              examples:
                Example:
                  value:
                    messageId: 1-5e2b2615-05efbb3acab9172f88dd3f6f
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                Example:
                  value:
                    message: Message with ID <id> is not supported for resend.
                    type: invalid_request_error
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageNotFound'
              examples:
                Example:
                  value:
                    message: Example message text
                    type: invalid_request_error
        '429':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequests'
              examples:
                Example:
                  value:
                    message: Too Many Requests
                    type: rate_limit_error
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Courier from '@trycourier/courier';

            const client = new Courier({
              apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.messages.resend('message_id');

            console.log(response.messageId);
        - lang: Python
          source: |-
            import os
            from courier import Courier

            client = Courier(
                api_key=os.environ.get("COURIER_API_KEY"),  # This is the default and can be omitted
            )
            response = client.messages.resend(
                "message_id",
            )
            print(response.message_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/trycourier/courier-go\"\n\t\"github.com/trycourier/courier-go/option\"\n)\n\nfunc main() {\n\tclient := courier.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Messages.Resend(context.TODO(), \"message_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.MessageID)\n}\n"
        - lang: Java
          source: |-
            package com.courier.example;

            import com.courier.client.CourierClient;
            import com.courier.client.okhttp.CourierOkHttpClient;
            import com.courier.models.messages.MessageResendParams;
            import com.courier.models.messages.MessageResendResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    CourierClient client = CourierOkHttpClient.fromEnv();

                    MessageResendResponse response = client.messages().resend("message_id");
                }
            }
        - lang: Ruby
          source: |-
            require "courier"

            courier = Courier::Client.new(api_key: "My API Key")

            response = courier.messages.resend("message_id")

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Courier\Client;

            use Courier\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->messages->resend('message_id');

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using TryCourier;
            using TryCourier.Models.Messages;

            CourierClient client = new();

            MessageResendParams parameters = new() { MessageID = "message_id" };

            var response = await client.Messages.Resend(parameters);

            Console.WriteLine(response);
        - lang: CLI
          source: |-
            courier messages resend \
              --api-key 'My API Key' \
              --message-id message_id
components:
  schemas:
    ResendMessageResponse:
      title: ResendMessageResponse
      type: object
      properties:
        messageId:
          type: string
          description: >-
            The new message id for the resent message. It is distinct from the
            id of the original message that was resent.
          example: 1-5e2b2615-05efbb3acab9172f88dd3f6f
      required:
        - messageId
    BadRequest:
      title: BadRequest
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    MessageNotFound:
      title: MessageNotFound
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    TooManyRequests:
      title: TooManyRequests
      type: object
      properties:
        type:
          type: string
          enum:
            - rate_limit_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    BaseError:
      title: BaseError
      type: object
      properties:
        message:
          type: string
          description: A message describing the error that occurred.
      required:
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````