---
title: "Create New Gateway"
url: "https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598/operations/GatewaysController_create"
---

> Full API specification: https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598.md

# Create New Gateway

`POST` `/tenants/gateways`

Operation ID: `GatewaysController_create`

Creates a new network gateway that will serve as an access point for users and devices to connect to the tenant's network resources. The gateway will be configured with WireGuard VPN settings and endpoint information.

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Successfully created the gateway
- `401` - Unauthorized - Invalid or missing authentication token
- `403` - Forbidden - Insufficient permissions to perform this operation.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Cipherscale API
  version: "1.0"
servers:
  - url: https://public-api.cipherscale.com/qa
    description: Cipherscale Public API Server
paths:
  /tenants/gateways:
    post:
      operationId: GatewaysController_create
      summary: Create New Gateway
      description: Creates a new network gateway that will serve as an access point
        for users and devices to connect to the tenant's network resources. The
        gateway will be configured with WireGuard VPN settings and endpoint
        information.
      requestBody:
        required: true
        description: The gateway data to create
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateGatewayDto"
      responses:
        "201":
          description: Successfully created the gateway
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GatewayDto"
        "401":
          description: Unauthorized - Invalid or missing authentication token
        "403":
          description: Forbidden - Insufficient permissions to perform this operation.
      tags:
        - Gateways
      security:
        - ApiKeyAuth: []
security:
  - ApiKeyAuth: []
components:
  schemas:
    CreateGatewayDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        wireguardPort:
          type: string
        endpoint:
          type: string
      required:
        - name
        - wireguardPort
    GatewayDto:
      type: object
      description: Network gateway configuration and status information
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the gateway
        createdAt:
          format: date-time
          type: string
          description: Timestamp when the gateway was created
        deployedOn:
          format: date-time
          type: string
          nullable: true
          description: Timestamp when the gateway was first successfully deployed
        updatedAt:
          format: date-time
          type: string
          description: Timestamp when the gateway was last updated
        name:
          type: string
          description: Human-readable name for the gateway
        description:
          type: string
          description: Detailed description of the gateway's purpose and location
        wireguardPort:
          type: string
          description: WireGuard VPN port number for this gateway
        status:
          enum:
            - PENDING
            - ONLINE
            - OFFLINE
            - MAINTENANCE
            - ERROR
          type: string
          description: Current operational status of the gateway
        error:
          type: string
          description: Error message if the gateway is in ERROR status
        token:
          type: string
          description: Authentication token for gateway communication
        lastOnline:
          format: date-time
          type: string
          description: Timestamp when the gateway was last online
        relayEnabled:
          type: boolean
          description: Whether the gateway can relay traffic between network segments
        endpoint:
          type: string
          description: Network endpoint address for the gateway
        autoDiscoverEndpoint:
          type: boolean
          description: Whether the gateway endpoint is automatically discovered
        resources:
          type: array
          items:
            $ref: "#/components/schemas/GatewayResourceDto"
          description: List of resources accessible through this gateway
      required:
        - id
        - createdAt
        - deployedOn
        - updatedAt
        - name
        - wireguardPort
        - status
        - token
        - autoDiscoverEndpoint
    GatewayResourceDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
      required:
        - id
        - name
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
```
