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

# Create knowledge source

> Create an inline text or file-based knowledge source for your Conductor account using the Content API.

Create a knowledge source in one of two ways:

* Send inline text as `application/json`.
* Upload a supported file as `multipart/form-data`. Supported formats are PDF, TXT, XLSX, XLS, CSV, Markdown, DOC, and DOCX.

## Create an inline text source

Use `kind: "TEXT"` and provide the source text in the JSON request body.

```bash theme={null}
curl --request POST \
  --url "https://api.conductor.com/v4/accounts/{accountId}/knowledge-sources" \
  --header "Authorization: Bearer <your-api-token>" \
  --header "Content-Type: application/json" \
  --data '{
    "kind": "TEXT",
    "text": "Use the product name Conductor Intelligence in customer-facing content."
  }'
```

## Upload a file source

Send the file in the required `file` form field. You can optionally provide `fileName` to override the uploaded file's name. Do not send `kind` or `text` when uploading a file.

```bash theme={null}
curl --request POST \
  --url "https://api.conductor.com/v4/accounts/{accountId}/knowledge-sources" \
  --header "Authorization: Bearer <your-api-token>" \
  --form "file=@./product-facts.pdf;type=application/pdf" \
  --form "fileName=product-facts.pdf"
```


## OpenAPI

````yaml POST /v4/accounts/{accountId}/knowledge-sources
openapi: 3.1.0
info:
  title: Conductor API Documentation
  version: 4.0.0
  license:
    name: Conductor terms of service
    url: https://www.conductor.com/legal/
  termsOfService: https://www.conductor.com/legal/
  x-logo:
    url: https://app.conductor.com/images/global/logo_login.png
servers:
  - url: https://api.conductor.com
security:
  - ApiToken: []
  - ApiKeyQuery: []
    SigQuery: []
tags:
  - name: Draft Management
    description: Create, retrieve, update, and delete Writing Assistant drafts.
  - name: Content Insights
    description: >-
      Request and retrieve AI-driven content insights and recommendations for a
      draft.
  - name: Content Generation
    description: >-
      Generate and revise content assets — outlines, drafts, meta descriptions,
      title tags, outline expansions, and shortened text.
  - name: Content Guidance
    description: >-
      Validate and guide content against target keywords and optimization
      criteria.
  - name: Content Score
    description: >-
      Evaluate on-page content and return scoring insights across intent
      alignment and topical coverage.
  - name: Content Profile
    description: >-
      Create, retrieve, update, and delete reusable voice, tone, and
      language-rule profiles applied to draft generation.
  - name: Knowledge Sources
    description: >-
      Create and retrieve account-level text and file sources used to inform
      generated content.
  - name: Internal Linking
    description: >-
      Get anchor text and URL recommendations for internal linking based on a
      customer's embedded pages.
paths:
  /v4/accounts/{accountId}/knowledge-sources:
    post:
      tags:
        - Knowledge Sources
      summary: Create knowledge source
      description: >-
        Creates an account-level knowledge source from inline text or an
        uploaded file. Supported file types are PDF, TXT, XLSX, XLS, CSV,
        Markdown, DOC, and DOCX.
      operationId: createKnowledgeSource
      parameters:
        - name: accountId
          in: path
          required: true
          schema:
            type: integer
          description: Account identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeSourceInput'
            example:
              kind: TEXT
              text: >-
                Use the product name Conductor Intelligence in customer-facing
                content.
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/KnowledgeSourceFileInput'
      responses:
        '200':
          description: File-based knowledge source created and processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeSource'
        '201':
          description: Inline knowledge source created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeSource'
        '400':
          description: >-
            The uploaded file is empty, has no filename, or uses an unsupported
            file type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpringBootErrorResponse'
        '401':
          description: Missing or invalid API key/signature.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Caller does not have access to this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpringBootErrorResponse'
        '422':
          description: The service could not create the uploaded knowledge source.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpringBootErrorResponse'
        '500':
          description: The file upload or extraction failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpringBootErrorResponse'
components:
  schemas:
    KnowledgeSourceInput:
      type: object
      description: Fields for creating an inline knowledge source.
      required:
        - kind
        - text
      properties:
        kind:
          type: string
          enum:
            - TEXT
        fileName:
          type: string
          description: Optional display name for the inline knowledge source.
        text:
          type: string
          description: Text that should inform generated content.
    KnowledgeSourceFileInput:
      type: object
      description: Fields for creating a file-based knowledge source.
      required:
        - file
      properties:
        file:
          type: string
          format: binary
          description: A PDF, TXT, XLSX, XLS, CSV, Markdown, DOC, or DOCX file.
        fileName:
          type: string
          description: Optional filename override. Include a supported file extension.
    KnowledgeSource:
      type: object
      description: An account-level source used to inform generated content.
      properties:
        id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - FILE
            - TEXT
        fileName:
          type: string
          nullable: true
          description: The uploaded filename for a file-based knowledge source.
        text:
          type: string
          nullable: true
          description: The supplied or extracted text content.
        status:
          type: string
          enum:
            - PENDING_UPLOAD
            - STORED
            - EXTRACTED
            - ERROR
        createdBy:
          $ref: '#/components/schemas/UserRef'
        created:
          type: string
          format: date-time
        account:
          $ref: '#/components/schemas/AccountRef'
    SpringBootErrorResponse:
      type: object
      description: >-
        Default error body returned by the Spring Boot backends (sage-history,
        content-guidance, serp-explorer) for unhandled/framework-level errors.
        Not endpoint-specific.
      properties:
        timestamp:
          type: string
          format: date-time
        status:
          type: integer
        error:
          type: string
          description: HTTP reason phrase, e.g. "Bad Request".
        message:
          type: string
          nullable: true
          description: >-
            Often empty; these backends do not consistently populate a detail
            message.
        path:
          type: string
    Error:
      type: object
      description: >-
        Error envelope for failures that apply uniformly across all v4 endpoints
        (e.g. gateway-level authentication failures).
      properties:
        code:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable error description.
    UserRef:
      type: object
      required:
        - id
      properties:
        id:
          type: integer
          description: User ID.
    AccountRef:
      type: object
      required:
        - id
      properties:
        id:
          type: integer
          description: Account ID.
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      description: >-
        Conductor API token, sent as `Bearer <your-api-token>`. Generate a token
        from Integrations > API > Create API Token.
    ApiKeyQuery:
      type: apiKey
      in: query
      name: apiKey
      description: API Key as a query parameter
    SigQuery:
      type: apiKey
      in: query
      name: sig
      description: >-
        Request signature computed using API key and secret. Valid for 5 minutes
        after creation.

````