Skip to content

Set configuration variables for a scope

Request

Create or replace configuration variables for a given scope. If no scopeType/scopeId is provided, sets company-level variables. Every variable created, updated or deleted is recorded in the audit log under the acting user: the token's subject (the client id of a service account), or when that is blank, the X-Hy-Meta-User-Id header.

Security
OAuth2(Required scopes: context-vars.write)
Headers
X-Hy-Meta-Internal-Company-Idstring

Company ID for service account authorization

X-Hy-Meta-User-Idstring

Hypatos user id of the acting user, recorded as the audit log actor and stored as the scope's created_by/updated_by so both agree. The token's subject takes precedence, so with a service account token the client id is recorded and this header is read only when the subject is blank. It in turn takes precedence over the body's deprecated updatedBy.

Bodyapplication/jsonrequired
scopeTypestring(ScopeType)
Enum:"PROJECT""PS_WORKFLOW""PS_AGENT""CE_WORKFLOW"
scopeIdstring

Scope identifier (required when scopeType is set)

Example:"66e80e8f4e8215461076e24b"
variablesArray of objects(Variable)required
updatedBystringdeprecated

Deprecated - the acting user is the token's subject. Read only when both the subject and the X-Hy-Meta-User-Id header are missing or blank.

Example:"66f2b0c4a1d3e5f6a7b8c9d0"
curl -i -X PUT \
  https://api.cloud.hypatos.ai/v2/context-vars/configurations \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-Hy-Meta-Internal-Company-Id: string' \
  -H 'X-Hy-Meta-User-Id: string' \
  -d '{
    "variables": [
      {
        "name": "emailSender",
        "value": "noreply",
        "description": "Default email sender address"
      },
      {
        "name": "notifyEnabled",
        "value": "true",
        "description": "Toggle system notifications"
      }
    ]
  }'

Responses

Configuration updated

Bodyapplication/json
scopeTypestring(ScopeType)
Enum:"PROJECT""PS_WORKFLOW""PS_AGENT""CE_WORKFLOW"
scopeIdstring
variablesArray of objects(Variable)required
Response
{ "scopeType": "PROJECT", "scopeId": "string", "variables": [ { … } ] }