'How can I add users into a wso2 Identity server tenant via Rest APIs?

enter image description hereI am trying to add users into a tenant using this url https://localhost:9443/t/{tenant-domain}/api/server/v1 But it responds with 200 OK status but no user is getting added into actual server if SSL verification is turned off. I am getting this error after turning SSL verification on.



Solution 1:[1]

Use the SCIM 2.0 API in the WSO2 IS server

Here is a sample curl command:

curl --location --request POST 'https://localhost:9443/t/{tenant-name}/scim2/Users/' \
--header 'Authorization: Basic <base64encode({tenantadmin_username}:{tenantadmin_password})>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "userName": "john",
    "password": "Wso2@123",
    "name": {
        "givenName": "John",
        "familyName" : "Smith"
    }
}'

Need to change paramtered places {tenant-name} and <base64encode({tenantadmin_username}:{tenantadmin_password})> based on the your tenant's details.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Harsh Manvar