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

# Set vault role

> **Manager Function**: Unified endpoint for setting vault roles. 
    
    **Supported roles:**
    - **manager**: Updates the manager address (requires current Manager role)
    - **emergency-manager**: Updates the emergency manager address (requires Manager role)  
    - **rebalance-manager**: Updates the rebalance manager address (requires Manager role)
    - **fee-receiver**: Updates the fee receiver address (requires Manager or current fee receiver role)
    
    The role parameter in the URL determines which role will be updated.



## OpenAPI

````yaml POST /vault/{address}/set/{role}
openapi: 3.0.0
info:
  title: DeFindex API
  description: API documentation for DeFindex endpoints
  version: 1.0.0
  contact: {}
  x-logo:
    url: https://links.paltalabs.io/defindex-full.svg
    backgroundColor: '#0e0e0e'
    altText: DeFindex Logo
    href: https://defindex.io
servers: []
security: []
tags: []
paths:
  /vault/{address}/set/{role}:
    post:
      tags:
        - Vault
      summary: Set vault role
      description: |-
        **Manager Function**: Unified endpoint for setting vault roles. 
            
            **Supported roles:**
            - **manager**: Updates the manager address (requires current Manager role)
            - **emergency-manager**: Updates the emergency manager address (requires Manager role)  
            - **rebalance-manager**: Updates the rebalance manager address (requires Manager role)
            - **fee-receiver**: Updates the fee receiver address (requires Manager or current fee receiver role)
            
            The role parameter in the URL determines which role will be updated.
      operationId: VaultController_setRole
      parameters:
        - name: address
          required: true
          in: path
          description: Stellar address of the vault contract
          schema:
            example: CBNKCU3HGFKHFOF7JTGXQCNKE3G3DXS5RDBQUKQMIIECYKXPIOUGB2S3
            type: string
        - name: role
          required: true
          in: path
          schema:
            type: string
        - name: network
          required: true
          in: query
          description: Stellar network to execute the transaction on (testnet or mainnet)
          schema:
            enum:
              - testnet
              - mainnet
            type: string
      requestBody:
        required: true
        description: >-
          Role setting parameters. The role to set is determined by the URL path
          parameter.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetRoleDto'
            examples:
              Set manager:
                value:
                  new_address: GACKTN5DAZGWXRWB2WLM6OPBDHAMT6SJNGLJZPQMEZBUR4JUGBX2UK7V
                  caller: GB7NTQG4EXB7NZEA5GNFHIHEQVTGQTZ6OWKWUD535FBEHNSEVCKZULIY
              Set emergency manager:
                value:
                  new_address: GACKTN5DAZGWXRWB2WLM6OPBDHAMT6SJNGLJZPQMEZBUR4JUGBX2UK7V
                  caller: GB7NTQG4EXB7NZEA5GNFHIHEQVTGQTZ6OWKWUD535FBEHNSEVCKZULIY
      responses:
        '200':
          description: Transaction prepared successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  xdr:
                    type: string
                    description: Base64 encoded transaction XDR ready for signing
                  simulationResponse:
                    type: object
                    description: Simulation result of the transaction
                  functionName:
                    type: string
                    description: Function name for the operation
                  params:
                    type: object
                    description: Parameters used for the operation
        '400':
          description: Bad request - invalid parameters
        '403':
          description: Forbidden - caller is not authorized for this operation
components:
  schemas:
    SetRoleDto:
      type: object
      properties:
        new_address:
          type: string
          description: >-
            Stellar address of the new role holder. Must be a valid Stellar
            public key.
          example: GB7NTQG4EXB7NZEA5GNFHIHEQVTGQTZ6OWKWUD535FBEHNSEVCKZULIY
        caller:
          type: string
          description: >-
            Stellar address of the user initiating the change. Must be a valid
            Stellar public key with appropriate permissions.
          example: GB7NTQG4EXB7NZEA5GNFHIHEQVTGQTZ6OWKWUD535FBEHNSEVCKZULIY
      required:
        - new_address
        - caller

````

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