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

# Pin Configuration for Flow Control Key

> Pins a processing configuration for a specific flow-control key.

Normally, each message sent to QStash includes a flow-control configuration for the corresponding flow-control key.
The processing configuration is updated based on configurations provided by incoming messages.

This means that if you want to change the configuration, you typically need to update it in your code and wait until a new message with the updated configuration is sent.

By pinning a configuration, you can enforce a fixed configuration for a flow-control key.
While pinned, the system ignores configurations provided by incoming messages and continues using the pinned configuration until it is explicitly unpinned.

This allows you to increase or decrease processing throughput without requiring code changes or waiting for new messages with updated configurations.
For example, you can temporarily increase the processing speed to clear a backlog of pending messages, or decrease it when a downstream dependency is experiencing issues.

<Warning>Pinning a configuration resets the current state (rate count and period) of the flow-control key.</Warning>


## OpenAPI

````yaml /qstash/openapi.yaml post /v2/flowControl/{flowControlKey}/pin
openapi: 3.1.0
info:
  title: QStash REST API
  description: |
    QStash is a message queue and scheduler built on top of Upstash Redis.
  version: 2.0.0
  contact:
    name: Upstash
    url: https://upstash.com
servers:
  - url: https://qstash.upstash.io
security:
  - bearerAuth: []
  - bearerAuthQuery: []
tags:
  - name: Messages
    description: Publish and manage messages
  - name: Queues
    description: Manage message queues
  - name: Schedules
    description: Create and manage scheduled messages
  - name: URL Groups
    description: Manage URL groups and endpoints
  - name: DLQ
    description: Dead Letter Queue operations
  - name: Logs
    description: Log operations
  - name: Signing Keys
    description: Manage signing keys
  - name: Flow Control
    description: Monitor flow control keys
paths:
  /v2/flowControl/{flowControlKey}/pin:
    post:
      tags:
        - Flow Control
      summary: Pin Configuration for Flow Control Key
      description: Pins a processing configuration for a specific flow-control key.
      parameters:
        - name: flowControlKey
          in: path
          required: true
          schema:
            type: string
          description: The flow-control key for which the configuration will be pinned.
        - name: parallelism
          in: query
          schema:
            type: integer
          description: The parallelism value to apply to the flow-control key.
        - name: rate
          in: query
          schema:
            type: integer
          description: The rate value to apply to the flow-control key.
        - name: period
          in: query
          schema:
            type: integer
          description: The period value to apply to the flow-control key, in seconds.
      responses:
        '200':
          description: The flow-control key configuration has been pinned.
        '400':
          description: >-
            Bad request. Returned when the flow-control key is not provided, or
            when the parallelism, rate or period values are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: QStash authentication token
    bearerAuthQuery:
      type: apiKey
      in: query
      name: qstash_token
      description: QStash authentication token passed as a query parameter

````