--- title: "Set a component's origin" canonical: "https://admiral.io/docs/api/components/RegistryAPI_SetComponentOrigin" --- # Set a component's origin `POST https://api.admiral.io/v1/components/{component_id}/set-origin` Scope: `component:write` ### Path parameters - `component_id` (string, required): The component_id path parameter. Pattern `^cmp-[0-9a-z]+$`. ### Request body - `origin` (ComponentOrigin, required): ComponentOrigin is where a component's new versions come from. The publish or import that creates the component sets it, and SetComponentOrigin moves it. Each version keeps its own provenance whatever the origin later becomes. - Exactly one of `source`, `published` is set. - `published` (PublishedOrigin): PublishedOrigin is a component published by hand: the CLI uploading a directory, from CI or a laptop. ImportComponent is refused on it with FAILED_PRECONDITION. SetComponentOrigin moves it. - `source` (SourceOrigin): SourceOrigin is a component whose versions arrive through one source and one artifact in it: an import, or a push to a GitHub repository through a push source. PublishComponent is refused on it with FAILED_PRECONDITION, naming the source. ImportComponent is refused with FAILED_PRECONDITION when it names a different source or artifact. SetComponentOrigin moves it. - `source_id` (string, required): Pattern `^src-[0-9a-z]+$`. - `artifact` (string): The artifact in the source: a chart name, `name/provider`, a name under an OCI namespace, or a path in a git repository. Empty is the repository root. string.not_contains = ".." Length at most 256. ### Response 200 Success - `component` (Component): Component is a registry entry: a name, and the versions and tags beneath it. - `id` (string): Unique identifier. Pattern `^cmp-[0-9a-z]+$`. Read-only. - `name` (string): Unique within the organization, never changed: `cloud-sql`. Renaming a component means publishing under the new name and deprecating the old one with it as the successor. Read-only. - `description` (string): Length at most 1024. - `labels` (map of string to string): Key-value metadata for filtering (e.g. `{"team": "payments", "runtime": "terraform"}`), the same labels every Admiral resource carries. - `origin` (ComponentOrigin): Where the component's new versions come from. Set when the component is created, and every new version must come from it. Only SetComponentOrigin moves it. Read-only. - Exactly one of `source`, `published` is set. - `published` (PublishedOrigin): PublishedOrigin is a component published by hand: the CLI uploading a directory, from CI or a laptop. ImportComponent is refused on it with FAILED_PRECONDITION. SetComponentOrigin moves it. - `source` (SourceOrigin): SourceOrigin is a component whose versions arrive through one source and one artifact in it: an import, or a push to a GitHub repository through a push source. PublishComponent is refused on it with FAILED_PRECONDITION, naming the source. ImportComponent is refused with FAILED_PRECONDITION when it names a different source or artifact. SetComponentOrigin moves it. - `source_id` (string, required): Pattern `^src-[0-9a-z]+$`. - `artifact` (string): The artifact in the source: a chart name, `name/provider`, a name under an OCI namespace, or a path in a git repository. Empty is the repository root. string.not_contains = ".." Length at most 256. - `tags` (array of Tag): Every tag on the component, by name. Read-only. - `name` (string): As written after the colon in `cloud-sql:v1.2.0`. Read-only. - `digest` (string): The version it names, as `sha256:`. Read-only. - `immutable` (boolean): True for a semver tag: it never moves once assigned. Decided from the name, so two tags with the same name are always the same class. Read-only. - `created_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `updated_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `created_by` (ActorRef): ActorRef is a lightweight reference to the user or agent that performed an action. Server-populated on all resource responses. Clients should never send this. Read-only. - `id` (string): The actor's typed id: a `usr-` user id or an `sa-` service account id. - `display_name` (string): Human-readable name (e.g., "John Smith", "deploy-bot"). - `email` (string): Email address (empty for non-human actors). - `created_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `updated_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `status` (Status): Status is whether a component is still recommended. Removing one is DeleteComponent. One of `STATUS_UNSPECIFIED`, `STATUS_ACTIVE`, `STATUS_DEPRECATED`. Read-only. - `status_reason` (string): Why, and when, the status last changed. Unset on a component that has only ever been ACTIVE. Read-only. - `status_changed_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `successor_component_id` (string): The component to use instead, `cmp-`; set only while DEPRECATED. Read-only.