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

# Master endpoints

> Contracts for listing, provisioning, registering, retrieving, and updating PAMM Masters.

## List Masters

`GET /api/v1/master/directory`

| Query parameter | Type | Required | Description |
| - | - | - | - |
| `engine` | enum | No | Defaults to `ALL`; explicitly send `PAMM` for this integration. |
| `page` | integer | No | Defaults to `1`; minimum `1`. Used with `engine=PAMM`. |
| `limit` | integer | No | Defaults to `50`; range `1..100`. |
| `search` | string | No | Searches login, name, or strategy name. |
| `search_by` | enum | No | `login` or `name`; omitted means both. |
| `sort_by` | enum | No | Defaults to `created_at`. Also accepts `id`, `mt5_login`, `name`, `investors_count`, `payment_account_login`, `min_deposit`. |
| `sort_dir` | enum | No | `asc` or `desc`; defaults to `desc`. |
| `branch_id` | integer | No | Filters by the account owner's branch. |
| `metatrader_account_product_id` | integer | No | Filters by account product, when configured. |
| `cursor` | string | No | Opaque cursor for `engine=ALL` only; not PAMM page pagination. |

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://pamm-api.example.com/api/v1/master/directory?engine=PAMM&limit=50" \
  -H "Authorization: Bearer YOUR_CRM_API_KEY"
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "items": [
    {
      "engine": "PAMM",
      "id": 375,
      "mt5_login": "146512",
      "name": "Momentum Weekly",
      "strategy_name": "Momentum",
      "strategy": "Trend-following strategy",
      "investors_count": 12,
      "payment_account_login": "146513",
      "min_deposit": "500",
      "default_perf_fee": "0.300000",
      "created_at": "2026-07-20T19:57:46.590732"
    }
  ],
  "next_cursor": null,
  "has_more": false,
  "total": 1,
  "page": 1
}
```

Use `id` with the single-Master `GET` and `PATCH` routes.

### Directory response fields

| Field | Type | Meaning |
| - | - | - |
| `items` | array | Master records on this page. |
| `items[].engine` | string | `PAMM` for this workflow. |
| `items[].id` | integer | Internal Master ID; not the MT5 login. |
| `items[].mt5_login` | string | Trading account login. |
| `items[].name`, `strategy_name`, `strategy` | string or null | Alias, short strategy name, and description. |
| `items[].investors_count` | integer | Active Investor count. |
| `items[].payment_account_login` | string | Separate fee recipient account. |
| `items[].min_deposit` | decimal or null | Minimum subscription capital; parse as a decimal. |
| `items[].default_perf_fee` | decimal | Default fee fraction; `0.30` means 30%. |
| `items[].created_at` | datetime | Master registration time. |
| `items[].branch_id`, `branch_name` | integer or null, string or null | Owner branch metadata, when available. |
| `total` | integer or null | Total matching Masters. |
| `page` | integer or null | Current page for `engine=PAMM`. |
| `has_more` | boolean | Whether another page exists. |
| `next_cursor` | string or null | Cursor for `ALL`; normally null for PAMM. |

## Register existing accounts

`POST /api/v1/master/add`

| Body field | Type | Required | Description |
| - | - | - | - |
| `mt5_login` | string | Yes | Existing Master trading login. |
| `name` | string | No | Visible strategy name. |
| `strategy_name` | string | No | Short commercial strategy name. |
| `strategy` | string | No | Strategy description. |
| `payment_account_login` | string | Yes | Separate existing login that receives fees. |
| `min_deposit` | string | Yes | Minimum subscription amount in USD. |
| `default_perf_fee` | decimal | Send explicitly | Fraction `0..1`; `0.30` means 30%. Legacy deployments allow omission and use `0`; strict deployments require it. |

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "mt5_login": "146512",
  "name": "Momentum Weekly",
  "strategy_name": "Momentum",
  "strategy": "Trend-following strategy",
  "payment_account_login": "146513",
  "min_deposit": "500",
  "default_perf_fee": "0.30"
}
```

The API rejects an already registered trading login, a payment account equal to the Master login, or a payment account already assigned elsewhere.

## Create a new Master

`POST /api/v1/master/create`

