{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-openai/json-schema/microsoft-azure-openai-file-import-schema.json",
  "title": "FileImport",
  "description": "Defines a document to import from an external content url to be usable with Azure OpenAI.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-openai-files-api-openapi.yml#/components/schemas/FileImport",
  "required": [
    "content_url",
    "filename",
    "purpose"
  ],
  "type": "object",
  "properties": {
    "purpose": {
      "$ref": "#/$defs/Purpose"
    },
    "filename": {
      "description": "The name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded.\nIf the `purpose` is set to \"fine-tune\", each line is a JSON record with \"prompt\" and \"completion\" fields representing your training examples.",
      "minLength": 1,
      "type": "string"
    },
    "content_url": {
      "format": "url",
      "description": "The url to download the document from (can be SAS url of a blob or any other external url accessible with a GET request).",
      "type": "string"
    }
  },
  "$defs": {
    "Purpose": {
      "title": "Purpose",
      "description": "The intended purpose of the uploaded documents. Use \"fine-tune\" for fine-tuning. This allows us to validate the format of the uploaded file.",
      "enum": [
        "fine-tune",
        "fine-tune-results",
        "assistants",
        "assistants_output",
        "batch",
        "batch_output"
      ],
      "type": "string",
      "readOnly": true,
      "x-ms-enum": {
        "name": "Purpose",
        "modelAsString": true,
        "values": [
          {
            "value": "fine-tune",
            "description": "This file contains training data for a fine tune job."
          },
          {
            "value": "fine-tune-results",
            "description": "This file contains the results of a fine tune job."
          },
          {
            "value": "assistants",
            "description": "This file contains data to be used in assistants."
          },
          {
            "value": "assistants_output",
            "description": "This file contains the results of an assistant."
          },
          {
            "value": "batch",
            "description": "This file contains the input data for a batch."
          },
          {
            "value": "batch_output",
            "description": "This file contains the results of a batch."
          }
        ]
      }
    }
  }
}