Is it possible to create Attribute Group and Attribute Set in Marketing Cloud by API? I don't see endpoints in documentation for doing that. Thanks for help.
This is not currently possible. Within SFMC this is done with internal / non-public APIs.
This might be a usecase considered for deployment manager in the future, see here:
"Some potential features that we want to support: Data Extension schemas, Attribute Groups, Content, Emails, Automations, and end-to-end Journeys. While an API is on the road map, it is unlikely that we will get to it this year. Ask questions, give feedback, and learn more in the Deployment Manager Trailblazer Community. "