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

# Set Role Permissions

> Replace all permissions for a role. Full replacement semantics in a single transaction.



## OpenAPI

````yaml https://config.heyhumm.ai/api/openapi.json put /api/organization/{organization_id}/role/{role_id}/permission
openapi: 3.1.0
info:
  title: Configuration API
  description: >-
    API for managing configuration and queues for various services. This service
    consolidates the API functionality previously provided by dd_rag_api and
    code_rag_api.
  version: 1.0.0
servers:
  - url: https://config.heyhumm.ai
security: []
paths:
  /api/organization/{organization_id}/role/{role_id}/permission:
    put:
      tags:
        - Roles
      summary: Set Role Permissions
      description: >-
        Replace all permissions for a role. Full replacement semantics in a
        single transaction.
      operationId: >-
        set_role_permissions_api_organization__organization_id__role__role_id__permission_put
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Organization Id
        - name: role_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Role Id
        - name: resource_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Resource Id
        - name: source_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Source Id
        - name: integration_source_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Integration Source Id
        - name: data_source_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Data Source Id
        - name: context_source_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Context Source Id
        - name: job_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Job Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RolePermissionSetRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RolePermissionResponse'
                title: >-
                  Response Set Role Permissions Api Organization  Organization
                  Id  Role  Role Id  Permission Put
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    RolePermissionSetRequest:
      properties:
        permissions:
          items:
            $ref: '#/components/schemas/RolePermissionCreate'
          type: array
          title: Permissions
      type: object
      required:
        - permissions
      title: RolePermissionSetRequest
      description: Full replacement semantics for PUT .../role/{id}/permission
    RolePermissionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        role_id:
          type: string
          format: uuid
          title: Role Id
        resource_type:
          type: string
          title: Resource Type
        action:
          type: string
          title: Action
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - role_id
        - resource_type
        - action
        - created_at
      title: RolePermissionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RolePermissionCreate:
      properties:
        resource_type:
          $ref: '#/components/schemas/FGAResourceType'
        action:
          $ref: '#/components/schemas/FGAAction'
      type: object
      required:
        - resource_type
        - action
      title: RolePermissionCreate
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    FGAResourceType:
      type: string
      enum:
        - organization
        - integration_source
        - ontology
        - analysis
        - report
        - memory
        - command
        - thread
        - command_schedule
        - context_source
        - procedure
        - golden_task
        - billing_account
        - role
        - database
        - schema
        - table
        - column
        - saas_object
        - saas_field
        - saas_association
      title: FGAResourceType
      description: >-
        Extended resource types for FGA permissions. Superset of
        permissions.ResourceType.
    FGAAction:
      type: string
      enum:
        - create
        - read
        - update
        - delete
      title: FGAAction
      description: >-
        CRUD actions for permissions.


        Note: CREATE permission implies UPDATE and DELETE permissions.

        If a user can create a resource, they should be able to modify and
        delete it.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````