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

# Create a new material



## OpenAPI

````yaml /openapi-components.json post /api/v1/materials
openapi: 3.0.0
info:
  title: StudyFetch API
  description: API documentation for StudyFetch
  version: '1.0'
  contact: {}
servers:
  - url: https://studyfetchapi.com
    description: Production API Server
security: []
tags: []
paths:
  /api/v1/materials:
    post:
      tags:
        - Materials
      summary: Create a new material
      operationId: createMaterial
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMaterialDto'
      responses:
        '201':
          description: Material created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaterialResponseDto'
        '403':
          description: Insufficient permissions
      security:
        - x-api-key: []
components:
  schemas:
    CreateMaterialDto:
      type: object
      properties:
        name:
          type: string
          example: Chapter 1 - Introduction
          description: Name of the material
        content:
          description: Content details
          allOf:
            - $ref: '#/components/schemas/ContentDto'
        folderId:
          type: string
          description: Folder ID to place the material in
        references:
          description: References that this material cites
          type: array
          items:
            $ref: '#/components/schemas/ReferenceDto'
      required:
        - name
        - content
    MaterialResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: Material ID
        name:
          type: string
          description: Material name
        organizationId:
          type: string
          description: Organization ID
        folderId:
          type: string
          description: Folder ID
          nullable: true
        contentType:
          type: string
          description: Content type
          enum:
            - text
            - pdf
            - video
            - audio
            - image
            - epub
        content:
          type: object
          description: Material content
          properties:
            text:
              type: string
            url:
              type: string
            s3Key:
              type: string
            s3Url:
              type: string
            filename:
              type: string
            fileSize:
              type: number
            mimeType:
              type: string
        metadata:
          type: object
          description: Material metadata
        status:
          type: string
          description: Material status
          enum:
            - active
            - processing
            - pending_upload
            - error
            - deleted
        usage:
          type: object
          description: Usage information
        references:
          description: References that this material cites
          type: array
          items:
            $ref: '#/components/schemas/ReferenceDto'
        createdAt:
          format: date-time
          type: string
          description: Creation timestamp
        updatedAt:
          format: date-time
          type: string
          description: Last update timestamp
      required:
        - _id
        - name
        - organizationId
        - folderId
        - contentType
        - content
        - status
        - createdAt
        - updatedAt
    ContentDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
            - pdf
            - video
            - audio
            - url
          description: Type of content
        text:
          type: string
          description: Text content (for text type)
        url:
          type: string
          description: URL to the content (for url type)
        sourceUrl:
          type: string
          description: URL to fetch content from
      required:
        - type
    ReferenceDto:
      type: object
      properties:
        title:
          type: string
          example: Understanding Photosynthesis
          description: Reference title
        url:
          type: string
          example: https://example.com/article
          description: Reference URL
      required:
        - title
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API Key for server-to-server authentication. Resolves to the owning
        organization.

````