openapi: 3.2.0 info: version: 2.57.0 title: Netlify's API documentation Environment Variables API description: Netlify is a hosting service for the programmable web. termsOfService: https://www.netlify.com/legal/terms-of-use/ x-logo: url: netlify-logo.png href: https://www.netlify.com/docs/ altText: Netlify servers: - url: https://api.netlify.com/api/v1 security: - netlifyAuth: [] tags: - name: Environment Variables x-displayName: Environment variables paths: /accounts/{account_id}/env: get: tags: - Environment Variables operationId: getEnvVars parameters: - name: account_id description: Scope response to account_id required: true in: path schema: type: string - name: context_name description: Filter by deploy context required: false in: query schema: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - name: scope description: Filter by scope required: false in: query schema: type: string enum: - builds - functions - runtime - post-processing - name: site_id description: If specified, only return environment variables set on this site required: false in: query schema: type: string responses: '200': description: OK content: application/json: schema: type: array items: type: object properties: key: type: string description: The environment variable key, like ALGOLIA_ID (case-sensitive) x-faker: commerce.productName scopes: type: array items: type: string enum: - builds - functions - runtime - post-processing description: The scopes that this environment variable is set to values: type: array items: type: object properties: id: type: string description: The environment variable value's universally unique ID x-faker: datatype.uuid value: type: string description: The environment variable's unencrypted value x-faker: internet.password context: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - branch description: The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. context_parameter: type: string description: An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`. description: Environment variable value model definition description: An array of Value objects containing values and metadata x-faker: internet.password is_secret: type: boolean description: Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. updated_at: type: string format: date-time description: The timestamp of when the value was last updated x-faker: date.past updated_by: type: object properties: id: type: string description: The user's unique identifier x-faker: datatype.number full_name: type: string description: The user's full name (first and last) x-faker: name.findName email: type: string description: The user's email address x-faker: internet.email avatar_url: type: string description: A URL pointing to the user's avatar x-faker: internet.avatar description: Environment variable model definition default: description: error content: application/json: schema: type: object required: - message properties: code: type: integer format: int64 message: type: string description: Returns all environment variables for an account or site. An account corresponds to a team in the Netlify UI. summary: Get env vars x-summary-source: derived post: tags: - Environment Variables operationId: createEnvVars description: Creates new environment variables. Granular scopes are available on Pro plans and above. parameters: - name: account_id description: Scope response to account_id required: true in: path schema: type: string - name: site_id description: If provided, create an environment variable on the site level, not the account level required: false in: query schema: type: string responses: '201': description: OK content: application/json: schema: type: array items: type: object properties: key: type: string description: The environment variable key, like ALGOLIA_ID (case-sensitive) x-faker: commerce.productName scopes: type: array items: type: string enum: - builds - functions - runtime - post-processing description: The scopes that this environment variable is set to values: type: array items: type: object properties: id: type: string description: The environment variable value's universally unique ID x-faker: datatype.uuid value: type: string description: The environment variable's unencrypted value x-faker: internet.password context: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - branch description: The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. context_parameter: type: string description: An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`. description: Environment variable value model definition description: An array of Value objects containing values and metadata x-faker: internet.password is_secret: type: boolean description: Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. updated_at: type: string format: date-time description: The timestamp of when the value was last updated x-faker: date.past updated_by: type: object properties: id: type: string description: The user's unique identifier x-faker: datatype.number full_name: type: string description: The user's full name (first and last) x-faker: name.findName email: type: string description: The user's email address x-faker: internet.email avatar_url: type: string description: A URL pointing to the user's avatar x-faker: internet.avatar description: Environment variable model definition default: description: error content: application/json: schema: type: object required: - message properties: code: type: integer format: int64 message: type: string requestBody: content: application/json: schema: type: array items: type: object properties: key: type: string description: The existing or new name of the key, if you wish to rename it (case-sensitive) scopes: description: The scopes that this environment variable is set to (Pro plans and above) type: array items: type: string enum: - builds - functions - runtime - post-processing values: type: array items: type: object properties: id: type: string description: The environment variable value's universally unique ID x-faker: datatype.uuid value: type: string description: The environment variable's unencrypted value x-faker: internet.password context: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - branch description: The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. context_parameter: type: string description: An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`. description: Environment variable value model definition is_secret: type: boolean description: Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. summary: Create env vars x-summary-source: derived /api/v1/sites/{site_id}/env: get: tags: - Environment Variables operationId: getSiteEnvVars parameters: - name: context_name description: Filter by deploy context required: false in: query schema: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - name: scope description: Filter by scope required: false in: query schema: type: string enum: - builds - functions - runtime - post_processing - name: site_id description: Scope response to site_id required: true in: path schema: type: string responses: '200': description: OK content: application/json: schema: type: array items: type: object properties: key: type: string description: The environment variable key, like ALGOLIA_ID (case-sensitive) x-faker: commerce.productName scopes: type: array items: type: string enum: - builds - functions - runtime - post-processing description: The scopes that this environment variable is set to values: type: array items: type: object properties: id: type: string description: The environment variable value's universally unique ID x-faker: datatype.uuid value: type: string description: The environment variable's unencrypted value x-faker: internet.password context: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - branch description: The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. context_parameter: type: string description: An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`. description: Environment variable value model definition description: An array of Value objects containing values and metadata x-faker: internet.password is_secret: type: boolean description: Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. updated_at: type: string format: date-time description: The timestamp of when the value was last updated x-faker: date.past updated_by: type: object properties: id: type: string description: The user's unique identifier x-faker: datatype.number full_name: type: string description: The user's full name (first and last) x-faker: name.findName email: type: string description: The user's email address x-faker: internet.email avatar_url: type: string description: A URL pointing to the user's avatar x-faker: internet.avatar description: Environment variable model definition default: description: error content: application/json: schema: type: object required: - message properties: code: type: integer format: int64 message: type: string 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. summary: Get site env vars x-summary-source: derived /accounts/{account_id}/env/{key}: get: tags: - Environment Variables operationId: getEnvVar parameters: - name: account_id description: Scope response to account_id required: true in: path schema: type: string - name: key description: The environment variable key (case-sensitive) required: true in: path schema: type: string - name: site_id description: If provided, return the environment variable for a specific site (no merging is performed) required: false in: query schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: key: type: string description: The environment variable key, like ALGOLIA_ID (case-sensitive) x-faker: commerce.productName scopes: type: array items: type: string enum: - builds - functions - runtime - post-processing description: The scopes that this environment variable is set to values: type: array items: type: object properties: id: type: string description: The environment variable value's universally unique ID x-faker: datatype.uuid value: type: string description: The environment variable's unencrypted value x-faker: internet.password context: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - branch description: The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. context_parameter: type: string description: An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`. description: Environment variable value model definition description: An array of Value objects containing values and metadata x-faker: internet.password is_secret: type: boolean description: Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. updated_at: type: string format: date-time description: The timestamp of when the value was last updated x-faker: date.past updated_by: type: object properties: id: type: string description: The user's unique identifier x-faker: datatype.number full_name: type: string description: The user's full name (first and last) x-faker: name.findName email: type: string description: The user's email address x-faker: internet.email avatar_url: type: string description: A URL pointing to the user's avatar x-faker: internet.avatar description: Environment variable model definition default: description: error content: application/json: schema: type: object required: - message properties: code: type: integer format: int64 message: type: string description: Returns an individual environment variable. summary: Get env var x-summary-source: derived put: tags: - Environment Variables operationId: updateEnvVar description: Updates an existing environment variable and all of its values. Existing values will be replaced by values provided. parameters: - name: account_id description: Scope response to account_id required: true in: path schema: type: string - name: key description: The existing environment variable key name (case-sensitive) required: true in: path schema: type: string - name: site_id description: If provided, update an environment variable set on this site required: false in: query schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: key: type: string description: The environment variable key, like ALGOLIA_ID (case-sensitive) x-faker: commerce.productName scopes: type: array items: type: string enum: - builds - functions - runtime - post-processing description: The scopes that this environment variable is set to values: type: array items: type: object properties: id: type: string description: The environment variable value's universally unique ID x-faker: datatype.uuid value: type: string description: The environment variable's unencrypted value x-faker: internet.password context: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - branch description: The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. context_parameter: type: string description: An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`. description: Environment variable value model definition description: An array of Value objects containing values and metadata x-faker: internet.password is_secret: type: boolean description: Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. updated_at: type: string format: date-time description: The timestamp of when the value was last updated x-faker: date.past updated_by: type: object properties: id: type: string description: The user's unique identifier x-faker: datatype.number full_name: type: string description: The user's full name (first and last) x-faker: name.findName email: type: string description: The user's email address x-faker: internet.email avatar_url: type: string description: A URL pointing to the user's avatar x-faker: internet.avatar description: Environment variable model definition default: description: error content: application/json: schema: type: object required: - message properties: code: type: integer format: int64 message: type: string requestBody: content: application/json: schema: type: object properties: key: type: string description: The existing or new name of the key, if you wish to rename it (case-sensitive) scopes: description: The scopes that this environment variable is set to (Pro plans and above) type: array items: type: string enum: - builds - functions - runtime - post-processing values: type: array items: type: object properties: id: type: string description: The environment variable value's universally unique ID x-faker: datatype.uuid value: type: string description: The environment variable's unencrypted value x-faker: internet.password context: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - branch description: The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. context_parameter: type: string description: An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`. description: Environment variable value model definition is_secret: type: boolean description: Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. summary: Update env var x-summary-source: derived patch: tags: - Environment Variables operationId: setEnvVarValue description: Updates or creates a new value for an existing environment variable. parameters: - name: account_id description: Scope response to account_id required: true in: path schema: type: string - name: key description: The existing environment variable key name (case-sensitive) required: true in: path schema: type: string - name: site_id description: If provided, update an environment variable set on this site in: query schema: type: string responses: '201': description: Created (success) content: application/json: schema: type: object properties: key: type: string description: The environment variable key, like ALGOLIA_ID (case-sensitive) x-faker: commerce.productName scopes: type: array items: type: string enum: - builds - functions - runtime - post-processing description: The scopes that this environment variable is set to values: type: array items: type: object properties: id: type: string description: The environment variable value's universally unique ID x-faker: datatype.uuid value: type: string description: The environment variable's unencrypted value x-faker: internet.password context: type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - branch description: The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. context_parameter: type: string description: An additional parameter for custom branches. Currently, this is used for specifying a branch name when `context=branch`. description: Environment variable value model definition description: An array of Value objects containing values and metadata x-faker: internet.password is_secret: type: boolean description: Secret values are only readable by code running on Netlify's systems. With secrets, only the local development context values are readable from the UI, API, and CLI. By default, environment variable values are not secret. updated_at: type: string format: date-time description: The timestamp of when the value was last updated x-faker: date.past updated_by: type: object properties: id: type: string description: The user's unique identifier x-faker: datatype.number full_name: type: string description: The user's full name (first and last) x-faker: name.findName email: type: string description: The user's email address x-faker: internet.email avatar_url: type: string description: A URL pointing to the user's avatar x-faker: internet.avatar description: Environment variable model definition default: description: error content: application/json: schema: type: object required: - message properties: code: type: integer format: int64 message: type: string requestBody: content: application/json: schema: type: object properties: context: description: The deploy context in which this value will be used. `dev` refers to local development when running `netlify dev`. `branch` must be provided with a value in `context_parameter`. type: string enum: - all - dev - dev-server - branch-deploy - deploy-preview - production - branch context_parameter: description: An additional parameter for custom branches. Currently, this is used for providing a branch name when `context=branch`. type: string value: description: The environment variable's unencrypted value type: string summary: Set env var value x-summary-source: derived delete: tags: - Environment Variables operationId: deleteEnvVar parameters: - name: account_id description: Scope response to account_id required: true in: path schema: type: string - name: key description: The environment variable key (case-sensitive) required: true in: path schema: type: string - name: site_id description: If provided, delete the environment variable from this site required: false in: query schema: type: string responses: '204': description: No Content (success) default: description: error content: application/json: schema: type: object required: - message properties: code: type: integer format: int64 message: type: string description: Deletes an environment variable summary: Delete env var x-summary-source: derived /accounts/{account_id}/env/{key}/value/{id}: delete: tags: - Environment Variables operationId: deleteEnvVarValue parameters: - name: account_id description: Scope response to account_id required: true in: path schema: type: string - name: id description: The environment variable value's ID required: true in: path schema: type: string - name: key description: The environment variable key name (case-sensitive) required: true in: path schema: type: string - name: site_id description: If provided, delete the value from an environment variable on this site required: false in: query schema: type: string responses: '204': description: No Content (success) default: description: error content: application/json: schema: type: object required: - message properties: code: type: integer format: int64 message: type: string description: Deletes a specific environment variable value. summary: Delete env var value x-summary-source: derived components: securitySchemes: netlifyAuth: type: oauth2 flows: implicit: scopes: {} authorizationUrl: https://app.netlify.com/authorize externalDocs: url: https://www.netlify.com/docs/api/ description: Online documentation x-tagGroups: - name: OAuth tags: - ticket - accessToken - name: User accounts tags: - user - accountMembership - member - accountType - paymentMethod - auditLog - name: Site tags: - site - environmentVariables - file - metadata - purge - snippet - name: Domain names tags: - dnsZone - sniCertificate - name: Deploys tags: - deploy - deployedBranch - deployKey - name: Builds tags: - build - buildLogMsg - name: Dev servers tags: - devServer - name: Webhooks and notifications tags: - hook - hookType - buildHook - devServerHook - name: Services tags: - service - serviceInstance - name: Functions tags: - function - name: Database tags: - database - name: Forms tags: - form - submission - name: Split tests tags: - splitTest - name: Large media tags: - asset - assetPublicSignature