{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/safetyculture/json-schema/safetyculture-s12-documents-v1-create-file-request-schema.json",
  "title": "Request to create a file in the specified folder",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/safetyculture-documents-api-openapi.yml#/components/schemas/s12.documents.v1.CreateFileRequest",
  "type": "object",
  "properties": {
    "path": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "An array of folder names that defines the path where the file will be stored.\nThe `path` is relative to the `parent_id` if it is provided. If not, it starts from the root folder.\nThe API will automatically create any folders in the path that don’t exist.\nEach folder name must be 1-255 characters and exclude invalid characters."
    },
    "name": {
      "type": "string",
      "description": "The name of the file.\nMust be between 1-255 characters and exclude invalid characters."
    },
    "file_type": {
      "description": "The type of the file to be created.\nPlease note that videos are currently not supported.",
      "allOf": [
        {
          "$ref": "#/$defs/s12.common.MediaType"
        }
      ]
    },
    "file_size": {
      "type": "integer",
      "format": "int64",
      "description": "The size of the file in bytes. Must not exceed 50MB.\nThis field is required if `file_type` is provided."
    },
    "parent_id": {
      "type": "string",
      "description": "The ID of the folder where the file should be stored.\nAny folders defined in the `path` will be created inside the parent folder.\nIf you don’t provide a parent_id, the file will be stored in the root folder.\nTo get the `parent_id`, open the folder in the SafetyCulture web app and copy the last part of the URL.\nFor example, in this link `https://app.safetyculture.com/documents/9dd76834-65ef-41d3-815c-964df32450e4`,\nthe parent ID is `9dd76834-65ef-41d3-815c-964df32450e4`."
    },
    "file_extension": {
      "type": "string",
      "description": "The file extension of the uploaded blob (e.g. \"pdf\", \"jpg\"), without the leading dot.\nUsed to populate the file's extension when the extension cannot be derived from `name`\nor the underlying media metadata is unavailable."
    }
  },
  "$defs": {
    "s12.common.MediaType": {
      "type": "string",
      "enum": [
        "MEDIA_TYPE_IMAGE",
        "MEDIA_TYPE_VIDEO",
        "MEDIA_TYPE_PDF",
        "MEDIA_TYPE_DOCX",
        "MEDIA_TYPE_XLSX",
        "MEDIA_TYPE_PPTX",
        "MEDIA_TYPE_CSV"
      ],
      "description": " - MEDIA_TYPE_IMAGE: An image file (GIF, JPG, PNG, WEBP).\n - MEDIA_TYPE_VIDEO: A video file (MP4, MOV).\n - MEDIA_TYPE_PDF: A PDF document.\n - MEDIA_TYPE_DOCX: A Microsoft Word document (DOCX, DOC).\n - MEDIA_TYPE_XLSX: A Microsoft Excel spreadsheet (XLSX, XLS).\n - MEDIA_TYPE_PPTX: A Microsoft PowerPoint presentation (PPTX, PPT).\n - MEDIA_TYPE_CSV: A CSV file."
    }
  }
}