Netlify · Capability

Netlify Netlify's API documentation — environmentVariables

Netlify Netlify's API documentation — environmentVariables. 8 operations. Lead operation: environmentVariables. Self-contained Naftiko capability covering one Netlify business surface.

Run with Naftiko NetlifyenvironmentVariables

What You Can Do

GET
Getenvvars — Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI. To use this endpoint, your site must no longer be using the /v1/accounts/{account-id}/env
POST
Createenvvars — Creates new environment variables. Granular scopes are available on Pro plans and above. To use this endpoint, your site must no longer be using the classic envir
/v1/accounts/{account-id}/env
GET
Getenvvar — Returns an individual environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now
/v1/accounts/{account-id}/env/{key}
PUT
Updateenvvar — Updates an existing environment variable and all of its values. Existing values will be replaced by values provided. To use this endpoint, your site must no longer be using the /v1/accounts/{account-id}/env/{key}
DELETE
Deleteenvvar — Deletes an environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Ne
/v1/accounts/{account-id}/env/{key}
PATCH
Setenvvarvalue — Updates or creates a new value for an existing environment variable. To use this endpoint, your site must no longer be using the classic environment variables expe
/v1/accounts/{account-id}/env/{key}
DELETE
Deleteenvvarvalue — Deletes a specific environment variable value. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate n
/v1/accounts/{account-id}/env/{key}/value/{id}
GET
Getsiteenvvars — Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars` but doesn't require an `account_id` as input.
/v1/api/v1/sites/{site-id}/env

MCP Tools

returns-all-environment-variables-account

Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI. To use this endpoint, your site must no longer be using the read-only idempotent

creates-new-environment-variables-granular

Creates new environment variables. Granular scopes are available on Pro plans and above. To use this endpoint, your site must no longer be using the classic envir

returns-individual-environment-variable-use

Returns an individual environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now

read-only idempotent
updates-existing-environment-variable-and

Updates an existing environment variable and all of its values. Existing values will be replaced by values provided. To use this endpoint, your site must no longer be using the idempotent

deletes-environment-variable-use-this

Deletes an environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate now with the Ne

idempotent
updates-creates-new-value-existing

Updates or creates a new value for an existing environment variable. To use this endpoint, your site must no longer be using the classic environment variables expe

idempotent
deletes-specific-environment-variable-value

Deletes a specific environment variable value. To use this endpoint, your site must no longer be using the classic environment variables experience. Migrate n

idempotent
returns-all-environment-variables-site

Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars` but doesn't require an `account_id` as input.

read-only idempotent

Capability Spec

