Create Environment Variable
Overview
Create an environment variable in AI Command Center.
Endpoint
POST /api/evar/create
Use the service origin described in Getting started. The path above already includes /api.
Authentication
Send the access token obtained from Get Access Token in the Authorization header. Access is limited by the authenticated account’s permissions.
Request headers
Accept: application/json
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/json
Request body
| Parameter | Type | Requirement | Description |
|---|---|---|---|
name | string | See notes | Resource name to look up or create. |
value | string | See notes | Value to store in the variable. |
isEncrypted | boolean | See notes | Whether to encrypt the stored variable value. |
description | string | See notes | Description of the resource. |
typeID | integer | See notes | Variable type identifier. Confirm the supported numeric mapping for your deployment. |
scopeID | integer | See notes | Variable scope identifier. Confirm the supported numeric mapping for your deployment. |
Types reflect the example below. Unless marked required, field requirements, defaults, and validation limits need confirmation for your deployed version.
{
"name": "DemoEvar",
"value": "Testing",
"isEncrypted": false,
"description": "Demo Evar Creation",
"typeID": 1,
"scopeID": 1
}
Request example
The following example uses cURL in a POSIX shell. Replace example credentials and IDs before running it. Replace the AI Command Center origin with your deployment address.
curl --request POST \
--url 'https://command-center.example.com/api/evar/create' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"name": "DemoEvar",
"value": "Testing",
"isEncrypted": false,
"description": "Demo Evar Creation",
"typeID": 1,
"scopeID": 1
}'
Response
Successful status: 200 OK.
The following is an illustrative response with synthetic contact and credential values. Arrays are shortened to one representative item.
{
"id": 23,
"tenantId": 1,
"name": "DemoEvar",
"value": "Testing",
"isEncrypted": false,
"description": "Demo Evar Creation",
"typeID": 1,
"scopeID": 1,
"ownerId": 2,
"created": "2024-04-10T14:18:48.5539768Z",
"modified": "2024-04-10T14:18:48.5539768Z",
"createdBy": "Sample User",
"modifiedBy": "Sample User"
}
Response fields
The table describes selected fields in the response. Types reflect the example; this is not an exhaustive schema or nullability contract.
| Field | Example type | Description |
|---|---|---|
tenantId | integer | ID of the tenant. |
Errors
Endpoint-specific error statuses and response bodies are not yet documented. See Usage and troubleshooting for general handling guidance.