---
title: "Create governance policy"
method: POST
path: "/policies"
tags: ["policies"]
---

# Create governance policy

`POST /policies`

Creates a new governance policy to control where and how resources are deployed. Policies can restrict deployment to specific regions, countries, or continents for compliance.

## Request body

- Policy — Rule that controls how a deployment is made and served (e.g. location restrictions)
  - `metadata` Metadata, required — Owner fields for Persistence
    - `createdAt` string — The date and time when the resource was created
    - `updatedAt` string — The date and time when the resource was updated
    - `createdBy` string — The user or service account who created the resource
    - `updatedBy` string — The user or service account who updated the resource
    - `displayName` string — Human-readable name for display in the UI. Can contain spaces and special characters, max 63 characters.
    - `externalId` string — Caller-owned identifier for external lookups. Max 64 chars, alphanumeric + dash.
    - `labels` MetadataLabels — Key-value pairs for organizing and filtering resources. Labels can be used to categorize resources by environment, project, team, or any custom taxonomy.
    - `name` string, required — Unique identifier for the resource within the workspace. Must be lowercase alphanumeric with hyphens, max 49 characters. Immutable after creation.
    - `plan` string — Billing plan tier applied to this resource (inherited from workspace account)
    - `url` string — Auto-generated endpoint URL for accessing this resource (for agents, functions, models, sandboxes)
    - `workspace` string — Name of the workspace this resource belongs to (read-only, set automatically)
  - `spec` PolicySpec, required — Policy specification
    - `flavors` Flavor[] — Types of hardware available for deployments
      - `name` string — Flavor name (e.g. t4)
      - `type` 'cpu' | 'gpu' — Flavor type (e.g. cpu, gpu)
    - `locations` PolicyLocation[] — PolicyLocations is a local type that wraps a slice of Location
      - `name` string — Policy location name
      - `type` 'location' | 'country' | 'continent' — Policy location type
    - `maxTokens` PolicyMaxTokens — PolicyMaxTokens is a local type that wraps a slice of PolicyMaxTokens
      - `granularity` string — Granularity
      - `input` integer — Input
      - `output` integer — Output
      - `ratioInputOverOutput` integer — RatioInputOverOutput
      - `step` integer — Step
      - `total` integer — Total
    - `resourceTypes` PolicyResourceType[] — PolicyResourceTypes is a local type that wraps a slice of PolicyResourceType
    - `sandbox` boolean — Sandbox mode
    - `type` 'location' | 'flavor' | 'maxToken' — Policy type, can be location or flavor
  - `usage` PolicyUsageCounts — Per-resource counts of how many resources reference a policy. Computed by the policies listing endpoint to avoid client-side fan-out across the agents/models/functions/sandboxes/jobs listings.
    - `agents` integer
    - `functions` integer
    - `jobs` integer
    - `models` integer
    - `sandboxes` integer

## Response `200`

successful operation

- Policy — Rule that controls how a deployment is made and served (e.g. location restrictions)
  - `metadata` Metadata, required — Owner fields for Persistence
    - `createdAt` string — The date and time when the resource was created
    - `updatedAt` string — The date and time when the resource was updated
    - `createdBy` string — The user or service account who created the resource
    - `updatedBy` string — The user or service account who updated the resource
    - `displayName` string — Human-readable name for display in the UI. Can contain spaces and special characters, max 63 characters.
    - `externalId` string — Caller-owned identifier for external lookups. Max 64 chars, alphanumeric + dash.
    - `labels` MetadataLabels — Key-value pairs for organizing and filtering resources. Labels can be used to categorize resources by environment, project, team, or any custom taxonomy.
    - `name` string, required — Unique identifier for the resource within the workspace. Must be lowercase alphanumeric with hyphens, max 49 characters. Immutable after creation.
    - `plan` string — Billing plan tier applied to this resource (inherited from workspace account)
    - `url` string — Auto-generated endpoint URL for accessing this resource (for agents, functions, models, sandboxes)
    - `workspace` string — Name of the workspace this resource belongs to (read-only, set automatically)
  - `spec` PolicySpec, required — Policy specification
    - `flavors` Flavor[] — Types of hardware available for deployments
      - `name` string — Flavor name (e.g. t4)
      - `type` 'cpu' | 'gpu' — Flavor type (e.g. cpu, gpu)
    - `locations` PolicyLocation[] — PolicyLocations is a local type that wraps a slice of Location
      - `name` string — Policy location name
      - `type` 'location' | 'country' | 'continent' — Policy location type
    - `maxTokens` PolicyMaxTokens — PolicyMaxTokens is a local type that wraps a slice of PolicyMaxTokens
      - `granularity` string — Granularity
      - `input` integer — Input
      - `output` integer — Output
      - `ratioInputOverOutput` integer — RatioInputOverOutput
      - `step` integer — Step
      - `total` integer — Total
    - `resourceTypes` PolicyResourceType[] — PolicyResourceTypes is a local type that wraps a slice of PolicyResourceType
    - `sandbox` boolean — Sandbox mode
    - `type` 'location' | 'flavor' | 'maxToken' — Policy type, can be location or flavor
  - `usage` PolicyUsageCounts — Per-resource counts of how many resources reference a policy. Computed by the policies listing endpoint to avoid client-side fan-out across the agents/models/functions/sandboxes/jobs listings.
    - `agents` integer
    - `functions` integer
    - `jobs` integer
    - `models` integer
    - `sandboxes` integer

---

[API](https://skmtc.net/blaxel/apis/blaxel-control-plane.md) · [All operations](https://skmtc.net/blaxel/apis/blaxel-control-plane/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/blaxel/blaxel-control-plane/versions/dfa264bc72ee/schema)
