Skip to content

List agents API

Objective

This tutorial will step you through configuring Insomnia HTTP call to the /orchestrate/agents API to list the existing agents in your tenant, so we can find the Agent ID. We need the Agent ID in order to call the /runs API.

List agents - step by step guide.

  1. Create a new HTTP request, using the "+" icon at the top of your list of existing HTTP requests. Select "New HTTP request" from the menu

    new http request

  2. Configure the request with the _.wxo_url variable and the following path:

    /v1/orchestrate/agents
    


    get agent url

  3. Next we will configure the token from the Token Auth API call as input to our Authorization token. In the Token field, type a period "." and select "Request -> OAuth 2.0 Access Token" from the list.

    select OAuth token

  4. The result is an input variable that needs to be configured. Click on the unconfigured variable token and a configuration dialogue will appear.

    unconfigured input

    Variable configuration dialogue box:

    edit tag

  5. Click on the "function to perform" and select "Response - reference values from other request's responses"

    reference values

  6. Under Attribute, select "Body Attribute - value of response body" and under Request select "POST Token Auth"

    configure attribute

  7. Under Trigger Behavior secrtion, select "Always - Always resend request" from the drop down menu.

    Always resend request

  8. Lastly, configure the filter to fetch the "token" field from the Token Auth output. This can be done using the syntax

     $.token
    
    (which represent the token parameter from the output of the Token Auth API call, payload). You can see the token value in the 'live Preview" box at the bottom of the screen.

    configure filter

    Click Done to complete this configuration. The correctly configured Auth section should look like this:

    get agent authl

  9. Click the Send button and view the results, which should be your agent details. If your tenant has multiple agents, use the CMD+F key to search for 'hello_world' and you should be able to find the Hello World agent and see it's id.

    get agent outputl

    Copy the Agent ID and save it to your environment.

    environment with agent_idl

Chatting with the Agent ID via /runs API

Ready for the next step? Click here to chat with your agent.