---
title: "Create Territory"
method: POST
path: "/api/v3/territories"
tags: ["Territories"]
---

# Create Territory

`POST /api/v3/territories`

Create one new territory; atomic JSONB + materialized write under user_profile row lock.

## Request body

- UserProfileInstitutionFilter
  - `id` string, uuid, nullable
  - `visibility` 'private' | 'organization'
  - `type` 'institution_type' | 'institution_list', required
  - `payload` union, required
    - InstitutionTypePayload
      - `name` string, nullable
      - `institution_type` string, nullable
      - `account_types` string[], nullable
      - `states` string[], nullable
      - `counties` string[], nullable
      - `cities` string[], nullable
      - `population_min` integer, nullable
      - `population_max` integer, nullable
      - `search_query` string, nullable
    - InstitutionListPayload
      - `institution_ids` string[]
      - `name` string, required
      - `original_filename` string, nullable
      - `original_filter` InstitutionTypePayload
        - `name` string, nullable
        - `institution_type` string, nullable
        - `account_types` string[], nullable
        - `states` string[], nullable
        - `counties` string[], nullable
        - `cities` string[], nullable
        - `population_min` integer, nullable
        - `population_max` integer, nullable
        - `search_query` string, nullable

## Response `201`

Successful Response

- TerritoryListItem — One row in the `GET /territories` list response. Visibility column lives in the DB but is intentionally not exposed here — future-sprint feature per boss; the API stays visibility-blind for now.
  - `id` string, uuid, required
  - `name` string, required
  - `type` 'institution_type' | 'institution_list', required
  - `payload` object, required
  - `account_count` integer, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/nationgraph/apis/nationgraph-api.md) · [All operations](https://skmtc.net/nationgraph/apis/nationgraph-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nationgraph/nationgraph-api/versions/85804e68d86d/schema)
