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

# Plugins

Plugin integration endpoints

## Handle Plugin REST Response

> Callback used by a REST plugin to deliver the result of a background run. It is called by the plugin, not by API clients. This route runs no authentication: it is reachable without an API key, and the \`session\` value is the only thing tying a payload to a plugin run.

```json
{"openapi":"3.0.3","info":{"title":"Ango Hub API v2","version":"2.0.0"},"tags":[{"name":"Plugins","description":"Plugin integration endpoints"}],"servers":[{"url":"https://imeritapi.ango.ai/v2","description":"EU Production Server"},{"url":"https://us-api.ango.ai/v2","description":"US Production Server"},{"url":"https://in-api.ango.ai/v2","description":"India Production Server"},{"url":"https://testapi.ango.ai/v2","description":"Test Server"}],"security":[],"paths":{"/pluginResponse":{"post":{"tags":["Plugins"],"summary":"Handle Plugin REST Response","description":"Callback used by a REST plugin to deliver the result of a background run. It is called by the plugin, not by API clients. This route runs no authentication: it is reachable without an API key, and the `session` value is the only thing tying a payload to a plugin run.","operationId":"handlePluginResponse","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PluginResponseRequest"}}}},"responses":{"200":{"description":"Plugin response received successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PluginAck"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"404":{"$ref":"#/components/responses/NotFoundError"}}}}},"components":{"schemas":{"PluginResponseRequest":{"type":"object","required":["session"],"properties":{"session":{"type":"string","description":"Plugin session ID. Must be a valid ObjectId, otherwise 400; an unknown one returns 404."},"response":{"description":"Result of the plugin run, stored and shown to the user who started it"},"error":{"type":"string","description":"Set it to mark the session failed. The user is notified that the plugin failed."},"export":{"type":"boolean","description":"Marks the result as a ready export, which changes the notification the user gets"}}},"PluginAck":{"type":"object","description":"The body carries no payload, the status code is the acknowledgement.","properties":{"status":{"type":"string"},"data":{"type":"object"}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["fail","error"]},"message":{"type":"string"}}}},"responses":{"BadRequestError":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFoundError":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Handle Plugin REST Log

> Callback used by a REST plugin to store a log line. It is called by the plugin, not by API clients, and the body is written to the plugin log collection as sent. This route runs no authentication: it is reachable without an API key.

```json
{"openapi":"3.0.3","info":{"title":"Ango Hub API v2","version":"2.0.0"},"tags":[{"name":"Plugins","description":"Plugin integration endpoints"}],"servers":[{"url":"https://imeritapi.ango.ai/v2","description":"EU Production Server"},{"url":"https://us-api.ango.ai/v2","description":"US Production Server"},{"url":"https://in-api.ango.ai/v2","description":"India Production Server"},{"url":"https://testapi.ango.ai/v2","description":"Test Server"}],"security":[],"paths":{"/pluginLog":{"post":{"tags":["Plugins"],"summary":"Handle Plugin REST Log","description":"Callback used by a REST plugin to store a log line. It is called by the plugin, not by API clients, and the body is written to the plugin log collection as sent. This route runs no authentication: it is reachable without an API key.","operationId":"handlePluginLog","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PluginLogRequest"}}}},"responses":{"200":{"description":"Plugin log received successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PluginAck"}}}}}}}},"components":{"schemas":{"PluginLogRequest":{"type":"object","description":"Mapped onto the plugin log collection: only the fields below are stored, anything else is dropped.","required":["pluginId","organization","session"],"properties":{"pluginId":{"type":"string"},"organization":{"type":"string"},"session":{"type":"string","description":"Plugin session ID"},"projectId":{"type":"string"},"runBy":{"type":"string","description":"Email of the user who started the run"},"timestamp":{"type":"string","format":"date-time"},"level":{"type":"string"},"msg":{"type":"string","description":"The log line itself"}}},"PluginAck":{"type":"object","description":"The body carries no payload, the status code is the acknowledgement.","properties":{"status":{"type":"string"},"data":{"type":"object"}}}}}}
```


---

# 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.imerit.net/api/docs/plugins.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.
