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

# Replay a delivery

> Queues the event for the endpoint again: the same `event_id` and the same body it received, with a new `NR-Webhook-Timestamp` and a signature from the endpoint's current signing key. It is retried like any other delivery, and its attempts are listed with `"replay": true`.

Your receiver deduplicates on the event id, so replaying an event it already processed changes nothing. The endpoint must be verified (409 `webhook_endpoint_unverified` otherwise), and an event that is not in the endpoint's log answers 404. Each call sends the event again. Requires the `webhooks` scope.



## OpenAPI

````yaml /openapi.json post /v1/webhooks/{endpoint_id}/deliveries/{event_id}/replay
openapi: 3.1.0
info:
  title: NoResponse API
  version: '1'
  description: >-
    The NoResponse API assesses a signup, login or purchase and answers with the
    account's one current risk: a 0 to 100 score, a decision for the flow
    (`allow`, `step_up`, `review` or `block`), the reasons behind it and the
    decision for each flow. The assessment's own facts, such as its status,
    confidence and incomplete sources, sit under `detail`.


    Authenticate every request with your API key as `Authorization: Bearer
    nrk_...`. Call the API only from your backend.


    Guides, SDKs and webhook verification are at
    [docs.noresponse.org](https://docs.noresponse.org/). Every error is an RFC
    9457 problem document; see
    [Errors](https://docs.noresponse.org/reference/errors).
servers:
  - url: https://api.noresponse.org
    description: Production
security:
  - tenantBearer: []
tags:
  - name: assess
    x-displayName: Assessments
    x-group: Assessments
    description: Create, read and list assessments, and report outcomes.
  - name: accounts
    x-displayName: Accounts
    x-group: Accounts
    description: >-
      Each of your accounts holds one current risk, and its assessments are its
      history.
  - name: usage
    x-displayName: Key usage
    x-group: Key usage
    description: >-
      Report usage of the API keys your signup gate issued, so a shared or
      stolen key raises its account's risk.
  - name: keys
    x-displayName: API keys
    x-group: API keys
    description: Rotate your own API key.
  - name: integrations
    x-displayName: Integrations
    x-group: Integrations
    description: >-
      Hosted endpoints that answer your WorkOS or Auth0 sign-up and sign-in
      hooks.
  - name: webhooks
    x-displayName: Webhooks
    x-group: Webhooks
    description: Your webhook endpoints, and the signed events NoResponse sends to them.
paths:
  /v1/webhooks/{endpoint_id}/deliveries/{event_id}/replay:
    post:
      tags:
        - webhooks
      summary: Replay a delivery
      description: >-
        Queues the event for the endpoint again: the same `event_id` and the
        same body it received, with a new `NR-Webhook-Timestamp` and a signature
        from the endpoint's current signing key. It is retried like any other
        delivery, and its attempts are listed with `"replay": true`.


        Your receiver deduplicates on the event id, so replaying an event it
        already processed changes nothing. The endpoint must be verified (409
        `webhook_endpoint_unverified` otherwise), and an event that is not in
        the endpoint's log answers 404. Each call sends the event again.
        Requires the `webhooks` scope.
      operationId: replayWebhookDelivery
      parameters:
        - $ref: '#/components/parameters/EndpointId'
        - $ref: '#/components/parameters/EventId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookReplayRequest'
            examples:
              empty:
                value: {}
      responses:
        '202':
          $ref: '#/components/responses/WebhookReplayAccepted'
        '400':
          $ref: '#/components/responses/InvalidWebhookRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/WorkspaceForbidden'
        '404':
          $ref: '#/components/responses/WebhookDeliveryNotFound'
        '409':
          $ref: '#/components/responses/WebhookEndpointUnverified'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - tenantBearer: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |
            curl --request POST \
              --url 'https://api.noresponse.org/v1/webhooks/whe_01JA2ZD0E1F2G3H4J5K6M7N8P9/deliveries/evt_01JA2ZD3K4M5N6P7Q8R9S0T1V2/replay' \
              --header "Authorization: Bearer $NORESPONSE_API_KEY" \
              --header 'Content-Type: application/json' \
              --data '{}'
        - lang: typescript
          label: TypeScript
          source: |
            import { NoResponse } from "@noresponse/node";

            const noResponse = new NoResponse({
              apiKey: process.env["NORESPONSE_API_KEY"] ?? "",
            });

            async function run() {
              const result = await noResponse.webhookEndpoints.replayDelivery({
                endpointId: "whe_01JA2ZD0E1F2G3H4J5K6M7N8P9",
                eventId: "evt_01JA2ZD3K4M5N6P7Q8R9S0T1V2",
                body: {},
              });

              console.log(result);
            }

            run();
        - lang: python
          label: Python
          source: |
            from noresponse import NoResponse
            import os


            with NoResponse(
                api_key=os.getenv("NORESPONSE_API_KEY", ""),
            ) as no_response:

                res = no_response.webhook_endpoints.replay_delivery(endpoint_id="whe_01JA2ZD0E1F2G3H4J5K6M7N8P9", event_id="evt_01JA2ZD3K4M5N6P7Q8R9S0T1V2", body={})

                # Handle response
                print(res)
        - lang: go
          label: Go
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tnoresponse \"github.com/noresponsehq/go/v5\"\n\t\"github.com/noresponsehq/go/v5/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := noresponse.New(\n        noresponse.WithSecurity(os.Getenv(\"NORESPONSE_API_KEY\")),\n    )\n\n    res, err := s.WebhookEndpoints.ReplayDelivery(ctx, \"whe_01JA2ZD0E1F2G3H4J5K6M7N8P9\", \"evt_01JA2ZD3K4M5N6P7Q8R9S0T1V2\", components.WebhookReplayRequest{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res != nil {\n        // handle response\n    }\n}\n"
        - lang: java
          label: Java
          source: >
            package hello.world;


            import java.lang.Exception;

            import org.noresponse.NoResponse;

            import org.noresponse.models.errors.AuthenticationException;

            import org.noresponse.models.errors.BadRequestException;

            import org.noresponse.models.errors.ConflictException;

            import org.noresponse.models.errors.NotFoundException;

            import org.noresponse.models.errors.PermissionDeniedException;

            import org.noresponse.models.errors.RateLimitException;

            import
            org.noresponse.models.operations.ReplayWebhookDeliveryResponse;

            import org.noresponse.models.shared.WebhookReplayRequest;


            public class Application {

                public static void main(String[] args) throws Exception {

                    NoResponse sdk = NoResponse.builder()
                            .apiKey(System.getenv().getOrDefault("NORESPONSE_API_KEY", ""))
                        .build();

                    ReplayWebhookDeliveryResponse res = sdk.webhookEndpoints().replayDelivery()
                            .endpointId("whe_01JA2ZD0E1F2G3H4J5K6M7N8P9")
                            .eventId("evt_01JA2ZD3K4M5N6P7Q8R9S0T1V2")
                            .body(WebhookReplayRequest.builder()
                                .build())
                            .call();

                    if (res.webhookReplay().isPresent()) {
                        System.out.println(res.webhookReplay().get());
                    }
                }
            }
        - lang: csharp
          label: C#
          source: >
            using NoResponse;

            using NoResponse.Models.Shared;

            using System;


            var sdk = new NoResponseClient(apiKey:
            Environment.GetEnvironmentVariable("NORESPONSE_API_KEY"));


            var res = await sdk.WebhookEndpoints.ReplayDeliveryAsync(
                endpointId: "whe_01JA2ZD0E1F2G3H4J5K6M7N8P9",
                eventId: "evt_01JA2ZD3K4M5N6P7Q8R9S0T1V2",
                body: new WebhookReplayRequest() {}
            );


            // handle response
        - lang: php
          label: PHP
          source: |
            <?php

            declare(strict_types=1);

            require 'vendor/autoload.php';

            use NoResponse;
            use NoResponse\Models\Shared;

            $sdk = NoResponse\NoResponseClient::builder()
                ->setSecurity(
                    getenv('NORESPONSE_API_KEY') ?: ''
                )
                ->build();

            $body = new Shared\WebhookReplayRequest();

            $response = $sdk->webhookEndpoints->replayDelivery(
                endpointId: 'whe_01JA2ZD0E1F2G3H4J5K6M7N8P9',
                eventId: 'evt_01JA2ZD3K4M5N6P7Q8R9S0T1V2',
                body: $body

            );

            if ($response->webhookReplay !== null) {
                // handle response
            }
        - lang: ruby
          label: Ruby
          source: >
            require 'noresponse'


            Models = ::NoResponse::Models

            s = ::NoResponse::NoResponseClient.new(
              api_key: ENV.fetch('NORESPONSE_API_KEY', '')
            )

            res = s.webhook_endpoints.replay_delivery(endpoint_id:
            'whe_01JA2ZD0E1F2G3H4J5K6M7N8P9', event_id:
            'evt_01JA2ZD3K4M5N6P7Q8R9S0T1V2', body:
            Models::Shared::WebhookReplayRequest.new)


            unless res.nil?
              # handle response
            end
components:
  parameters:
    EndpointId:
      name: endpoint_id
      in: path
      required: true
      schema:
        type: string
        pattern: ^whe_[0-9A-HJKMNP-TV-Z]{26}$
        not:
          description: >-
            A line feed anywhere, refused with `not` beside every anchored
            pattern.
          pattern: \n
        description: Opaque id of the endpoint registration.
      description: >-
        The endpoint's whe_ id. An id that is unknown, malformed or another
        workspace's answers 404.
    EventId:
      name: event_id
      in: path
      required: true
      schema:
        type: string
        pattern: ^evt_[0-9A-HJKMNP-TV-Z]{26}$
        description: >-
          Opaque, workspace-scoped webhook event id. A redelivery of the same
          event carries the same event_id, so consumers deduplicate on it.
        not:
          description: >-
            A line feed anywhere, refused with `not` beside every anchored
            pattern.
          pattern: \n
      description: >-
        The evt_ id of a delivery the endpoint's log holds, as GET
        /v1/webhooks/{endpoint_id}/deliveries lists it. An id that is malformed,
        not sent to this endpoint, past the log's retention or another
        workspace's answers 404.
  schemas:
    WebhookReplayRequest:
      title: Webhook replay request
      description: >-
        POST /v1/webhooks/{endpoint_id}/deliveries/{event_id}/replay body: an
        empty object.
      type: object
      additionalProperties: false
      properties: {}
    WebhookReplay:
      title: Webhook replay
      description: >-
        The 202 answer of POST
        /v1/webhooks/{endpoint_id}/deliveries/{event_id}/replay: the event
        queued to be sent again.
      type: object
      additionalProperties: false
      required:
        - endpoint_id
        - event_id
        - event_type
      properties:
        endpoint_id:
          type: string
          pattern: ^whe_[0-9A-HJKMNP-TV-Z]{26}$
          not:
            description: >-
              A line feed anywhere, refused with `not` beside every anchored
              pattern.
            pattern: \n
          description: Opaque id of the endpoint registration.
        event_id:
          type: string
          pattern: ^evt_[0-9A-HJKMNP-TV-Z]{26}$
          description: >-
            The replayed event's id. The receiver sees the same id and body as
            the first time, with a new NR-Webhook-Timestamp and signature.
          not:
            description: >-
              A line feed anywhere, refused with `not` beside every anchored
              pattern.
            pattern: \n
        event_type:
          type: string
          pattern: ^[a-z]+(\.[a-z_]+)+$
          description: >-
            The event's type, as its body's type: assessment.updated,
            account.deleted or account.risk_changed.
    Problem:
      title: Problem details error
      description: >-
        RFC 9457 problem-details error body returned by every non-2xx API
        response, extended with a stable machine code and request id.
      type: object
      additionalProperties: false
      required:
        - type
        - title
        - status
        - detail
        - code
        - request_id
      properties:
        type:
          type: string
          format: uri-reference
        title:
          type: string
        status:
          type: integer
          minimum: 400
          maximum: 599
        detail:
          type: string
        instance:
          type: string
          format: uri-reference
        code:
          type: string
        request_id:
          type: string
          minLength: 1
        invalid_params:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - field
              - reason
            properties:
              field:
                type: string
                minLength: 1
              reason:
                type: string
                minLength: 1
              example:
                type: string
                minLength: 1
  responses:
    WebhookReplayAccepted:
      description: The event is queued to be sent again.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WebhookReplay'
          examples:
            replay:
              value:
                endpoint_id: whe_01JA2ZD0E1F2G3H4J5K6M7N8P9
                event_id: evt_01JA2ZD3K4M5N6P7Q8R9S0T1V2
                event_type: assessment.updated
    InvalidWebhookRequest:
      description: >-
        The body is not JSON or does not match the request schema.
        invalid_params names the offending fields, never their values.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 400
                  code:
                    enum:
                      - invalid_request
    Unauthorized:
      description: No API key, or one that is malformed, unknown, revoked or expired.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        WWW-Authenticate:
          schema:
            type: string
            const: Bearer realm="noresponse-assessments"
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 401
                  code:
                    enum:
                      - unauthorized
    WorkspaceForbidden:
      description: >-
        The API key is valid but may not use this operation: it lacks the
        operation's scope, or its workspace is not entitled or is suspended.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 403
                  code:
                    enum:
                      - workspace_forbidden
          examples:
            missingScope:
              value:
                type: https://docs.noresponse.org/problems/workspace-forbidden
                title: Forbidden
                status: 403
                detail: The API key does not carry a scope this operation accepts.
                code: workspace_forbidden
                request_id: 0123456789abcdef0123456789abcdef
    WebhookDeliveryNotFound:
      description: >-
        No endpoint with this id for the calling workspace, or no delivery of
        this event in the endpoint's log: not sent to it, past the log's
        retention, deleted with its assessment, or another workspace's. A
        malformed id answers the same.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 404
                  code:
                    enum:
                      - not_found
    WebhookEndpointUnverified:
      description: >-
        assessment.updated or a replay was asked for an endpoint that is not
        verified. Send endpoint.verification first; a disabled endpoint is
        verified again the same way.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 409
                  code:
                    enum:
                      - webhook_endpoint_unverified
          examples:
            unverified:
              value:
                type: >-
                  https://docs.noresponse.org/problems/webhook-endpoint-unverified
                title: Webhook endpoint unverified
                status: 409
                detail: >-
                  The endpoint is not verified; send endpoint.verification
                  first.
                code: webhook_endpoint_unverified
                request_id: 0123456789abcdef0123456789abcdef
    PayloadTooLarge:
      description: The body exceeds 32768 bytes. Refused before parsing.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 413
                  code:
                    enum:
                      - payload_too_large
    UnsupportedMediaType:
      description: Content-Type is not application/json.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 415
                  code:
                    enum:
                      - unsupported_media_type
    RateLimited:
      description: >-
        The workspace's rate or concurrency limit is exhausted. Retry-After says
        when to retry; the provider applies its own fallback meanwhile.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        Retry-After:
          description: >-
            Whole seconds to wait before polling or retrying. Required on 202,
            429 and 503.
          schema:
            type: string
            pattern: >-
              ^(?:[1-9]|[1-9][0-9]|[1-9][0-9]{2}|[12][0-9]{3}|3[0-5][0-9]{2}|3600)$
            description: Whole decimal seconds; wait at least this long.
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 429
                  code:
                    enum:
                      - rate_limited
          examples:
            limited:
              value:
                type: https://docs.noresponse.org/problems/rate-limited
                title: Rate limited
                status: 429
                detail: >-
                  The tenant's assessment rate is exhausted; retry after the
                  Retry-After interval.
                code: rate_limited
                request_id: 0123456789abcdef0123456789abcdef
    ServiceUnavailable:
      description: >-
        The assessment could not be admitted at all (overload, shutdown or a
        dependency down). An assessment that was admitted answers partial or
        pending instead of 503.
      headers:
        Cache-Control:
          schema:
            type: string
            const: no-store
          required: true
        Retry-After:
          description: >-
            Whole seconds to wait before polling or retrying. Required on 202,
            429 and 503.
          schema:
            type: string
            pattern: >-
              ^(?:[1-9]|[1-9][0-9]|[1-9][0-9]{2}|[12][0-9]{3}|3[0-5][0-9]{2}|3600)$
            description: Whole decimal seconds; wait at least this long.
          required: true
        X-Request-ID:
          description: The request correlation id, 32 lowercase hexadecimal characters.
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
            not:
              pattern: \n
          required: true
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - properties:
                  status:
                    const: 503
                  code:
                    enum:
                      - service_unavailable
  securitySchemes:
    tenantBearer:
      type: http
      scheme: bearer
      description: >-
        Your API key, sent as `Authorization: Bearer <key>`. A key is
        `nrk_live_` or `nrk_test_`, a 26-character key id, `_` and a
        43-character secret. A key sees only its own environment's data.


        Each key has one or more scopes: `assess` creates and reads assessments,
        records outcomes and reports key usage; `history` reads assessments, an
        account's current risk and an account's history, and erases an account;
        `detailed` adds the detailed view; `webhooks` registers, tests, rotates
        and deletes webhook endpoints; `integrations` registers and manages
        hosted provider integrations. A missing, unknown, revoked or expired key
        answers 401. A valid key without the scope an operation needs answers
        403.

````

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