> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talaria.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Update key agreement

> Update key agreement in a public Talaria DID document.

Update key agreement in a public Talaria DID document.

## Path parameters

<ParamField path="did" type="string" required>
  The DID to update.
</ParamField>

<ParamField path="keyAgreementId" type="string" required>
  The key-agreement ID.
</ParamField>

## Request body

<ParamField body="did" type="string" required>
  The DID to update. It must match the path.
</ParamField>

<ParamField body="action" type="string" required>
  The operation name. Use `UpdateKeyAgreement`.
</ParamField>

<ParamField body="key_agreement" type="object" required>
  The public key agreement value for this operation.
</ParamField>

<ParamField body="nonce" type="string" required>
  The request nonce.
</ParamField>

<ParamField body="valid_until" type="string" required>
  The authorization expiration time.
</ParamField>

<ParamField body="signer_key_id" type="string">
  The public signing-key identifier. Defaults to `root`.
</ParamField>

<ParamField body="canonical_payload" type="string" required>
  The payload supplied by a Talaria-compatible signer.
</ParamField>

<ParamField body="signature" type="string" required>
  The authorization signature.
</ParamField>

<RequestExample>
  ```bash Request theme={null}
  curl --request PUT \
    --url "https://directory.example.com/dids/did%3Atalaria%3A1111111111111111111111/document/key-agreements/did%3Atalaria%3A1111111111111111111111%23agreement" \
    --header "Content-Type: application/json" \
    --data '{
    "did": "did:talaria:1111111111111111111111",
    "action": "UpdateKeyAgreement",
    "key_agreement": {
      "id": "did:talaria:1111111111111111111111#agreement",
      "type": "Multikey",
      "controller": "did:talaria:1111111111111111111111",
      "publicKeyMultibase": "<new-public-key>"
    },
    "nonce": "<nonce>",
    "valid_until": "2026-07-16T12:05:00Z",
    "signer_key_id": "did:talaria:1111111111111111111111#root",
    "canonical_payload": "<payload>",
    "signature": "<signature>"
  }'
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 202 Response theme={null}
  {
    "status": "accepted",
    "did": "did:talaria:1111111111111111111111",
    "action": "UpdateKeyAgreement",
    "tx_hash": "<transaction-hash>",
    "message": "DID document modification submitted"
  }
  ```
</ResponseExample>

<Note>
  `202 Accepted` means the Directory accepted the request for processing. It does not confirm final settlement.
</Note>
