Trigger.dev Environment Variables API

Create, read, update, delete, and import environment variables per project and environment.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

trigger-dev-environment-variables-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Trigger.dev Management Batches Environment Variables API
  description: The Trigger.dev Management API provides comprehensive REST endpoints for managing workflow runs, tasks, schedules, deployments, queues, environment variables, batches, and waitpoints. Enables programmatic control over the full lifecycle of background job workflows including triggering, monitoring, cancellation, and observability. Authenticated via bearer token (secret API key starting with tr_dev_, tr_prod_, or tr_stg_).
  version: 3.1.0
  contact:
    url: https://trigger.dev
  license:
    name: AGPL-3.0
    url: https://github.com/triggerdotdev/trigger.dev/blob/main/LICENSE
servers:
- url: https://api.trigger.dev
  description: Trigger.dev Cloud API
- url: https://your-self-hosted-instance.com
  description: Self-hosted Trigger.dev instance
security:
- bearerAuth: []
tags:
- name: Environment Variables
  description: Create, read, update, delete, and import environment variables per project and environment.
paths:
  /api/v1/envvars:
    get:
      operationId: listEnvVars
      summary: List Environment Variables
      description: Returns all environment variables for the project/environment.
      tags:
      - Environment Variables
      responses:
        '200':
          description: List of environment variables
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EnvVar'
    post:
      operationId: createEnvVar
      summary: Create Environment Variable
      description: Create a new environment variable.
      tags:
      - Environment Variables
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEnvVarRequest'
      responses:
        '200':
          description: Environment variable created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvVar'
  /api/v1/envvars/import:
    post:
      operationId: importEnvVars
      summary: Import Environment Variables
      description: Import multiple environment variables at once.
      tags:
      - Environment Variables
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                variables:
                  type: object
                  additionalProperties:
                    type: string
      responses:
        '200':
          description: Environment variables imported
  /api/v1/envvars/{name}:
    get:
      operationId: getEnvVarByName
      summary: Retrieve Environment Variable
      description: Get the value of a specific environment variable.
      tags:
      - Environment Variables
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
        description: Variable name
      responses:
        '200':
          description: Environment variable details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvVar'
    put:
      operationId: updateEnvVar
      summary: Update Environment Variable
      description: Update the value of an environment variable.
      tags:
      - Environment Variables
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - value
              properties:
                value:
                  type: string
      responses:
        '200':
          description: Environment variable updated
    delete:
      operationId: deleteEnvVar
      summary: Delete Environment Variable
      description: Delete an environment variable from the project.
      tags:
      - Environment Variables
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Environment variable deleted
components:
  schemas:
    CreateEnvVarRequest:
      type: object
      required:
      - name
      - value
      properties:
        name:
          type: string
        value:
          type: string
    EnvVar:
      type: object
      required:
      - name
      properties:
        name:
          type: string
          description: Variable name
        value:
          type: string
          description: Variable value (may be redacted)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret API key (starts with tr_dev_, tr_prod_, or tr_stg_). Set TRIGGER_SECRET_KEY environment variable or pass in Authorization header.