---
title: "Bulk import variables to the group"
method: POST
path: "/api/v3/variable-groups/{variable_group_id}/variables"
tags: ["Secrets and Environment Vars"]
---

# Bulk import variables to the group

`POST /api/v3/variable-groups/{variable_group_id}/variables`

## Request

- Base URL: `https://codemagic.io`
- URL: `https://codemagic.io/api/v3/variable-groups/{variable_group_id}/variables`
- Auth: API key in header `x-auth-token`
- TypeScript: <https://skmtc.dev/codemagic/apis/codemagic-api/docs/api/v3/variable-groups/:variable_group_id/variables/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `variable_group_id` string, required

## Request body

- VariableGroupsSchemasBulkImportSchema
  - `secure` boolean, required
  - `variables` NewEnvironmentVariableSchema[], required
    - `name` string, required
    - `value` string, required

## Response `201`

Document created, URL follows

## Other responses

- `400`: The request could not be validated
- `401`: Authentication is missing or invalid
- `403`: The caller lacks the required permission
- `404`: The requested resource does not exist
- `429`: The rate limit has been exceeded

---

[API](https://skmtc.dev/codemagic/apis/codemagic-api.md) - [All operations](https://skmtc.dev/codemagic/apis/codemagic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/codemagic/apis/codemagic-api/revisions/be09630f65e2?raw)
