---
title: Upload single file
slug: eng-1519-openapi-eyebrow-labels/upload-single-file
createdAt: 2026-10-21T07:05:13.485Z
---

{
  "id": "mXLQK9FjRMjZpSVXWua4s",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.example.com/files/{fileId}",
    "servers": [
      {
        "url": "https://api.example.com/files/{fileId}"
      }
    ],
    "name": "Upload single file",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "fileId",
          "type": "string",
          "example": "file-1234",
          "description": "The file identifier.",
          "minLength": 4,
          "maxLength": 36,
          "pattern": "^[a-z0-9-]+$"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Content-Type",
          "type": "string",
          "example": "multipart/form-data",
          "description": "",
          "enum": [
            "multipart/form-data",
            "application/json"
          ]
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "status",
          "type": "string",
          "description": "Filter by status.",
          "default": "OK",
          "enum": [
            "OK",
            "Not OK"
          ]
        },
        {
          "kind": "optional",
          "name": "limit",
          "type": "integer<int32>",
          "description": "How many items to return.",
          "default": 20,
          "format": "int32",
          "minimum": 1,
          "maximum": 100
        },
        {
          "kind": "optional",
          "name": "region",
          "type": "string",
          "example": "eu-west-1",
          "examples": [
            {
              "label": "Europe",
              "value": "eu-west-1"
            },
            {
              "label": "America",
              "value": "us-east-1"
            }
          ],
          "description": "Region with named examples."
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "isPublic",
              "kind": "optional",
              "type": "boolean",
              "description": "Make the file publicly accessible."
            },
            {
              "name": "metadata",
              "kind": "optional",
              "type": "object",
              "description": "Nested object with constraints.",
              "example": "",
              "schema": [
                {
                  "name": "visibility",
                  "kind": "optional",
                  "type": "string<private | team | public>",
                  "description": "",
                  "default": "private",
                  "enum": [
                    "private",
                    "team",
                    "public"
                  ]
                },
                {
                  "name": "tags",
                  "kind": "optional",
                  "type": "array",
                  "description": "",
                  "example": "",
                  "itemType": "string",
                  "customType": "string[]",
                  "itemExample": "",
                  "itemDefault": ""
                }
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Uploaded",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string<OK | Not OK>",
                "description": "Result of the upload.",
                "enum": [
                  "OK",
                  "Not OK"
                ]
              },
              {
                "name": "size",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "",
                "example": 2048,
                "format": "int64",
                "minimum": 0
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url 'https://api.example.com/files/{fileId}?status=OK&limit=20' \\\n     --header 'accept: application/json' \\\n     --header 'content-type: multipart/form-data' \\\n     --data '{\n     \"metadata\": {\n     \"visibility\": \"private\"\n     }\n     }'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"multipart/form-data\");\n\nvar raw = \"{\\n  \\\"metadata\\\": {\\n    \\\"visibility\\\": \\\"private\\\"\\n  }\\n}\";\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.example.com/files/{fileId}?status=OK&limit=20\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.example.com/files/{fileId}?status=OK&limit=20\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"multipart/form-data\"\nrequest.body = \"{\\n  \\\"metadata\\\": {\\n    \\\"visibility\\\": \\\"private\\\"\\n  }\\n}\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.example.com/files/{fileId}?status=OK&limit=20\"\n\npayload = \"{\\n  \\\"metadata\\\": {\\n    \\\"visibility\\\": \\\"private\\\"\\n  }\\n}\"\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'multipart/form-data'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Uploaded\n{\n  \"status\": \"\",\n  \"size\": 2048\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}