> For the complete documentation index, see [llms.txt](https://docs.defguard.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.defguard.net/2.1/for-developers/rest-api/core/network/list-networks.md).

# List networks

```json
{"openapi":"3.1.0","info":{"title":"defguard Core API","version":"2.1.0"},"tags":[{"name":"network","description":"WireGuard networks, including import from a WireGuard configuration file."}],"security":[{"cookie":[]},{"api_token":[]}],"components":{"securitySchemes":{"cookie":{"type":"apiKey","in":"cookie","name":"defguard_session"},"api_token":{"type":"http","scheme":"bearer"}},"schemas":{"WireguardNetworkInfo":{"allOf":[{"$ref":"#/components/schemas/WireguardNetwork_i64"},{"type":"object","required":["gateways","allowed_groups","has_devices","posture_checks"],"properties":{"allowed_groups":{"type":"array","items":{"type":"string"}},"gateways":{"type":"array","items":{"$ref":"#/components/schemas/GatewayInfo"}},"has_devices":{"type":"boolean"},"posture_checks":{"type":"array","items":{"$ref":"#/components/schemas/i64"}}}}]},"WireguardNetwork_i64":{"type":"object","description":"Stores the configuration required to set up a WireGuard network.","required":["id","name","address","port","pubkey","endpoint","mtu","fwmark","allowed_ips","allow_all_groups","acl_enabled","acl_default_allow","allowed_ips_from_acl","keepalive_interval","peer_disconnect_threshold","location_mfa_mode","service_location_mode"],"properties":{"acl_default_allow":{"type":"boolean"},"acl_enabled":{"type":"boolean"},"address":{"type":"array","items":{"type":"string"}},"allow_all_groups":{"type":"boolean"},"allowed_ips":{"type":"array","items":{"type":"string"}},"allowed_ips_from_acl":{"type":"boolean"},"connected_at":{"type":["string","null"],"format":"date-time"},"dns":{"type":["string","null"]},"endpoint":{"type":"string"},"fwmark":{"type":"integer","format":"int64"},"id":{"type":"integer","format":"int64"},"keepalive_interval":{"type":"integer","format":"int32"},"location_mfa_mode":{"$ref":"#/components/schemas/LocationMfaMode"},"mtu":{"type":"integer","format":"int32"},"name":{"type":"string"},"peer_disconnect_threshold":{"type":"integer","format":"int32"},"port":{"type":"integer","format":"int32"},"pubkey":{"type":"string"},"service_location_mode":{"$ref":"#/components/schemas/ServiceLocationMode"}}},"LocationMfaMode":{"type":"string","enum":["disabled","internal","external"]},"ServiceLocationMode":{"type":"string","enum":["disabled","prelogon","alwayson"]},"GatewayInfo":{"type":"object","required":["id","location_id","name","address","port","connected","enabled","modified_at","modified_by","location_name"],"properties":{"address":{"type":"string"},"certificate_expiry":{"type":["string","null"],"format":"date-time"},"certificate_serial":{"type":["string","null"]},"connected":{"type":"boolean"},"connected_at":{"type":["string","null"],"format":"date-time"},"disconnected_at":{"type":["string","null"],"format":"date-time"},"enabled":{"type":"boolean"},"id":{"$ref":"#/components/schemas/i64"},"location_id":{"$ref":"#/components/schemas/i64"},"location_name":{"type":"string"},"modified_at":{"type":"string","format":"date-time"},"modified_by":{"type":"string"},"name":{"type":"string"},"port":{"type":"integer","format":"int32"},"version":{"type":["string","null"]}}},"i64":{"type":"integer","format":"int64"},"ApiErrorResponse":{"type":"object","description":"Body returned with error responses.","required":["msg"],"properties":{"code":{"type":["string","null"],"description":"Machine-readable error code, returned for selected errors."},"msg":{"type":"string","description":"Human-readable error message."}}}}},"paths":{"/api/v1/network":{"get":{"tags":["network"],"summary":"List networks","operationId":"list_networks","responses":{"200":{"description":"All networks.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WireguardNetworkInfo"}}}}},"401":{"description":"Session is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"403":{"description":"Requires admin privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Unable to list networks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}}}}
```
