But I got error as "The request failed with response code: 400. Message: This request requires a non-user context. User token cannot be used for requests to this resource."
Could you please help me to undersatnd why the API is failing?
The API you are calling must be invoked using a token generated with an OAuth Client Credential. Based on your description it sources you are using a user-based token and the API is rejecting.
You cannot use the API Explorer to execute/test the Agentless Email API. When you are using the API Explorer, it is using a user-context OAuth token that it obtained when you used the 'Add Account' feature, and the agentless email API will not execute under a user-context OAuth client.
If you want to play with that API then can use Postman along with our pre-built Postman collections (https://developer.genesys.cloud/platform/api/postman) to execute that API under a client-credentials OAuth client context.
Alternatively you can setup a Genesys Cloud Data Action (https://help.mypurecloud.com/articles/about-genesys-cloud-data-actions-integration/) that calls that API using a client-credentials OAuth client context as well. You can test out the API using the 'Test' tool in the Data Action UI and once you've got the Data Action functioning to your liking you can then use that Data Action in Architect or an Agent Script.