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

# Back up the client's wallet

> Creates backup shares for the wallet. After storing the backup shares,
confirm storage with the Client API's update backup share pairs statuses
endpoint before attempting to recover.




## OpenAPI

````yaml /openapi/enclave-mpc-api.yaml post /v1/backup
openapi: 3.1.0
info:
  title: Portal Enclave MPC API
  version: '1.0'
  description: |
    The Enclave MPC API provides endpoints for MPC wallet generation, signing,
    backup, and recovery. All endpoints require a Client API Key or Client
    Session Token as a Bearer token.

    ## Base URL
    `https://mpc-client.portalhq.io`
servers:
  - url: https://mpc-client.portalhq.io
security:
  - bearerAuth: []
tags:
  - name: MPC Operations
    description: MPC wallet generation, signing, asset transfers, backup, and recovery
paths:
  /v1/backup:
    post:
      tags:
        - MPC Operations
      summary: Back up the client's wallet
      description: |
        Creates backup shares for the wallet. After storing the backup shares,
        confirm storage with the Client API's update backup share pairs statuses
        endpoint before attempting to recover.
      operationId: backup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BackupRequest'
            example:
              generateResponse: >-
                {"SECP256K1":{"share":"share","id":"shareId"},"ED25519":{"share":"share","id":"shareId"}}
      responses:
        '200':
          description: Backup created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MpcShareResponse'
              example:
                SECP256K1:
                  share: eyJjbGl...
                  id: clu32l6c8008wuvz52jokyo3r
                ED25519:
                  share: eyJjbGl...
                  id: clu32l9310087evz5u5v9k1ao
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MpcErrorResponse'
              example:
                id: BAD_REQUEST
                message: Can't parse the request body
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                type: string
              example: Authorization header is missing
components:
  schemas:
    BackupRequest:
      type: object
      description: Request body for backing up a wallet.
      properties:
        generateResponse:
          type: string
          description: |
            JSON-stringified response body from the generate endpoint.
      required:
        - generateResponse
    MpcShareResponse:
      type: object
      description: MPC shares for both supported curves.
      properties:
        SECP256K1:
          $ref: '#/components/schemas/MpcShare'
        ED25519:
          $ref: '#/components/schemas/MpcShare'
      required:
        - SECP256K1
        - ED25519
    MpcErrorResponse:
      type: object
      description: Standard error response from the Enclave MPC API.
      properties:
        id:
          type: string
          description: >-
            Short error identifier (e.g. `DKG_FAILED`, `BAD_REQUEST`,
            `RPC_OP_FAILED`).
        message:
          type: string
          description: Human-readable error details.
      required:
        - id
    MpcShare:
      type: object
      description: An MPC share for a single curve.
      properties:
        share:
          type: string
          description: The MPC share data (base64-encoded).
        id:
          type: string
          description: Unique identifier for this share.
      required:
        - share
        - id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Client API Key or Client Session Token

````