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

# Delete a resource



## OpenAPI

````yaml /api-reference/openapi.json delete /accounting/{resource}/{id}
openapi: 3.0.0
info:
  title: RouteMCP API
  description: >-
    Unified API for integrations. Connect to multiple providers through a single
    API.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.routemcp.io/api/v1
    description: Production
security:
  - bearerAuth: []
tags: []
paths:
  /accounting/{resource}/{id}:
    delete:
      tags:
        - Accounting Resources
      summary: Delete a resource
      operationId: AccountingResourceController_deleteResource
      parameters:
        - name: resource
          required: true
          in: path
          schema:
            enum:
              - invoice
              - contact
              - account
              - payment
              - tax_rate
              - journal_entry
              - expense
              - purchase_order
              - sales_order
              - credit_note
              - vendor_credit
              - company_info
              - item
              - tracking_category
              - accounting_period
              - payment_method
              - payment_term
              - address
              - attachment
              - balance_sheet
              - bank_feed_account
              - bank_feed_transaction
              - cash_flow_statement
              - employee
              - expense_report
              - general_ledger_transaction
              - income_statement
              - item_fulfillment
              - phone_number
              - project
              - transaction
            type: string
          description: >-
            Canonical accounting resource type to delete. Must be one of the
            values in the enum below. RouteMCP maps this to the equivalent
            provider-native object. Read-only resources (reports, bank feeds,
            `general_ledger_transaction`, `address`, `phone_number`,
            `transaction`) and certain master records (e.g. QuickBooks accounts)
            may return `405 Method Not Allowed`.
        - $ref: '#/components/parameters/CrmRecordIdPath'
        - $ref: '#/components/parameters/ProviderQueryRequired'
        - $ref: '#/components/parameters/XEndUserIdHeader'
      responses:
        '200':
          description: Resource deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteAccountingResourceResponse'
              examples:
                default:
                  summary: Resource deleted
                  value:
                    success: true
                    statusCode: 200
                    message: OK
                    data:
                      deleted: true
                      id: '12345'
        '400':
          description: Missing provider or X-End-User-Id header or invalid resource type
        '401':
          description: Missing or invalid API key
        '404':
          description: End user, provider, or record not found
        '405':
          description: Provider does not support delete for this resource
        '422':
          description: Validation Errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    example: false
                  statusCode:
                    type: integer
                    example: 400
                    default: 400
                  message:
                    type: string
                    example: Validation Errors.
                    default: Validation Errors.
                  errors:
                    type: object
                    additionalProperties:
                      type: string
                    example:
                      email: email should not be empty
                  timestamp:
                    type: string
                    format: date-time
                    example: '2026-02-06T12:00:00.000Z'
                  path:
                    type: string
                    example: /api/v1/example
                required:
                  - success
                  - statusCode
                  - message
                  - errors
                  - timestamp
                  - path
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    example: false
                  statusCode:
                    type: integer
                    example: 429
                    default: 429
                  message:
                    type: string
                    example: Too Many Requests
                    default: Too Many Requests
                  timestamp:
                    type: string
                    format: date-time
                    example: '2026-02-06T12:00:00.000Z'
                  path:
                    type: string
                    example: /api/v1/example
                required:
                  - success
                  - statusCode
                  - message
                  - timestamp
                  - path
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    example: false
                  statusCode:
                    type: integer
                    example: 500
                    default: 500
                  message:
                    type: string
                    example: Internal server error.
                    default: Internal server error.
                  timestamp:
                    type: string
                    format: date-time
                    example: '2026-02-06T12:00:00.000Z'
                  path:
                    type: string
                    example: /api/v1/example
                required:
                  - success
                  - statusCode
                  - message
                  - timestamp
                  - path
      security:
        - bearerAuth: []
components:
  parameters:
    CrmRecordIdPath:
      name: id
      required: true
      in: path
      description: >-
        Provider-native record id. This is the id as it appears in the source
        system (e.g. a HubSpot contact id, a Pipedrive deal id, a QuickBooks
        invoice id). Use the `remote_id` field returned by the list endpoint.
      schema:
        example: '12345'
        type: string
    ProviderQueryRequired:
      name: provider
      required: true
      in: query
      description: >-
        Provider slug identifying which connected provider to target (e.g.
        `hubspot`, `pipedrive`, `zoho-crm`, `quickbooks-online`, `xero`,
        `zoho-books`). Required — single-record operations always target a
        specific provider.
      schema:
        example: hubspot
        type: string
    XEndUserIdHeader:
      name: X-End-User-Id
      required: true
      in: header
      description: >-
        Identifier of the end user whose connected provider should be queried.
        This is the same `endUserId` you supplied when creating the connect
        token. Required on every CRM and accounting call.
      schema:
        example: user-001
        type: string
  schemas:
    DeleteAccountingResourceResponse:
      type: object
      title: DeleteAccountingResourceResponse
      description: >-
        Standard envelope returned by `DELETE /accounting/{resource}/{id}`.
        Confirms which provider-native record was removed. Not every provider
        supports deletion of every resource — some return `405 Method Not
        Allowed` instead (e.g. QuickBooks accounts can only be deactivated, not
        deleted).
      properties:
        success:
          type: boolean
          example: true
          description: Always `true` for successful (2xx) responses.
        statusCode:
          type: integer
          example: 200
          description: HTTP status code mirrored inside the envelope.
        message:
          type: string
          example: OK
        data:
          type: object
          description: Confirmation payload.
          properties:
            deleted:
              type: boolean
              example: true
              description: >-
                `true` when the provider acknowledged the delete. RouteMCP
                normalises this across providers regardless of how the upstream
                API signals success (some return 204 No Content, others return
                the deleted record, others mark it as voided).
            id:
              type: string
              example: '12345'
              description: >-
                Provider-native id of the record that was deleted (echo of the
                `id` path parameter).
          required:
            - deleted
            - id
      required:
        - success
        - statusCode
        - message
        - data
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Enter your API key with the Bearer prefix — e.g. Bearer sk_live_xxx
        (production) or Bearer sk_test_xxx (sandbox)

````