Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Netlify environmentVariables API

The environmentVariables API from Netlify — 4 operation(s) for environmentvariables.

Netlify environmentVariables API is one of 35 APIs that Netlify publishes on the APIs.io network, described by a machine-readable OpenAPI specification and an AsyncAPI event-driven specification.

Tagged areas include environmentVariables. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, an AsyncAPI specification, and a getting-started guide.

This API exposes 8 operations across 4 paths, and defines 4 schemas. It is described by OpenAPI 3.0.1, at version 2.33.1.

Requests are made against a single base URL, https://api.netlify.com/api/v1.

8 operations 4 paths 4 schemas 2 DELETE3 GET1 PATCH1 POST1 PUT

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.0.1
API Version
2.33.1
Base URL
https://api.netlify.com/api/v1/
Authentication
OAuth 2.0
Terms of Service
Resource Areas
1

Authentication & Security 1

Netlify environmentVariables API declares 1 security scheme for authenticating requests. It supports OAuth 2.0 (netlifyAuth) using the implicit flow. By default, every request must be authenticated.

Paths & Operations 8

Across 4 paths, the API surfaces 8 operations — 2 DELETE, 3 GET, 1 PATCH, 1 POST, 1 PUT. Each is listed below with its method, path, parameters, and response codes.

environmentVariables 8
GET
/accounts/{account_id}/env
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 classic environment variables…
getEnvVars 4 params → 200default
POST
/accounts/{account_id}/env
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 environment variables experience . Migrate…
createEnvVars 2 params body → 201default
GET
/api/v1/sites/{site_id}/env
Returns all environment variables for a site. This convenience method behaves the same as getEnvVars but doesn't require an accountid as input.
getSiteEnvVars 3 params → 200default
GET
/accounts/{account_id}/env/{key}
Returns an individual environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience . Migrate now with the Netlify UI.
getEnvVar 3 params → 200default
PUT
/accounts/{account_id}/env/{key}
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 classic environment va…
updateEnvVar 3 params body → 200default
DELETE
/accounts/{account_id}/env/{key}
Deletes an environment variable. To use this endpoint, your site must no longer be using the classic environment variables experience . Migrate now with the Netlify UI.
deleteEnvVar 3 params → 204default
PATCH
/accounts/{account_id}/env/{key}
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 experience . Migrate now with the Netlif…
setEnvVarValue 3 params body → 201default
DELETE
/accounts/{account_id}/env/{key}/value/{id}
Deletes a specific environment variable value. To use this endpoint, your site must no longer be using the classic environment variables experience . Migrate now with the Netlify UI.
deleteEnvVarValue 4 params → 204default

Schemas 4

The contract defines 4 schemas that model the data the API accepts and returns. The most detailed are envVar (6 properties), envVarValue (4 properties), envVarUser (4 properties), error (2 properties). Each schema is shown below with its type and property counts.

envVarUser
object
4 properties
envVarValue
object
Environment variable value model definition
4 properties
envVar
object
Environment variable model definition
6 properties
error
object
2 properties 1 required

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

netlify-environmentvariables-api-openapi.yml Raw ↑

Other APIs Netlify publishes across the network.

Netlify accessToken API
Netlify accountMembership API
Netlify accountType API
Netlify Asset API
Netlify assetPublicSignature API
Netlify auditLog API
Netlify Build API
Netlify buildHook API
Netlify buildLogMsg API
Netlify Deploy API
Netlify deployedBranch API
Netlify deployKey API