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

# Update a group

> Update an existing group (Permitted scopes: **fax:all:edit**)

<RequestExample>
  ```js NodeJS SDK theme={null}
  const axios = require('axios');
  const ContactsApiFp = require('@alohi/faxplus-api').ContactsApiFp;
  const Configuration = require('@alohi/faxplus-api').Configuration;

  const config = new Configuration({
      accessToken: accessToken,
      basePath: 'https://restapi.fax.plus/v3',
      baseOptions: {
          headers: {
            "x-fax-clientid": clientId,
          }
      }
  });

  async function updateContactGroup() {
      const updateData = {
          name: 'Premium Clients',
          description: 'Updated group description'
      };
      const req = await ContactsApiFp(config).updateContactGroup({
          userId: 'self',
          groupId: 'group_123',
          body: updateData
      });
      const resp = await req(axios);
  }

  updateContactGroup()
  ```

  ```python Python SDK theme={null}
  from faxplus import ApiClient, ContactsApi
  from faxplus.configuration import Configuration

  conf = Configuration()
  conf.access_token = access_token
  api_client = ApiClient(header_name='x-fax-clientid', header_value=client_id, configuration=conf)
  api = ContactsApi(api_client)

  update_data = {
      'name': 'Premium Clients',
      'description': 'Updated group description'
  }

  resp = api.update_contact_group(user_id='self', group_id='group_123', body=update_data)
  ```

  ```bash cURL theme={null}
  curl -X PUT https://restapi.fax.plus/v3/accounts/self/contact-groups/group_123 \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json'  \
    -H 'Authorization: Bearer {access-token}' \
    -H 'x-fax-clientid: "YOUR_CLIENT_ID"' \
    -d '{
      "name": "Premium Clients",
      "description": "Updated group description"
    }'
  ```
</RequestExample>


## OpenAPI

````yaml put /accounts/self/contact-groups/{group_id}
openapi: 3.0.1
info:
  title: Fax.Plus REST API
  description: >-
    This is the Fax.Plus API v3 developed for third party developers and
    organizations. In order to have a better coding experience with this API,
    let's quickly go through some points:<br /><br /> - This API assumes
    **/accounts** as an entry point with the base url of
    **https://restapi.fax.plus/v3**. <br /><br /> - This API treats all date and
    times sent to it in requests as **UTC**. Also, all dates and times returned
    in responses are in **UTC**<br /><br /> - Once you have an access_token, you
    can easily send a request to the resource server with the base url of
    **https://restapi.fax.plus/v3** to access your permitted resources. As an
    example to get the user's profile info you would send a request to
    **https://restapi.fax.plus/v3/accounts/self** when **Authorization** header
    is set to **Bearer YOUR_ACCESS_TOKEN** and custom header of
    **x-fax-clientid** is set to YOUR_CLIENT_ID
  version: 3.4.0
  contact:
    name: Fax.Plus
    email: info@fax.plus
    url: https://github.com/alohi
servers:
  - url: https://restapi.fax.plus/v3
  - url: /v3
security: []
paths:
  /accounts/self/contact-groups/{group_id}:
    put:
      tags:
        - Contacts
      summary: Update a group
      description: 'Update an existing group (Permitted scopes: **fax:all:edit**)'
      operationId: updateTag
      parameters:
        - name: group_id
          in: path
          required: true
          schema:
            type: string
          description: Group ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactGroupUpdate'
      responses:
        '200':
          $ref: '#/components/responses/ContactGroup'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - personal_access_token:
            - fax:all:edit
        - oauth2:
            - all
components:
  schemas:
    ContactGroupUpdate:
      type: object
      properties:
        name:
          type: string
          description: Group name
          example: Premium Clients
        notes:
          type: string
          description: Additional notes or description for the group
          example: Updated notes
    ContactGroup:
      type: object
      properties:
        id:
          type: string
          description: Group ID
          example: 5f7a8b9c0d1e2f3a4b5c6d7f
        name:
          type: string
          description: Group name
          example: VIP Clients
        notes:
          type: string
          description: Additional notes or description for the group
          example: Important clients only
        is_shared:
          type: boolean
          description: Whether group is shared with corporate members
          example: true
        creation_date:
          type: string
          description: Date group was created
          example: '2024-01-10T09:00:00Z'
        modification_date:
          type: string
          description: Date group was last modified
          example: '2024-02-15T11:20:00Z'
    Error:
      properties:
        description:
          type: string
        error:
          type: string
      additionalProperties: false
  responses:
    ContactGroup:
      description: Response containing a single group object
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContactGroup'
    Error:
      description: Error object in case there's a problem with given data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid_user_id
            description: Invalid user id given
    UnauthorizedError:
      description: Error object in case there's a problem with the authorization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
            description: >-
              The access token provided is expired, revoked, malformed, or
              invalid for other reasons.
    NotFoundError:
      description: Requested resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: bad_request
            description: Requested resource was not found.
    ServerError:
      description: Error object in case there's a server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal_server_error
            description: An unexpected error happened, please contact support
  securitySchemes:
    personal_access_token:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Personal Access Token (PAT) is a Bearer token used for secure API calls.
        For direct API calls, the PAT is used in the Authorization header as
        'Bearer {PAT}'. For MCP usage, configure your PAT in your MCP client
        settings (e.g., in your IDE's MCP server configuration) - authentication
        will be handled automatically.
    oauth2:
      type: oauth2
      description: OAuth2 Authorization Grant
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://accounts.fax.plus/login?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=http://localhost&scope=all
          tokenUrl: https://accounts.fax.plus/token
          refreshUrl: >-
            https://accounts.fax.plus/token?grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN
          scopes:
            all: >-
              for now when a user grants permission, all grants will be
              permitted

````