I would think of exposing the associated_accounts like this when creating a new user :
POST /users.json
{
username: "something",
email: "test@test.com",
associated_accounts: [
{
provider_name: "oauth2_basic",
provider_uid: "12345"
}
]
}
This would be perfect !
Note: this is similar to the provider and extern_uid parameters of Gitlab Users API (Users API | GitLab Docs)