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

# Execute a transaction

> Executes a transaction that has reached the required threshold.



## OpenAPI

````yaml /openapi.yaml post /transactions/{txId}/execute
openapi: 3.1.0
info:
  title: Den API
  version: 2.0.0
  description: >
    API for managing wallets with Den. This API provides programmatic access to
    all platform capabilities

    including wallet accounts, members, groups, policies, and transactions.


    ## Authentication

    All API requests require authentication via Bearer token in the
    Authorization header.


    ## Idempotency

    All mutation requests (POST, PUT, DELETE) require an X-Idempotency-Key
    header for safe retries.


    ## Two Transaction Types

    - **Account Transactions**: Value movement and contract interactions
    (governed by policies)

    - **Organization Operations**: Governance/admin changes (governed by admin
    threshold)
servers:
  - url: https://api.onchainden.com/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Members
    description: Manage organization members
  - name: Groups
    description: Manage member groups
  - name: Policies
    description: Manage transaction policies
  - name: Accounts
    description: Manage wallet accounts
  - name: Transactions
    description: Create and execute account transactions
  - name: Admins
    description: Manage admin configuration
  - name: AuditLogs
    description: View audit log entries
paths:
  /transactions/{txId}/execute:
    post:
      tags:
        - Transactions
      summary: Execute a transaction
      description: Executes a transaction that has reached the required threshold.
      operationId: executeTransaction
      parameters:
        - name: txId
          in: path
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteRequest'
      responses:
        '200':
          description: Transaction executed
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/AccountTransaction'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '426':
          $ref: '#/components/responses/UpgradeRequired'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      x-codeSamples:
        - lang: javascript
          label: SDK
          source: >
            const client = new DenClient({ apiKey: 'ck_live_...' });

            const { data: executed } = await client.executeTransaction('tx_456',
            {
              type: 'approve',
            });

            console.log(executed.executionStatus);