| Body field | Type | Required | Description |
| - | - | - | - |
| `first_name` | string | Yes | MT5 holder first name. |
| `last_name` | string | Yes | MT5 holder last name. |
| `name` | string | Yes | Master alias. |
| `username` | email | Yes | Email associated with MT5 provisioning. |
| `platform_group` | string | Yes | Broker-agreed Master MT5 group. |
| `leverage` | string | No | Defaults to `100`. |
| `min_deposit` | string | Yes | Minimum Investor balance required for assignment. |
| `default_perf_fee` | decimal | Send explicitly | Fraction `0..1`; use `"0.30"` for 30%, not `30`. Omission can result in zero fees on legacy deployments. |
| `strategy_name` | string | No | Short strategy name. |
| `strategy` | string | No | Strategy description. |

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "first_name": "Laura",
  "last_name": "Gomez",
  "name": "Momentum Weekly",
  "username": "laura.gomez@example.com",
  "platform_group": "<MT5_MASTER_GROUP>",
  "leverage": "100",
  "min_deposit": "500",
  "default_perf_fee": "0.30",
  "strategy_name": "Momentum",
  "strategy": "Trend-following strategy"
}
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": 375,
  "mt5_login": "146512",
  "name": "Momentum Weekly",
  "strategy_name": "Momentum",
  "strategy": "Trend-following strategy",
  "created_at": "2026-07-20T19:57:46.590732",
  "default_perf_fee": "0.300000",
  "password": "<MT5_MAIN_PASSWORD>",
  "investor_password": "<MT5_INVESTOR_PASSWORD>",
  "payment_account_login": "146513"
}
```

The payment account is created in the payment group configured by ExuraCopy; its group is not part of this request.

> [!WARNING]
>
> Always send `default_perf_fee` on both `/master/create` and `/master/add`. Some deployed versions default a missing value to zero; newer strict versions reject omission. Neither the alias nor the strategy name configures a fee.

### Master response fields

`/master/add`, `GET /master/{master_id}`, and `PATCH /master/{master_id}` return `id`, `mt5_login`, `name`, `strategy_name`, `strategy`, `default_perf_fee`, and `created_at` with the meanings above.

The `/master/create` response additionally contains:

| Field | Type | Meaning |
| - | - | - |
| `payment_account_login` | string | New fee recipient account login. |
| `password` | string | New trading account's main password; secret. |
| `investor_password` | string | Trading account's read-only password; secret. |

Creation does not return `min_deposit` in this response model. Read it through the directory or sensitive information route when verification is needed.

## Retrieve by internal ID

`GET /api/v1/master/{master_id}`

`master_id` is the numeric internal PAMM ID, not the MT5 login.

| Path parameter | Type | Required | Meaning |
| - | - | - | - |
| `master_id` | integer | Yes | `id` returned by Master registration, creation, or directory. |

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://pamm-api.example.com/api/v1/master/375" \
  -H "Authorization: Bearer YOUR_CRM_API_KEY"
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": 375,
  "mt5_login": "146512",
  "name": "Momentum Weekly",
  "strategy_name": "Momentum",
  "strategy": "Trend-following strategy",
  "default_perf_fee": "0.300000",
  "created_at": "2026-07-20T19:57:46.590732"
}
```

## Update a Master

`PATCH /api/v1/master/{master_id}`

Send at least one of the fields below. Omitted fields keep their current value.

| Body field | Type | Required | Behavior |
| - | - | - | - |
| `name` | string or null | No | Master alias; null clears it. |
| `strategy_name` | string or null | No | Short strategy name; null clears it. |
| `strategy` | string or null | No | Strategy description; null clears it. |
| `min_deposit` | integer or null | No | New minimum for future assignments; null clears the minimum and assignment treats it as zero. |
| `default_perf_fee` | decimal | No | Fraction `0..1`; null is rejected. Does not update existing Investor settings. |

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "name": "Momentum Weekly v2",
  "min_deposit": 750,
  "default_perf_fee": "0.30"
}
```

Changing `min_deposit` affects later assignment validation and does not credit or debit existing balances.

Changing `default_perf_fee` affects later assignment inheritance only. To change an existing Investor, use `POST /api/v1/investor/perf-fee/update`, then verify the Investor's configuration.

## Retrieve sensitive Master details

`GET /api/v1/info/master/{master_login}`

| Path parameter | Type | Required | Meaning |
| - | - | - | - |
| `master_login` | string | Yes | Trading account MT5 login, not the payment login or internal ID. |

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": 375,
  "mt5_login": "146512",
  "name": "Momentum Weekly",
  "mt5_password": "<MT5_MAIN_PASSWORD>",
  "mt5_investor_password": "<MT5_INVESTOR_PASSWORD>",
  "strategy_name": "Momentum",
  "strategy": "Trend-following strategy",
  "payment_account_login": "146513",
  "min_deposit": 500,
  "default_perf_fee": "0.300000",
  "created_at": "2026-07-20T19:57:46.590732",
  "investors_count": 12
}
```

### Sensitive response fields

The response includes the common Master fields plus `payment_account_login`, `min_deposit`, `investors_count`, and:

| Field | Type | Meaning |
| - | - | - |
| `engine`, `type` | string | `PAMM` and `MASTER`. |
| `mt5_password`, `mt5_investor_password` | string or null | Stored MT5 credentials; secrets. |
| `default_perf_fee` | decimal | Current Master default, not proof of an Investor's effective fee. |
| `leaderboard_visibility` | boolean | Current listing visibility. |
| `branch_ids` | string or null | Configured external branch IDs. |
| `metatrader_account_product_id` | integer or null | Linked account product, if any. |
| `user_id` | integer or null | Linked platform owner, if any. |
| `deposit_request_required`, `withdrawal_request_required` | boolean | Platform approval requirements for funding requests. |
| `subscription_request_required`, `unsubscription_request_required` | boolean | Platform approval requirements for relationship requests. |

Platform metadata returned by this route is not a promise that the same fields belong to the external CRM create/update contract.

### Endpoint errors

Invalid fee fractions return `422`. Missing Masters return `404`. Registering duplicate or conflicting logins is rejected. An MT5 provisioning failure can return `500`; reconcile created accounts before repeating creation.

> [!WARNING]
>
> This response contains MT5 secrets. Restrict it to authorized backend and administrative processes and exclude the body from logs.

> [card] [Previous: Endpoint index](https://pamm-api.exuratech.com/reference/endpoint-index.md)
>
> Return to the route catalog.

> [card] [Next: Investor endpoints](https://pamm-api.exuratech.com/reference/investors.md)
>
> Open Investor provisioning contracts.


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