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

# Create a run

> Required permission: runs:write.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/runs
openapi: 3.0.3
info:
  title: Bulkgrid API
  version: 0.1.0
  description: >-
    Search indexed content, create crawl and extraction runs, and retrieve
    results. API keys require the scopes listed for each operation. OAuth
    connections grant MCP and search access only.
servers:
  - url: https://bulkgrid.com
    description: Bulkgrid
security:
  - apiKeyAuth: []
  - bearerAuth: []
tags:
  - name: Sources
    description: Source discovery, subscriptions, and indexing
  - name: Collections
    description: Collections and content selection rules
  - name: Search
    description: Search endpoints
  - name: Runs
    description: Run creation and lifecycle endpoints
  - name: Results
    description: Run result retrieval endpoints
paths:
  /api/v1/runs:
    post:
      tags:
        - Runs
      summary: Create a run
      description: 'Required permission: runs:write.'
      operationId: createRun
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - crawl
                    urls:
                      type: array
                      items:
                        type: string
                        format: uri
                    strategy:
                      type: string
                      enum:
                        - lexical
                        - embedding
                    config:
                      type: object
                      properties:
                        maxDepth:
                          default: 3
                          type: number
                          minimum: 1
                        maxPages:
                          default: 50
                          type: number
                          minimum: 1
                        topKLinks:
                          default: 10
                          type: number
                          minimum: 1
                        minGainThreshold:
                          default: 0.1
                          type: number
                          minimum: 0
                          maximum: 1
                        confidenceThreshold:
                          default: 0.8
                          type: number
                          minimum: 0
                          maximum: 1
                    options:
                      type: object
                      properties:
                        formats:
                          default:
                            - markdown
                            - cleanHtml
                          type: array
                          items:
                            type: string
                            enum:
                              - markdown
                              - cleanHtml
                              - rawHtml
                              - links
                        includeTags:
                          type: array
                          items:
                            type: string
                        excludeTags:
                          type: array
                          items:
                            type: string
                        headers:
                          type: object
                          additionalProperties:
                            type: string
                        waitAfterLoad:
                          default: 0
                          type: number
                          minimum: 0
                          maximum: 30000
                        timeout:
                          default: 30000
                          type: number
                          minimum: 1000
                          maximum: 60000
                        blockAds:
                          default: true
                          type: boolean
                        useInteractions:
                          default: false
                          type: boolean
                        waitForSelector:
                          type: string
                        waitForImages:
                          default: false
                          type: boolean
                        removeConsentPopups:
                          type: boolean
                        screenshot:
                          type: string
                          enum:
                            - screenshot
                            - fullPageScreenshot
                        useHttp:
                          type: boolean
                        useLlmsTxt:
                          type: boolean
                        includeDocumentLinks:
                          default: false
                          type: boolean
                  required:
                    - type
                    - urls
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - extract
                    urls:
                      minItems: 1
                      type: array
                      items:
                        type: string
                        format: uri
                      description: List of URLs to extract data from
                    query:
                      type: string
                      minLength: 1
                      description: Extraction query used to guide the extraction
                    schema:
                      type: object
                      additionalProperties: {}
                      description: JSON schema defining the structure of data to extract
                    maxRetries:
                      description: Maximum retry attempts for each URL
                      default: 3
                      type: number
                      minimum: 1
                      maximum: 5
                  required:
                    - type
                    - urls
                    - query
                    - schema
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - deep_crawl
                    url:
                      type: string
                      format: uri
                    config:
                      type: object
                      properties:
                        maxDepth:
                          type: number
                          minimum: 1
                        includeExternal:
                          default: false
                          type: boolean
                        includeDocumentLinks:
                          default: false
                          type: boolean
                        scoreThreshold:
                          default: 0
                          type: number
                        normalizeScores:
                          default: true
                          type: boolean
                        maxPages:
                          type: number
                          minimum: 1
                        seedUrls:
                          type: array
                          items:
                            type: string
                            format: uri
                        includePaths:
                          type: array
                          items:
                            type: string
                        excludePaths:
                          type: array
                          items:
                            type: string
                        restrictToStartPath:
                          default: false
                          type: boolean
                    options:
                      type: object
                      properties:
                        formats:
                          default:
                            - markdown
                            - cleanHtml
                          type: array
                          items:
                            type: string
                            enum:
                              - markdown
                              - cleanHtml
                              - rawHtml
                              - links
                        includeTags:
                          type: array
                          items:
                            type: string
                        excludeTags:
                          type: array
                          items:
                            type: string
                        headers:
                          type: object
                          additionalProperties:
                            type: string
                        waitAfterLoad:
                          default: 0
                          type: number
                          minimum: 0
                          maximum: 30000
                        timeout:
                          default: 30000
                          type: number
                          minimum: 1000
                          maximum: 60000
                        blockAds:
                          default: true
                          type: boolean
                        useInteractions:
                          default: false
                          type: boolean
                        waitForSelector:
                          type: string
                        waitForImages:
                          default: false
                          type: boolean
                        removeConsentPopups:
                          type: boolean
                        screenshot:
                          type: string
                          enum:
                            - screenshot
                            - fullPageScreenshot
                        useHttp:
                          type: boolean
                        useLlmsTxt:
                          type: boolean
                        includeDocumentLinks:
                          default: false
                          type: boolean
                  required:
                    - type
                    - url
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  indexed_pages:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  indexing_done:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  indexing_failed:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  indexing_failed_pages:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  indexing_in_progress:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  indexing_queued:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  deletion_requested_at:
                    nullable: true
                    type: string
                  id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  completed_at:
                    nullable: true
                    type: string
                  config:
                    $ref: '#/components/schemas/Schema43___schema0'
                  created_at:
                    type: string
                  credential_id:
                    nullable: true
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  done:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  error_code:
                    nullable: true
                    type: string
                  error_count:
                    nullable: true
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  error_details:
                    nullable: true
                    allOf:
                      - $ref: '#/components/schemas/Schema43___schema0'
                  extraction_query:
                    nullable: true
                    type: string
                  extraction_schema:
                    nullable: true
                    allOf:
                      - $ref: '#/components/schemas/Schema43___schema0'
                  failed:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  in_progress:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  inline_credentials:
                    nullable: true
                    allOf:
                      - $ref: '#/components/schemas/Schema43___schema0'
                  indexing_completed_at:
                    nullable: true
                    type: string
                  indexing_started_at:
                    nullable: true
                    type: string
                  indexing_time_ms:
                    nullable: true
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  last_error:
                    nullable: true
                    type: string
                  last_error_at:
                    nullable: true
                    type: string
                  last_heartbeat:
                    nullable: true
                    type: string
                  max_retries:
                    nullable: true
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  message_ids:
                    type: array
                    items:
                      type: string
                  metadata:
                    nullable: true
                    allOf:
                      - $ref: '#/components/schemas/Schema43___schema0'
                  needs_dispatch:
                    type: boolean
                  priority:
                    nullable: true
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  processing_time_ms:
                    nullable: true
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  query:
                    nullable: true
                    type: string
                  queued:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  requested_by_user_id:
                    nullable: true
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  retry_count:
                    nullable: true
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  started_at:
                    nullable: true
                    type: string
                  status:
                    type: string
                    enum:
                      - pending
                      - processing
                      - completed
                      - failed
                      - cancelled
                  workspace_id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  type:
                    type: string
                    enum:
                      - crawl
                      - deep_crawl
                      - extract
                      - source_sync
                  updated_at:
                    type: string
                  urls:
                    type: array
                    items:
                      type: string
                      format: uri
                required:
                  - id
                  - completed_at
                  - config
                  - created_at
                  - credential_id
                  - done
                  - error_code
                  - error_count
                  - error_details
                  - extraction_query
                  - extraction_schema
                  - failed
                  - in_progress
                  - inline_credentials
                  - indexing_completed_at
                  - indexing_started_at
                  - indexing_time_ms
                  - last_error
                  - last_error_at
                  - last_heartbeat
                  - max_retries
                  - message_ids
                  - metadata
                  - needs_dispatch
                  - priority
                  - processing_time_ms
                  - query
                  - queued
                  - requested_by_user_id
                  - retry_count
                  - started_at
                  - status
                  - workspace_id
                  - type
                  - updated_at
                  - urls
                additionalProperties: false
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details: {}
                required:
                  - error
                additionalProperties: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details: {}
                required:
                  - error
                additionalProperties: false
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details: {}
                required:
                  - error
                additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details: {}
                required:
                  - error
                additionalProperties: false
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details: {}
                required:
                  - error
                additionalProperties: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details: {}
                required:
                  - error
                additionalProperties: false
      security:
        - apiKeyAuth: []
        - bearerAuth: []
components:
  schemas:
    Schema43___schema0:
      anyOf:
        - type: string
          nullable: true
          enum:
            - null
        - type: boolean
        - type: number
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/Schema43___schema0'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/Schema43___schema0'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Bulkgrid API key
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bulkgrid API key or OAuth access token. OAuth grants currently allow
        search:query and mcp:use only.

````