> ## 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.

# Upload material from URL and wait for processing to complete

> Fetches content from URL and waits for processing to finish before returning. Useful for synchronous API usage.



## OpenAPI

````yaml /openapi-components.json post /api/v1/materials/upload/url-and-process
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/upload/url-and-process:
    post:
      tags:
        - Materials
      summary: Upload material from URL and wait for processing to complete
      description: >-
        Fetches content from URL and waits for processing to finish before
        returning. Useful for synchronous API usage.
      operationId: uploadFromUrlSync
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadFromUrlSyncDto'
      responses:
        '201':
          description: Material uploaded from URL and processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaterialResponseDto'
        '400':
          description: Invalid URL, processing failed, or timed out
      security:
        - x-api-key: []
components:
  schemas:
    UploadFromUrlSyncDto:
      type: object
      properties:
        url:
          type: string
          example: https://example.com/document.pdf
          description: URL to fetch content from
        name:
          type: string
          example: My Document
          description: Material name
        folderId:
          type: string
          description: Folder ID (optional)
        timeoutMs:
          type: number
          default: 300000
          description: >-
            Maximum time to wait for processing in milliseconds (default: 5
            minutes)
        pollIntervalMs:
          type: number
          default: 2000
          description: 'Polling interval in milliseconds (default: 2 seconds)'
        references:
          description: References that this material cites
          type: array
          items:
            $ref: '#/components/schemas/ReferenceDto'
      required:
        - url
        - name
    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
    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.

````