# Upload Temporary File

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Upload Temporary File"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/workspaces/{workspace_name}/temporary_files"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Uploads a file into the workspace. You can also use this endpoint to create a text file. To do that, enter the file name and text as its contents.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"description":"Type the name of the workspace.","in":"path","name":"workspace_name","required":true,"schema":{"description":"Type the name of the workspace.","title":"Workspace Name","type":"string"}},{"description":"The name of the file you want to create. Use this field only if you're creating a file to upload. If you're uploading an existing file, leave this field empty.","in":"query","name":"file_name","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The name of the file you want to create. Use this field only if you're creating a file to upload. If you're uploading an existing file, leave this field empty.","title":"File Name"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"anyOf":[{"contentMediaType":"application/octet-stream","type":"string"},{"type":"null"}],"description":"The name of the file you want to upload.","title":"File"},"meta":{"default":"{}","description":"A list of metadata fields in the \"key\":\"value\" format. During search, you can use these metadata as filters.","title":"Meta","type":"string"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Instead of uploading a file, you can paste the file contents here to create a text file.","title":"Text"}},"title":"Body_upload_temporary_file_api_v1_workspaces__workspace_name__temporary_files_post","type":"object"}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"201":{"content":{"application/json":{"schema":{"properties":{"file_id":{"description":"Unique identifier of a file.","format":"uuid","title":"File ID","type":"string"}},"required":["file_id"],"title":"UploadFileResponse","type":"object"}}},"description":"Your file's in the workspace."},"400":{"description":"We couldn't upload your file because some of the arguments specified were incompatible. You can upload a file from your disk or create a file by providing a file name and text as its contents. "},"413":{"description":"Too large payload.Either the file uploaded is larger than 200 MB or the metadata you tried to upload is too large. The string '<your-string>' of key '<your-key>' is longer than 32766 bytes, which approximately equals the same number of characters.To upload files larger than 200 MB, use the [deepset SDK](https://github.com/deepset-ai/deepset-cloud-sdk)."},"415":{"description":"Haystack Enterprise Platform supports .txt, .csv, .json, .xml, .html, .md, .pdf, .docx, .pptx, .xlsx, .xlsb, .xlsm, .msg, .zip and ..DS_Store files. Upload a file in the supported format."},"422":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"}}},"description":"Validation Error"}}}
>
  
</StatusCodes>
