Register host on ubuntu 22.04 with foreman

Problem:
Im trying to register host on ubuntu 22.04
after curl command with activation_keys, lifecycle_environment_id, location_id, operatingsystem_id and organization_id

Host initial configuration failed, please see the registration log for more details.

and

Could not find a provider for hostname.domain. Providers returned {"Katello::ManagedContentMediumProvider"=>["Kickstart repository was not set for host 'hostname.domain'", "Content source was not set for host 'hostname.domain'"], "MediumProviders::Default"=>["ubuntu 22.04.2 medium was not set for host 'hostname.domain'", "Invalid medium '' for 'ubuntu 22.04.2'", "Invalid architecture '' for 'ubuntu 22.04.2'"]}

Expected outcome:
Host registration successfuly
Foreman and Proxy versions:
Foreman 3.6.1
Foreman and Proxy plugin versions:

Distribution and version:
Ubuntu 22.04.2
Other relevant data:
I have installed subscription-manager from http://apt.atix.de on ubuntu
In foreman, I did everything using this link Managing deb content in Foreman | Opensource.com , but for ubuntu 22

SOLVED: first you need to register the host using subscription-manager using org and activation key