> For the complete documentation index, see [llms.txt](https://docs.airops.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airops.com/api-reference-1/agent.md).

# Agent

An endpoint for interacting with Agent apps using chat messages.

## Chat

> This endpoint allows you to send a message (chat) to an Agent app. You can include inputs with your message which will be passed to the app.<br>

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Agent","description":"An endpoint for interacting with Agent apps using chat messages."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"app_uuid":{"name":"app_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The app uuid, you can find the app uuid by going to the App => Integrate"}},"schemas":{"ChatPayload":{"type":"object","properties":{"message":{"type":"string","description":"The message to send to the agent"},"session_id":{"type":"string","description":"The session id of the chat. Use the session_id to send a message to an existing conversation. If not present, a new session will be created after sending the first message."},"inputs":{"type":"object","additionalProperties":true,"description":"Optional inputs to send along with the message."}}},"ChatResponse":{"properties":{"result":{"type":"object","additionalProperties":true,"description":"The result from calling the agent"}}},"Execution":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","running","error","success","cancelled","review_needed"]},"airops_apps_version_id":{"type":"integer"},"conversation_id":{"type":"string"},"credits_used":{"type":"integer"},"error_code":{"type":"string"},"error_message":{},"feedback":{"type":"string","enum":["positive","neutral","negative"]},"inputs":{"type":"object"},"output":{"type":"object"},"runtime":{"type":"integer","description":"The time it took to execute the app in seconds"},"source":{"type":"string"},"uuid":{"type":"string","maxLength":36,"minLength":36},"workspace_id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt","updatedAt"]}}},"paths":{"/public_api/agent_apps/{app_uuid}/chat":{"post":{"summary":"Chat","description":"This endpoint allows you to send a message (chat) to an Agent app. You can include inputs with your message which will be passed to the app.\n","tags":["Agent"],"operationId":"chatWithAgent","parameters":[{"$ref":"#/components/parameters/app_uuid"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatPayload","required":["message"]}}}},"responses":{"200":{"description":"Message sent","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"$ref":"#/components/schemas/ChatResponse/properties/result"},"airops_app_execution":{"$ref":"#/components/schemas/Execution"}}}}}},"401":{"description":"Authentication error"}}}}}}
```

## Async Chat

> This endpoint allows you to send a message (chat) to an Agent app asynchronously, without waiting for the response. You can include inputs with your message which will be passed to the app.<br>

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Agent","description":"An endpoint for interacting with Agent apps using chat messages."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"app_uuid":{"name":"app_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The app uuid, you can find the app uuid by going to the App => Integrate"}},"schemas":{"ChatPayload":{"properties":{"session_id":{"type":"string","description":"The session id of the chat. Use the session_id to send a message to an existing conversation. If not present, a new session will be created after sending the first message."}}},"Execution":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","running","error","success","cancelled","review_needed"]},"airops_apps_version_id":{"type":"integer"},"conversation_id":{"type":"string"},"credits_used":{"type":"integer"},"error_code":{"type":"string"},"error_message":{},"feedback":{"type":"string","enum":["positive","neutral","negative"]},"inputs":{"type":"object"},"output":{"type":"object"},"runtime":{"type":"integer","description":"The time it took to execute the app in seconds"},"source":{"type":"string"},"uuid":{"type":"string","maxLength":36,"minLength":36},"workspace_id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt","updatedAt"]}}},"paths":{"/public_api/agent_apps/{app_uuid}/async_chat":{"post":{"summary":"Async Chat","description":"This endpoint allows you to send a message (chat) to an Agent app asynchronously, without waiting for the response. You can include inputs with your message which will be passed to the app.\n","tags":["Agent"],"operationId":"asyncChatWithAgent","parameters":[{"$ref":"#/components/parameters/app_uuid"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"The message to send to the agent."},"inputs":{"type":"object","description":"Optional inputs to send along with the message.","additionalProperties":true}},"required":["message"]}}}},"responses":{"200":{"description":"Message sent","content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"$ref":"#/components/schemas/ChatPayload/properties/session_id"},"airops_app_execution":{"$ref":"#/components/schemas/Execution"}}}}}},"401":{"description":"Authentication error"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.airops.com/api-reference-1/agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
