---
title: "Update Organization API Key Roles for One Project"
method: PATCH
path: "/api/atlas/v2/groups/{groupId}/apiKeys/{apiUserId}"
tags: ["Programmatic API Keys"]
---

# Update Organization API Key Roles for One Project

`PATCH /api/atlas/v2/groups/{groupId}/apiKeys/{apiUserId}`

Updates the roles of the organization API key that you specify for the project that you specify. You must specify at least one valid role for the project. The application removes any roles that you do not include in this request if they were previously set in the organization API key that you specify for the project.

## Path parameters

- `groupId` string, required
- `apiUserId` string, required

## Query parameters

- `pageNum` integer
- `itemsPerPage` integer
- `includeCount` boolean
- `pretty` boolean
- `envelope` boolean

## Response `200`

OK

## Other responses

- `400` — Bad Request.
- `401` — Unauthorized.
- `403` — Forbidden.
- `404` — Not Found.
- `429` — Too Many Requests.
- `500` — Internal Server Error.

---

[API](https://skmtc.dev/mongodb/apis/atlas-admin-api.md) · [All operations](https://skmtc.dev/mongodb/apis/atlas-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mongodb/atlas-admin-api/revisions/e37e8ef8429f/schema)
