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

# Set environment variables



## OpenAPI

````yaml /openapi.json put /api/v1/projects/{projectId}/environment-variables
openapi: 3.1.0
info:
  title: Capy API
  version: 1.0.0
  description: Programmatic access to Capy's agent platform.
servers:
  - url: https://api.capy.ai
security:
  - bearerAuth: []
tags:
  - name: automations
  - name: projects
  - name: threads
  - name: folders
  - name: tasks
  - name: messages
  - name: reviews
  - name: usage
  - name: users
paths:
  /api/v1/projects/{projectId}/environment-variables:
    put:
      tags:
        - projects
      summary: Set environment variables
      operationId: projects.setEnvironmentVariables
      parameters:
        - name: projectId
          in: path
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetEnvironmentVariablesRequest'
        required: true
      responses:
        '200':
          description: EnvironmentVariableList
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentVariableListEncoded'
        '400':
          description: capy/InvalidRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_InvalidRequestEncoded'
        '401':
          description: capy/Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_UnauthorizedEncoded'
        '403':
          description: capy/Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_ForbiddenEncoded'
        '404':
          description: capy/ProjectNotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_ProjectNotFoundEncoded'
        '429':
          description: capy/RateLimited
          headers:
            retry-after:
              schema:
                type: integer
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_RateLimitedEncoded'
      security:
        - bearerAuth: []
components:
  schemas:
    SetEnvironmentVariablesRequest:
      type: object
      properties:
        entries:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                pattern: ^[A-Za-z_][A-Za-z0-9_]*$
              value:
                type: string
              description:
                type: string
            required:
              - name
              - value
            additionalProperties: false
          minItems: 1
          maxItems: 500
      required:
        - entries
      additionalProperties: false
    EnvironmentVariableListEncoded:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/EnvironmentVariableEncoded'
      required:
        - items
      additionalProperties: false
    capy_InvalidRequestEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/InvalidRequest
        message:
          type: string
      required:
        - _tag
        - message
      additionalProperties: false
    capy_UnauthorizedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Unauthorized
      required:
        - _tag
      additionalProperties: false
    capy_ForbiddenEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Forbidden
      required:
        - _tag
      additionalProperties: false
    capy_ProjectNotFoundEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/ProjectNotFound
        projectId:
          type: string
      required:
        - _tag
        - projectId
      additionalProperties: false
    capy_RateLimitedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/RateLimited
        retryAfterSeconds:
          type: integer
      required:
        - _tag
        - retryAfterSeconds
      additionalProperties: false
    EnvironmentVariableEncoded:
      type: object
      properties:
        name:
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
        updatedAt:
          type: string
      required:
        - name
        - description
        - updatedAt
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Capy API key
      description: An API key created in Capy under Settings → API.

````