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

# Create a new piece of knowledge from a PDF file

> Extracts content from the provided PDF file and creates a new piece of knowledge



## OpenAPI

````yaml /openapi/squad-api.json post /organisations/{orgId}/workspaces/{workspaceId}/knowledge/source/pdf
openapi: 3.1.0
info:
  title: Squad API
  version: 4.8.0
  description: API for managing Squad resources
  contact:
    name: Squad Support
    url: https://www.meetsquad.ai/support
    email: help@meetsquad.ai
servers:
  - url: https://api.meetsquad.ai
    description: Production server
  - url: https://uat.api.meetsquad.ai
    description: Staging server
  - url: https://dev.api.meetsquad.ai
    description: Development server
security: []
tags:
  - name: Organisations
  - name: Workspaces
  - name: Goals
  - name: Opportunities
  - name: Solutions
  - name: Feedback
  - name: Submit Feedback
  - name: Insights
  - name: Knowledge
  - name: Metrics
  - name: Topics
  - name: Integrations
  - name: AI & Search
  - name: Onboarding
paths:
  /organisations/{orgId}/workspaces/{workspaceId}/knowledge/source/pdf:
    post:
      tags:
        - Knowledge
      summary: Create a new piece of knowledge from a PDF file
      description: >-
        Extracts content from the provided PDF file and creates a new piece of
        knowledge
      operationId: createKnowledgeFromPdf
      parameters:
        - in: path
          name: orgId
          schema:
            type: string
          required: true
          description: Organization ID
          example: a5f3c6e1-9d20-4f7b-8e31-d09a2b63c184
        - in: path
          name: workspaceId
          schema:
            type: string
          required: true
          description: Workspace ID
          example: c0e195d9-b918-4a3a-bd8b-f730361d044f
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKnowledgeFromPdfPayload'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SingleKnowledgeResponseWithUploadPdf'
                required:
                  - data
                additionalProperties: false
        '400':
          description: Bad Request - Invalid input
          content:
            application/json:
              schema:
                description: >-
                  Bad Request - Invalid input parameters or missing required
                  fields
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code identifier
                        example: INVALID_REQUEST
                        type: string
                      description:
                        description: Human-readable error description
                        example: One or more fields are invalid
                        type: string
                      fields:
                        description: List of field names that are missing or invalid
                        example:
                          - title
                          - description
                        type: array
                        items:
                          type: string
                      validationErrors:
                        description: >-
                          Detailed validation error information for each invalid
                          field
                        example:
                          invalidFields:
                            title:
                              type: too_small
                              message: Title must be at least 3 characters long
                              path:
                                - title
                            deadline:
                              type: invalid_date
                              message: Deadline must be a valid date in the future
                              path:
                                - deadline
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - code
                      - description
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '401':
          description: Unauthorized - Authentication required
          content:
            application/json:
              schema:
                description: Unauthorized - Missing or invalid authentication token
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code identifier
                        example: UNAUTHORISED_ERROR
                        type: string
                      description:
                        description: Human-readable error description
                        example: User is unauthenticated
                        type: string
                    required:
                      - code
                      - description
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                description: Forbidden - Insufficient permissions to access this resource
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code identifier
                        example: UNAUTHORISED_ERROR
                        type: string
                      description:
                        description: Human-readable error description
                        example: User is unauthorised
                        type: string
                    required:
                      - code
                      - description
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                description: >-
                  Internal Server Error - An unexpected error occurred on the
                  server
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code identifier
                        example: INTERNAL_SERVER_ERROR
                        type: string
                      description:
                        description: Human-readable error description
                        example: An unexpected error occurred on the server
                        type: string
                    required:
                      - code
                      - description
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  schemas:
    CreateKnowledgeFromPdfPayload:
      description: Request schema for creating knowledge from a PDF file
      type: object
      properties:
        id:
          description: An optional Knowledge ID must be a uuid
          example: 7b9e5d2c-f314-48a9-be56-9843a2f6c019
          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)$
        fileName:
          description: The name of the file to create knowledge from
          example: example.pdf
          type: string
      required:
        - fileName
    SingleKnowledgeResponseWithUploadPdf:
      description: Response containing a single knowledge
      type: object
      properties:
        id:
          description: Knowledge ID
          example: 7b9e5d2c-f314-48a9-be56-9843a2f6c019
          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)$
        state:
          description: Knowledge state
          example: initial
          type: string
          enum:
            - initial
            - processing
            - completed
            - error
        title:
          description: Knowledge title
          example: Best practices for AI in healthcare
          type: string
        description:
          description: Knowledge description - a short summary of the knowledge
          example: A collection of best practices for AI in healthcare
          type: string
        createdAt:
          description: Knowledge creation timestamp
          example: '2023-01-01T00:00:00.000Z'
          type: string
        updatedAt:
          description: Knowledge update timestamp
          example: '2023-01-01T00:00:00.000Z'
          type: string
        source:
          description: Type of knowledge
          example: text
          type: string
          enum:
            - text
            - url
            - pdf
        providedBy:
          description: >-
            Integration node type that provides this knowledge (calculated field
            from PROVIDES relationship)
          example: NotionPage
          type:
            - string
            - 'null'
        pdfFileUrl:
          description: URL of the PDF file of the knowledge (mutually exclusive with url)
          example: https://example.com/document.pdf
          type: string
        txtFileUrl:
          description: URL of the TXT file of the knowledge (mutually exclusive with url)
          example: /knowledge/7b9e5d2c-f314-48a9-be56-9843a2f6c019
          type: string
        url:
          description: URL of the knowledge source (mutually exclusive with filePath)
          example: https://example.com/document.pdf
          type: string
          format: uri
        uploadUrl:
          description: The single use secure S3 upload url.
          example: https://s3.amazonaws.com/basilisk-ai-dev/example.pdf
          type: string
      required:
        - id
        - state
        - title
        - description
        - createdAt
        - updatedAt
        - source
        - providedBy
        - uploadUrl
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT authentication for organization-scoped endpoints.

````