Achieve public client token-exchange programmatically through SDK

I am looking for keycloak SDK API to create token-exchange permission and policy programmatically in latest versions. (v20 or v21). I couldn’t find a API to persist the created ClientPolicyRepresentation / ScopePermissionRepresentation entities from the admin client. Any advise would be appreciated.

Anything the web console does is using the admin API. Just inspect the calls when configuring via interface and repeat them using the admin cli.

Not all configurations have a dedicated --parameter in the cli. For some, you’ll just providing the json and using the cli as a simpler way to do the HTTP request.