# Import Query Set

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Import Query Set"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v2/workspaces/{workspace_id}/query_sets/import"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Create a query set from an uploaded CSV file. Expected columns: 'query' (required), 'filters', 'params', 'group name', 'query label'. Returns 409 if a query set with the given name already exists.

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

<ParamsDetails
  parameters={[{"description":"Type the id of the workspace.","in":"path","name":"workspace_id","required":true,"schema":{"description":"Type the id of the workspace.","format":"uuid","title":"Workspace Id","type":"string"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"contentMediaType":"application/octet-stream","title":"File","type":"string"},"file_name":{"description":"Name for this query set","title":"File Name","type":"string"}},"required":["file","file_name"],"title":"Body_import_query_set_api_v2_workspaces__workspace_id__query_sets_import_post","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"201":{"content":{"application/json":{"schema":{"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"created_by":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Created By"},"name":{"title":"Name","type":"string"},"query_count":{"title":"Query Count","type":"integer"},"query_set_id":{"format":"uuid","title":"Query Set Id","type":"string"}},"required":["query_set_id","name","query_count","created_by","created_at"],"title":"QuerySetResponse","type":"object"}}},"description":"Successful Response"},"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>
