---
title: "Replace the owners of an identity"
method: PUT
path: "/v1/nhi/identities/{identity_id}/owners/update"
tags: ["NHI Identity Owners"]
---

# Replace the owners of an identity

`PUT /v1/nhi/identities/{identity_id}/owners/update`

## Request

- Base URL: `https://api.gitguardian.com`
- URL: `https://api.gitguardian.com/v1/nhi/identities/{identity_id}/owners/update`
- Auth: HTTP bearer

Replace the owners of a non-human identity with the given list.
Owners not in the list are removed, and missing owners are added.
An empty list removes all the owners of the identity.

An identity can have at most 5 owners.

The API token must have the Manager access level or above, or be a service account token.

## Path parameters

- `identity_id` integer, required

## Request body

- object
  - `owners` object[], required
    - `email` string, email, required

## Response `200`

Owners were replaced.

- object
  - `owners` object[], required
    - `id` integer, required: Id of the owner. Use it to remove the owner from the identity.
    - `email` string, email, required
    - `user_id` integer, nullable: Id of the GitGuardian user linked to this owner. It is set only when the email belonged to an active workspace member when the owner was added. It is a user id, not a member id.
    - `state` 'suggested' | 'manually_added', required: - `suggested`: GitGuardian suggests this owner. - `manually_added`: a user or an API call added this owner.
    - `confidence` number, float, required: Confidence of the ownership, between 0 and 1.
    - `rule` string, nullable: Rule that suggested this owner.
    - `evidence` object, nullable: Data that supports the suggestion.

## Other responses

- `400`: Invalid data, or the identity would exceed the maximum number of owners
- `401`: Invalid API key
- `403`: Permission denied
- `404`: Identity not found
- `503`: API under maintenance

## Changes

- **2026-10-14** `a5ca8c876a75`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gitguardian/apis/gitguardian-api/changes/v1/nhi/identities/:identity_id/owners/update/put.md)

---

[API](https://skmtc.dev/gitguardian/apis/gitguardian-api.md) - [All operations](https://skmtc.dev/gitguardian/apis/gitguardian-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitguardian/apis/gitguardian-api/revisions/5829df7b9045?raw)
