I'm trying to use a API to create a call to a determined agent but I'm getting the below error:
REST call for action execute failed. Message: Request to backend service failed. Response from web service: {"message":"This request requires a user context. Client credentials cannot be used for requests to this resource.","code":"not.a.user","status":400,"contextId":"b1abb69a-2122-4a20-ba43-8ad838de3adf","details":[],"errors":[]} [19a4e43a-ba0f-4446-8064-aab18c578b20]
Seems I just use the API in the context of the user.
Is there a way to create a call to a determined agent using API externally?
If you're asking if you can have a user context without a user ever interacting to complete an auth flow, like a data action or a headless service on a server somewhere in your data center that has no UI, you cannot do that.
If by "outside request" you mean one from outside Genesys' cloud servers, yes. That is the purpose of the Genesys Cloud Platform API. Just authorize with any of the aforementioned user-based oauth flows and your outside app can make use of the API to make user-based requests.