---
title: "Create a Security Group"
method: POST
path: "/security-group"
tags: ["security-group"]
---

# Create a Security Group

`POST /security-group`

## Request

- Base URL: `https://api-ch-gva-2.exoscale.com/v2`
- URL: `https://api-ch-gva-2.exoscale.com/v2/security-group`
- Auth: none declared
- TypeScript: <https://skmtc.dev/exoscale/apis/exoscale-api/docs/security-group/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- object
  - `name` string, required: Security Group name
  - `description` string: Security Group description

## Response `200`

200

- Operation: Operation
  - `id` string, uuid: Operation ID
  - `reason` 'incorrect' | 'unknown' | 'unavailable' | 'forbidden' | 'busy' | 'fault' | 'partial' | 'not-found' | 'interrupted' | 'unsupported' | 'conflict': Operation failure reason
  - `reference` object: Related resource reference
    - `id` string, uuid: Reference ID
    - `link` string: Link to the referenced resource
    - `command` string: Command name
  - `message` string: Operation message
  - `state` 'failure' | 'pending' | 'success' | 'timeout': Operation status

## Changes

- **2023-02-03** `6e9809fd1444`: 1 breaking, 2 warning
  - the `name` request property's minLength was increased from `0` to `1`
  - the `description` request property's maxLength was set to `255`
  - the `name` request property's maxLength was set to `255`

[Operation history](https://skmtc.dev/exoscale/apis/exoscale-api/changes/security-group/post.md)

---

[API](https://skmtc.dev/exoscale/apis/exoscale-api.md) - [All operations](https://skmtc.dev/exoscale/apis/exoscale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/exoscale/apis/exoscale-api/revisions/63da6f74c845?raw)
