---
title: "Update Group Mappings"
method: PUT
path: "/v1/group-mappings/"
tags: ["Group Mappings"]
deprecated: true
---

# Update Group Mappings

`PUT /v1/group-mappings/`

## Request

- Base URL: `https://logfire-api.pydantic.dev/api`
- URL: `https://logfire-api.pydantic.dev/api/v1/group-mappings/`
- Auth: OAuth 2
  - Authorization code: `api/oauth/authorize`
  - Token URL: `/api/oauth/token` scopes: `instance:admin`
- TypeScript: <https://skmtc.dev/pydantic/apis/pydantic-logfire-api/docs/v1/group-mappings/put.ts> (a function with typed inputs; its response is checked against the schema)

> **Deprecated.**

Replace the complete authoritative group-access mapping (self-hosted admin only).

Organizations and projects referenced by the mapping become managed by identity-provider
groups. On each user's next sign-in, memberships and roles in those scopes are reconciled
against their current provider groups, so existing manual access may be changed or removed.

Membership in a user's own personal organization is never removed. Organizations and projects
not referenced by the mapping are left unchanged, and only projects explicitly listed in
`project_roles` are managed. Removing a scope from the mapping stops managing it but does not
restore access changed or removed by an earlier reconciliation. When multiple matching groups
grant roles in the same scope, the most permissive mapped role is applied.

Every `organization_name` and `project_name` in the payload must correspond to an existing
record, and every `group_id` must be unique; otherwise a 400 is returned. A 409 is returned
when an environment-configured mapping overrides API-managed mappings.

## Request body

- GroupOrganizationMappingUpdate
  - `group_organization_mapping` GroupOrganizationMapping[], required
    - `group_id` string, required
    - `organization_roles` OrganizationRoleDefinition[], required
      - `organization_name` string, required
      - `role` string, required
      - `project_roles` ProjectRoleDefinition[]
        - `project_name` string, required
        - `role` string, required

## Response `200`

Successful Response

- GroupOrganizationMappingRead
  - `group_organization_mapping` GroupOrganizationMapping[], required
    - `group_id` string, required
    - `organization_roles` OrganizationRoleDefinition[], required
      - `organization_name` string, required
      - `role` string, required
      - `project_roles` ProjectRoleDefinition[]
        - `project_name` string, required
        - `role` string, required

## Other responses

- `400`: The mapping is invalid
- `409`: An environment-configured mapping overrides API-managed mappings
- `422`: Validation Error
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/pydantic/apis/pydantic-logfire-api.md) - [All operations](https://skmtc.dev/pydantic/apis/pydantic-logfire-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pydantic/apis/pydantic-logfire-api/revisions/7996e45256f4?raw)
