> ## Documentation Index
> Fetch the complete documentation index at: https://www.edenai.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Map a group to a role

> Gives every member of a directory group a role, now and as the identity provider adds members. A member of several mapped groups gets the role of the group with the highest `priority`. A management key can only map roles limited to member management: roles granting organization or billing administration are refused (403), and so is a change that would let a member fall back to such a role through another mapped group. Returns the group; `members` is left out for a key without the `manage:read` scope. Requires the `manage:write` scope.



## OpenAPI

````yaml https://api.edenai.run/v2/info/splitted-schema/management_api/openapi.json put /v3/manage/groups/{external_group_id}/role/
openapi: 3.0.3
info:
  title: Organization Management
  version: '2.0'
  description: Your project description
servers:
  - url: https://api.edenai.run
security: []
paths:
  /v3/manage/groups/{external_group_id}/role/:
    put:
      tags:
        - Groups
      summary: Map a group to a role
      description: >-
        Gives every member of a directory group a role, now and as the identity
        provider adds members. A member of several mapped groups gets the role
        of the group with the highest `priority`. A management key can only map
        roles limited to member management: roles granting organization or
        billing administration are refused (403), and so is a change that would
        let a member fall back to such a role through another mapped group.
        Returns the group; `members` is left out for a key without the
        `manage:read` scope. Requires the `manage:write` scope.
      operationId: manage_groups_role_update
      parameters:
        - in: path
          name: external_group_id
          schema:
            type: string
          description: The group's id in your identity provider.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManageGroupRoleRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ManageGroupRoleRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ManageGroupRoleRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManageGroup'
          description: ''
      security:
        - ManagementKeyAuth: []
components:
  schemas:
    ManageGroupRoleRequest:
      type: object
      description: >-
        The role to give the group's members, by id, and the mapping's
        `priority` (0 or more,

        default 0): a member of several mapped groups gets the role of the
        highest priority one.
      properties:
        role_id:
          type: integer
        priority:
          type: integer
          minimum: 0
          default: 0
      required:
        - role_id
    ManageGroup:
      type: object
      description: >-
        A group synced from your identity provider. `external_group_id` is the
        group's id in the

        identity provider and the identifier used in
        `/manage/groups/{external_group_id}` URLs;

        `members` lists the emails of the group's active members. `mapped_role`
        is the role the group's

        members get, or null: a member of several mapped groups gets the role of
        the one with the

        highest `priority`.
      properties:
        external_group_id:
          type: string
          maxLength: 255
        name:
          type: string
          maxLength: 255
        members:
          type: array
          items:
            type: string
            format: email
          readOnly: true
        mapped_role:
          allOf:
            - $ref: '#/components/schemas/GroupMappedRole'
          nullable: true
          readOnly: true
      required:
        - external_group_id
        - mapped_role
        - members
        - name
    GroupMappedRole:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        priority:
          type: integer
      required:
        - id
        - name
        - priority
  securitySchemes:
    ManagementKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        A management key (created from the organization dashboard or with `POST
        /v3/manage/auth-keys`), sent as `Authorization: Bearer
        <management_key>`. Inference API keys (`sk-eden...`) are not accepted on
        these endpoints.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.