> For the complete documentation index, see [llms.txt](https://bc-security.gitbook.io/empire-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bc-security.gitbook.io/empire-wiki/restful-api/hosts.md).

# Hosts

## GET /api/v2/hosts/{uid}

> Read Host

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/api/v2/hosts/{uid}":{"get":{"tags":["hosts"],"summary":"Read Host","operationId":"read_host_api_v2_hosts__uid__get","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"integer","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Host"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Host":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"internal_ip":{"type":"string","title":"Internal Ip"}},"type":"object","required":["id","name","internal_ip"],"title":"Host"},"BadRequestResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"BadRequestResponse"},"NotFoundResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"NotFoundResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## GET /api/v2/hosts

> Read Hosts

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/api/v2/hosts":{"get":{"tags":["hosts"],"summary":"Read Hosts","operationId":"read_hosts_api_v2_hosts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hosts"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}}}}}},"components":{"schemas":{"Hosts":{"properties":{"records":{"items":{"$ref":"#/components/schemas/Host"},"type":"array","title":"Records"}},"type":"object","required":["records"],"title":"Hosts"},"Host":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"internal_ip":{"type":"string","title":"Internal Ip"}},"type":"object","required":["id","name","internal_ip"],"title":"Host"},"BadRequestResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"BadRequestResponse"},"NotFoundResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"NotFoundResponse"}}}}
```

## GET /api/v2/hosts/{host\_id}/processes/{uid}

> Read Process

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/api/v2/hosts/{host_id}/processes/{uid}":{"get":{"tags":["hosts"],"summary":"Read Process","operationId":"read_process_api_v2_hosts__host_id__processes__uid__get","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"integer","title":"Uid"}},{"name":"host_id","in":"path","required":true,"schema":{"type":"integer","title":"Host Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Process"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Process":{"properties":{"process_id":{"type":"integer","title":"Process Id"},"process_name":{"type":"string","title":"Process Name"},"host_id":{"type":"integer","title":"Host Id"},"architecture":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Architecture"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"stale":{"type":"boolean","title":"Stale"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},"type":"object","required":["process_id","process_name","host_id","stale"],"title":"Process"},"BadRequestResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"BadRequestResponse"},"NotFoundResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"NotFoundResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## GET /api/v2/hosts/{host\_id}/processes

> Read Processes

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/api/v2/hosts/{host_id}/processes":{"get":{"tags":["hosts"],"summary":"Read Processes","operationId":"read_processes_api_v2_hosts__host_id__processes_get","parameters":[{"name":"host_id","in":"path","required":true,"schema":{"type":"integer","title":"Host Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Processes"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Processes":{"properties":{"records":{"items":{"$ref":"#/components/schemas/Process"},"type":"array","title":"Records"}},"type":"object","required":["records"],"title":"Processes"},"Process":{"properties":{"process_id":{"type":"integer","title":"Process Id"},"process_name":{"type":"string","title":"Process Name"},"host_id":{"type":"integer","title":"Host Id"},"architecture":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Architecture"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"stale":{"type":"boolean","title":"Stale"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},"type":"object","required":["process_id","process_name","host_id","stale"],"title":"Process"},"BadRequestResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"BadRequestResponse"},"NotFoundResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"NotFoundResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```
