> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuraltrust.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Attach a registry to a consumer

> Associates a registry with a consumer (idempotent). The optional body sets the registry weight for weighted load balancing.



## OpenAPI

````yaml /trustgate/api/openapi.json post /v1/gateways/{gateway_id}/consumers/{id}/registries/{registry_id}
openapi: 3.0.0
info:
  description: >-
    Administrative API for managing gateways and their registries, policies,
    consumers, roles and auth credentials.
  title: TrustGate Admin API
  contact:
    name: NeuralTrust
    url: https://neuraltrust.ai/contact
    email: support@neuraltrust.ai
  version: '1.0'
servers:
  - url: https://agentgateway-admin.dev.neuraltrust.ai
    description: Admin API
security: []
paths:
  /v1/gateways/{gateway_id}/consumers/{id}/registries/{registry_id}:
    post:
      tags:
        - consumers
      summary: Attach a registry to a consumer
      description: >-
        Associates a registry with a consumer (idempotent). The optional body
        sets the registry weight for weighted load balancing.
      parameters:
        - description: Gateway id
          name: gateway_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - description: Consumer id
          name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - description: Registry id
          name: registry_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.AttachRegistryRequest
        description: Optional registry weight
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
      security:
        - BearerAuth: []
components:
  schemas:
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.AttachRegistryRequest:
      type: object
      properties:
        weight:
          description: Weight is the relative weighted-round-robin share on a 1..100 scale.
          type: integer
          maximum: 100
          minimum: 1
          example: 1
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    BearerAuth:
      type: apiKey
      name: Authorization
      in: header

````