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

# Create source

> Create a file-upload source. Only `direct_file_uploads` sources can be created through the API; connected sources such as Notion or Google Drive are set up in the Gumloop app because they need an account connection.

By default the source is `active` and indexes (and bills) each file as soon as it is uploaded. Set `require_approval` to `true` to create it as a `draft` instead: uploads then run a credit estimate, the source owner is notified, and nothing is indexed until [Approve source](/api-reference/brain/approve-source) is called.




## OpenAPI

````yaml post /brain/sources
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /brain/sources:
    post:
      tags:
        - Brain
      summary: Create source
      description: >
        Create a file-upload source. Only `direct_file_uploads` sources can be
        created through the API; connected sources such as Notion or Google
        Drive are set up in the Gumloop app because they need an account
        connection.


        By default the source is `active` and indexes (and bills) each file as
        soon as it is uploaded. Set `require_approval` to `true` to create it as
        a `draft` instead: uploads then run a credit estimate, the source owner
        is notified, and nothing is indexed until [Approve
        source](/api-reference/brain/approve-source) is called.
      operationId: createBrainSource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: Display name of the source.
                  example: Engineering docs
                source_type:
                  type: string
                  default: direct_file_uploads
                  description: Only `direct_file_uploads` is accepted.
                scope:
                  type: string
                  enum:
                    - personal
                    - team
                    - organization
                  default: personal
                  description: >-
                    Which Brain the source belongs to. `team` requires
                    `team_id`.
                team_id:
                  type: string
                  description: 'The team for `scope: team`. Not accepted with other scopes.'
                require_approval:
                  type: boolean
                  default: false
                  description: >-
                    Create as a draft that estimates credits before anything is
                    indexed.
      responses:
        '201':
          description: Source created.
          content:
            application/json:
              schema:
                type: object
                required:
                  - source
                properties:
                  source:
                    $ref: '#/components/schemas/BrainSource'
        '400':
          description: >-
            Invalid body — `source_type_not_supported`, a `team` scope without
            `team_id`, or `team_id` with another scope.
        '401':
          description: Unauthorized — missing or invalid Gumloop API credentials.
        '403':
          description: >-
            Forbidden — the caller cannot manage sources in the requested scope,
            or the team is not in their organization.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl 'https://api.gumloop.com/api/v1/brain/sources' \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
              -H 'Content-Type: application/json' \
              -d '{"name": "Engineering docs", "scope": "team", "team_id": "5sjVFsvytdaxEvdqV7mnmn"}'
        - lang: python
          label: Python
          source: >
            from gumloop import Gumloop


            client = Gumloop(access_token="YOUR_ACCESS_TOKEN")


            source = client.brain.create_source("Engineering docs",
            scope="team", team_id="5sjVFsvytdaxEvdqV7mnmn").source

            print(source.id, source.status)
components:
  schemas:
    BrainSource:
      type: object
      required:
        - id
        - name
        - source_type
        - status
        - scope
      properties:
        id:
          type: string
          example: PFqdAMir8PA2Xc6qcszSN9
        name:
          type: string
          example: Engineering docs
        source_type:
          type: string
          description: >-
            `direct_file_uploads` for sources created through the API; connected
            sources report their type, for example `notion`.
          example: direct_file_uploads
        status:
          type: string
          enum:
            - draft
            - active
            - paused
          description: '`draft` sources only estimate credits until approved.'
        scope:
          type: string
          enum:
            - personal
            - team
            - organization
        team_id:
          type: string
          nullable: true
          description: Set for `team` scope only.
        created_by_user_id:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````