---
title: "Read one network policy"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Read one network policy

Path: CloudRaker Workspace API › Network policies

`GET /network-policies/{policyId}`

Reads a policy by id, revoked ones included — a published agent version keeps pointing at the policy it was published with, so history stays readable. Authorization: any member.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `policyId` (`getNetworkPolicy.path.policyId`; string, required)
  - pattern `^net_[0-9A-HJKMNP-TV-Z]{26}$`

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.cloudraker.com/network-policies/<policyId>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/network-policies/<policyId>';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/network-policies/<policyId>"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The policy.

#### Example

```json
{
  "data": {
    "id": "string",
    "name": "string",
    "hosts": {
      "property1": {
        "credentialRef": "string",
        "approval": true
      },
      "property2": {
        "credentialRef": "string",
        "approval": true
      }
    },
    "createdAt": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "revokedAt": "2019-08-24T14:15:22Z"
  }
}
```

- `data` (`getNetworkPolicy.response.200.data`; object, required)
  - `id` (`getNetworkPolicy.response.200.data.id`; string, required)
    - pattern `^net_[0-9A-HJKMNP-TV-Z]{26}$`
  - `name` (`getNetworkPolicy.response.200.data.name`; string, required)
  - `hosts` (`getNetworkPolicy.response.200.data.hosts`; map<object>, required)
  - `createdAt` (`getNetworkPolicy.response.200.data.createdAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `createdBy` (`getNetworkPolicy.response.200.data.createdBy`; string, required)
  - `revokedAt` (`getNetworkPolicy.response.200.data.revokedAt`; any of, required) — Set once the policy is revoked. A revoked policy stays READABLE for history and every egress request under it is denied.
    - any of: `string`, `null`

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`getNetworkPolicy.response.400.success`; boolean, required)
  - one of `false`
- `error` (`getNetworkPolicy.response.400.error`; array<unknown>, required)
- `data` (`getNetworkPolicy.response.400.data`; unknown, required)

### 404

`network_policy_not_found` — no such policy in this organization.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`getNetworkPolicy.response.404.error`; string, required) — The sentence a human reads.
- `error_code` (`getNetworkPolicy.response.404.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`getNetworkPolicy.response.404.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`getNetworkPolicy.response.404.issues.path`; string, required)
  - `code` (`getNetworkPolicy.response.404.issues.code`; string, required)
  - `message` (`getNetworkPolicy.response.404.issues.message`; string, required)


Source: https://docs.cloudraker.com/workspace/api/network-policies/get-network-policy/index.md
