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

# Create a file upload request in user's root folder

> Step 1 of 3-step file upload: Initiate a direct upload.

This endpoint creates a placeholder file record and returns credentials
for uploading the file directly to the storage service.

Please see the [File Uploads guide](/file-uploads) for an overview of the
whole process.

## Response

The response includes a `meta.direct_upload` object containing:
- `url`: The URL to upload the file to
- `headers`: Headers to include in the upload request
- `blob_signed_id`: Signed ID of the blob (for reference)



## OpenAPI

````yaml /openapi.json post /api/v1/file_upload_requests
openapi: 3.1.0
info:
  title: Scholarly API V1
  version: v1
  description: API for accessing Scholarly data
  license:
    name: Proprietary
    identifier: Proprietary
servers:
  - url: https://api.scholarlysoftware.com
    description: Production server
security: []
paths:
  /api/v1/file_upload_requests:
    post:
      tags:
        - File Upload Requests
      summary: Create a file upload request in user's root folder
      description: >-
        Step 1 of 3-step file upload: Initiate a direct upload.


        This endpoint creates a placeholder file record and returns credentials

        for uploading the file directly to the storage service.


        Please see the [File Uploads guide](/file-uploads) for an overview of
        the

        whole process.


        ## Response


        The response includes a `meta.direct_upload` object containing:

        - `url`: The URL to upload the file to

        - `headers`: Headers to include in the upload request

        - `blob_signed_id`: Signed ID of the blob (for reference)
      operationId: createFileUploadRequest
      parameters:
        - name: Authorization
          in: header
          required: true
          description: Bearer token
          schema:
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - file
                    attributes:
                      type: object
                      properties:
                        name:
                          type: string
                          example: annual_report.pdf
                        size:
                          type: integer
                          example: 1024000
                          description: File size in bytes
                        content_type:
                          type:
                            - string
                            - 'null'
                          example: application/pdf
                        checksum:
                          type: string
                          description: Base64-encoded MD5 checksum
                          example: rL0Y20zC+Fzt72VPzMSk2A==
                      additionalProperties: false
                      required:
                        - name
                        - size
                        - checksum
                  additionalProperties: false
                  required:
                    - type
                    - attributes
              additionalProperties: false
              required:
                - data
      responses:
        '201':
          description: Upload request created
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/FileUploadRequest'
                    type: object
                    additionalProperties: {}
                  meta:
                    type: object
                    properties:
                      direct_upload:
                        type: object
                        properties:
                          url:
                            type: string
                            description: URL to upload the file to
                          headers:
                            type: object
                            additionalProperties:
                              type: string
                            description: Headers required for the upload request
                          blob_signed_id:
                            type: string
                            description: Signed ID to use when confirming the upload
                        additionalProperties: false
                        required:
                          - url
                          - headers
                          - blob_signed_id
                    additionalProperties: false
                    required:
                      - direct_upload
                additionalProperties: false
                required:
                  - data
                  - meta
        '400':
          description: error
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: unauthorized
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: forbidden
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: validation error
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/ValidationError'
      security:
        - bearer_auth: []
components:
  schemas:
    FileUploadRequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          const: file_upload_request
          example: file_upload_request
        attributes:
          type: object
          properties:
            created_at:
              type: string
              format: datetime
            updated_at:
              type: string
              format: datetime
            name:
              type: string
              example: annual_report.pdf
            content_type:
              type:
                - string
                - 'null'
              example: application/pdf
            byte_size:
              type:
                - integer
                - 'null'
              example: 1024000
            checksum_md5:
              type:
                - string
                - 'null'
            url:
              type:
                - string
                - 'null'
            locked:
              type:
                - boolean
                - 'null'
            state:
              type: string
        relationships:
          type: object
          properties:
            folder:
              type: object
              properties:
                links:
                  type: object
                  properties:
                    related:
                      type: string
                      format: uri
                  required:
                    - related
                meta:
                  type: object
              anyOf:
                - required:
                    - links
                - required:
                    - meta
            created_by:
              type: object
              properties:
                links:
                  type: object
                  properties:
                    related:
                      type: string
                      format: uri
                  required:
                    - related
                meta:
                  type: object
              anyOf:
                - required:
                    - links
                - required:
                    - meta
      required:
        - id
        - type
        - attributes
    Error:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              status:
                type: string
              title:
                type: string
              detail:
                type: string
            required:
              - status
              - title
      required:
        - errors
    ValidationError:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              status:
                type: string
                example: '422'
              title:
                type: string
                example: Validation Error
              detail:
                type: string
                example: Label can't be blank
            required:
              - status
              - title
              - detail
      required:
        - errors
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````