> ## 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 or subscribe to a source

> Required permission: sources:write.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/sources
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/sources:
    post:
      tags:
        - Sources
      summary: Create or subscribe to a source
      description: 'Required permission: sources:write.'
      operationId: sourcesCreate
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                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:
                    - domain
                identifier:
                  type: string
                label:
                  type: string
                visibility:
                  type: string
                  enum:
                    - public
                    - private
                source_mode:
                  type: string
                  enum:
                    - discover
                    - selected_pages
                crawl_config:
                  type: object
                  properties:
                    maxDepth:
                      type: number
                      minimum: 1
                    maxPages:
                      type: number
                      minimum: 1
                    includePaths:
                      type: array
                      items:
                        type: string
                    excludePaths:
                      type: array
                      items:
                        type: string
                    selectedUrls:
                      type: array
                      items:
                        type: string
                        format: uri
                    crawlOptions:
                      type: object
                      properties:
                        waitAfterLoad:
                          type: number
                          minimum: 0
                          maximum: 30000
                        timeout:
                          type: number
                          minimum: 1000
                          maximum: 60000
                        includeTags:
                          type: array
                          items:
                            type: string
                        excludeTags:
                          type: array
                          items:
                            type: string
                        useHttp:
                          type: boolean
                        useLlmsTxt:
                          type: boolean
                        removeConsentPopups:
                          type: boolean
                        includeDocumentLinks:
                          type: boolean
                metadata:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/Schema7___schema0'
                crawl_interval:
                  type: string
                  enum:
                    - hourly
                    - daily
                    - weekly
                    - monthly
                    - custom
                custom_interval_minutes:
                  type: number
                analysis_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)$
              required:
                - type
                - identifier
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  source:
                    type: object
                    properties:
                      crawl_config:
                        nullable: true
                      crawl_interval:
                        nullable: true
                        type: string
                        enum:
                          - hourly
                          - daily
                          - weekly
                          - monthly
                          - custom
                      created_at:
                        type: string
                      created_by_user_id:
                        nullable: true
                        type: string
                      created_by_workspace_id:
                        nullable: true
                        type: string
                      custom_interval_minutes:
                        nullable: true
                        type: number
                      icon_url:
                        nullable: true
                        type: string
                      id:
                        type: string
                      identifier:
                        type: string
                      integration_type:
                        type: string
                        enum:
                          - web
                          - upload
                          - github
                      is_active:
                        nullable: true
                        type: boolean
                      label:
                        nullable: true
                        type: string
                      last_crawled_at:
                        nullable: true
                        type: string
                      max_depth:
                        nullable: true
                        type: number
                      max_items:
                        nullable: true
                        type: number
                      metadata:
                        nullable: true
                      next_crawl_at:
                        nullable: true
                        type: string
                      public_source_id:
                        nullable: true
                        type: string
                      source_mode:
                        type: string
                        enum:
                          - discover
                          - selected_pages
                      total_items_found:
                        nullable: true
                        type: number
                      type:
                        type: string
                        enum:
                          - domain
                          - document
                          - repository
                      updated_at:
                        type: string
                      visibility:
                        type: string
                        enum:
                          - public
                          - private
                      workspace_id:
                        nullable: true
                        type: string
                    required:
                      - crawl_config
                      - crawl_interval
                      - created_at
                      - created_by_user_id
                      - created_by_workspace_id
                      - custom_interval_minutes
                      - icon_url
                      - id
                      - identifier
                      - integration_type
                      - is_active
                      - label
                      - last_crawled_at
                      - max_depth
                      - max_items
                      - metadata
                      - next_crawl_at
                      - public_source_id
                      - source_mode
                      - total_items_found
                      - type
                      - updated_at
                      - visibility
                      - workspace_id
                    additionalProperties: {}
                  created:
                    type: boolean
                required:
                  - source
                  - created
                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:
    Schema7___schema0:
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: string
          nullable: true
          enum:
            - null
        - type: array
          items:
            $ref: '#/components/schemas/Schema7___schema0'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/Schema7___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.

````