> ## Documentation Index
> Fetch the complete documentation index at: https://cantonfoundation-reference-history-contracts.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Parties external generate topology

<div class="x2mdx-ref-page x2mdx-ref-page--operation x2mdx-ref-page--manual-api" />

<div class="x2mdx-ref-hero">
  <p class="x2mdx-ref-eyebrow">JSON Ledger API</p>

  <h1 class="x2mdx-ref-title">Parties external generate topology</h1>

  <div class="x2mdx-ref-badges">
    <span class="x2mdx-ref-badge x2mdx-ref-badge--protocol">OpenAPI</span>

    <span class="x2mdx-ref-badge x2mdx-ref-badge--added">Since 3.4</span>

    <span class="x2mdx-ref-badge x2mdx-ref-badge--changed">Changed 3.5</span>
  </div>
</div>

You may use this endpoint to generate the common external topology transactions which can be signed externally and uploaded as part of the allocate party process Note that this request will create a normal namespace using the same key for the identity as for signing. More elaborate schemes such as multi-signature or decentralized parties require you to construct the topology transactions yourself.

## Protocol Details

<dl class="x2mdx-ref-meta-grid">
  <div class="x2mdx-ref-meta-item">
    <dt>Operation ID</dt>
    <dd>postV2PartiesExternalGenerate-topology</dd>
  </div>

  <div class="x2mdx-ref-meta-item">
    <dt>Authentication</dt>
    <dd>Bearer token</dd>
  </div>

  <div class="x2mdx-ref-meta-item">
    <dt>Published</dt>
    <dd>3.5</dd>
  </div>
</dl>

## Inputs

### Request body

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ParamField body="synchronizer" type="string" required>
  Synchronizer-id for which we are building this request. Required
</ParamField>

<ParamField body="partyHint" type="string" required>
  The actual party id will be constructed from this hint and a fingerprint of the public key Required
</ParamField>

<ParamField body="publicKey" type="object" required>
  OpenAPI type: `SigningPublicKey`.

  *
</ParamField>

<ParamField body="localParticipantObservationOnly" type="boolean">
  If true, then the local participant will only be observing, not confirming. Default false. Optional
</ParamField>

<ParamField body="otherConfirmingParticipantUids" type="string[]">
  Other participant ids which should be confirming for this party Optional: can be empty
</ParamField>

<ParamField body="confirmationThreshold" type="number">
  OpenAPI type: `integer (int32)`.

  Confirmation threshold >= 1 for the party. Defaults to all available confirmers (or if set to 0). Optional
</ParamField>

<ParamField body="observingParticipantUids" type="string[]">
  Other observing participant ids for this party Optional: can be empty
</ParamField>

## Outputs

### 200

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="partyId" type="string" required>
  The generated party id Required
</ResponseField>

<ResponseField name="publicKeyFingerprint" type="string" required>
  The fingerprint of the supplied public key Required
</ResponseField>

<ResponseField name="topologyTransactions" type="string[]" required>
  The serialized topology transactions which need to be signed and submitted as part of the allocate party process Note that the serialization includes the versioning information. Therefore, the transaction here is serialized as an `UntypedVersionedMessage` which in turn contains the serialized `TopologyTransaction` in the version supported by the synchronizer. Required: must be non-empty
</ResponseField>

<ResponseField name="multiHash" type="string" required>
  the multi-hash which may be signed instead of each individual transaction Required: must be non-empty
</ResponseField>

### 400

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">text/plain</span>
</div>

<ResponseField name="value" type="string" required>
  *
</ResponseField>

### default

<div class="x2mdx-ref-badges">
  <span class="x2mdx-ref-badge x2mdx-ref-badge--neutral">application/json</span>
</div>

<ResponseField name="code" type="string" required>
  *
</ResponseField>

<ResponseField name="cause" type="string" required>
  *
</ResponseField>

<ResponseField name="correlationId" type="string">
  *
</ResponseField>

<ResponseField name="traceId" type="string">
  *
</ResponseField>

<ResponseField name="context" type="Map_String" required>
  *
</ResponseField>

<ResponseField name="resources" type="Tuple2_String_String[]">
  *
</ResponseField>

<ResponseField name="errorCategory" type="integer (int32)" required>
  *
</ResponseField>

<ResponseField name="grpcCodeValue" type="integer (int32)">
  *
</ResponseField>

<ResponseField name="retryInfo" type="string">
  *
</ResponseField>

<ResponseField name="definiteAnswer" type="boolean">
  *
</ResponseField>

## History

<div class="x2mdx-ref-history" aria-label="Reference history">
  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--changed">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Changed</span>
      <code class="x2mdx-ref-history-event-version">3.5</code>
    </div>

    <p class="x2mdx-ref-history-event-detail">The POST /v2/parties/external/generate-topology operation changed in this snapshot.</p>
  </div>

  <div class="x2mdx-ref-history-event x2mdx-ref-history-event--introduced">
    <div class="x2mdx-ref-history-event-head">
      <span class="x2mdx-ref-history-event-label">Introduced</span>
      <code class="x2mdx-ref-history-event-version">3.4</code>
    </div>
  </div>
</div>

<RequestExample>
  ```bash Request theme={null}
  curl --request POST \
    --url 'http://localhost:7575/v2/parties/external/generate-topology' \
    --header 'Authorization: Bearer $TOKEN' \
    --header 'Content-Type: application/json' \
    --data '{"synchronizer":"string","partyHint":"string","publicKey":{"format":"CRYPTO_KEY_FORMAT_DER_X509_SUBJECT_PUBLIC_KEY_INFO","keyData":"string","keySpec":"SIGNING_KEY_SPEC_EC_CURVE25519"},"localParticipantObservationOnly":false,"otherConfirmingParticipantUids":["string"],"confirmationThreshold":0,"observingParticipantUids":["string"]}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 response theme={null}
  {
    "partyId": "string",
    "publicKeyFingerprint": "string",
    "topologyTransactions": [
      "string"
    ],
    "multiHash": "string"
  }
  ```

  ```json default response theme={null}
  {
    "code": "string",
    "cause": "string",
    "correlationId": "string",
    "traceId": "string",
    "context": {},
    "resources": [
      [
        "string"
      ]
    ],
    "errorCategory": 0,
    "grpcCodeValue": 0,
    "retryInfo": "string",
    "definiteAnswer": false
  }
  ```
</ResponseExample>
