Skip to main content
Version: Current

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​

ParameterTypeRequirementDescription
namestringSee notesResource name to look up or create.
valuestringSee notesValue to store in the variable.
isEncryptedbooleanSee notesWhether to encrypt the stored variable value.
descriptionstringSee notesDescription of the resource.
typeIDintegerSee notesVariable type identifier. Confirm the supported numeric mapping for your deployment.
scopeIDintegerSee notesVariable 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.

FieldExample typeDescription
tenantIdintegerID of the tenant.

Errors​

Endpoint-specific error statuses and response bodies are not yet documented. See Usage and troubleshooting for general handling guidance.