# Import Custom Components

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Import Custom Components"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v2/custom_components"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Imports a custom component as a zip file.
Use the [Custom component template](https://github.com/deepset-ai/dc-custom-component-template)
to write your component, and then upload the zipped template.

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

<ParamsDetails
  parameters={undefined}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"contentMediaType":"application/octet-stream","title":"File","type":"string"}},"required":["file"],"title":"Body_import_custom_components_api_v2_custom_components_post","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"content":{"application/json":{"schema":{"properties":{"created_by_user_id":{"description":"User ID of the user who created the custom component.","format":"uuid","title":"Created by user ID","type":"string"},"custom_component_id":{"description":"Unique identifier of the custom component.","format":"uuid","title":"Custom component ID","type":"string"},"logs":{"description":"Custom component logs.","items":{"properties":{"level":{"description":"Log level, for example error or warning.","title":"Level","type":"string"},"log_entry_id":{"description":"Unique identifier of the log entry.","format":"uuid","title":"Log entry ID","type":"string"},"msg":{"description":"Log message.","title":"Message","type":"string"}},"required":["log_entry_id","msg","level"],"title":"CustomComponentLog","type":"object"},"title":"Logs","type":"array"},"organization_id":{"description":"Unique identifier of the Haystack Enterprise Platform organization with the organization where you want to upload the component.","format":"uuid","title":"Organization ID","type":"string"},"status":{"description":"Status of the custom component.","title":"Status","type":"string"},"version":{"description":"Version of the custom component.","title":"Version","type":"string"}},"required":["organization_id","logs","version","created_by_user_id","custom_component_id","status"],"title":"CustomComponent","type":"object"}}},"description":"Returns the ID of the imported custom component."},"400":{"description":"Something went wrong while validating the custom component. {error_message}"},"409":{"description":"Change the version of this custom component and upload it again. A custom component with this version already exists in your workspace."},"415":{"description":"Upload a valid ZIP file as the custom component. Currently, we only support the ZIP format for custom components."},"422":{"description":"Validation failed. The version or package format is invalid. {error_message}"}}}
>
  
</StatusCodes>
