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

# Create a Contract Call

> Submit an arbitrary contract call from a vault, such as EVM call data, an ICP canister call, a raw-signing message, or an Alephium method.

**POST** `/api/external/transactions/`

Use a contract call for arbitrary contract execution. These transactions can have chain-specific data requirements and may require approval before broadcast.

## Request body

<ParamField body="vaultId" type="string" required>
  Vault that signs and submits the call.
</ParamField>

<ParamField body="blockChain" type="string" required>
  Blockchain identifier.
</ParamField>

<ParamField body="amount" type="string">
  Decimal amount of native asset sent with the call.
</ParamField>

<ParamField body="category" type="string" required>
  Must be `"CONTRACT_CALL"`.
</ParamField>

<ParamField body="data" type="object">
  Chain-specific call payload. Use one of the following shapes.

  <Expandable title="Shapes">
    <ParamField body="EVM call data" type="{ callData: string; toAddress?: string }">
      Encoded call data and the target contract address.
    </ParamField>

    <ParamField body="ICP canister call" type="{ canisterId: string; method: string; arg: string }">
      Canister ID, method name, and encoded argument.
    </ParamField>

    <ParamField body="Raw signing" type="{ messageHex: string }">
      Hex-encoded message to sign.
    </ParamField>

    <ParamField body="Alephium method" type="{ method: string; params: Record<string, unknown> }">
      Method name and parameters.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="externalId" type="string">
  Client reference.
</ParamField>

<ParamField body="gasParams" type="object">
  Gas settings for the call.

  <Expandable title="Properties">
    <ParamField body="gasParams.feeTier" type="string">
      One of `HIGH`, `MEDIUM`, or `LOW`.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="creationOptions" type="object">
  Creation options.

  <Expandable title="Properties">
    <ParamField body="creationOptions.skipPreprocessSimulation" type="boolean">
      Set only when your integration has an explicit reason to bypass supported preprocessing or simulation.
    </ParamField>
  </Expandable>
</ParamField>

<Note>
  The SDK accepts `chain` and serializes it as `blockChain`. It injects `category: "CONTRACT_CALL"`.
</Note>

## Response

