# Agents

## GET /api/v1/agents/{agentId}/status

> Get single Agent's status

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"DtoAgentStatusGetResponse":{"required":["Data"],"type":"object","properties":{"data":{"$ref":"#/components/schemas/DtoAgentStatusGet"}},"additionalProperties":false},"DtoAgentStatusGet":{"required":["IsCloudAgent","IsGateway","Name"],"type":"object","properties":{"url":{"type":"string","description":"The hostname or address for the agent. Can either be full URL https://example.org:1234 or hostname subdomain.example.org","readOnly":true},"httpPorts":{"type":"array","items":{"type":"string"},"description":"List of http ports the Agent listens to. If the Url is a full address (schema://hostname:port?) this can be ignored.","readOnly":true},"httpsPorts":{"type":"array","items":{"type":"string"},"description":"List of https ports the Agent listens to. If the Url is a full address (schema://hostname:port?) this can be ignored.","readOnly":true},"id":{"type":"integer","description":"Agent Identifier","format":"int64"},"name":{"type":"string","description":"Agent name","readOnly":true},"isGateway":{"type":"boolean","description":"If the agent is a Gateway Agent. If true, these Agents are the ones that should primarily be accessible from the internet.","readOnly":true},"isCloudAgent":{"type":"boolean","description":"If the agent is a Cloud Agent. If true, these Agents are managed by Frends.","readOnly":true},"lastError":{"type":"string","description":"Date&Time of the last error occurred.","format":"date-time","nullable":true,"readOnly":true},"lastUpdate":{"type":"string","description":"Date&Time of the last agent update occurred.","format":"date-time","nullable":true,"readOnly":true},"lastStatus":{"type":"string","description":"Last known Agent status.","nullable":true,"readOnly":true}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/agents/{agentId}/status":{"get":{"tags":["Agents"],"summary":"Get single Agent's status","operationId":"GetAgentStatus","parameters":[{"name":"agentId","in":"path","description":"Agent ID","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DtoAgentStatusGetResponse"}}}},"404":{"description":"Agent not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```

## GET /api/v1/agents/{agentId}/events

> List Agent's Event Log

```json
{"openapi":"3.0.1","info":{"title":"Frends API","version":"1.0"},"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Enter your bearer token in the format **Bearer &lt;token>**","name":"Authorization","in":"header"}},"schemas":{"AgentEventViewModelPagedResponse":{"required":["Data","Paging"],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentEventViewModel"},"description":"Response data"},"paging":{"$ref":"#/components/schemas/PagingModel"}},"additionalProperties":false},"AgentEventViewModel":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"eventId":{"type":"integer","format":"int64"},"level":{"type":"string"},"utcTimestamp":{"type":"string","format":"date-time"},"category":{"type":"integer","format":"int32"},"source":{"type":"string"},"message":{"type":"string"}},"additionalProperties":false},"PagingModel":{"required":["CurrentPage","FirstPage","LastPage","PageSize","TotalCount"],"type":"object","properties":{"currentPage":{"type":"integer","description":"Current page","format":"int32"},"pageSize":{"type":"integer","description":"Number of entries per page","format":"int32"},"totalCount":{"type":"integer","description":"Total number of entries","format":"int32"},"firstPage":{"type":"string","description":"Url of the first page","format":"uri","nullable":true},"lastPage":{"type":"string","description":"Url of the last page","format":"uri","nullable":true},"nextPage":{"type":"string","description":"Url of the next page","format":"uri","nullable":true},"previousPage":{"type":"string","description":"Url of the previous page","format":"uri","nullable":true}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/api/v1/agents/{agentId}/events":{"get":{"tags":["Agents"],"summary":"List Agent's Event Log","operationId":"GetAgentEventLog","parameters":[{"name":"agentId","in":"path","description":"Agent Identifier","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"PageNumber","in":"query","description":"Current page number. Default value is 1.","schema":{"type":"integer","format":"int32"}},{"name":"PageSize","in":"query","description":"Maximum page size is 200. Default page size is 30.","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentEventViewModelPagedResponse"}}}},"404":{"description":"Agent not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.frends.com/reference/frends-platform-api/platform-api-reference/agents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
