Display Name Management API
HTTP endpoints for managing the agent display name at runtime.
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/display-name/manage | POST | Manage display name on local agent |
/agents/{agent-id}/display-name/manage | POST | Manage display name on remote agent |
These endpoints require http.remote_api: true in configuration.
POST /display-name/manage
Manage the display name on the local agent.
Request
Set the display name:
curl -X POST http://localhost:8080/display-name/manage \
-H "Content-Type: application/json" \
-d '{"action": "set", "name": "gateway-us-east"}'
Get the current display name:
curl -X POST http://localhost:8080/display-name/manage \
-H "Content-Type: application/json" \
-d '{"action": "get"}'
Revert to the config value (set empty name):
curl -X POST http://localhost:8080/display-name/manage \
-H "Content-Type: application/json" \
-d '{"action": "set", "name": ""}'
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Action to perform: set or get |
name | string | For set | Display name to set (empty string reverts to config value) |
Response
Set Success (200):
{
"status": "ok",
"message": "display name set to \"gateway-us-east\"",
"name": "gateway-us-east"
}
Get Success (200):
{
"status": "ok",
"name": "gateway-us-east"
}
Bad Request (400):
{
"error": "unknown action foo (expected set or get)"
}
Forbidden (403):
display name management restricted: management key decryption unavailable
Service Unavailable (503):
display name management not configured
Behavior
When a display name is set:
- The name is stored in memory
- Route advertisements are triggered immediately
- Node info is re-advertised to peers
- The new name appears in dashboard, topology, and agent listings
When a display name is retrieved:
- Returns the current effective display name
- Priority: dynamic name > config name > short agent ID
Setting an empty name reverts to the configured agent.display_name value.
Dynamic display names:
- Are ephemeral (lost on agent restart)
- Override the config-file display name while set
- Are immediately propagated to all connected peers
POST /agents/{agent-id}/display-name/manage
Manage the display name on a remote agent.
Request
Set display name on remote agent:
curl -X POST http://localhost:8080/agents/abc123def456/display-name/manage \
-H "Content-Type: application/json" \
-d '{"action": "set", "name": "exit-eu-west"}'
Get display name from remote agent:
curl -X POST http://localhost:8080/agents/abc123def456/display-name/manage \
-H "Content-Type: application/json" \
-d '{"action": "get"}'
Request Body
Same as /display-name/manage.
Response
Same response formats as /display-name/manage.
The request is forwarded to the target agent via the mesh control channel. The response reflects the result from the remote agent.
Error Responses
Additional error cases for remote display name management:
Agent Not Found (404):
{
"error": "agent not found or not reachable"
}
Timeout (504):
{
"error": "request to remote agent timed out"
}
Error Responses
All endpoints may return:
| Status | Description |
|---|---|
| 400 | Invalid request body or parameters |
| 403 | Management key required but unavailable |
| 404 | Endpoint disabled (remote_api not enabled) or agent not found |
| 405 | Method not allowed (must be POST) |
| 503 | Display name management not configured |
| 504 | Remote request timeout (remote endpoint only) |
Display name management endpoints follow the same management key restrictions as route management. Agents with only management.public_key (field agents) cannot manage display names. Agents with both keys (operator nodes) can manage display names freely. If no management key is configured, display name management is unrestricted.
Dynamic display names set via the API are lost when the agent restarts. For persistent names, set agent.display_name in the configuration file.