# Create Upload Session

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create Upload Session"}
>
</Heading>

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

Creates a session for uploading files and file metadata. The session remains active for 24 hours. You can upload up to 10 000 files in a session.

<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"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"properties":{"expires_in_seconds":{"anyOf":[{"maximum":86400,"minimum":1,"type":"integer"},{"type":"null"}],"default":86400,"description":"Timestamp when the upload session should expire, for example '2022-05-12T12:25:09+02:00'. This is an optional parameter. If not provided, the upload session will expire after the maximum expiry time of 24 hours.","title":"Upload session expiry"},"parallel_processing_enabled":{"default":false,"description":"Determines whether to process upload sessions in parallel. Use this option to speed up the ingestion process if the different sessions don't modify the same files.","title":"Parallel Processing Enabled","type":"boolean"},"write_mode":{"default":"KEEP","description":"Determines how to handle files that already exist. You can KEEP the existing file, OVERWRITE it, or FAIL to ingest if a file with the same name is already in your workspace.","title":"Write Mode","enum":["KEEP","OVERWRITE","FAIL","TEMPORARY"],"type":"string"}},"title":"CreateSession","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"201":{"content":{"application/json":{"schema":{"properties":{"aws_prefixed_request_config":{"description":"The request configuration used for uploading files. Set each file key to `<org_id>/<workspace_id>/<session_id>/${filename}`, where filename is <file_name>.<txt|pdf> or <file_name>.<txt|pdf>.meta.json for meta files.","title":"AWS Prefix","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"The fields to include in the request to the presigned URL. These fields are required in the body of each request.","examples":[{"key":"7a3749f5-448a-475f-8d94-b87872a0342d/7d0a7027-5b3d-48f2-97d6-28fc138f2821/upload_sessions/5c38259b-19ee-4a99-8f38-7c3007dcaaae/","policy":"<policy>","x-amz-algorithm":"AWS4-HMAC-SHA256","x-amz-credential":"<credential>","x-amz-date":"20230419T152408Z","x-amz-security-token":"<security-token>","x-amz-signature":"<signature>"}],"title":"Request fields","type":"object"},"url":{"description":"The presigned URL to upload the file to. This URL was generated using the AWS ShareObjectPresignedUrl feature. To learn more, see [AWS Documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html).","title":"Presigned URL","type":"string"}},"required":["url","fields"],"type":"object"},"documentation_url":{"default":"https://docs.cloud.deepset.ai/docs/upload-files","description":"The URL to the documentation of the session.","title":"Session Documentation URL","type":"string"},"expires_at":{"description":"The time when the session expires.","format":"date-time","title":"Session Expires At","type":"string"},"session_id":{"description":"Unique identifier of a session.","format":"uuid","title":"Session ID","type":"string"}},"required":["expires_at","aws_prefixed_request_config"],"title":"UploadSession","type":"object"}}},"description":"Your session is created."},"402":{"description":"You can't upload to this workspace through upload sessions on a free plan. To use this feature, upgrade to a paid plan. You can still upload files through the UI at no cost."},"406":{"description":"You can't upload files because you've reached the maximum number of upload sessions allowed per user. Close existing sessions using the Close Session endpoint before starting a new one."},"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>
