# Close Session

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

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

Closes the session and starts the ingestion process.
If the session is not closed explicitly, the session will be automatically closed after 24 hours.

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

<ParamsDetails
  parameters={[{"description":"The ID of the session.","in":"path","name":"session_id","required":true,"schema":{"description":"The ID of the session.","format":"uuid","title":"Session Id","type":"string"}},{"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":{"status":{"const":"CLOSED","default":"CLOSED","description":"Closes the session and starts the ingestion of the uploaded files.","title":"Close Session","type":"string"}},"title":"CloseSession","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"204":{"description":"Your session details."},"404":{"description":"There's no session with the ID '{session_id}' in the workspace. Check if the ID is correct. "},"409":{"description":"The session is already closed."},"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>
