> Solana Developer Platform docs, served as Markdown. The [docs index](https://platform.solana.com/docs.md) lists every page and [llms.txt](https://platform.solana.com/docs/ai/llms.txt) the key ones; [SKILL.md](https://platform.solana.com/SKILL.md) has the rules for building on SDP.

# Get counterparty field options

Returns the enum option sets and country list needed to build a counterparty form.

`GET /v1/counterparties/metadata`

Requires an [API key](/docs/developing-with-sdp/authentication) with the `counterparties.read` action.

## Headers

- **`x-project-id`** · `string` · min length 1 · example `prj_example`

  Required for dashboard sessions. API keys use their assigned project.

## Responses

- **`200`** Counterparty field options

  - **`data`** · `object` · required

    Field option sets for building a counterparty form: closed enums plus the country list.

    - **`fields`** · `object` · required

      - **`entityTypes`** · `string[]` · required · each one of `individual`, `business`

      - **`countries`** · `object[]` · required

        - **`code`** · `string` · required · example `US`

          ISO 3166-1 alpha-2 code.

        - **`name`** · `string` · required · example `United States`

          English display name.

  - **`meta`** · `object` · required

    Response metadata.

    - **`requestId`** · `string` · required · min length 1 · example `req_example`

      Request identifier for tracing.

    - **`timestamp`** · `string` · required · format `date-time` · example `2025-01-01T00:00:00.000Z`

      ISO 8601 timestamp.

- **`401`** Unauthorized

  - **`error`** · `object` · required

    Standard error payload.

    - **`code`** · `string` · required

      Machine-readable error code.

    - **`message`** · `string` · required

      Human-readable error message.

    - **`details`** · `object`

      Optional error details for debugging.

      - **`*`** · `any`

  - **`meta`** · `object`

    - **`requestId`** · `string` · min length 1 · example `req_example`

      Request identifier for tracing.

- **`403`** Forbidden. Requires the `counterparties.read` action: an API key must hold it (a module's `manage` or `execute` also covers its `read`), and a signed-in member's organization role must include it. Without it the error is INSUFFICIENT_PERMISSIONS and `error.details.action` names the action. Any other 403 names its own reason.

  Same fields as `401`.

- **`500`** Internal Server Error

  Same fields as `401`.

## Example request

```bash tab="cURL"
curl 'https://api.solana.com/v1/counterparties/metadata' \
  -H "Authorization: Bearer $SDP_API_KEY"
```

```ts tab="TypeScript"
const res = await fetch("https://api.solana.com/v1/counterparties/metadata", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.SDP_API_KEY}`
  }
});
```

```python tab="Python"
import os, requests

r = requests.get("https://api.solana.com/v1/counterparties/metadata",
  headers={"Authorization": f"Bearer {os.environ['SDP_API_KEY']}"})
```

## Example responses

```json tab="200"
{
  "data": {
    "fields": {
      "entityTypes": [
        "individual"
      ],
      "countries": [
        {
          "code": "US",
          "name": "United States"
        }
      ]
    }
  },
  "meta": {
    "requestId": "req_example",
    "timestamp": "2025-01-01T00:00:00.000Z"
  }
}
```

```json tab="403"
{
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Missing action: counterparties.read",
    "details": {
      "action": "counterparties.read"
    }
  },
  "meta": {
    "requestId": "req_example"
  }
}
```

Error responses use the [standard error shape](/docs/reference/conventions/errors).