netlify-environmentvariables.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Netlify Netlify's API documentation — environmentVariables
  description: 'Netlify Netlify''s API documentation — environmentVariables. 8 operations. Lead operation: environmentVariables.
    Self-contained Naftiko capability covering one Netlify business surface.'
  tags:
  - Netlify
  - environmentVariables
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    NETLIFY_API_KEY: NETLIFY_API_KEY
capability:
  consumes:
  - type: http
    namespace: netlify-environmentvariables
    baseUri: https://api.netlify.com/api/v1
    description: Netlify Netlify's API documentation — environmentVariables business capability. Self-contained, no shared
      references.
    resources:
    - name: accounts-account_id-env
      path: /accounts/{account_id}/env
      operations:
      - name: getenvvars
        method: GET
        description: Returns all environment variables for an account or site. An account corresponds to a team in the Netlify
          UI. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experi
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          description: Scope response to account_id
          required: true
        - name: context_name
          in: query
          type: string
          description: Filter by deploy context
        - name: scope
          in: query
          type: string
          description: Filter by scope
        - name: site_id
          in: query
          type: string
          description: If specified, only return environment variables set on this site
      - name: createenvvars
        method: POST
        description: Creates new environment variables. Granular scopes are available on Pro plans and above.  To use this
          endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic
          envir
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          description: Scope response to account_id
          required: true
        - name: site_id
          in: query
          type: string
          description: If provided, create an environment variable on the site level, not the account level
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: accounts-account_id-env-key
      path: /accounts/{account_id}/env/{key}
      operations:
      - name: getenvvar
        method: GET
        description: 'Returns an individual environment variable. To use this endpoint, your site must no longer be using
          the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>.  Migrate
          now '
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          description: Scope response to account_id
          required: true
        - name: key
          in: path
          type: string
          description: The environment variable key (case-sensitive)
          required: true
        - name: site_id
          in: query
          type: string
          description: If provided, return the environment variable for a specific site (no merging is performed)
      - name: updateenvvar
        method: PUT
        description: Updates an existing environment variable and all of its values. Existing values will be replaced by values
          provided. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          description: Scope response to account_id
          required: true
        - name: key
          in: path
          type: string
          description: The existing environment variable key name (case-sensitive)
          required: true
        - name: site_id
          in: query
          type: string
          description: If provided, update an environment variable set on this site
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: deleteenvvar
        method: DELETE
        description: Deletes an environment variable. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic
          environment variables experience</a>.  Migrate now with the Ne
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          description: Scope response to account_id
          required: true
        - name: key
          in: path
          type: string
          description: The environment variable key (case-sensitive)
          required: true
        - name: site_id
          in: query
          type: string
          description: If provided, delete the environment variable from this site
      - name: setenvvarvalue
        method: PATCH
        description: Updates or creates a new value for an existing environment variable. To use this endpoint, your site
          must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic
          environment variables expe
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          description: Scope response to account_id
          required: true
        - name: key
          in: path
          type: string
          description: The existing environment variable key name (case-sensitive)
          required: true
        - name: site_id
          in: query
          type: string
          description: If provided, update an environment variable set on this site
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: accounts-account_id-env-key-value-id
      path: /accounts/{account_id}/env/{key}/value/{id}
      operations:
      - name: deleteenvvarvalue
        method: DELETE
        description: Deletes a specific environment variable value. To use this endpoint, your site must no longer be using
          the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>.  Migrate
          n
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          description: Scope response to account_id
          required: true
        - name: id
          in: path
          type: string
          description: The environment variable value's ID
          required: true
        - name: key
          in: path
          type: string
          description: The environment variable key name (case-sensitive)
          required: true
        - name: site_id
          in: query
          type: string
          description: If provided, delete the value from an environment variable on this site
    - name: api-v1-sites-site_id-env
      path: /api/v1/sites/{site_id}/env
      operations:
      - name: getsiteenvvars
        method: GET
        description: Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars`
          but doesn't require an `account_id` as input.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: context_name
          in: query
          type: string
          description: Filter by deploy context
        - name: scope
          in: query
          type: string
          description: Filter by scope
        - name: site_id
          in: path
          type: string
          description: Scope response to site_id
          required: true
    authentication:
      type: bearer
      token: '{{env.NETLIFY_API_KEY}}'
  exposes:
  - type: rest
    namespace: netlify-environmentvariables-rest
    port: 8080
    description: REST adapter for Netlify Netlify's API documentation — environmentVariables. One Spectral-compliant resource
      per consumed operation, prefixed with /v1.
    resources:
    - path: /v1/accounts/{account-id}/env
      name: accounts-account-id-env
      description: REST surface for accounts-account_id-env.
      operations:
      - method: GET
        name: getenvvars
        description: Returns all environment variables for an account or site. An account corresponds to a team in the Netlify
          UI. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experi
        call: netlify-environmentvariables.getenvvars
        with:
          account_id: rest.account_id
          context_name: rest.context_name
          scope: rest.scope
          site_id: rest.site_id
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createenvvars
        description: Creates new environment variables. Granular scopes are available on Pro plans and above.  To use this
          endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic
          envir
        call: netlify-environmentvariables.createenvvars
        with:
          account_id: rest.account_id
          site_id: rest.site_id
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/accounts/{account-id}/env/{key}
      name: accounts-account-id-env-key
      description: REST surface for accounts-account_id-env-key.
      operations:
      - method: GET
        name: getenvvar
        description: 'Returns an individual environment variable. To use this endpoint, your site must no longer be using
          the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>.  Migrate
          now '
        call: netlify-environmentvariables.getenvvar
        with:
          account_id: rest.account_id
          key: rest.key
          site_id: rest.site_id
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updateenvvar
        description: Updates an existing environment variable and all of its values. Existing values will be replaced by values
          provided. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic
        call: netlify-environmentvariables.updateenvvar
        with:
          account_id: rest.account_id
          key: rest.key
          site_id: rest.site_id
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deleteenvvar
        description: Deletes an environment variable. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic
          environment variables experience</a>.  Migrate now with the Ne
        call: netlify-environmentvariables.deleteenvvar
        with:
          account_id: rest.account_id
          key: rest.key
          site_id: rest.site_id
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: setenvvarvalue
        description: Updates or creates a new value for an existing environment variable. To use this endpoint, your site
          must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic
          environment variables expe
        call: netlify-environmentvariables.setenvvarvalue
        with:
          account_id: rest.account_id
          key: rest.key
          site_id: rest.site_id
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/accounts/{account-id}/env/{key}/value/{id}
      name: accounts-account-id-env-key-value-id
      description: REST surface for accounts-account_id-env-key-value-id.
      operations:
      - method: DELETE
        name: deleteenvvarvalue
        description: Deletes a specific environment variable value. To use this endpoint, your site must no longer be using
          the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>.  Migrate
          n
        call: netlify-environmentvariables.deleteenvvarvalue
        with:
          account_id: rest.account_id
          id: rest.id
          key: rest.key
          site_id: rest.site_id
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v1/sites/{site-id}/env
      name: api-v1-sites-site-id-env
      description: REST surface for api-v1-sites-site_id-env.
      operations:
      - method: GET
        name: getsiteenvvars
        description: Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars`
          but doesn't require an `account_id` as input.
        call: netlify-environmentvariables.getsiteenvvars
        with:
          context_name: rest.context_name
          scope: rest.scope
          site_id: rest.site_id
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: netlify-environmentvariables-mcp
    port: 9090
    transport: http
    description: MCP adapter for Netlify Netlify's API documentation — environmentVariables. One tool per consumed operation,
      routed inline through this capability's consumes block.
    tools:
    - name: returns-all-environment-variables-account
      description: Returns all environment variables for an account or site. An account corresponds to a team in the Netlify
        UI. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experi
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: netlify-environmentvariables.getenvvars
      with:
        account_id: tools.account_id
        context_name: tools.context_name
        scope: tools.scope
        site_id: tools.site_id
      outputParameters:
      - type: object
        mapping: $.
    - name: creates-new-environment-variables-granular
      description: Creates new environment variables. Granular scopes are available on Pro plans and above.  To use this endpoint,
        your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic
        envir
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: netlify-environmentvariables.createenvvars
      with:
        account_id: tools.account_id
        site_id: tools.site_id
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: returns-individual-environment-variable-use
      description: 'Returns an individual environment variable. To use this endpoint, your site must no longer be using the
        <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>.  Migrate
        now '
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: netlify-environmentvariables.getenvvar
      with:
        account_id: tools.account_id
        key: tools.key
        site_id: tools.site_id
      outputParameters:
      - type: object
        mapping: $.
    - name: updates-existing-environment-variable-and
      description: Updates an existing environment variable and all of its values. Existing values will be replaced by values
        provided. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: netlify-environmentvariables.updateenvvar
      with:
        account_id: tools.account_id
        key: tools.key
        site_id: tools.site_id
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: deletes-environment-variable-use-this
      description: Deletes an environment variable. To use this endpoint, your site must no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic
        environment variables experience</a>.  Migrate now with the Ne
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: netlify-environmentvariables.deleteenvvar
      with:
        account_id: tools.account_id
        key: tools.key
        site_id: tools.site_id
      outputParameters:
      - type: object
        mapping: $.
    - name: updates-creates-new-value-existing
      description: Updates or creates a new value for an existing environment variable. To use this endpoint, your site must
        no longer be using the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment
        variables expe
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: netlify-environmentvariables.setenvvarvalue
      with:
        account_id: tools.account_id
        key: tools.key
        site_id: tools.site_id
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: deletes-specific-environment-variable-value
      description: Deletes a specific environment variable value. To use this endpoint, your site must no longer be using
        the <a href="https://docs.netlify.com/environment-variables/classic-experience/">classic environment variables experience</a>.  Migrate
        n
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: netlify-environmentvariables.deleteenvvarvalue
      with:
        account_id: tools.account_id
        id: tools.id
        key: tools.key
        site_id: tools.site_id
      outputParameters:
      - type: object
        mapping: $.
    - name: returns-all-environment-variables-site
      description: Returns all environment variables for a site. This convenience method behaves the same as `getEnvVars`
        but doesn't require an `account_id` as input.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: netlify-environmentvariables.getsiteenvvars
      with:
        context_name: tools.context_name
        scope: tools.scope
        site_id: tools.site_id
      outputParameters:
      - type: object
        mapping: $.