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

# Update a Tenant

> This endpoint updates the Tenant data.



## OpenAPI

````yaml openapi/stellar-disbursement-platform/bundled.yaml PATCH /tenants/{id}
openapi: 3.1.0
info:
  title: Stellar Disbursement Platform API
  version: 7.0.0
  summary: >-
    The Stellar Disbursement Platform (SDP) is a tool built for organizations to
    make bulk payments to a group of recipients over the Stellar network.
  description: >
    The Stellar Disbursement Platform (SDP) is a tool built for organizations to
    make bulk payments to a group of recipients over the Stellar network.


    This is an open-source project that is built on top of the Stellar network,
    and the code can be found on the following repositories:


    -
    [stellar/stellar-disbursement-platform-backend](https://github.com/stellar/stellar-disbursement-platform-backend):
    This repository contains the backend and infrastructure code for the Stellar
    Disbursement Platform.

    -
    [stellar/stellar-disbursement-platform-frontend](https://github.com/stellar/stellar-disbursement-platform-frontend):
    This repository contains the web frontend code for the Stellar Disbursement
    Platform.

    -
    [stellar/helm-charts](https://github.com/stellar/helm-charts/tree/main/charts/stellar-disbursement-platform):
    This repository contains the Helm chart for deploying the Stellar
    Disbursement Platform using Kubernetes.
  termsOfService: https://stellar.org/terms-of-service
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: ''
security: []
tags:
  - name: Admin
    x-displayName: Admin (Tenant Management)
    description: >-
      The Admin API oversees the management of tenants within the system,
      facilitating tasks such as provisioning new tenants, updating their
      information, and retrieving tenant data.
  - name: Authentication
    description: >-
      Authentication controls the log in/log out process for all SDP users, as
      well as the token refresh process. Authentication uses a JWT approach
      signed with an ES256 private key.
  - name: API Keys
    description: >-
      API Keys functionality allows to create access key with granular
      permissions and resource management.
  - name: Balances
    description: >-
      Endpoints related to balances. A balance is an amount of a particular
      asset held by an organization, tenant, or account.
  - name: Bridge Integration
    description: >
      Bridge integration endpoints for connecting organizations with Bridge
      services.


      **Integration Flow:**

      1. Organization opts into Bridge (OPTED_IN status)

      2. Complete KYC verification process via Bridge

      3. Create virtual account for USD deposits (READY_FOR_DEPOSIT status)

      4. Receive USD deposits that are automatically converted to USDC on
      Stellar


      **Status Description:**

      - NOT_ENABLED → Bridge service not configured

      - NOT_OPTED_IN → Organization hasn't opted in

      - OPTED_IN → Organization opted in, KYC link created

      - READY_FOR_DEPOSIT → Virtual account created, ready for deposits

      - ERROR → Integration error occurred
  - name: Disbursements
    description: >-
      Endpoints related to disbursements. A disbursement is a group of payments
      sent to multiple individuals at once. An SDP user with the appropriate
      role triggers a new disbursement through the SDP dashboard by uploading a
      list of receivers and amounts. When the receiver has linked their wallet
      to the SDP, the payment automatically begins. SDP users can track their
      disbursements in real-time through the SDP dashboard. Each disbursement
      must have a unique name defined by the organization.
  - name: Distribution Wallets
    description: >
      Endpoints related to distribution accounts (the Stellar accounts a tenant
      sends funds from). A tenant starts with a single account, created when the
      tenant is provisioned, which is marked as the default. Tenants using the
      `DISTRIBUTION_ACCOUNT.STELLAR.DB_VAULT` account type can hold up to 20,
      and Owners can add more at any time.


      Access to an account is granted per user and is separate from the user's
      role: both are required to act on an account. API keys need the
      `read:distribution_wallets` or `write:distribution_wallets` permission,
      and the Owner-only operations additionally require that the key was
      created by an Owner, so permissions alone are not sufficient. Accounts are
      archived rather than deleted, so past disbursements and payments keep
      pointing at the account that sent them.
  - name: Organization
    description: >-
      Organization endpoints manage the process of getting and updating
      organizational profile information. The organization's profile has basic
      information set at the time of SDP deployment. It can be modified by the
      Owner. Organizations can also manage their preferences, like which assets
      to use, through these endpoints.
  - name: Payments
    description: >-
      Endpoints related to payments. An SDP payment is an individual payment
      from an organization to a receiver. Each payment is part of a disbursement
      and occurs on the Stellar network. Granular payment status is stored in
      the SDP database and can be viewed in real-time on the SDP dashboard.
  - name: Profile
    description: >-
      Profiles endpoints manage the process of getting and updating individual
      profile information. Profile information is set when the account is
      created and can be updated by the user on the SDP dashboard Profile page.
      Note: profiles never refer to receivers of funds.
  - name: Receivers
    description: >
      Endpoints related to receivers. A receiver is an individual receiving a
      payment in a disbursement. The receiver is tracked by phone number to
      reduce the need for personally identifiable information. Each receiver
      must be unique within the disbursement.


      Each receiver will have at least one wallet associated with them. The
      wallet public key will remain null until the receiver registers with a
      wallet provider and links the wallet to the SDP through SEP-24. Receivers
      must verify their identity through that process, which requires the SDP to
      store verification information on receivers like date of birth, national
      ID number, or personal PIN. This information can be updated by the
      organization through the receiver endpoints.
  - name: Registration
    description: >
      The registration endpoints guide the process for a receiver to verify
      their identity and link their wallet address to an SDP. The registration
      process only needs to happen once per receiver to link their wallet. Only
      SDP-compatible wallet providers can facilitate the registration process.
      These endpoints must be supported and hit by the wallet providers after
      the receiver gets the initial invite. After the wallet address is
      successfully linked, the payment automatically begins.


      There are two parts to the registration flow. First, the wallet must
      authenticate and initiate a registration flow using the Anchor Platform
      Endpoints defined below. Note that these endpoints are hosted on a
      different host than the Stellar Disursement Platform.


      The second part of the registration flow is handled by the webview that is
      opened within the wallet application. This webview uses the endpoints
      defined in the Stellar Disbursement Platfrom Endpoints section to complete
      the registration process. The wallet application can chose not to use the
      webview and intstead integrate directly with the API.
  - name: Statistics
    description: >-
      Statistics endpoints return general aggregated data per organization, as
      well as disbursement-specific metrics. SDP users can use this data to
      monitor their disbursements over time.
  - name: Users
    description: >-
      The users endpoints facilitate the creation of new SDP users - including
      setting the appropriate role, sending an email invitation, and activating
      a user - and managing roles.
paths:
  /tenants/{id}:
    patch:
      tags:
        - Admin
      summary: Update a Tenant
      description: This endpoint updates the Tenant data.
      operationId: UpdateATenant
      parameters:
        - name: id
          in: path
          description: ID of the `Tenant`.
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        description: List of fields to update for the tenant
        content:
          '*/*':
            schema:
              type: object
              properties:
                base_url:
                  type: string
                  description: The SDP backend server's base URL.
                sdp_ui_base_url:
                  type: string
                  description: The SDP UI/dashboard Base URL.
                status:
                  type: string
                  enum:
                    - TENANT_CREATED
                    - TENANT_PROVISIONED
                    - TENANT_ACTIVATED
                    - TENANT_DEACTIVATED
        required: true
      responses:
        '200':
          description: Updated Tenant details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tenant'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Details about the error
                  extras:
                    type: object
                    properties: {}
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  extras:
                    type: object
                    properties:
                      status:
                        type: number
                      message:
                        type: string
                example:
                  error: Not authorized
                  extras:
                    status: 401
                    message: Not authorized
              example:
                error: Not authorized
                extras:
                  status: 401
                  message: Not authorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  extras:
                    type: object
                    properties:
                      status:
                        type: number
                      message:
                        type: string
              example:
                error: Not found
                extras:
                  status: 404
                  message: Resource not found
      security:
        - BasicAuth: []
components:
  schemas:
    Tenant:
      type: object
      properties:
        id:
          type: string
          example: 1736bed3-7b92-4760-8ff2-51fb08ee079f
        name:
          type: string
          description: The tenant name. It should match the pattern `^[a-z-]+$`.
          example: bluecorp
        base_url:
          type: string
          description: The SDP backend server's base URL.
          example: https://bluecorp-backend.sdp.org
        sdp_ui_base_url:
          type: string
          description: The SDP UI/dashboard Base URL.
          example: https://bluecorp.sdp.org
        status:
          type: string
          enum:
            - TENANT_CREATED
            - TENANT_PROVISIONED
            - TENANT_ACTIVATED
            - TENANT_DEACTIVATED
        distribution_account_address:
          type: string
          description: The Stellar account address used for distributing funds.
          example: GCXAJ3XJ3VK3JFH3QMDFOSKM2NMMZBSO3VIT6EUPQWSDW2J74M23RRSL
        distribution_account_type:
          type: string
          description: The Stellar account type used for distributing funds.
          enum:
            - DISTRIBUTION_ACCOUNT.STELLAR.ENV
            - DISTRIBUTION_ACCOUNT.STELLAR.DB_VAULT
            - DISTRIBUTION_ACCOUNT.CIRCLE.DB_VAULT
        distribution_account_status:
          type: string
          description: The status of the distribution account used for distributing funds.
          enum:
            - ACTIVE
            - PENDING_USER_ACTIVATION
        is_default:
          type: boolean
          description: Boolean flag that shows whether the tenant is the default or not.
          default: false
        created_at:
          type: string
          format: date-time
          example: '2024-03-27T17:21:51Z'
        updated_at:
          type: string
          format: date-time
          example: '2024-03-27T17:21:51Z'
        deleted_at:
          type: string
          description: The timestamp when the tenant was (soft) deleted.
          format: date-time
          example: '2024-03-27T17:21:51Z'
      required:
        - base_url
        - created_at
        - distribution_account_address
        - distribution_account_status
        - distribution_account_type
        - id
        - is_default
        - name
        - sdp_ui_base_url
        - status
        - updated_at
      example:
        id: 840dca45-d1df-44cd-83c1-65c04235c25f
        name: redcorp
        base_url: https://redcorp-backend.sdp.org
        sdp_ui_base_url: https://redcorp.sdp.org
        status: TENANT_PROVISIONED
        distribution_account: GCQVDMPOEN3HHJJ64V42KUTONOXN7C6V2PSVPALEVJ7PIYOB6M3DJV7N
        is_default: true
        created_at: '2024-03-27T17:21:51.000Z'
        updated_at: '2024-03-27T17:21:51.000Z'

````