# Detect Pipeline Migrations

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Detect Pipeline Migrations"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/workspaces/{workspace_name}/pipelines/detect-migrations"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Detect possible migrations in a pipeline.

Call this endpoint after a successful validation to check if the pipeline
contains components that can be removed/migrated.

<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":{"description":"Request to detect/apply migrations in a pipeline.","properties":{"migration_criteria_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"If provided, only the migrations with the given IDs will be detected/applied.","title":"Migration Criteria IDs"},"pipeline_config_yaml":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The pipeline YAML config to detect/apply migrations for.","title":"Pipeline YAML Config"},"version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The pipeline version ID to fetch the YAML from.","title":"Pipeline Version ID"}},"title":"MigrationRequest","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"content":{"application/json":{"schema":{"description":"Result of detecting possible migrations in a pipeline.","properties":{"has_migrations":{"description":"Whether any migrations were detected.","title":"Has Migrations","type":"boolean"},"suggestions":{"description":"List of suggested migrations.","items":{"description":"A single suggested component removal with rewiring details.","properties":{"description":{"description":"Explanation of why this migration should be applied.","title":"Description","type":"string"},"id":{"description":"ID of the migration.","title":"Id","type":"string"}},"required":["id","description"],"title":"Migration","type":"object"},"title":"Suggestions","type":"array"}},"required":["has_migrations"],"title":"MigrationDetectionResult","type":"object"}}},"description":"Detected pipeline migrations."},"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>