components:
  parameters:
    IdempotencyKey:
      name: X-Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        format: uuid
      description: Idempotency key for safely retrying mutation requests.
  schemas:
    ExecuteRequest:
      type: object
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/ExecuteType'
    AccountTransaction:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/TokenTransferTransaction'
          title: Token Transfer
        - allOf:
            - $ref: '#/components/schemas/ContractInteractionTransaction'
          title: Contract Interaction
      discriminator:
        propertyName: type
        mapping:
          TOKEN_TRANSFER:
            $ref: '#/components/schemas/TokenTransferTransaction'
          CONTRACT_INTERACTION:
            $ref: '#/components/schemas/ContractInteractionTransaction'
    ExecuteType:
      type: string
      enum:
        - approve
        - reject
      description: Which resolution to execute
    TokenTransferTransaction:
      allOf:
        - $ref: '#/components/schemas/AccountTransactionBase'
        - type: object
          required:
            - data
          properties:
            type:
              type: string
              const: TOKEN_TRANSFER
            data:
              $ref: '#/components/schemas/TokenTransferData'
    ContractInteractionTransaction:
      allOf:
        - $ref: '#/components/schemas/AccountTransactionBase'
        - type: object
          required:
            - data
          properties:
            type:
              type: string
              const: CONTRACT_INTERACTION
            data:
              $ref: '#/components/schemas/ContractInteractionData'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorObject'
    AccountTransactionBase:
      type: object
      required:
        - id
        - accountId
        - policy
        - type
        - signatureData
        - executionStatus
        - approvals
        - rejections
        - createdAt
        - expiresAt
      properties:
        id:
          type: string
          example: tx_123
        accountId:
          type: string
          example: acc_123
        policy:
          $ref: '#/components/schemas/PolicySummary'
        type:
          $ref: '#/components/schemas/TransactionType'
        signatureData:
          $ref: '#/components/schemas/AccountTransactionSignatureData'
          description: Signature workflow state and currently available payloads
        executionStatus:
          $ref: '#/components/schemas/ExecutionStatus'
        approvals:
          type: array
          items:
            $ref: '#/components/schemas/MemberSummary'
        rejections:
          type: array
          items:
            $ref: '#/components/schemas/MemberSummary'
        createdAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp for when the transaction expires
          example: '2026-01-25T00:00:00Z'
    TokenTransferData:
      type: object
      required:
        - destination
        - asset
        - rawAmount
        - displayAmount
        - networkId
      properties:
        destination:
          type: string
          description: Recipient address (checksummed)
          pattern: ^0x[a-fA-F0-9]{40}$
          example: 0xdef...
        asset:
          $ref: '#/components/schemas/Asset'
        rawAmount:
          type: string
          description: Amount in token's smallest unit (wei)
          example: '1000000000'
        displayAmount:
          type: string
          description: Human-readable display amount (decimal-adjusted)
          example: '1000.00'
        networkId:
          $ref: '#/components/schemas/NetworkId'
    ContractInteractionData:
      type: object
      required:
        - toAddress
        - calldata
        - networkId
        - value
      properties:
        toAddress:
          type: string
          description: Contract address
          pattern: ^0x[a-fA-F0-9]{40}$
          example: 0xContractAddress...
        calldata:
          type: string
          description: Encoded transaction calldata (always present)
          example: 0x095ea7b3...
        functionName:
          type: string
          description: Decoded function name (if decodable)
          example: approve
        functionParameters:
          type: array
          items:
            $ref: '#/components/schemas/FunctionParameter'
          description: Decoded function parameters (if decodable)
        networkId:
          $ref: '#/components/schemas/NetworkId'
        value:
          type: string
          description: Wei value for native token transfer (usually "0")
          example: '0'
    ErrorObject:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: Human-readable error message
        details:
          $ref: '#/components/schemas/ErrorDetails'
    PolicySummary:
      type: object
      required:
        - id
        - threshold
      properties:
        id:
          type: string
          description: Policy ID used for this transaction
          example: pol_123
        threshold:
          type: integer
          description: Signature threshold defined by the policy
          example: 2
    TransactionType:
      type: string
      enum:
        - TOKEN_TRANSFER
        - CONTRACT_INTERACTION
    AccountTransactionSignatureData:
      description: Signature workflow data and currently available signing payloads.
      oneOf:
        - $ref: '#/components/schemas/AccountTransactionPendingInitiatorSignatureData'
        - $ref: '#/components/schemas/AccountTransactionPendingReviewSignaturesData'
        - $ref: '#/components/schemas/AccountTransactionApprovalReadySignatureData'
        - $ref: '#/components/schemas/AccountTransactionRejectionReadySignatureData'
        - $ref: >-
            #/components/schemas/AccountTransactionApprovalAndRejectionReadySignatureData
        - $ref: '#/components/schemas/AccountTransactionExpiredSignatureData'
      discriminator:
        propertyName: status
        mapping:
          pendingInitiatorSignature:
            $ref: >-
              #/components/schemas/AccountTransactionPendingInitiatorSignatureData
          pendingReviewSignatures:
            $ref: '#/components/schemas/AccountTransactionPendingReviewSignaturesData'
          approvalReady:
            $ref: '#/components/schemas/AccountTransactionApprovalReadySignatureData'
          rejectionReady:
            $ref: '#/components/schemas/AccountTransactionRejectionReadySignatureData'
          approvalAndRejectionReady:
            $ref: >-
              #/components/schemas/AccountTransactionApprovalAndRejectionReadySignatureData
          expired:
            $ref: '#/components/schemas/AccountTransactionExpiredSignatureData'
    ExecutionStatus:
      type: string
      nullable: true
      enum:
        - null
        - processing
        - completed
        - rejected
        - failed
        - blocked
      description: |
        Execution lifecycle state:
        - null: Not yet attempted
        - processing: Execution in progress
        - completed: Successfully executed
        - rejected: Successfully rejected
        - failed: Execution failed
        - blocked: Blocked by policy or constraint
    MemberSummary:
      type: object
      description: Abbreviated member info used in approvals/rejections arrays
      required:
        - id
        - name
        - type
        - walletAddress
      properties:
        id:
          type: string
          example: mem_123
        name:
          type: string
          example: Alice
        type:
          $ref: '#/components/schemas/MemberType'
        walletAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
    Asset:
      type: object
      required:
        - id
        - symbol
        - decimals
      properties:
        id:
          type: string
          example: usdc_1
        symbol:
          type: string
          description: Token symbol (e.g., ETH, USDC)
          example: USDC
        name:
          type: string
          description: Token name (e.g., Ether, USD Coin)
          example: USD Coin
        decimals:
          type: integer
          example: 6
        logoUrl:
          type: string
          format: uri
          example: https://assets.onchainden.com/tokens/usdc.png
        tokenAddress:
          type: string
          description: Contract address for ERC20 tokens
          pattern: ^0x[a-fA-F0-9]{40}$
          example: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
    NetworkId:
      type: integer
      example: 1
      description: Network chain ID
    FunctionParameter:
      type: object
      required:
        - name
        - type
        - value
      properties:
        name:
          type: string
          example: spender
        type:
          type: string
          example: address
        value:
          type: string
          example: 0xSpender...
    ErrorCode:
      type: string
      enum:
        - validationError
        - invalidSignature
        - unauthorized
        - forbidden
        - notFound
        - conflict
        - thresholdNotMet
        - proposalExpired
        - idempotencyConflict
        - upgradeRequired
        - rateLimited
        - internalError
      description: Machine-readable error codes
    ErrorDetails:
      type: object
      additionalProperties: true
      description: Additional error details (structure varies by error type)
      properties:
        field:
          type: string
          description: Field that caused the error (for validation errors)
        message:
          type: string
          description: Detailed message about the error
    AccountTransactionPendingInitiatorSignatureData:
      title: Pending Initiator Signature Data
      type: object
      required:
        - status
        - initiatorPayload
      properties:
        status:
          type: string
          const: pendingInitiatorSignature
        initiatorPayload:
          type: string
          description: Typed-data hash for the initiator signature
    AccountTransactionPendingReviewSignaturesData:
      title: Pending Review Signatures Data
      type: object
      required:
        - status
        - approvePayload
        - rejectPayload
      properties:
        status:
          type: string
          const: pendingReviewSignatures
        approvePayload:
          type: string
          description: Typed-data hash for approval signature
        rejectPayload:
          type: string
          description: Typed-data hash for rejection signature
    AccountTransactionApprovalReadySignatureData:
      title: Approval Ready Signature Data
      type: object
      required:
        - status
        - approvePayload
        - rejectPayload
      properties:
        status:
          type: string
          const: approvalReady
        approvePayload:
          type: string
          description: Payload for approval signature
        rejectPayload:
          type: string
          description: Payload for rejection signature
    AccountTransactionRejectionReadySignatureData:
      title: Rejection Ready Signature Data
      type: object
      required:
        - status
        - approvePayload
        - rejectPayload
      properties:
        status:
          type: string
          const: rejectionReady
        approvePayload:
          type: string
          description: Payload for approval signature
        rejectPayload:
          type: string
          description: Payload for rejection signature
    AccountTransactionApprovalAndRejectionReadySignatureData:
      title: Approval And Rejection Ready Signature Data
      type: object
      required:
        - status
        - approvePayload
        - rejectPayload
      properties:
        status:
          type: string
          const: approvalAndRejectionReady
        approvePayload:
          type: string
          description: Payload for approval signature
        rejectPayload:
          type: string
          description: Payload for rejection signature
    AccountTransactionExpiredSignatureData:
      title: Expired Signature Data
      type: object
      required:
        - status
      properties:
        status:
          type: string
          const: expired
    MemberType:
      type: string
      enum:
        - user
        - api
      description: Type of member (user for human members, api for bots)
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: validationError
              message: Validation failed
              details:
                field: name
                message: Name is required
    Unauthorized:
      description: API key is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid API key
    Forbidden:
      description: Not permitted for this action
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden
              message: Not permitted for this action
    Conflict:
      description: Resource already exists or proposal already queued
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: conflict
              message: Resource already exists
    UnprocessableEntity:
      description: >-
        Request cannot be processed due to proposal state or idempotency
        conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            thresholdNotMet:
              value:
                error:
                  code: thresholdNotMet
                  message: Threshold not reached
            proposalExpired:
              value:
                error:
                  code: proposalExpired
                  message: Proposal expired
            idempotencyConflict:
              value:
                error:
                  code: idempotencyConflict
                  message: Idempotency key used with different request body
    UpgradeRequired:
      description: HTTPS required; plain HTTP requests are rejected
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: upgradeRequired
              message: HTTPS required
    RateLimited:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rateLimited
              message: Too many requests
    InternalError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internalError
              message: Server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key authentication. Include your API key in the Authorization
        header.

````