---
title: "Create Sector"
method: POST
path: "/api/sectors/"
tags: ["sectors"]
---

# Create Sector

`POST /api/sectors/`

## Request

- Base URL: `https://api.regdoor.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.regdoor.com/api/sectors/`
- Auth: HTTP bearer

Create a new sector or subsector.

- To create a root sector: provide only `name` (and optionally `info`)
- To create a subsector: provide `name` and `father_sector_uuid` (and optionally `info`)

Args:
    payload: SectorCreate payload with name, optional father_sector_uuid, and info

Returns:
    Created Sector instance

## Request body

- SectorCreate: Schema for creating a sector (without father)
  - `name` string, required
  - `info` object, nullable
  - `father_sector_uuid` string, uuid4, nullable
  - `contents` SectorContentAssociation[], nullable
    - `content_uuid` string, uuid4, required
    - `impact_level` 'High' | 'Medium' | 'Low', required
    - `info` object, nullable
  - `organizations` OrganizationSectorAssociation[], nullable
    - `organization_uuid` string, uuid4, required
    - `type` 'transversal' | 'primary' | 'secondary' | 'indirect', required
    - `info` object, nullable

## Response `201`

Successful Response

- Sector: Full sector schema with relationships
  - `name` string, required
  - `info` object, nullable
  - `uuid` string, uuid4, required
  - `father_sector_uuid` string, uuid4, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `deleted_at` string, date-time, nullable
  - `subsectors` SectorRef[]
    - `uuid` string, uuid4, required
    - `name` string, required
    - `father_sector_uuid` string, uuid4, nullable
  - `contents` AppViewsSchemasSectorsSchemaContentRef[], required
    - `uuid` string, uuid4, required
    - `name` string, required
  - `organizations` OrganizationRef[], required
    - `uuid` string, uuid4, required
    - `name` string, required

## Other responses

- `404`: Not found
- `422`: Validation Error

---

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