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

# Trigger Scan

> Trigger a new scan for a connected org.

Owner/Admin only (session auth): triggering a scan exercises the stored
platform credential and consumes worker capacity — a mutation the workspace
role model reserves for Admin/Owner. API-key auth is owner-equivalent and
bypasses the role check. (Cancelling an in-flight scan stays member-permitted
as an operational action.)

Accepts an optional JSON body with ``scan_type``: ``"incremental"`` (default)
skips repos unchanged since the last scan; ``"full"`` re-scans every repo.
Creates a Scan record immediately (status=pending) and dispatches
the scan to a Celery worker. Poll GET /scans/{scan_id} for progress.



## OpenAPI

````yaml /openapi.json post /api/v1/connected-orgs/{connected_org_id}/scans
openapi: 3.1.0
info:
  description: Change Impact Engine for multi-repo systems
  title: Riftmap
  version: 1.12.3
servers: []
security: []
paths:
  /api/v1/connected-orgs/{connected_org_id}/scans:
    post:
      tags:
        - scans
      summary: Trigger Scan
      description: >-
        Trigger a new scan for a connected org.


        Owner/Admin only (session auth): triggering a scan exercises the stored

        platform credential and consumes worker capacity — a mutation the
        workspace

        role model reserves for Admin/Owner. API-key auth is owner-equivalent
        and

        bypasses the role check. (Cancelling an in-flight scan stays
        member-permitted

        as an operational action.)


        Accepts an optional JSON body with ``scan_type``: ``"incremental"``
        (default)

        skips repos unchanged since the last scan; ``"full"`` re-scans every
        repo.

        Creates a Scan record immediately (status=pending) and dispatches

        the scan to a Celery worker. Poll GET /scans/{scan_id} for progress.
      operationId: trigger_scan_api_v1_connected_orgs__connected_org_id__scans_post
      parameters:
        - in: path
          name: connected_org_id
          required: true
          schema:
            format: uuid
            title: Connected Org Id
            type: string
        - in: header
          name: X-Workspace-Id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Workspace-Id
        - in: cookie
          name: riftmap_access
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Riftmap Access
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanTriggerRequest'
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanTriggerResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    ScanTriggerRequest:
      description: Optional request body for POST /organizations/{org_id}/scans.
      properties:
        scan_type:
          default: incremental
          title: Scan Type
          type: string
      title: ScanTriggerRequest
      type: object
    ScanTriggerResponse:
      description: Returned immediately after a scan is queued.
      properties:
        message:
          title: Message
          type: string
        scan_id:
          format: uuid
          title: Scan Id
          type: string
        status:
          title: Status
          type: string
      required:
        - scan_id
        - status
        - message
      title: ScanTriggerResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-API-Key
      type: apiKey
    HTTPBearer:
      description: API key as Bearer token (rfm_live_... prefix)
      scheme: bearer
      type: http

````