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

# Update group

> Updates a group: its display name and/or its monthly spend cap.

The cap is enforced per calendar month against the group's attributed spend; when it is reached, requests billing to the group are rejected until the month rolls over or the cap is raised. `null` removes the cap. Changes take effect on the next request (checks are cached for a few seconds).

Requires your organization API key, from your backend.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/groups/{groupId}
openapi: 3.1.0
info:
  title: Sidenet API
  version: 1.0.0
  description: >-
    Sidenet HTTP endpoints exposed by the Sidenet Studio. All routes require an
    api key that can be generated through the studio in studio.sidenet.ai.
servers:
  - url: https://api.sidenet.ai
security:
  - bearerAuth: []
paths:
  /v1/groups/{groupId}:
    patch:
      tags:
        - Users & Groups
      summary: Update group
      description: >-
        Updates a group: its display name and/or its monthly spend cap.


        The cap is enforced per calendar month against the group's attributed
        spend; when it is reached, requests billing to the group are rejected
        until the month rolls over or the cap is raised. `null` removes the cap.
        Changes take effect on the next request (checks are cached for a few
        seconds).


        Requires your organization API key, from your backend.
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
            example: grp_84f20c19
          description: >-
            Your id for the group (the `group_id` sent when minting or updating
            a user).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: Acme — production
                monthly_limit:
                  type: number
                  nullable: true
                  example: 250
                  description: Monthly spend cap in USD. `null` removes the cap.
      responses:
        '200':
          description: The updated group
          content:
            application/json:
              schema:
                type: object
                properties:
                  group:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Your id for the group.
                      name:
                        type: string
                        nullable: true
                      monthly_limit:
                        type: number
                        nullable: true
                        description: Monthly spend cap in USD; null = no cap.
                      month_spend:
                        type: number
                        nullable: true
                        description: Attributed spend so far this calendar month, in USD.
                      limit_remaining:
                        type: number
                        nullable: true
                        description: >-
                          monthly_limit minus month_spend (never below 0); null
                          when no cap is set.
        '400':
          description: Invalid body
        '403':
          description: Not an API key
        '404':
          description: Unknown group in this organization
        '409':
          description: Another group in this organization already uses that name
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````