---
title: "Set workspace policy layer"
url: https://hexelstudio.com/docs/api/titan/management/set-workspace-policy-layer
---

# Set workspace policy layer

**PUT** `/titan/management/policy-layers/workspaces/{workspace_id}`

## Path parameters

- `workspace_id: string`

  A workspace id of the organization.

## Headers

- `Authorization: string`

  `Bearer <token>`. A Hexel Studio access token for a member or a service user of your organization (or send a service user's API key as X-API-Key).

## Body parameters

- `approval_profiles: array of object`

  - `approval_profile_id: string`

  - `delegator_separation_required: boolean`

  - `maximum_age_seconds: integer`

  - `notify: optional array of object`

    - `channel: optional string`

    - `type: string`

    - `url: optional string`

  - `quorum: integer`

  - `requester_separation_required: boolean`

  - `role_ids: array of string`

- `approval_roles: array of object`

  - `delegator: optional boolean`

  - `group_ids: optional array of string`

  - `human_principal_ids: array of string`

  - `role_id: string`

- `authorization_not_before: integer`

- `enforcement_deployment_id: string`

- `obligation_profile_references: array of object`

  - `conflicts_with: array of string`

  - `kind: string`

  - `profile_digest: string`

  - `profile_id: string`

  - `profile_version: integer`

- `organization_id: string`

- `policy_source_id: string`

- `rules: array of object`

  - `approval_profile_ids: array of string`

  - `connection_constraints: object`

    - `allowed_principal_types: optional array of string`

    - `provider: optional string`

    - `required_destination_boundaries: optional array of string`

    - `required_permissions: optional array of string`

    - `required_tags: optional array of string`

  - `effect: string`

  - `limits: object`

    - `maximum_concurrency: optional integer`

    - `maximum_cost_microunits: optional integer`

    - `maximum_response_bytes: optional integer`

    - `timeout_ms: optional integer`

  - `match: object`

    - `agent_ids: optional array of string`

    - `agent_revision_ids: optional array of string`

    - `attributes: optional array of object`

      - `name: string`

      - `operator: string`

      - `value: any`

    - `capability_contract_digests: optional array of string`

    - `capability_ids: optional array of string`

    - `capability_revisions: optional array of integer`

    - `delegation: optional string`

    - `delegator_ids: optional array of string`

    - `deployment_ids: optional array of string`

    - `destination_boundaries_all: optional array of string`

    - `destination_providers: optional array of string`

    - `environment_ids: optional array of string`

    - `environment_states: optional array of string`

    - `excluded_delegator_ids: optional array of string`

    - `minimum_assurance: optional string`

    - `operations: optional array of string`

    - `resource_ids: optional array of string`

    - `resource_types: optional array of string`

    - `risk_classes: optional array of string`

    - `runtime_classes: optional array of string`

    - `runtime_principal_ids: optional array of string`

    - `side_effect_classes: optional array of string`

    - `toolkits: optional array of string`

    - `utc_windows: optional array of object`

      - `end_minute: integer`

      - `start_minute: integer`

      - `weekday: integer`

    - `workspace_ids: optional array of string`

  - `mode: optional string`

  - `obligations: object`

    - `audit_profile_ids: optional array of string`

    - `audit_required: optional boolean`

    - `executor_obligation_profile_ids: optional array of string`

    - `idempotency_required: optional boolean`

    - `response_filter_profile_ids: optional array of string`

  - `priority: integer`

  - `rule_id: string`

- `source_revision: integer`

- `version: integer`

## Returns

`200` Organization-scoped result. (`PolicyLayersView`)

- `deployments: optional array of object`

  - `applied: boolean`

  - `deployment_id: string`

  - `enforcement_deployment_id: string`

  - `error_code: optional string`

- `organization: object`

  - `policy_source_id: string`

  - `source: any`

  - `source_digest: string`

  - `source_revision: integer`

  - `updated_at: string`

  - `updated_by: string`

- `organization_id: string`

- `workspaces: map[object]`

## Errors

- `400` Invalid request or path; POLICY_LAYER_INVALID when the layer source does not compile, does not name the caller's organization and enforcement_deployment_id "*", has a rule other than deny or require_approval or a rule with limits, obligations or connection constraints, or cannot be composed with a deployment's policy; POLICY_TERM_UNSUPPORTED when a rule has a mode (a watch-only rule) and watch-only rules is off, except for the layer in force submitted again.
- `401` Missing or invalid authenticated context.
- `403` Organization mismatch, or the IAM action is denied: titan:policy:read to read, titan:policy:publish to change.
- `404` Unknown or foreign organization resource, or plan not yet prepared.
- `405` HTTP method is not supported on this route.
- `409` source_revision is not greater than the stored layer's (POLICY_REVISION_STALE); POLICY_LAYER_WORKSPACE_LIMIT_REACHED when the organization already has layers for 1,000 workspaces.
- `413` Request body exceeds its size limit.
- `415` Unsupported request media type.
- `502` A deployment's Configuration Authority refused or answered unexpectedly (closed code) when a PUT read its entry; nothing was stored.
- `503` Local storage or a deployment's Configuration Authority unavailable. A PUT waits for every provisioned deployment management can address: when one's entry cannot be read, nothing is stored; retry. A DELETE never waits for the deployments; a deployment management cannot address under its configuration is listed (PROVISIONING_NOT_CONFIGURED) and flagged (policy_layers_refused), not waited for.

## Example

```bash
curl --request PUT \
  --url 'https://api.hexelstudio.com/v1/titan/management/policy-layers/workspaces/{workspace_id}' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "approval_profiles": [
    {
      "approval_profile_id": "string",
      "delegator_separation_required": true,
      "maximum_age_seconds": 0,
      "notify": [
        {
          "channel": "string",
          "type": "string",
          "url": "string"
        }
      ],
      "quorum": 0,
      "requester_separation_required": true,
      "role_ids": [
        "string"
      ]
    }
  ],
  "approval_roles": [
    {
      "delegator": true,
      "group_ids": [
        "string"
      ],
      "human_principal_ids": [
        "string"
      ],
      "role_id": "string"
    }
  ],
  "authorization_not_before": 0,
  "enforcement_deployment_id": "string",
  "obligation_profile_references": [
    {
      "conflicts_with": [
        "string"
      ],
      "kind": "string",
      "profile_digest": "string",
      "profile_id": "string",
      "profile_version": 0
    }
  ],
  "organization_id": "string",
  "policy_source_id": "string",
  "rules": [
    {
      "approval_profile_ids": [
        "string"
      ],
      "connection_constraints": {
        "allowed_principal_types": [
          "string"
        ],
        "provider": "string",
        "required_destination_boundaries": [
          "string"
        ],
        "required_permissions": [
          "string"
        ],
        "required_tags": [
          "string"
        ]
      },
      "effect": "string",
      "limits": {
        "maximum_concurrency": 0,
        "maximum_cost_microunits": 0,
        "maximum_response_bytes": 0,
        "timeout_ms": 0
      },
      "match": {
        "agent_ids": [
          "string"
        ],
        "agent_revision_ids": [
          "string"
        ],
        "attributes": [
          {
            "name": "string",
            "operator": "string",
            "value": "string"
          }
        ],
        "capability_contract_digests": [
          "string"
        ],
        "capability_ids": [
          "string"
        ],
        "capability_revisions": [
          0
        ],
        "delegation": "string",
        "delegator_ids": [
          "string"
        ],
        "deployment_ids": [
          "string"
        ],
        "destination_boundaries_all": [
          "string"
        ],
        "destination_providers": [
          "string"
        ],
        "environment_ids": [
          "string"
        ],
        "environment_states": [
          "string"
        ],
        "excluded_delegator_ids": [
          "string"
        ],
        "minimum_assurance": "string",
        "operations": [
          "string"
        ],
        "resource_ids": [
          "string"
        ],
        "resource_types": [
          "string"
        ],
        "risk_classes": [
          "string"
        ],
        "runtime_classes": [
          "string"
        ],
        "runtime_principal_ids": [
          "string"
        ],
        "side_effect_classes": [
          "string"
        ],
        "toolkits": [
          "string"
        ],
        "utc_windows": [
          {
            "end_minute": 0,
            "start_minute": 0,
            "weekday": 0
          }
        ],
        "workspace_ids": [
          "string"
        ]
      },
      "mode": "string",
      "obligations": {
        "audit_profile_ids": [
          "string"
        ],
        "audit_required": true,
        "executor_obligation_profile_ids": [
          "string"
        ],
        "idempotency_required": true,
        "response_filter_profile_ids": [
          "string"
        ]
      },
      "priority": 0,
      "rule_id": "string"
    }
  ],
  "source_revision": 0,
  "version": 0
}'
```

### Response (200)

```json
{
  "deployments": [
    {
      "applied": true,
      "deployment_id": "string",
      "enforcement_deployment_id": "string",
      "error_code": "string"
    }
  ],
  "organization": {
    "policy_source_id": "string",
    "source": "string",
    "source_digest": "string",
    "source_revision": 0,
    "updated_at": "2026-01-01T00:00:00Z",
    "updated_by": "string"
  },
  "organization_id": "string",
  "workspaces": {
    "key": {
      "policy_source_id": "string",
      "source": "string",
      "source_digest": "string",
      "source_revision": 0,
      "updated_at": "2026-01-01T00:00:00Z",
      "updated_by": "string"
    }
  }
}
```

### Response (400)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (401)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (403)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (404)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (405)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (409)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (413)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (415)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (502)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (503)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```
