---
title: "Connect Resource to Gateways"
url: "https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598/operations/ResourceController_newResourceConnection"
---

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

# Connect Resource to Gateways

`POST` `/tenants/resources/{id}/gateways`

Operation ID: `ResourceController_newResourceConnection`

Establishes network connections between a resource and one or more gateways, enabling users to access the resource through those gateways. This operation is essential for defining network topology and access paths.

## Path parameters

- `id` (string, uuid, required) - The unique identifier (UUID) of the resource

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Successfully created resource-gateway connections
- `400` - Bad Request - Invalid gateway IDs provided
- `401` - Unauthorized - Invalid or missing authentication token
- `403` - Forbidden - Insufficient permissions to perform this operation.
- `404` - Resource or gateway not found with the provided ID

## 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/resources/{id}/gateways:
    post:
      operationId: ResourceController_newResourceConnection
      summary: Connect Resource to Gateways
      description: Establishes network connections between a resource and one or more
        gateways, enabling users to access the resource through those gateways.
        This operation is essential for defining network topology and access
        paths.
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier (UUID) of the resource
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                gateways:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: Comma-separated list of gateway IDs
              required:
                - gateways
      responses:
        "201":
          description: Successfully created resource-gateway connections
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/AccessPointDto"
        "400":
          description: Bad Request - Invalid gateway IDs provided
        "401":
          description: Unauthorized - Invalid or missing authentication token
        "403":
          description: Forbidden - Insufficient permissions to perform this operation.
        "404":
          description: Resource or gateway not found with the provided ID
      tags:
        - Resources
      security:
        - ApiKeyAuth: []
security:
  - ApiKeyAuth: []
components:
  schemas:
    AccessPointDto:
      type: object
      properties:
        addressId:
          type: string
        gatewayId:
          type: string
      required:
        - addressId
        - gatewayId
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
```
