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

# Update a role and its permissions



## OpenAPI

````yaml put /v1/roles/{id}
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/roles/{id}:
    put:
      tags:
        - Role
      summary: Update a role and its permissions
      operationId: role.update
      parameters:
        - name: id
          in: path
          required: true
          description: The role identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleUpdateRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/RoleResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error_code:
                    type: string
                    const: RESOURCE_NOT_FOUND
                  message:
                    type: string
                  errors:
                    type: 'null'
                  data:
                    type: 'null'
                required:
                  - success
                  - error_code
                  - message
                  - errors
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    RoleUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the role.
          maxLength: 255
        permissions:
          type: array
          description: >-
            An array of permission names assigned to the role. An empty array
            removes every permission.
          items:
            type: string
            description: The permission name.
            enum:
              - View:AuthenticationLog
              - View:ActivityLog
              - View:AIReport
              - Create:AIReport
              - Delete:AIReport
              - ViewAllAIReports:AIReport
              - Download:AIReport
              - View:AIReportSchedule
              - Create:AIReportSchedule
              - Update:AIReportSchedule
              - Delete:AIReportSchedule
              - View:AgentPrompt
              - Create:AgentPrompt
              - Update:AgentPrompt
              - Delete:AgentPrompt
              - PublishRevision:AgentPrompt
              - View:LlmTokenUsage
              - View:Appointment
              - Create:Appointment
              - Update:Appointment
              - Delete:Appointment
              - ViewAllAppointments:Appointment
              - BulkReschedule:Appointment
              - Cancel:Appointment
              - RevertCancel:Appointment
              - View:Holiday
              - Create:Holiday
              - Update:Holiday
              - Delete:Holiday
              - View:AppointmentReminder
              - Update:AppointmentReminder
              - Delete:AppointmentReminder
              - Approve:AppointmentReminder
              - Reject:AppointmentReminder
              - Send:AppointmentReminder
              - View:RescheduleBatchItem
              - View:ProformaInvoice
              - Download:ProformaInvoice
              - Pay:ProformaInvoice
              - View:BillingPayment
              - View:BillingUsage
              - View:TenantBillingSetting
              - Update:TenantBillingSetting
              - View:BillingQuotaPackage
              - Purchase:BillingQuotaPackage
              - View:ReferralCode
              - View:ChannelBlacklist
              - ViewAllChannelBlacklists:ChannelBlacklist
              - Create:ChannelBlacklist
              - Update:ChannelBlacklist
              - Delete:ChannelBlacklist
              - Unblock:ChannelBlacklist
              - View:MessageTemplate
              - Create:MessageTemplate
              - Update:MessageTemplate
              - Delete:MessageTemplate
              - View:Channel
              - Create:Channel
              - Update:Channel
              - Delete:Channel
              - QueryStatus:Channel
              - GenerateLink:Channel
              - CopyLink:Channel
              - View:FlexyChatFeedback
              - Update:FlexyChatFeedback
              - Delete:FlexyChatFeedback
              - View:Conversation
              - ViewAllConversations:Conversation
              - Create:Conversation
              - Archive:Conversation
              - Delete:Conversation
              - Export:Conversation
              - ManageTags:Conversation
              - ManageAiSuggestions:Conversation
              - ToggleAgent:Conversation
              - Send:Message
              - Update:Message
              - Delete:Message
              - View:QuickReply
              - Create:QuickReply
              - Update:QuickReply
              - Delete:QuickReply
              - View:Announcement
              - View:Note
              - ViewAllNotes:Note
              - Create:Note
              - Update:Note
              - Delete:Note
              - View:Occupation
              - Create:Occupation
              - Update:Occupation
              - Delete:Occupation
              - View:Tag
              - Create:Tag
              - Update:Tag
              - Delete:Tag
              - View:TenantInfo
              - Update:TenantInfo
              - View:DataErasureRequests
              - Create:DataErasureRequests
              - Cancel:DataErasureRequests
              - Retry:DataErasureRequests
              - CopyLink:DataErasureRequests
              - View:RecycleBin
              - Restore:RecycleBin
              - Purge:RecycleBin
              - View:Credit
              - Update:Credit
              - Delete:Credit
              - View:CreditUsage
              - View:Customer
              - ViewAllCustomers:Customer
              - Create:Customer
              - Update:Customer
              - Merge:Customer
              - Delete:Customer
              - View:CustomerIdentity
              - Create:CustomerIdentity
              - Update:CustomerIdentity
              - Delete:CustomerIdentity
              - View:CustomerForm
              - Update:CustomerForm
              - Delete:CustomerForm
              - FillOnBehalf:CustomerForm
              - Download:CustomerForm
              - View:FormTemplate
              - Create:FormTemplate
              - Update:FormTemplate
              - Delete:FormTemplate
              - GenerateLink:FormTemplate
              - View:Account
              - Create:Account
              - Update:Account
              - Delete:Account
              - View:AccountTransaction
              - Create:AccountTransaction
              - Update:AccountTransaction
              - Delete:AccountTransaction
              - View:CustomerTransaction
              - Create:CustomerTransaction
              - Update:CustomerTransaction
              - Delete:CustomerTransaction
              - View:CustomerBalances
              - Export:CustomerBalances
              - View:Assistant
              - Create:Assistant
              - Update:Assistant
              - Delete:Assistant
              - View:User
              - Create:User
              - Update:User
              - Delete:User
              - Invite:User
              - View:Client
              - Create:Client
              - Update:Client
              - Delete:Client
              - UpdateScopes:Client
              - Revoke:Client
              - Activate:Client
              - View:Imports
              - Update:ImportSource
              - Install:ImportSource
              - Uninstall:ImportSource
              - Start:ImportSource
              - Cancel:ImportSource
              - View:ImportJobDetails
              - View:Integrations
              - Create:Integration
              - Update:Integration
              - View:IntegrationConnection
              - Create:IntegrationConnection
              - Update:IntegrationConnection
              - Delete:IntegrationConnection
              - View:ProductBrand
              - Create:ProductBrand
              - Update:ProductBrand
              - Delete:ProductBrand
              - View:ProductCategory
              - Create:ProductCategory
              - Update:ProductCategory
              - Delete:ProductCategory
              - View:Product
              - Create:Product
              - Update:Product
              - Delete:Product
              - View:StockMovement
              - View:Warehouse
              - Create:Warehouse
              - Update:Warehouse
              - Delete:Warehouse
              - View:StockOverview
              - Create:StockMovement
              - Count:StockMovement
              - Transfer:StockMovement
              - Adjust:StockMovement
              - View:Invoice
              - Create:Invoice
              - Delete:Invoice
              - Cancel:Invoice
              - RevertCancel:Invoice
              - Send:Invoice
              - SendEmail:Invoice
              - Archive:Invoice
              - QueryStatus:Invoice
              - Download:Invoice
              - View:InvoiceAccount
              - Create:InvoiceAccount
              - Update:InvoiceAccount
              - Delete:InvoiceAccount
              - View:Lead
              - Create:Lead
              - Update:Lead
              - Delete:Lead
              - Convert:Lead
              - ViewAllLeads:Lead
              - Assign:Lead
              - AutoAssignLeads:Lead
              - ReceiveLeads:Lead
              - View:LeadReferenceSource
              - Create:LeadReferenceSource
              - Update:LeadReferenceSource
              - Delete:LeadReferenceSource
              - View:Pipeline
              - Create:Pipeline
              - Update:Pipeline
              - Delete:Pipeline
              - Activate:Pipeline
              - View:MailboxPage
              - View:Offer
              - Create:Offer
              - Update:Offer
              - Delete:Offer
              - Replicate:Offer
              - ViewAllOffers:Offer
              - Convert:Offer
              - View:OfferTemplate
              - Create:OfferTemplate
              - Update:OfferTemplate
              - Delete:OfferTemplate
              - View:PanelTicket
              - Create:PanelTicket
              - Update:PanelTicket
              - View:Role
              - Create:Role
              - Update:Role
              - Delete:Role
              - View:Sale
              - ViewAllSales:Sale
              - Create:Sale
              - Update:Sale
              - Delete:Sale
              - Pay:Sale
              - CreateDocument:Sale
              - DeductStock:Sale
              - Export:Sale
              - View:ProductSet
              - Create:ProductSet
              - Update:ProductSet
              - Delete:ProductSet
              - View:GeneralSettings
              - Update:GeneralSettings
              - View:AppointmentSettings
              - Update:AppointmentSettings
              - View:NotificationSettings
              - Update:NotificationSettings
              - View:ChatSettings
              - Update:ChatSettings
              - View:SupportSettings
              - Update:SupportSettings
              - View:AccountingSettings
              - Update:AccountingSettings
              - View:SalesSettings
              - Update:SalesSettings
              - Manage:SetupWizard
              - View:File
              - Create:File
              - Delete:File
              - Reorder:File
              - Download:File
              - View:Ticket
              - ViewAllTickets:Ticket
              - Create:Ticket
              - Update:Ticket
              - Delete:Ticket
              - View:Doctor
              - Create:Doctor
              - Update:Doctor
              - Delete:Doctor
              - View:Salesperson
              - Create:Salesperson
              - CreateUnavailablePeriod:Salesperson
              - Update:Salesperson
              - Delete:Salesperson
              - View:Treatment
              - Create:Treatment
              - Update:Treatment
              - Delete:Treatment
              - GenerateDescription:Treatment
              - View:TreatmentGroup
              - Create:TreatmentGroup
              - Update:TreatmentGroup
              - Delete:TreatmentGroup
              - View:Room
              - Create:Room
              - Update:Room
              - Delete:Room
      title: RoleUpdateRequest
    RoleResource:
      type: object
      properties:
        id:
          type: integer
        tenant_id:
          type:
            - integer
            - 'null'
        name:
          type: string
        is_system:
          type: boolean
        permissions_count:
          type: integer
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/PermissionResource'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - tenant_id
        - name
        - is_system
        - created_at
        - updated_at
      title: RoleResource
    PermissionResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
      title: PermissionResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

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