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

# Bulk Add Cards to Group

> This operation adds multiple cards to a specified group within a card hierarchy.




## OpenAPI

````yaml hierarchy post /v1/card-hierarchies/{cardHierarchyId}/groups/{groupId}/cards/bulk
openapi: 3.0.3
info:
  version: '1'
  title: Hierarchy API
  description: >
    Card hierarchy defines a tree-structure that separates card space in
    non-intersecting groups.

    Such groups can be further used for ruleset attachments via Spend Control
    API.


    Key Points:

    - Only one card-hierarchy can be active at the same time. Only active
    hierarchy is taken into account when evaluating Spend Control rules.

    - Whenever you create a card-hierarchy, a root group (`type: ROOT`) is
    created with the same name and id.

    - You cannot create a detached group, so whenever you create a group, you
    should specify a parentId.

    - Cards (and only cards, not other subgroups) can be attached only to a
    group with `type: CARD`. If you want to create a group that will be split
    further into subgroups, use `type: INTERMEDIATE`

    - You can move a card or a group from one group to another

    - You can delete a group, but only if it does not contain any cards or
    subgroups. If you want to delete a group with cards or subgroups, you should
    specify a query parameter `recursive=true`

    - If you want to migrate to a completely different hierarchy, you should
    create a new inactive hierarchy, add all cards to it, and then activate it.


    ![Card
    Hierarchies](https://enfuce-public-resources.s3.eu-central-1.amazonaws.com/public/card-hierarchies.png)  


    ### Disclaimer

    This feature is sold separately. Please contact our sales department for
    more information.
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
  x-logo:
    url: https://developer.enfuce.com/images/enfuce.svg
    altText: Enfuce logo
servers:
  - url: >-
      https://integration-api-cat2.{{environment}}.ext.{{realm}}.cia.enfuce.com/hierarchy
  - url: https://integration-api-cat2.live.ext.prod.cia.enfuce.com/hierarchy
    description: Live environment
security: []
paths:
  /v1/card-hierarchies/{cardHierarchyId}/groups/{groupId}/cards/bulk:
    post:
      tags:
        - Card Management in Card Hierarchy Groups
      summary: Bulk Add Cards to Group
      description: >
        This operation adds multiple cards to a specified group within a card
        hierarchy.
      operationId: bulkAddCardsToCardHierarchyGroupV1
      parameters:
        - $ref: '#/components/parameters/cardHierarchyId'
        - $ref: '#/components/parameters/cardHierarchyGroupId'
        - $ref: '#/components/parameters/auditUser'
      requestBody:
        $ref: '#/components/requestBodies/bulkAddCardsToCardHierarchyGroupV1Request'
      responses:
        '204':
          description: Successful addition of the cards to the group
        '400':
          $ref: '#/components/responses/error400'
        '401':
          $ref: '#/components/responses/error401'
        '403':
          $ref: '#/components/responses/error403'
        '404':
          $ref: '#/components/responses/error404'
        '500':
          $ref: '#/components/responses/error500'
components:
  parameters:
    cardHierarchyId:
      name: cardHierarchyId
      in: path
      required: true
      description: Card hierarchy id
      schema:
        type: string
        format: biginteger
    cardHierarchyGroupId:
      name: groupId
      in: path
      required: true
      description: Group id
      schema:
        type: string
        format: biginteger
    auditUser:
      name: auditUser
      in: query
      description: The audit user to log the request
      required: true
      schema:
        type: string
  requestBodies:
    bulkAddCardsToCardHierarchyGroupV1Request:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/bulkAddCardsToCardHierarchyGroupV1Request'
  responses:
    error400:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error401:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error403:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error404:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error500:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
  schemas:
    bulkAddCardsToCardHierarchyGroupV1Request:
      type: object
      required:
        - cardIds
      properties:
        cardIds:
          type: array
          items:
            type: string
            format: biginteger
    errorResponse:
      type: object
      properties:
        code:
          type: string
          description: An error code indicating what kind of error. I.e. HTTP error code
        message:
          type: string
          description: Error message in human-readable format
        id:
          type: string
          format: uuid
          description: Unique error identifier
        errorCode:
          type: string
          description: Enfuce code for a specific error type
        errorType:
          type: string
          description: Error type
          enum:
            - STATIC_VALIDATION_ERROR
            - DYNAMIC_VALIDATION_ERROR
            - INTEGRATION_ERROR
            - SECURITY_ERROR
            - UNEXPECTED_ERROR
        errorReason:
          type: string
          description: Free-form text explaining the error reason
        timestamp:
          type: string
          format: date-time
          description: Datetime when error occurred

````