---
title: "Create a Fleet Policy"
method: POST
path: "/v1/fleet/{fleet_name}/policies"
tags: ["Fleets"]
---

# Create a Fleet Policy

`POST /v1/fleet/{fleet_name}/policies`

## Request

- Base URL: `https://api.edgegap.com`
- URL: `https://api.edgegap.com/v1/fleet/{fleet_name}/policies`
- Auth: API key in header `authorization`

Create a fleet policy. Policies are conditions that the fleet must respect.

## Path parameters

- `fleet_name` string, required

## Request body

- FleetPoliciesPostPayload
  - `name` string, required: Name of the Policy
  - `enabled` boolean, required: If the Policy is enabled. Defaults to true.
  - `type` 'Location' | 'Tag' | 'Coordinates', required: Type of the Policy. See our documentation for more information on the type and it's data.
  - `minimum` integer, required: Minimum deployments at all time
  - `maximum` integer, required: Maximum deployments for the provided type.
  - `threshold` number, required: Based on the number of sockets connected, how filled should a session deployment be before initiating a scale-up deployment. Float between 0.1 and 1.
  - `data` object, required: JSON object for your filters. See our documentation for more information.

## Response `200`

Success

- FleetPoliciesPostResponse
  - `name` string, required: Name of the Policy
  - `enabled` boolean, required: If the Policy is enabled. Defaults to true.
  - `type` 'Location' | 'Tag' | 'Coordinates', required: Type of the Policy. See our documentation for more information on the type and it's data.
  - `minimum` integer, required: Minimum deployments at all time
  - `maximum` integer, required: Maximum deployments for the provided type.
  - `threshold` number, required: Based on the number of sockets connected, how filled should a session deployment be before initiating a scale-up deployment. Float between 0.1 and 1.
  - `data` object, required: JSON object for your filters. See our documentation for more information.
  - `create_time` string: UTC time of policy creation
  - `last_updated` string: UTC time of policy last update

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not Found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/edgegap/apis/edgegap-v1.md) · [All operations](https://skmtc.dev/edgegap/apis/edgegap-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/edgegap/apis/edgegap-v1/revisions/9fa2b393a6be?raw)
