Skip to main content
POST
/
variables
Create Variable
curl --request POST \
  --url https://api.example.com/variables \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "variable": {
    "type": "ENV",
    "value": "<string>",
    "name": "<string>"
  }
}
'
{
  "variable": {
    "id": "kSuB9Gf6aD4",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "type": "ENV",
    "value": "<string>",
    "name": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Enter 'Bearer' followed by a space and your token (e.g., 'Bearer ${HASMCP_ACCESS_TOKEN}').

Body

application/json
variable
object

Response

201 - application/json

Variable created

variable
object