Skip to content
Get started

Patch Account By ID

client.V1.Accounts.PatchAccountByID(ctx, accountID, body) (*V1AccountPatchAccountByIDResponse, error)
PATCH/v1/accounts/{account_id}

Update account risk settings

ParametersExpand Collapse
accountID int64
body V1AccountPatchAccountByIDParams
Risk param.Field[RiskSettings]Optional

Risk settings for the account

ReturnsExpand Collapse
type V1AccountPatchAccountByIDResponse struct{…}
Risk RiskSettingsOptional

Risk settings for the account

MaxNotional stringOptional

The maximum notional value available to the account

Patch Account By ID

package main

import (
  "context"
  "fmt"

  "github.com/clear-street/clear-street-go"
  "github.com/clear-street/clear-street-go/option"
)

func main() {
  client := clearstreet.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.V1.Accounts.PatchAccountByID(
    context.TODO(),
    0,
    clearstreet.V1AccountPatchAccountByIDParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{
  "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"
  }
}