---
title: "Handles requests to the `/delay/:n` endpoint."
url: "https://developer.rucho.org/apis/rucho/versions/5bdf1bcb-8db4-40f1-a293-72c7198e26c8/operations/delay_handler"
---

> Full API specification: https://developer.rucho.org/apis/rucho/versions/5bdf1bcb-8db4-40f1-a293-72c7198e26c8.md

# Handles requests to the `/delay/:n` endpoint.

`HEAD` `/delay/{n}`

Operation ID: `delay_handler`

Introduces a delay of `n` seconds before sending a response. The delay duration `n` is extracted from the path. # Security The maximum delay is capped at `MAX_DELAY_SECONDS` (300 seconds) to prevent denial-of-service attacks where malicious requests could hold connections open indefinitely.

## Path parameters

- `n` (integer, int64, required) - Number of seconds to delay the response (max 300)

## Responses

- `200` - Responds after the specified delay
- `400` - Delay exceeds maximum allowed value

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: rucho
  version: 1.6.0
servers:
  - url: https://rucho.org
    description: Production (EKS us-east-2, behind Kong)
paths:
  /delay/{n}:
    head:
      tags:
        - crate::routes::delay
      summary: Handles requests to the `/delay/:n` endpoint.
      description: >-
        Introduces a delay of `n` seconds before sending a response.

        The delay duration `n` is extracted from the path.


        # Security


        The maximum delay is capped at `MAX_DELAY_SECONDS` (300 seconds) to
        prevent

        denial-of-service attacks where malicious requests could hold
        connections open indefinitely.
      operationId: delay_handler
      parameters:
        - name: n
          in: path
          description: Number of seconds to delay the response (max 300)
          required: true
          schema:
            type: integer
            format: int64
            minimum: 0
      responses:
        "200":
          description: Responds after the specified delay
          content:
            text/plain:
              schema:
                type: string
        "400":
          description: Delay exceeds maximum allowed value
```
