---
title: "Update a network agent"
method: PUT
path: "/agents/{id}"
tags: ["Network Agents"]
---

# Update a network agent

`PUT /agents/{id}`

## Request

- Base URL: `https://sg.deployhq.com`
- URL: `https://sg.deployhq.com/agents/{id}`
- Auth: HTTP basic

Updates the name of an existing network agent.

## Path parameters

- `id` string, required

## Request body

- AgentObject2
  - `agent` object, required
    - `name` string

## Response `200`

Success

- Agent
  - `id` integer
  - `created_at` string
  - `identifier` string
  - `name` string
  - `online` boolean
  - `revoked_at` string, nullable
  - `updated_at` string

## Other responses

- `401`: You are not authorized to access this resource. You need to authenticate yourself first.
- `403`: You are not allowed to access this resource. You do not have the necessary permissions.
- `404`: The requested resource could not be found.
- `422`: Unprocessable Entity
- `500`: An unexpected error occurred on the server. The server was unable to process the request.

---

[API](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation.md) · [All operations](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation/revisions/830264ae58be?raw)
