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

# Rename a target group or retune its health check, framing, or stickiness



## OpenAPI

````yaml /api-reference/specs/loadbalancer.yaml patch /v1/target-groups/{id}
openapi: 3.0.3
info:
  title: Basaltic Load Balancer API
  version: 1.0.0
  description: |
    Managed load balancers: listeners, target pools, health checks and the
    TLS certificates a listener terminates.
  contact:
    name: Basaltic Support
    email: ping@basaltic.sh
  license:
    name: Proprietary
    url: https://basaltic.sh/terms
servers:
  - url: https://loadbalancer.{region}.basaltic.sh
    description: Regional API endpoint
    variables:
      region:
        default: sa-saopaulo-1
        description: Region code
security:
  - SignatureAuth: []
paths:
  /v1/target-groups/{id}:
    patch:
      tags:
        - Load Balancers
      summary: Rename a target group or retune its health check, framing, or stickiness
      operationId: updateTargetGroup
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            example: b8c9d0e1-f2a3-4456-b7c8-d9e0f1a2b3c4
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTargetGroupRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TargetGroupResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    UpdateTargetGroupRequest:
      type: object
      properties:
        name:
          type: string
          example: web-targets
        health_check:
          $ref: '#/components/schemas/HealthCheck'
        proxy_protocol:
          type: boolean
          description: |
            Toggle PROXY v2 framing on upstream connections. Omitting
            the field leaves the current setting; setting true/false
            flips it explicitly.
        session_affinity:
          allOf:
            - $ref: '#/components/schemas/SessionAffinity'
          description: >-
            Replaces the stickiness config. Omitting the field leaves it alone;
            turning it off is an explicit `{"type": "none"}`.
        tags:
          $ref: '#/components/schemas/Tags'
    TargetGroupResponse:
      type: object
      properties:
        target_group:
          $ref: '#/components/schemas/TargetGroup'
    HealthCheck:
      type: object
      properties:
        protocol:
          type: string
          enum:
            - http
            - https
            - tcp
            - udp
          description: Defaults to the target group protocol when omitted
          example: http
        path:
          type: string
          example: /healthz
        port:
          type: integer
          minimum: 1
          maximum: 65535
          example: 8080
        interval_sec:
          type: integer
          default: 30
          example: 30
        timeout_sec:
          type: integer
          default: 5
          example: 5
        healthy_threshold:
          type: integer
          default: 3
          example: 3
        unhealthy_threshold:
          type: integer
          default: 3
          example: 3
        matcher:
          type: string
          default: '200'
          example: '200'
    SessionAffinity:
      type: object
      description: |
        Sticky sessions: pin a client to one backend in the group instead of
        balancing each request independently. Off unless you ask for it.

        The data plane hashes the key consistently, so adding or losing a
        backend only moves the clients that backend was serving.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - none
            - cookie
            - source_ip
          default: none
          example: cookie
          description: >
            `none` balances every request. `cookie` sets an opaque cookie on the

            first response and routes every later request carrying it to the
            same

            backend — http and https groups only. `source_ip` hashes the client

            address, works on every protocol and is the only option for tcp and

            udp, but a NAT gateway makes every client behind it a single key.
        cookie_name:
          type: string
          maxLength: 128
          default: BASALTICLB
          example: BASALTICLB
          description: >-
            Cookie the load balancer sets and hashes. `type=cookie` only; the
            field is dropped for the other types.
        duration_sec:
          type: integer
          minimum: 1
          maximum: 604800
          default: 86400
          example: 86400
          description: How long that cookie lives, up to 7 days. `type=cookie` only.
    Tags:
      type: object
      additionalProperties:
        type: string
      example:
        environment: production
        team: backend
    TargetGroup:
      type: object
      required:
        - id
        - crn
        - account_id
        - name
        - protocol
        - target_type
        - port
        - health_check
        - proxy_protocol
        - session_affinity
        - target_mode
        - tags
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          example: b8c9d0e1-f2a3-4456-b7c8-d9e0f1a2b3c4
        crn:
          type: string
          example: >-
            crn:loadbalancer:sa-saopaulo-1:my-account:target-group/b8c9d0e1-f2a3-4456-b7c8-d9e0f1a2b3c4
        account_id:
          type: string
          format: uuid
          example: 6f9619ff-8b86-4d01-b42d-00cf4fc964ff
        name:
          type: string
          example: web-targets
        protocol:
          type: string
          enum:
            - http
            - https
            - tcp
            - udp
          example: http
        target_type:
          type: string
          enum:
            - ip
            - instance
            - function
          example: instance
        port:
          type: integer
          minimum: 1
          maximum: 65535
          example: 8080
        health_check:
          $ref: '#/components/schemas/HealthCheck'
        proxy_protocol:
          type: boolean
          example: false
          description: |
            When true, upstream connections are wrapped in the PROXY
            v2 header so backends see the original client IP + port.
            HTTP backends already get X-Forwarded-For; PROXY is the
            right pick for TCP/UDP target groups or HTTP backends that
            prefer the framed envelope.
        session_affinity:
          $ref: '#/components/schemas/SessionAffinity'
        target_mode:
          type: string
          enum:
            - static
            - pool
          example: static
          description: >
            Where the backend set comes from. `static` routes to the targets

            attached via POST /v1/target-groups/{id}/targets; `pool` resolves
            live

            instance addresses from the compute instance pool named by

            instance_pool_id, so scaling the pool moves the backends with it.
        instance_pool_id:
          type: string
          format: uuid
          example: a1b2c3d4-e5f6-4789-a0b1-c2d3e4f5a6b7
          description: Compute instance pool backing the group. Set iff target_mode=pool.
        tags:
          $ref: '#/components/schemas/Tags'
        created_at:
          type: string
          format: date-time
          example: '2026-01-15T09:30:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-01-15T09:30:00Z'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              description: Error code identifying the type of error
              example: INVALID_INPUT
            message:
              type: string
              description: Human-readable error message
              example: Invalid request parameters
            request_id:
              type: string
              format: uuid
              description: Request ID for debugging
              example: 550e8400-e29b-41d4-a716-446655440000
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_INPUT
              message: Invalid request parameters
              request_id: 550e8400-e29b-41d4-a716-446655440000
    Unauthorized:
      description: Authentication required or token invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: UNAUTHORIZED
              message: Authentication required
              request_id: 550e8400-e29b-41d4-a716-446655440000
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: ACCESS_DENIED
              message: You don't have permission to perform this action
              request_id: 550e8400-e29b-41d4-a716-446655440000
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: NOT_FOUND
              message: Resource not found
              request_id: 550e8400-e29b-41d4-a716-446655440000
  securitySchemes:
    SignatureAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >
        Request signing with an access key issued to a service account. An

        HMAC-SHA256 over a canonical form of the request, close to AWS SigV4.

        The `basaltic` CLI signs for you.


        Send `Authorization`, `X-Date` (UTC, `YYYYMMDDTHHMMSSZ`) and `X-Nonce`

        (random per request); add `X-Content-Sha256` to bind a body, and

        `X-Amz-Security-Token` when using temporary credentials.


        ```

        Authorization: BASALTIC-HMAC-SHA256
        Credential=<access_key_id>/<date>/<region>/basaltic/basaltic_request,
        SignedHeaders=host;x-date;x-nonce, Signature=<hex>

        ```


        `<region>` is the region code you are calling, or `global` for the
        global

        services. A signature is valid for 5 minutes from `X-Date`, and mutating

        requests are replay-guarded on the nonce.


        **Full signing procedure, including a working implementation:**

        https://docs.basaltic.sh/authentication


        ## Rate limits

        There is no global request budget. A limit applies only where an

        operation documents a `429`, and that operation says what it counts.

        Those responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining`,

        `X-RateLimit-Reset` and, on a `429`, `Retry-After` — read them rather

        than hard-coding a number. Retrying before `Retry-After` is refused and

        extends the window. Everything else is bounded by quota, not by request

        rate.

````