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

# Start a supported bulk accounting action



## OpenAPI

````yaml https://app.usequanta.com/openapi/quanta-services-api/openapi.json post /api/bulk_actions
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://app.usequanta.com
    description: Production
security:
  - HTTPBearer: []
paths:
  /api/bulk_actions:
    post:
      tags:
        - bulk_actions
        - quanta-services-api
      summary: Start a supported bulk accounting action
      operationId: create_bulk_action
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/ReplayInvoicesRequest'
                - $ref: '#/components/schemas/ResetPayrollRequest'
                - $ref: '#/components/schemas/SpendBulkActionRequest'
              title: Request
              discriminator:
                propertyName: bulk_action_type
                mapping:
                  REPLAY_INVOICES: '#/components/schemas/ReplayInvoicesRequest'
                  RESET_PAYROLL: '#/components/schemas/ResetPayrollRequest'
                  SPEND: '#/components/schemas/SpendBulkActionRequest'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBulkActionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ReplayInvoicesRequest:
      properties:
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        bulk_action_type:
          type: string
          const: REPLAY_INVOICES
          title: Bulk Action Type
          default: REPLAY_INVOICES
        payload:
          $ref: '#/components/schemas/ReplayInvoicesPayload'
      type: object
      required:
        - payload
      title: ReplayInvoicesRequest
    ResetPayrollRequest:
      properties:
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        bulk_action_type:
          type: string
          const: RESET_PAYROLL
          title: Bulk Action Type
          default: RESET_PAYROLL
        payload:
          $ref: '#/components/schemas/ResetPayrollPayload'
      type: object
      required:
        - payload
      title: ResetPayrollRequest
    SpendBulkActionRequest:
      properties:
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        bulk_action_type:
          type: string
          const: SPEND
          title: Bulk Action Type
          default: SPEND
        payload:
          $ref: '#/components/schemas/SpendBulkActionPayload'
      type: object
      required:
        - payload
      title: SpendBulkActionRequest
    CreateBulkActionResponse:
      properties:
        workflow_id:
          type: string
          title: Workflow Id
      type: object
      required:
        - workflow_id
      title: CreateBulkActionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ReplayInvoicesPayload:
      properties:
        selection:
          $ref: '#/components/schemas/SpecificInvoicesSelection'
      type: object
      required:
        - selection
      title: ReplayInvoicesPayload
    ResetPayrollPayload:
      properties:
        selection:
          $ref: '#/components/schemas/SpecificPayStatementsSelection'
      type: object
      required:
        - selection
      title: ResetPayrollPayload
    SpendBulkActionPayload:
      properties:
        selection:
          oneOf:
            - $ref: '#/components/schemas/SpecificSpendsSelection'
            - $ref: '#/components/schemas/SpendsFromDateSelection'
            - $ref: '#/components/schemas/SpendsWithVendorSelection'
          title: Selection
          discriminator:
            propertyName: selection_type
            mapping:
              SPECIFIC_SPENDS: '#/components/schemas/SpecificSpendsSelection'
              SPENDS_FROM_DATE: '#/components/schemas/SpendsFromDateSelection'
              SPENDS_WITH_VENDOR: '#/components/schemas/SpendsWithVendorSelection'
        action:
          oneOf:
            - $ref: '#/components/schemas/BookingUpdateFromMappingsPolicy'
            - $ref: '#/components/schemas/BookingOverridePolicy'
          title: Action
          discriminator:
            propertyName: action_type
            mapping:
              BOOKING_OVERRIDE: '#/components/schemas/BookingOverridePolicy'
              BOOKING_UPDATE_FROM_MAPPINGS: '#/components/schemas/BookingUpdateFromMappingsPolicy'
      type: object
      required:
        - selection
        - action
      title: SpendBulkActionPayload
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SpecificInvoicesSelection:
      properties:
        selection_type:
          type: string
          const: SPECIFIC_INVOICES
          title: Selection Type
          default: SPECIFIC_INVOICES
        invoice_source_qids:
          items:
            type: string
          type: array
          minItems: 1
          title: Invoice Source Qids
      type: object
      required:
        - invoice_source_qids
      title: SpecificInvoicesSelection
    SpecificPayStatementsSelection:
      properties:
        selection_type:
          type: string
          const: SPECIFIC_PAY_STATEMENTS
          title: Selection Type
          default: SPECIFIC_PAY_STATEMENTS
        actions:
          items:
            $ref: '#/components/schemas/PayrollAction'
          type: array
          minItems: 1
          title: Actions
      type: object
      required:
        - actions
      title: SpecificPayStatementsSelection
    SpecificSpendsSelection:
      properties:
        selection_type:
          type: string
          const: SPECIFIC_SPENDS
          title: Selection Type
          default: SPECIFIC_SPENDS
        spend_qids:
          items:
            type: string
          type: array
          minItems: 1
          title: Spend Qids
      type: object
      required:
        - spend_qids
      title: SpecificSpendsSelection
    SpendsFromDateSelection:
      properties:
        selection_type:
          type: string
          const: SPENDS_FROM_DATE
          title: Selection Type
          default: SPENDS_FROM_DATE
        from_date:
          type: string
          format: date
          title: From Date
        exclude_payroll_reimbursements:
          type: boolean
          title: Exclude Payroll Reimbursements
          default: false
      type: object
      required:
        - from_date
      title: SpendsFromDateSelection
    SpendsWithVendorSelection:
      properties:
        selection_type:
          type: string
          const: SPENDS_WITH_VENDOR
          title: Selection Type
          default: SPENDS_WITH_VENDOR
        vendor_qid:
          type: string
          title: Vendor Qid
        from_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: From Date
      type: object
      required:
        - vendor_qid
      title: SpendsWithVendorSelection
    BookingUpdateFromMappingsPolicy:
      properties:
        action_type:
          type: string
          const: BOOKING_UPDATE_FROM_MAPPINGS
          title: Action Type
          default: BOOKING_UPDATE_FROM_MAPPINGS
        department:
          anyOf:
            - $ref: '#/components/schemas/DepartmentCalculationPolicy'
            - type: 'null'
        gl_account:
          anyOf:
            - $ref: '#/components/schemas/VendorMappingGlAccountUpdatePolicy'
            - type: 'null'
      type: object
      title: BookingUpdateFromMappingsPolicy
    BookingOverridePolicy:
      properties:
        action_type:
          type: string
          const: BOOKING_OVERRIDE
          title: Action Type
          default: BOOKING_OVERRIDE
        department_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Department Qid
        gl_account_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Gl Account Qid
        vendor_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor Qid
      type: object
      title: BookingOverridePolicy
      description: >-
        Overwrite supplied attributes; null or omitted QIDs leave them
        unchanged.
    PayrollAction:
      properties:
        pay_statement_qid:
          type: string
          title: Pay Statement Qid
        action:
          $ref: '#/components/schemas/PayrollActionType'
      type: object
      required:
        - pay_statement_qid
        - action
      title: PayrollAction
    DepartmentCalculationPolicy:
      properties:
        sources:
          items:
            $ref: '#/components/schemas/DepartmentCalculationLogic'
          type: array
          minItems: 1
          title: Sources
        respect_previous_human_overrides:
          type: boolean
          title: Respect Previous Human Overrides
          default: false
      type: object
      title: DepartmentCalculationPolicy
    VendorMappingGlAccountUpdatePolicy:
      properties:
        respect_previous_human_overrides:
          type: boolean
          title: Respect Previous Human Overrides
          default: false
      type: object
      title: VendorMappingGlAccountUpdatePolicy
    PayrollActionType:
      type: string
      enum:
        - RESET
        - RE_PROCESS
        - IGNORE_AND_UNPROCESS
        - SKIP
      title: PayrollActionType
    DepartmentCalculationLogic:
      type: string
      enum:
        - GL_ACCOUNT
        - VENDOR_MAPPING
        - CARDHOLDER_MAPPING
        - USER_MAPPING
      title: DepartmentCalculationLogic
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Quanta Services API scoped bearer token. Supported only on Services API
        routes.

````

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