Update Environment
PATCH
/workspaces/{slug}/environments/{envSlug} Updates \`providerKeyId\` and/or \`model\` on the environment. Passing \`providerKeyId: null\` (model must also be null) reverts to system fallback. If \`model\` is non-null it must be in the provider's allowlist. Requires workspace ownership and provider-key ownership.
Body Parameters
providerKeyId: string | null
model: string | null
curl -X PATCH \
-H "x-api-key: dsk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"providerKeyId": "example-providerKeyId",
"model": "example-model"
}' \
https://api.tracore.io/workspaces/my-workspace/environments/production
// No SDK example available for updateEnvironment
200 Response
{
"id": "ws_abc123",
"workspaceId": "ws_abc123",
"slug": "production",
"name": "My Workspace",
"isDefault": true,
"isLocked": false,
"createdAt": "2024-03-15T10:30:00Z",
"updatedAt": "2024-03-15T10:30:00Z",
"providerKeyId": "example-value",
"model": "example-value",
"resolved": {
"provider": "mistral",
"model": "example-value",
"residency": "EU",
"keySource": "system"
}
}