> ## Documentation Index
> Fetch the complete documentation index at: https://developers.portao3.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Archive a group

> Archives a group: it leaves the group list, can no longer be changed, and can no longer be used as an approver in business policies.

Archiving is permanent and replaces deletion. You can still get the group by its ID.


## OpenAPI

````yaml /api-reference/identity.openapi.json post /realms/{realmId}/organizations/{organizationId}/groups/{groupId}/archive
openapi: 3.0.3
info:
  title: Identity
  version: 1.0.0
  description: >-
    Portão 3 identity API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). 4 app groups run without
    the identity authorizer; publicPatterns enumerates every route they expose,
    except POST /auth/sign-in, documented with HTTP Basic for the API-client
    credentials flow. Confidence tiers: generated:typed=45 copied:manual=0
    unknown=0.
servers:
  - url: https://api.identity.v2.portao3.com.br/
    description: production
  - url: https://api.identity.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Authentication
  - name: Current User
  - name: Custom Fields
  - name: API Clients
  - name: Users
  - name: Organizations
  - name: Groups
  - name: Realms
paths:
  /realms/{realmId}/organizations/{organizationId}/groups/{groupId}/archive:
    post:
      tags:
        - Groups
      summary: Archive a group
      description: >-
        Archives a group: it leaves the group list, can no longer be changed,
        and can no longer be used as an approver in business policies.
      operationId: postRealmsByRealmIdOrganizationsByOrganizationIdGroupsByGroupIdArchive
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: |-
            ID of the organization that owns the group.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: groupId
          in: path
          required: true
          description: |-
            ID of the group to archive.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: 8ae5ee60-6ebe-4d85-a056-8c1387763478
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the group.
                    example: 8ae5ee60-6ebe-4d85-a056-8c1387763478
                    format: uuid
                  realm:
                    type: string
                    description: ID of the realm the group belongs to.
                    example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                    format: uuid
                  organization:
                    type: string
                    description: ID of the organization the group belongs to.
                    example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                    format: uuid
                  name:
                    type: string
                    description: >-
                      Name of the group, unique within the organization
                      (archived groups included).
                    example: Finance approvers
                  description:
                    type: string
                    description: >-
                      Description of the group. Omitted, or empty, when the
                      group has none.
                    example: Approves payments above R$ 10,000
                  memberIds:
                    type: array
                    items:
                      type: string
                      example: e3553bc1-5e20-4e17-b22a-a796fda0aa99
                    description: >-
                      IDs of the users in the group, in the order they were
                      added.


                      ---


                      Example: `["e3553bc1-5e20-4e17-b22a-a796fda0aa99"]`
                  status:
                    type: string
                    enum:
                      - ACTIVE
                      - ARCHIVED
                    description: >-
                      `ACTIVE` groups can be changed and used as approvers.
                      `ARCHIVED` groups can still be read by ID, but are hidden
                      from the list, can't be changed and can't be used as
                      approvers. Archiving is permanent.
                    example: ARCHIVED
                  createdBy:
                    type: string
                    description: >-
                      ID of the user or API client that created the group. May
                      be absent on older groups.
                    example: f1235202-71e0-49ef-a8ba-939b8d3ec945
                  updatedBy:
                    type: string
                    description: >-
                      ID of the user or API client that last changed the group.
                      May be absent on older groups.
                    example: f1235202-71e0-49ef-a8ba-939b8d3ec945
                  createdAt:
                    type: string
                    description: When the group was created.
                    example: '2026-10-02T13:27:41.512Z'
                    format: date-time
                  updatedAt:
                    type: string
                    description: When the group last changed.
                    example: '2026-10-09T17:05:12.034Z'
                    format: date-time
                required:
                  - id
                  - realm
                  - organization
                  - name
                  - memberIds
                  - status
                description: >-
                  A group: a named set of users of one organization, used as an
                  approver in business policies.
        '404':
          description: >-
            `GROUP_NOT_FOUND` — No group with this ID exists in the
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - GROUP_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - IDENTITY
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: GROUP_NOT_FOUND
                origin: IDENTITY
                message: Group not found
        '409':
          description: '`GROUP_ARCHIVED` — The group is already archived.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - GROUP_ARCHIVED
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - IDENTITY
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: GROUP_ARCHIVED
                origin: IDENTITY
                message: This group is archived and can no longer be used or modified
        '422':
          description: >-
            `BAD_REQUEST` — A path parameter is not a valid ID; `fields` lists
            each one.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - IDENTITY
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BAD_REQUEST
                origin: IDENTITY
                message: >-
                  Bad Request: Your request is invalid or incomplete. Please
                  make sure you are requesting with the right fields.
                fields:
                  - field: groupId
                    message: Invalid UUID
                    code: GROUPID_UUID

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.