Skip to content
Get started

Patch Account By ID

AccountPatchAccountByIdResponse v1().accounts().patchAccountById(AccountPatchAccountByIdParamsparams = AccountPatchAccountByIdParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
PATCH/v1/accounts/{account_id}

Update account risk settings

ParametersExpand Collapse
AccountPatchAccountByIdParams params
Optional<Long> accountId
Optional<RiskSettings> risk

Risk settings for the account

ReturnsExpand Collapse
class AccountPatchAccountByIdResponse:
Optional<RiskSettings> risk

Risk settings for the account

Optional<String> maxNotional

The maximum notional value available to the account

Patch Account By ID

package com.clear_street.api.example;

import com.clear_street.api.client.ClearStreetClient;
import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams;
import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        AccountPatchAccountByIdResponse response = client.v1().accounts().patchAccountById(0L);
    }
}
{
  "data": {
    "risk": {
      "max_notional": "5000000.00"
    }
  },
  "error": null,
  "metadata": {
    "request_id": "c8f3e4a5-b2c3-5d4e-9f0a-6b7c8d9e0f1a"
  }
}
{
  "error": {
    "code": 400,
    "message": "Failed to parse the request body as JSON: EOF while parsing an object at line 5 column 3"
  },
  "metadata": {
    "request_id": "5805829b-238e-4669-846b-d768bc5d279c"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
{
  "error": {
    "code": 404,
    "message": "Some requested entity was not found"
  },
  "metadata": {
    "request_id": "67e95eb4-93b9-4010-8c9b-7ada7c2be93f"
  }
}
Returns Examples
{
  "data": {
    "risk": {
      "max_notional": "5000000.00"
    }
  },
  "error": null,
  "metadata": {
    "request_id": "c8f3e4a5-b2c3-5d4e-9f0a-6b7c8d9e0f1a"
  }
}
{
  "error": {
    "code": 400,
    "message": "Failed to parse the request body as JSON: EOF while parsing an object at line 5 column 3"
  },
  "metadata": {
    "request_id": "5805829b-238e-4669-846b-d768bc5d279c"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
{
  "error": {
    "code": 404,
    "message": "Some requested entity was not found"
  },
  "metadata": {
    "request_id": "67e95eb4-93b9-4010-8c9b-7ada7c2be93f"
  }
}