---
sidebar_label: Legacy NRN API
doc_id: 3b7e1d42-94a6-4c8f-b1e3-6f2d8a9c5e70
description: >-
  Legacy hierarchical configuration store API that reads and writes
  key-value data keyed by NRN strings.
keywords:
  - NRN API
  - hierarchical configuration
  - profiles
  - legacy
---

# NRN API

:::warning Deprecation notice

This API may be removed in the future. Use [**Providers**](./overview.md) for infrastructure configuration and [**Parameters**](../parameters/parameters.md) for application runtime settings.

:::

The NRN API is a hierarchical configuration store accessible at `https://api.nullplatform.com/nrn/:id`. It stores key-value data keyed by [NRN](../NRN.md) strings and supports hierarchical merging — child entities automatically inherit parent values.

## Reading configuration

```http
GET /nrn/organization=1:account=2:namespace=3:application=4:scope=5?ids=some-key,mynamespace.another-key
```

```json
{
  "nrn": "organization=1:account=2:namespace=3:application=4:scope=5",
  "namespaces": {
    "global": {
      "some-key": "some-value"
    },
    "mynamespace": {
      "another-key": "another-value"
    }
  },
  "profiles": {}
}
```

Key points:
- You **must** specify keys to retrieve using the `ids` query parameter (comma-separated).
- Keys in the `global` namespace can omit the namespace prefix. All other keys use the format `namespace.key`.
- Pass `output_json_values=true` to deserialize JSON string values in the response.
- Pass `no-merge=true` to see only the values set at that exact node, without inheriting from parent levels.

## Available methods

| Method | Description |
|---|---|
| `GET` | Retrieve namespaced keys for an NRN |
| `POST` | Create an NRN entry |
| `PUT` | Fully replace an NRN's content (destructive) |
| `PATCH` | Update specific keys (additive) |

:::warning
`PUT` and `PATCH` behave differently. `PUT` replaces all content; `PATCH` only updates the specified keys.
:::

## Object and array merging

When values are JSON objects or arrays stored as strings, the API merges them across the hierarchy. For example, if a parent defines `{"the": "thing"}` and a child defines `{"another": "thing"}` for the same key, a query at the child level returns the merged result:

```json
{"the": "thing", "another": "thing"}
```

## Profiles

Profiles apply cross-cutting configuration overrides to multiple branches of the NRN tree. For example, you can define a `production` profile at the organization level that sets specific cloud accounts for every production scope, regardless of which application or namespace they belong to.

### Creating a profile

Use the naming convention `profilename::namespace.key`:

```http
POST /nrn/organization=1
{
  "testing::some_cloud_provider.account_id": "1234_testing",
  "production::some_cloud_provider.account_id": "1234_production"
}
```

### Assigning a profile to a scope

```http
PATCH /scope/5
{
  "profiles": ["production"]
}
```

### Querying with a profile

```http
GET /nrn/organization=1:account=2:namespace=3?profile=production&ids=some_cloud_provider.account_id
```

The profile values merge with (and override) the natural NRN hierarchy response.

### Checking available profiles

```http
GET /nrn/organization=1:account=2/available_profiles
```

```json
{
  "nrn": "organization=1:account=2",
  "available_profiles": ["development", "testing", "production"]
}
```

### Multiple profiles

Apply multiple profiles by separating them with commas. When profiles define the same key, the one with the lower `order` value takes precedence:

```http
GET /nrn/organization=1:account=2:namespace=3?profile=production,hardened_ami
```

### Hierarchical profiles

Profiles compose hierarchically just like NRN values — keys inside a profile merge upward through the hierarchy. This lets you define shared settings at the organization level and team-specific overrides at the namespace level.

## Deleting configuration

```http
DELETE /nrn/organization=1:account=2?namespaces=example,another_example
```

```http
DELETE /nrn/organization=1:account=2?profiles=development,testing
```

Pass `include_parents=true` to delete across the entire hierarchy, not just the specified node.
