---
title: "Create a router resource"
method: POST
path: "/routers"
tags: ["Router"]
---

# Create a router resource

`POST /routers`

## Request

- Base URL: `https://demo.ziti.dev/fabric/v1`
- URL: `https://demo.ziti.dev/fabric/v1/routers`
- Auth: one of:
  - API key in header `zt-session`
  - OAuth 2
    - Authorization code: `/oidc/authorize`
    - Token URL: `/oidc/token` scopes: `openid`
- TypeScript: <https://skmtc.dev/openziti/apis/ziti-fabric/docs/routers/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a router resource. Requires admin access.

## Request body

- RouterCreate
  - `id` string, required
  - `name` string, required
  - `fingerprint` string, nullable
  - `cost` integer, required
  - `noTraversal` boolean, required
  - `disabled` boolean, nullable
  - `ctrlChanListeners` object
  - `configs` string[]
  - `tags` Tags

## Response `201`

The create request was successful and the resource has been added at the following location

- CreateEnvelope
  - `meta` Meta
    - `filterableFields` string[]
    - `pagination` Pagination
      - `limit` number, required
      - `offset` number, required
      - `totalCount` number, required
    - `apiEnrollmentVersion` string
    - `apiVersion` string
  - `data` CreateLocation
    - `_links` Links: A map of named links
    - `id` string

## Other responses

- `400`: The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information
- `401`: The currently supplied session does not have the correct access rights to request this resource
- `429`: The resource requested is rate limited and the rate limit has been exceeded
- `503`: The request could not be completed due to the server being busy or in a temporarily bad state

## Changes

- **2025-02-19** `9f5b78059994`: 1 info
  - added the non-success response with the status `503`
- **2023-10-23** `61384eb76c21`: 1 info
  - added the non-success response with the status `429`
- **2023-08-16** `94130b45fa7e`: 2 info
  - removed the non-success response with the status `429`
  - removed the non-success response with the status `503`

[Operation history](https://skmtc.dev/openziti/apis/ziti-fabric/changes/routers/post.md)

---

[API](https://skmtc.dev/openziti/apis/ziti-fabric.md) - [All operations](https://skmtc.dev/openziti/apis/ziti-fabric/llms.txt) - [OpenAPI document](https://skmtc.dev/openziti/apis/ziti-fabric/revisions/b899875c8f57?raw)
