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

# Tag entities

> Tag entities of a specified type with custom tags. This generic endpoint allows tagging of any supported entity type. When tagging a BANK_ACCOUNT, the tags are automatically applied to all transactions and opening balances associated with that bank account.



## OpenAPI

````yaml post /v1/businesses/{businessId}/tags
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/tags:
    post:
      tags: []
      summary: Tag entities
      description: >-
        Tag entities of a specified type with custom tags. This generic endpoint
        allows tagging of any supported entity type. When tagging a
        BANK_ACCOUNT, the tags are automatically applied to all transactions and
        opening balances associated with that bank account.
      operationId: business.tags.post
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business to tag entities for
          required: true
          schema:
            type: string
            format: uuid
        - name: Content-Type
          in: header
          description: Content-Type must be set to application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewTagsPostParamsWithEntity'
      responses:
        '200':
          description: Tags successfully created
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTags'
        '404':
          description: Business id or any of the specified entity ids are not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    NewTagsPostParamsWithEntity:
      type: object
      properties:
        key_values:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
          description: List of key-value pairs used to create new tags
        entity_ids:
          type: array
          items:
            type: string
            format: uuid
          description: The entity IDs to create each new tag for.
        entity_type:
          $ref: '#/components/schemas/TaggableEntityType'
          description: The type of entity to tag.
      required:
        - key_values
        - entity_ids
        - entity_type
    ApiTags:
      type: object
      properties:
        tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: A list of tags associated with a taggable object.
      required:
        - tags
      description: >-
        Contains a collection of tags as defined by the ApiTag schema. This
        structure is used to encapsulate multiple tags in API responses or
        requests.
    ApiError:
      type: object
      properties: {}
      example: ''
      description: ''
    TagKeyValue:
      type: object
      description: >-
        A TagKeyValue holds key=value data related to a tag. This is used when
        creating or updating taggable entities (transactions, invoices, etc.).
      properties:
        key:
          type: string
          description: The tag dimension key (e.g., "department", "project", "location")
          example: department
        dimension_display_name:
          type: string
          nullable: true
          description: >-
            If the TagDimension doesn't exist, providing this value specifies
            the display name upon database insertion. Otherwise, it is left as
            null on the TagDimension.
          example: Department
        value:
          type: string
          description: The tag value (e.g., "sales", "marketing", "engineering")
          example: sales
        value_display_name:
          type: string
          nullable: true
          description: >-
            If the TagValueDefinition doesn't exist, providing this value
            specifies the display name upon database insertion. Otherwise, it is
            left as null on the TagValueDefinition.
          example: Sales Department
      required:
        - key
        - value
    TaggableEntityType:
      type: string
      enum:
        - CUSTOMER
        - VENDOR
        - BANK_TRANSACTION
        - INVOICE
        - INVOICE_PAYMENT
        - INVOICE_PAYMENT_ALLOCATION
        - INVOICE_WRITE_OFF
        - BILL
        - BILL_PAYMENT
        - BILL_PAYMENT_ALLOCATION
        - MANUAL_JOURNAL_ENTRY
        - MANUAL_JOURNAL_ENTRY_LINE_ITEM
        - CLOSING_ACTION
        - CUSTOMER_PAYOUT
        - VENDOR_PAYOUT
        - PAYROLL
        - PAYROLL_PAYMENT
        - OPENING_BALANCE
        - CUSTOMER_REFUND
        - CUSTOMER_REFUND_PAYMENT
        - CUSTOMER_REFUND_ALLOCATION
        - CUSTOMER_REFUND_ALLOCATION_LINE_ITEM
        - VENDOR_REFUND
        - VENDOR_REFUND_PAYMENT
        - VENDOR_REFUND_ALLOCATION
        - VENDOR_REFUND_ALLOCATION_LINE_ITEM
        - LEDGER_ENTRY
        - QUICKBOOKS_LEDGER_ENTRY
        - VENDOR_CREDIT
        - CUSTOMER_CREDIT
        - INVOICE_LINE_ITEM
        - BILL_LINE_ITEM
        - VENDOR_CREDIT_LINE_ITEM
        - CUSTOMER_CREDIT_LINE_ITEM
        - BANK_ACCOUNT
      description: Type of entity that can be tagged
    ApiTag:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID for the tag
        key:
          type: string
          description: Key for the tag
          example: ExampleTagKey
        dimension_display_name:
          type: string
          nullable: true
          description: Display name for the tag dimension
        value:
          type: string
          description: Value for the tag
          example: ExampleTagValue
        value_display_name:
          type: string
          nullable: true
          description: Display name for the tag value definition
        dimension_id:
          type: string
          format: uuid
          description: ID of the tag dimension this tag belongs to
        definition_id:
          type: string
          format: uuid
          description: ID of the tag value definition
        archived_at:
          type: string
          format: date-time
          nullable: true
          description: When the tag was archived
      required:
        - id
        - key
        - value
        - dimension_id
        - definition_id
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````