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

# Trigger on-demand fact collection

> Queues fact collection jobs for the specified collectors and entities. Collection is performed asynchronously; the endpoint returns immediately with a summary of what was queued. Requires the soundcheck.fact.collect permission.




## OpenAPI

````yaml /plugins/soundcheck/openapi.yaml post /facts/collect
openapi: 3.0.0
info:
  title: soundcheck
  version: 0.1.0
  description: API for interacting with Soundcheck.
servers:
  - url: https://backstage.example.com/api/soundcheck
security: []
tags:
  - name: Campaigns
  - name: Certification
  - name: CheckResults
  - name: Checks
  - name: FactCollectors
  - name: Facts
  - name: Tracks
paths:
  /facts/collect:
    post:
      tags:
        - Facts
      summary: Trigger on-demand fact collection
      description: >
        Queues fact collection jobs for the specified collectors and entities.
        Collection is performed asynchronously; the endpoint returns immediately
        with a summary of what was queued. Requires the soundcheck.fact.collect
        permission.
      operationId: triggerFactCollection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - collectorIds
                - entityRefs
              properties:
                collectorIds:
                  type: array
                  description: IDs of registered fact collectors to trigger.
                  items:
                    type: string
                  minItems: 1
                entityRefs:
                  type: array
                  description: >-
                    Entity references to collect facts for (e.g.
                    "component:default/my-service").
                  items:
                    type: string
                  minItems: 1
                factRefs:
                  type: array
                  description: >-
                    Optional filter to collect only specific facts. If omitted,
                    all facts from the collector are collected.
                  items:
                    type: string
              additionalProperties: false
      responses:
        '202':
          description: Collection jobs accepted and queued
          content:
            application/json:
              schema:
                type: object
                required:
                  - queued
                  - skipped
                properties:
                  queued:
                    type: array
                    items:
                      type: object
                      required:
                        - collectorId
                        - entityRefs
                        - jobsQueued
                      properties:
                        collectorId:
                          type: string
                        entityRefs:
                          type: array
                          items:
                            type: string
                        jobsQueued:
                          type: integer
                      additionalProperties: false
                  skipped:
                    type: array
                    items:
                      type: object
                      required:
                        - collectorId
                        - reason
                      properties:
                        collectorId:
                          type: string
                        reason:
                          type: string
                      additionalProperties: false
                additionalProperties: false
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                type: string
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            name:
              type: string
            message:
              type: string
          required:
            - name
            - message
          additionalProperties: true
        request:
          type: object
          properties:
            method:
              type: string
            url:
              type: string
          required:
            - method
            - url
          additionalProperties: false
        response:
          type: object
          properties:
            statusCode:
              type: integer
          required:
            - statusCode
          additionalProperties: false
      required:
        - error
        - response
      additionalProperties: false

````