> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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
      description: An error object returned in API error responses.
      properties:
        type:
          $ref: '#/components/schemas/ApiErrorType'
          description: >-
            A fixed category for the error, helpful for categorizing and
            processing errors.
        description:
          type: string
          description: A human-readable error description.
        error_enum:
          $ref: '#/components/schemas/ApiEnumErrorType'
          description: >-
            A stable, machine-readable identifier for programmatically handling
            specific error conditions. Only present for 4xx client errors—not
            included for 5xx server errors. Use this instead of parsing the
            description field, as enum values remain stable across API versions.
          nullable: true
        meta:
          type: object
          description: Optional additional information about the error.
          nullable: true
      required:
        - type
        - 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
    ApiErrorType:
      type: string
      enum:
        - ResourceArchived
        - AuthFailure
        - Plaid
        - Stripe
        - InvalidState
        - ResourceNotFound
        - InvalidParameters
        - JsonSerialization
        - Unknown
        - BadRequest
        - PaginationCursor
        - Conflict
        - LedgerOperationFailed
    ApiEnumErrorType:
      type: string
      description: >-
        Stable enum values for programmatic error handling. Only present in 4xx
        error responses.
      enum:
        - AccessCodeInvalid
        - BalanceSheetDoesNotBalance
        - BalanceSheetMissingAccount
        - BankStatementParserError
        - BillStateError
        - BulkCategorizeFailure
        - BulkMatchFailure
        - BusinessTaskAlreadyCompleted
        - BusinessTaskDeleted
        - CalendlyOAuthError
        - CallBookingError
        - CantUpdateTransactionInCustomerPayout
        - CantUpdateTransactionInVendorPayout
        - CheckPayrollConfigNotFound
        - CheckPayrollServiceNotFound
        - ClerkUserAlreadyExists
        - ConflictingQueryParams
        - CustomAccountAlreadyExists
        - CustomTransactionCsvParsingError
        - CustomTransactionUploadFailure
        - CustomerPayoutInputFormatError
        - DoesNotMatchExistingEntity
        - EmptyBatchRequest
        - ExpenseParserError
        - ExternalAccountBalanceReconciliationError
        - ExternalIdConflict
        - InvalidCategory
        - InvalidEffectiveDate
        - InvalidLedgerOperation
        - InvalidMonthlyAverageRange
        - InvalidMultiPartRequest
        - InvalidPaginationCursor
        - InvalidPayload
        - InvoiceDeleted
        - InvoiceNotFound
        - InvoiceReferenceMismatch
        - InvoiceStateError
        - ManualRateLimit
        - MultipleTagKeyFiltersUnsupported
        - NoCognitoUserFound
        - NoOpeningBalanceFound
        - NotYetReconciled
        - OnePasswordApiError
        - OnePasswordItemNotFound
        - OnePasswordVaultNotFound
        - OpenAICategorizationError
        - PaymentLinkInvalid
        - PayrollStateError
        - PeriodIsClosed
        - PeriodNotClosed
        - PhoneNumberAlreadyRegistered
        - PlaidApiError
        - PlaidConnectionBroken
        - PlaidCreateLinkTokenError
        - PlaidCredentialsNotConfigured
        - PlaidExchangePublicTokenError
        - PlaidGetInstitutionByIdError
        - PlaidGetItemError
        - PlaidInvalidEnvironment
        - PlaidItemAlreadyExists
        - PlaidItemNotFound
        - PlaidProcessorApiError
        - PlaidUnlinkItemError
        - QueryParamFormat
        - QueryParamMissing
        - QuickbooksBrokenConnection
        - QuickbooksConnectionAlreadyExists
        - QuickbooksConnectionAlreadySyncing
        - QuickbooksConnectionMissing
        - QuickbooksConnectionNotActivated
        - QuickbooksInvalidRequest
        - QuickbooksInvalidState
        - QuickbooksNoMatchingAccount
        - QuickbooksNonPostingAccountType
        - QuickbooksNotConfigured
        - QuickbooksOAuthCallbackInvalid
        - QuickbooksOAuthError
        - QuickbooksTokenExpired
        - ResourceArchived
        - ScheduleCNotConfigured
        - SmsNotEnabled
        - SpecifiedBadRequest
        - SpecifiedIdNotFound
        - SplitTransactionError
        - StepEvaluationBadRequest
        - StripeConnectAccountIdNotFound
        - StripeCredentialsNotConfigured
        - StripeGetBalanceForConnectAccountFailure
        - StripeRedirectOrRefreshUrlNotConfigured
        - TagFilterNotFound
        - UnexpectedQueryParam
        - UnitAccountsInUse
        - WrongAnswerType
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````