Returns the new [Transaction](/api-basics/data-models#transaction). Its `status` is the lifecycle source of truth.

<ResponseField name="id" type="string">
  Transaction ID. Use it with [Retrieve Transaction](/transactions/retrieve-transaction) to track status.
</ResponseField>

<ResponseField name="orgId" type="string">
  Organization that owns the transaction.
</ResponseField>

<ResponseField name="vaultId" type="string">
  Vault the transaction runs from.
</ResponseField>

<ResponseField name="status" type="string">
  Lifecycle status. Track it until `COMPLETED`, `FAILED`, or `DECLINED`. See [TransactionStatus](/api-basics/data-models#transactionstatus).
</ResponseField>

<ResponseField name="transactionType" type="string">
  See [TransactionType](/api-basics/data-models#transactiontype).
</ResponseField>

<ResponseField name="category" type="string">
  For example `TRANSFER` or `CONTRACT_CALL`. See [TransactionCategory](/api-basics/data-models#transactioncategory).
</ResponseField>

<ResponseField name="subCategory" type="string">
  See [TransactionSubCategory](/api-basics/data-models#transactionsubcategory).
</ResponseField>

<ResponseField name="createdAt" type="string">
  Creation timestamp (ISO 8601).
</ResponseField>

<ResponseField name="updatedAt" type="string">
  Last update timestamp (ISO 8601).
</ResponseField>

<ResponseField name="isDeleted" type="boolean">
  Whether the transaction is deleted.
</ResponseField>

<ResponseField name="externalId" type="string">
  Your own reference, if you set one.
</ResponseField>

<ResponseField name="source" type="TransferPartyData">
  Where the funds come from. Which fields are present depends on `type`. See [TransferPartyData](/api-basics/data-models#transferpartydata).

  <Expandable title="Properties">
    <ResponseField name="type" type="string">
      `VAULT`, `BANK_ACCOUNT`, `CONTACT`, `EXTERNAL_ADDRESS`, or `EXTERNAL_BANK_ACCOUNT`.
    </ResponseField>

    <ResponseField name="id" type="string">
      ID of the vault, bank account, or contact.
    </ResponseField>

    <ResponseField name="name" type="string">
      Display name.
    </ResponseField>

    <ResponseField name="address" type="string">
      Wallet address, for crypto parties.
    </ResponseField>

    <ResponseField name="chain" type="string">
      Blockchain, for crypto parties.
    </ResponseField>

    <ResponseField name="paymentRail" type="string">
      Payment rail, for bank parties, such as `ACH`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="blockChain" type="string">
  Chain the transaction runs on.
</ResponseField>

<ResponseField name="amount" type="string">
  Amount as a decimal string.
</ResponseField>

## Approve the transaction

New transactions return `status: "PENDING"` and wait for approval. [Get the approval message](/approvals/get-approval-message) for the transaction `id`, sign it with your API user's key, then [submit the approval](/approvals/submit-approval-action). See [Approvals](/approvals/overview).

With the SDK, call `approveChangeRequest({ entityId: transaction.id, action: "approve" })` after this call.

<RequestExample dropdown>
  ```json Request example theme={null}
  {
    "vaultId": "vault_123",
    "blockChain": "ETHEREUM",
    "amount": "0",
    "category": "CONTRACT_CALL",
    "data": {
      "callData": "0xa9059cbb000000000000000000000000...",
      "toAddress": "0xTokenContract1234567890abcdef"
    },
    "externalId": "contract-call-1001",
    "gasParams": {
      "feeTier": "MEDIUM"
    },
    "creationOptions": {
      "skipPreprocessSimulation": false
    }
  }
  ```

  ```bash cURL theme={null}
  # Sample only. Generate a new signed token for each request
  # (see Authentication). Tokens expire after 120 seconds.
  curl --request POST \
    --url "https://api.primevault.com/api/external/transactions/" \
    --header "Authorization: Bearer <signed JWT>" \
    --header "Api-Key: <API key>" \
    --header "Content-Type: application/json" \
    --data '{
      "vaultId": "vault_123",
      "blockChain": "ETHEREUM",
      "amount": "0",
      "category": "CONTRACT_CALL",
      "data": {
        "callData": "0xa9059cbb000000000000000000000000...",
        "toAddress": "0xTokenContract1234567890abcdef"
      },
      "externalId": "contract-call-1001",
      "gasParams": { "feeTier": "MEDIUM" },
      "creationOptions": { "skipPreprocessSimulation": false }
    }'
  ```

  ```typescript JavaScript SDK theme={null}
  const tx = await apiClient.createContractCallTransaction({
    vaultId: "vault_123",
    chain: "ETHEREUM",
    amount: "0",
    data: {
      callData: "0xa9059cbb000000000000000000000000...",
      toAddress: "0xTokenContract1234567890abcdef",
    },
    externalId: "contract-call-1001",
    gasParams: { feeTier: "MEDIUM" },
    creationOptions: { skipPreprocessSimulation: false },
  });
  console.log(tx.id, tx.status);
  ```
</RequestExample>

<ResponseExample dropdown>
  ```json Response example theme={null}
  {
    "id": "transaction_contract_123",
    "orgId": "org_456",
    "vaultId": "vault_123",
    "status": "PENDING",
    "transactionType": "OUTGOING",
    "category": "CONTRACT_CALL",
    "subCategory": "CONTRACT_CALL",
    "createdAt": "2026-08-04T11:00:00Z",
    "updatedAt": "2026-08-04T11:00:00Z",
    "isDeleted": false,
    "externalId": "contract-call-1001",
    "source": {
      "type": "VAULT",
      "id": "vault_123",
      "name": "Treasury Vault"
    },
    "blockChain": "ETHEREUM",
    "amount": "0"
  }
  ```

  ```typescript JavaScript SDK theme={null}
  interface Transaction {
    id: string;
    orgId: string;
    vaultId: string;
    status: TransactionStatus | string;
    transactionType: TransactionType | string;
    category: TransactionCategory | string;
    subCategory: TransactionSubCategory | string;
    createdAt: string;
    updatedAt: string;
    isDeleted: boolean;
    amount: string;

    txHash?: string;
    error?: string;
    externalId?: string;
    createdById?: string;
    fees?: Fees;
    memo?: string;
    txnSignature?: string;
    txnSignatureData?: Record<string, unknown>;
    output?: TransactionOutput;
    amountInUSD?: string;
    nonce?: number;
    dAppId?: string;
    source?: TransferPartyData;
    destination?: TransferPartyData;
    quoteResponse?: QuoteResponseItem;
    depositInstructions?: DepositInstructions;
    operations?: TransactionOperation[];
    balanceChanges?: TransactionOperationBalanceChanges | null;
    blockChain?: string;
    asset?: string;

    /** Deprecated: use destination.address. */
    toAddress?: string;
    /** Deprecated: use destination.name. */
    toAddressName?: string;
    /** Deprecated: use destination.id. */
    toVaultId?: string;
    /** Deprecated: use source.address. */
    sourceAddress?: string;
  }
  ```
</ResponseExample>


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