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

# Override Concurrency Limit

> Override a concurrency limit's bounds. Only the given fields change; the declared
values are kept and restored by reset. To stop runs holding a limit, prefer the
pause endpoint (it keeps the configured bounds); overriding `total` to `0` also
blocks every run holding the limit.




## OpenAPI

````yaml v3-openapi POST /api/v1/concurrency-limits/{name}/override
openapi: 3.1.0
info:
  title: Trigger.dev v3 REST API
  description: >-
    The REST API lets you trigger and manage runs on Trigger.dev. You can
    trigger a run, get the status of a run, and get the results of a run. 
  version: 2024-04
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.trigger.dev
    description: Trigger.dev API
security: []
paths:
  /api/v1/concurrency-limits/{name}/override:
    post:
      tags:
        - concurrency-limits
      summary: Override concurrency limit
      description: >
        Override a concurrency limit's bounds. Only the given fields change; the
        declared

        values are kept and restored by reset. To stop runs holding a limit,
        prefer the

        pause endpoint (it keeps the configured bounds); overriding `total` to
        `0` also

        blocks every run holding the limit.
      operationId: override_concurrency_limit_v1
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
          description: The limit's name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  title: Limit bounds
                  description: >-
                    Override the limit itself. At least one of `perKey` or
                    `total` must be provided.
                  minProperties: 1
                  additionalProperties: false
                  properties:
                    perKey:
                      type: integer
                      minimum: 0
                      maximum: 100000
                      description: >-
                        Caps each concurrencyKey pool; runs without a key share
                        one pool. May not exceed the environment concurrency
                        limit.
                    total:
                      type: integer
                      minimum: 0
                      maximum: 100000
                      description: >-
                        Caps every run holding this limit, keys or not. May not
                        exceed the environment concurrency limit.
                - type: object
                  title: Per-key cap
                  description: >-
                    Override the limit's `perKey` for one concurrencyKey only.
                    The override is temporary (see `ttl`), changes no other
                    bound, and applies to every task holding the limit. `total`
                    cannot be given here.
                  required:
                    - concurrencyKey
                    - perKey
                  additionalProperties: false
                  properties:
                    concurrencyKey:
                      type: string
                      description: The concurrencyKey whose cap is overridden.
                    perKey:
                      type: integer
                      minimum: 0
                      maximum: 100000
                      description: >-
                        The cap for this key; `0` blocks it. May not exceed the
                        environment concurrency limit.
                    ttl:
                      oneOf:
                        - type: string
                        - type: integer
                      description: >-
                        How long the override lasts, as a duration such as "7d"
                        or a number of seconds. Default 7 days, maximum 30 days.
      responses:
        '200':
          description: Concurrency limit overridden successfully
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ConcurrencyLimitObject'
                  - $ref: '#/components/schemas/ConcurrencyLimitKeyObject'
        '400':
          description: >-
            Invalid request parameters, or a bound exceeds the environment
            concurrency limit
        '401':
          description: Unauthorized request
        '404':
          description: Concurrency limit not found
        '409':
          description: The limit changed concurrently; retry the request
      security:
        - secretKey: []
      x-codeSamples:
        - lang: typescript
          source: |-
            import { concurrencyLimits } from "@trigger.dev/sdk";

            // Raise the shared cap
            await concurrencyLimits.override("openai", { total: 50 });
components:
  schemas:
    ConcurrencyLimitObject:
      type: object
      required:
        - id
        - name
        - perKey
        - total
        - running
        - queued
      properties:
        id:
          type: string
          description: The limit's id, starting with `climit_`
          example: climit_abcdef123456
        name:
          type: string
          description: The limit's name, as declared with `concurrencyLimit()`
          example: openai
        perKey:
          type: object
          description: Caps each concurrencyKey pool; runs without a key share one pool
          properties:
            current:
              type: integer
              nullable: true
              description: >-
                Enforced right now (null = no per-key bound). Enforcement clamps
                it to the environment concurrency limit at admit time.
              example: null
            base:
              type: integer
              nullable: true
              description: The declared value an override reverts to on reset
              example: null
            override:
              type: integer
              nullable: true
              description: The overridden value, when an override is active
              example: null
            overriddenAt:
              type: string
              format: date-time
              nullable: true
              description: When the override was applied
              example: null
        total:
          type: object
          description: Caps every run holding this limit, keys or not
          properties:
            current:
              type: integer
              nullable: true
              description: >-
                Enforced right now (null = no total bound). Enforcement clamps
                it to the environment concurrency limit at admit time.
              example: 25
            base:
              type: integer
              nullable: true
              description: The declared value an override reverts to on reset
              example: 25
            override:
              type: integer
              nullable: true
              description: The overridden value, when an override is active
              example: null
            overriddenAt:
              type: string
              format: date-time
              nullable: true
              description: When the override was applied
              example: null
        running:
          type: integer
          description: Runs executing that hold this limit
          example: 14
        queued:
          type: integer
          description: Runs that are queued and must clear this limit to execute
          example: 100
        paused:
          type: boolean
          description: >-
            Whether the limit is paused. A paused limit admits no runs until
            resumed; its configured bounds are kept.
          example: false
    ConcurrencyLimitKeyObject:
      type: object
      description: >-
        A limit's view for one concurrencyKey, returned when a request names a
        concurrencyKey.
      required:
        - name
        - concurrencyKey
        - perKey
        - running
        - paused
      properties:
        name:
          type: string
          description: The limit's name, as declared with `concurrencyLimit()`
          example: subagents
        concurrencyKey:
          type: string
          description: The concurrencyKey this view is for
          example: session_abc123
        perKey:
          type: object
          description: The per-key bound for this key
          properties:
            current:
              type: integer
              nullable: true
              description: >-
                Enforced right now for this key (the override when one is in
                force, else the limit's perKey), clamped to the environment
                concurrency limit
              example: 3
            base:
              type: integer
              nullable: true
              description: The limit's own perKey as enforced
              example: 1
            override:
              type: integer
              nullable: true
              description: The key's temporary override, when one is in force
              example: 3
            expiresAt:
              type: string
              format: date-time
              nullable: true
              description: When the key's override lapses; null when there is none
              example: '2026-10-16T12:00:00.000Z'
        running:
          type: integer
          description: Runs executing for this key that hold this limit
          example: 2
        paused:
          type: boolean
          description: >-
            Whether the limit is paused. A paused limit admits no runs, override
            or not.
          example: false
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >
        Use a named environment API key. It starts with `tr_dev_sk_`,
        `tr_prod_sk_`, `tr_stg_sk_`, etc.


        Create a named API key in the API Keys section of your Trigger.dev
        project dashboard. Choose the narrowest access preset that supports your
        integration.


        Our TypeScript SDK will default to using the value of the
        `TRIGGER_SECRET_KEY` environment variable if it is set. If you are using
        the SDK in a different environment, you can set the key using the
        `configure` function.


        ```typescript

        import { configure } from "@trigger.dev/sdk";


        configure({ accessToken: "tr_dev_sk_1234" });

        ```

````

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