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

# Upsert General Role Restriction

> Create or update a restriction for an account group general role in your
organization. Only available for organizations that have role restrictions
enabled and only performable by organization admins.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/sgp/openapi.yml put /v4/account-groups/general-role-restrictions/{role}
openapi: 3.1.0
info:
  title: EGP API V4
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
tags:
  - name: Models
    description: Model API.
paths:
  /v4/account-groups/general-role-restrictions/{role}:
    put:
      tags:
        - account groups
      summary: Upsert General Role Restriction
      description: >-
        Create or update a restriction for an account group general role in your

        organization. Only available for organizations that have role
        restrictions

        enabled and only performable by organization admins.
      operationId: PUT-V4-/account-groups/general-role-restrictions/{role}
      parameters:
        - name: role
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/AccountGroupGeneralRole'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleRestriction'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AccountGroupGeneralRole:
      type: string
      enum:
        - admin
      title: AccountGroupGeneralRole
    RoleRestriction:
      properties:
        restriction_type:
          $ref: '#/components/schemas/RoleRestrictionType'
          description: The type of restriction
        restriction:
          $ref: '#/components/schemas/UserGroupRoleRestriction'
          description: The restriction (currently only user group restrictions)
      type: object
      required:
        - restriction_type
        - restriction
      title: RoleRestriction
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RoleRestrictionType:
      type: string
      enum:
        - user_group
      title: RoleRestrictionType
    UserGroupRoleRestriction:
      properties:
        group_ids:
          items:
            type: string
          type: array
          title: Group Ids
          description: A list of groups for which users must be in at least one of
      type: object
      required:
        - group_ids
      title: UserGroupRoleRestriction
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````