---
title: "Update the collaborators of a public secret incident"
method: PATCH
path: "/v1/public-incidents/secrets/{incident_id}/collaborators"
tags: ["Public Secret Incidents"]
---

# Update the collaborators of a public secret incident

`PATCH /v1/public-incidents/secrets/{incident_id}/collaborators`

## Request

- Base URL: `https://api.gitguardian.com`
- URL: `https://api.gitguardian.com/v1/public-incidents/secrets/{incident_id}/collaborators`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/gitguardian/apis/gitguardian-api/docs/v1/public-incidents/secrets/:incident_id/collaborators/patch.ts> (a function with typed inputs; its response is checked against the schema)

Add and remove workspace members in the collaborators of a public secret incident,
in one request.

The request changes only what differs from the current collaborators:
  - A member who is already a collaborator is not added again.
  - A member who is not a collaborator is not removed.
  - An id that is not a member of the workspace is ignored.
  - A member who is not active, who is a bot, or who cannot view the
    incident is not added.
  - A resolved or ignored incident does not change.

The response gives the collaborators after the change. Compare it with the
request to find the members that were not added.

The same member cannot be in `member_ids_to_add` and in
`member_ids_to_remove`.

If incident collaborators are not enabled for the workspace, a `404` is
returned.

**Prerequisites**:
  - A valid API key with the incidents:write scope.
  - Edit access on the incident.

## Path parameters

- `incident_id` integer, required

## Request body

- object
  - `member_ids_to_add` integer[]: Ids of the workspace members to add to the collaborators. The incident does not get a member who is not active, who is a bot, or who cannot view the incident.
  - `member_ids_to_remove` integer[]: Ids of the workspace members to remove from the collaborators.

## Response `200`

Collaborators of the public secret incident after the change.

- object
  - `member_ids` integer[], required: Ids of the workspace members who collaborate on the incident, sorted in ascending order.

## Other responses

- `400`: Invalid data
- `401`: Invalid API key
- `403`: Permission denied
- `404`: Resource not found
- `503`: API under maintenance

## Changes

- **2026-11-10** `5328c2f90004`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gitguardian/apis/gitguardian-api/changes/v1/public-incidents/secrets/:incident_id/collaborators/patch.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/a0deede13c19?raw)
