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

# Update Package Variables

> Updates only the `variables` and `secret_variables` of the specified package.
Other package fields, including `name`, `description`, and `data_flow_json`,
are not touched even if sent in the request body.

Use this endpoint when you want to save variable changes without persisting
any unsaved canvas edits on the package. For full package updates, use
`PUT /packages/{package_id}` instead.

`variables` replaces the existing variables map. `secret_variables` is
merged into the existing secrets: a `null` value deletes that secret key,
and any other value adds or replaces it.

A secret value shorter than 6 characters, or a variable with an empty
name, returns `400`. Sending `null` for the whole `secret_variables`
field, or a package that fails validation, returns `422`.




## OpenAPI

````yaml /integrateio-openapi.yaml patch /packages/{package_id}/variables
openapi: 3.0.3
info:
  title: Integrate.io (Xplenty) ETL API
  description: >
    The Integrate.io ETL API (formerly Xplenty) provides functions for
    controlling and monitoring

    clusters, jobs, packages, schedules, deliveries, connections, and account
    management.


    After defining a data processing package using the Integrate.io web
    application, you can call

    this API to create clusters, run jobs, monitor their progress, and terminate
    jobs and clusters.


    ## Authentication

    All API calls require your API key via HTTP Basic Authentication.

    Enter your API key as the **username** and leave the **password** blank.

    ```

    curl -u YOUR_API_KEY: https://api.xplenty.com/{account_id}/api/clusters

    ```


    ## API Versioning

    All requests must include the `Accept` header with the API version:

    ```

    Accept: application/vnd.xplenty+json; version=2

    ```

    Without this header, requests may be routed incorrectly and return `404`
    errors.


    ## Pagination

    Collection endpoints support `offset` and `limit` query parameters.

    Pagination info is provided via the `Link` header (RFC 5988).


    ## Rate Limits

    Each user is allocated 5,000 credits per hour. Most API calls cost 1 credit.

    Exceeding the limit returns a `429 Too Many Requests` response.
  version: '2.0'
  contact:
    name: Integrate.io Support
    url: https://www.integrate.io
  license:
    name: Proprietary
servers:
  - url: https://api.xplenty.com/{account_id}/api
    description: Production API
    variables:
      account_id:
        description: Your Integrate.io (Xplenty) account ID
        default: my-account
security:
  - apiKeyAuth: []
tags:
  - name: Clusters
    description: Create, manage, monitor, and terminate compute clusters
  - name: Jobs
    description: Run, monitor, and manage data processing jobs
  - name: Packages
    description: Manage data flow packages
  - name: Package Validations
    description: Validate package configurations
  - name: Schedules
    description: Create and manage recurring job schedules
  - name: Deliveries
    description: Manage data delivery blueprints
  - name: Connections
    description: Manage data source and destination connections
  - name: Connection Groups
    description: Organize database and cloud storage connections into named groups
  - name: Accounts
    description: Manage Integrate.io accounts
  - name: Members
    description: Manage account members and roles
  - name: Users
    description: Manage authenticated user information
  - name: Public Keys
    description: Manage SSH public keys
  - name: Notifications
    description: View and manage user notifications
  - name: Hooks
    description: Manage webhooks for event notifications
  - name: System
    description: System information (regions, stacks, time zones, variables)
  - name: Billing
    description: Subscription, invoices, and payment methods
paths:
  /packages/{package_id}/variables:
    parameters:
      - $ref: '#/components/parameters/packageIdParam'
    patch:
      tags:
        - Packages
      summary: Update Package Variables
      description: >
        Updates only the `variables` and `secret_variables` of the specified
        package.

        Other package fields, including `name`, `description`, and
        `data_flow_json`,

        are not touched even if sent in the request body.


        Use this endpoint when you want to save variable changes without
        persisting

        any unsaved canvas edits on the package. For full package updates, use

        `PUT /packages/{package_id}` instead.


        `variables` replaces the existing variables map. `secret_variables` is

        merged into the existing secrets: a `null` value deletes that secret
        key,

        and any other value adds or replaces it.


        A secret value shorter than 6 characters, or a variable with an empty

        name, returns `400`. Sending `null` for the whole `secret_variables`

        field, or a package that fails validation, returns `422`.
      operationId: updatePackageVariables
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PackageVariablesUpdate'
            examples:
              setVariables:
                summary: Set package variables
                value:
                  variables:
                    region: us-east-1
                    batch_size: '500'
              rotateAndDeleteSecret:
                summary: Add a new secret and delete an existing one
                value:
                  secret_variables:
                    api_token: new_token_value_at_least_6_chars
                    legacy_token: null
      responses:
        '200':
          description: Package variables updated
          content:
            application/vnd.xplenty+json; version=2:
              schema:
                $ref: '#/components/schemas/Package'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  parameters:
    packageIdParam:
      name: package_id
      in: path
      required: true
      description: The unique ID of the package
      schema:
        type: integer
    acceptHeader:
      name: Accept
      in: header
      required: true
      description: API version header — required on all requests
      schema:
        type: string
        default: application/vnd.xplenty+json; version=2
  schemas:
    PackageVariablesUpdate:
      type: object
      description: >
        Partial update payload for the variables-only endpoint. Only `variables`
        and

        `secret_variables` are accepted; any other fields are ignored.
      properties:
        variables:
          type: object
          additionalProperties: true
          description: >-
            Package variables. Replaces the package's existing variables. Omit
            to leave them unchanged. Send `{}` to clear them.
        secret_variables:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: >-
            Secret variables as key-value pairs, merged into the existing
            secrets. Values of `DUMMY_KEY` or masked values are ignored. A key
            with a `null` value deletes that secret. Any other value must be a
            string of at least 6 characters. Sending `null` for the whole field
            returns a `422` error.
    Package:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type: string
        variables:
          type: object
          additionalProperties: true
        owner_id:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        url:
          type: string
          format: uri
        html_url:
          type: string
          format: uri
        status:
          type: string
        missing_secret_variables:
          type: array
          items:
            type: string
          description: >-
            Returned on create or update when the request referenced secret
            variables with placeholder values that the package has no value for.
            Set these secrets before running the package. Present only when at
            least one secret is missing.
    Error:
      type: object
      properties:
        message:
          type: string
          example: Item not found.
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/vnd.xplenty+json; version=2:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or missing credentials
      content:
        application/vnd.xplenty+json; version=2:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/vnd.xplenty+json; version=2:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: Invalid fields provided
      content:
        application/vnd.xplenty+json; version=2:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: basic
      description: |
        Enter your API key as the username. Leave the password field blank.
        Example: `curl -u YOUR_API_KEY: https://api.xplenty.com/...`

````

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