> For the complete documentation index, see [llms.txt](https://docs.aquanow.io/cams/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aquanow.io/cams/api-reference/accounts.md).

# Accounts

## Get Accounts

> Retrieve a list of accounts with optional filtering and pagination.

```json
{"openapi":"3.0.3","info":{"title":"Aquanow CAMS REST API","version":"1.0"},"servers":[{"url":"https://cams.aquanow.com/api","description":"production"},{"url":"http://localhost:3001/api","description":"local"},{"url":"https://cams.dev.aquanow.com/api","description":"dev"},{"url":"https://cams.staging.aquanow.com/api","description":"staging"},{"url":"https://cams.cert.aquanow.com/api","description":"cert"},{"url":"https://marketdata.aquanow.com","description":"production market data"},{"url":"https://marketdata.staging.aquanow.com","description":"staging market data"},{"url":"https://marketdata.dev.aquanow.com","description":"dev market data"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer"}},"schemas":{"AccountStatus":{"type":"string","enum":["ACTIVE","INACTIVE","CREATING"]},"AccountType":{"type":"string","enum":["CREDIT","CASH"]},"SortDirection":{"type":"string","enum":["ASC","DESC"]},"Datetime":{"title":"Datetime","type":"string","format":"date-time","description":"Date-time in ISO 8601 format"}}},"paths":{"/v1/accounts":{"get":{"summary":"Get Accounts","description":"Retrieve a list of accounts with optional filtering and pagination.","tags":["Accounts"],"parameters":[{"name":"accountStatus","in":"query","schema":{"$ref":"#/components/schemas/AccountStatus"},"description":"Filter accunts by status"},{"name":"accountType","in":"query","schema":{"$ref":"#/components/schemas/AccountType"},"description":"Filter account by type"},{"name":"createDateStart","in":"query","schema":{"type":"string","format":"date-time"},"description":"Filter account by creation date lower bound, exclusive"},{"name":"createDateEnd","in":"query","schema":{"type":"string","format":"date-time"},"description":"Filter accounts by creation date upper bound, inclusive"},{"name":"recentCreditHistory","in":"query","schema":{"type":"string","enum":["YES"]}},{"name":"customerId","in":"query","schema":{"type":"string","format":"uuid"},"description":"Filter accounts by customer ID"},{"name":"after","in":"query","required":false,"schema":{"type":"string"},"description":"When provided, specifies the last item returned in previous page, used to fetch the next page. Fetches the first page when omitted."},{"name":"limit","in":"query","required":false,"schema":{"type":"string","format":"integer"},"description":"When provided, specifies the number of items to return in the page. Uses default page size of 10 when omitted."},{"name":"sortField","in":"query","required":false,"schema":{"type":"string","enum":["accountStatus","accountType","createdDate"]},"description":"Will sort the returned data using the specified field."},{"name":"sortDirection","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortDirection"},"description":"Specifies the sort direction for the sortField."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"after":{"type":"string","description":"The token of the last item in the response","nullable":true},"totalCount":{"type":"integer","description":"The total number of items in the entire filtered data set"},"items":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"accountStatus":{"$ref":"#/components/schemas/AccountStatus"},"accountType":{"$ref":"#/components/schemas/AccountType"},"createDate":{"type":"string","format":"date-time"},"credit":{"type":"object","properties":{"creditCurrency":{"type":"string"},"creditLimit":{"type":"string","format":"number"},"utilizedCredit":{"type":"string","format":"number"},"unutilizedCredit":{"type":"string","format":"number"}}},"assets":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string"},"tradeBalance":{"type":"string","format":"number","description":"The balance with which the customer can trade"},"custodyBalance":{"type":"string","format":"number","description":"The balance which the provider is holding on behalf of the customer"},"pendingSettlement":{"type":"string","format":"number","description":"The balance which is pending settlement"},"open":{"type":"string","format":"number","description":"The balance which is currently in open orders or transactions"},"availableToWithdraw":{"type":"string","format":"number","description":"The balance which is available to withdraw"}}}},"recentCreditHistory":{"type":"array","items":{"type":"object","properties":{"creditLimitRequested":{"type":"string","format":"number"},"newCreditLimit":{"type":"string","format":"number"},"action":{"type":"string","enum":["INCREASE","DECREASE","SET"]},"updatedAt":{"$ref":"#/components/schemas/Datetime"}}}}}}}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not Found"}},"operationId":"GetAllAccounts"}}}}
```

## Create Account

> Creates a new trading account for an active, onboarded customer using the tenant default account type (CASH or CREDIT).

```json
{"openapi":"3.0.3","info":{"title":"Aquanow CAMS REST API","version":"1.0"},"servers":[{"url":"https://cams.aquanow.com/api","description":"production"},{"url":"http://localhost:3001/api","description":"local"},{"url":"https://cams.dev.aquanow.com/api","description":"dev"},{"url":"https://cams.staging.aquanow.com/api","description":"staging"},{"url":"https://cams.cert.aquanow.com/api","description":"cert"},{"url":"https://marketdata.aquanow.com","description":"production market data"},{"url":"https://marketdata.staging.aquanow.com","description":"staging market data"},{"url":"https://marketdata.dev.aquanow.com","description":"dev market data"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer"}},"parameters":{"X-Request-Id":{"name":"X-Request-Id","in":"header","required":false,"schema":{"type":"string"},"description":"A client-supplied unique identifier for this request, used for safely retrying and deduplicating operations. When the same X-Request-Id is sent with multiple identical requests within a defined time window, the server treats them as the same logical operation and will not perform the side effect more than once. Instead, it will return the original result associated with that identifier, if available. The client should generate a collision-resistant value (for example, a UUID) and reuse it only when retrying the same operation."}},"headers":{"X-Request-Id":{"description":"Unique identifier for this request. If the client supplied X-Request-Id, the same value is returned.","schema":{"type":"string"}}},"schemas":{"AccountStatus":{"type":"string","enum":["ACTIVE","INACTIVE","CREATING"]},"AccountType":{"type":"string","enum":["CREDIT","CASH"]}},"responses":{"400":{"description":"Validation Error"},"401":{"description":"Unauthorized"},"403":{"description":"Insufficient Privileges"},"409":{"description":"Duplicate request error","content":{"application/json":{"schema":{"properties":{"id":{"type":"string"}}}}}},"4XX":{"description":"Client error"},"5XX":{"description":"Server error"}}},"paths":{"/v1/accounts":{"post":{"summary":"Create Account","description":"Creates a new trading account for an active, onboarded customer using the tenant default account type (CASH or CREDIT).","tags":["Accounts"],"parameters":[{"$ref":"#/components/parameters/X-Request-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"type":"string","format":"uuid","description":"Customer to attach the new account to"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid"},"accountStatus":{"$ref":"#/components/schemas/AccountStatus"},"accountType":{"$ref":"#/components/schemas/AccountType"},"credit":{"type":"object","properties":{"creditCurrency":{"type":"string"},"creditLimit":{"type":"string","format":"number"},"utilizedCredit":{"type":"string","format":"number"},"unutilizedCredit":{"type":"string","format":"number"}}},"assets":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string"},"tradeBalance":{"type":"string","format":"number","description":"The balance with which the customer can trade"},"custodyBalance":{"type":"string","format":"number","description":"The balance which the provider is holding on behalf of the customer"},"pendingSettlement":{"type":"string","format":"number","description":"The balance which is pending settlement"},"open":{"type":"string","format":"number","description":"The balance which is currently in open orders or transactions"},"availableToWithdraw":{"type":"string","format":"number","description":"The balance which is available to withdraw"}}}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"409":{"$ref":"#/components/responses/409"},"4XX":{"$ref":"#/components/responses/4XX"},"5XX":{"$ref":"#/components/responses/5XX"}},"operationId":"CreateAccount"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aquanow.io/cams/api-reference/accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
