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

# canonicalize • AI Agent SDK

> canonicalize: Return the stable canonical id for a raw platform address.

# canonicalize

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**IdentityCanonicalizerProtocol**](../classes/IdentityCanonicalizerProtocol) class in the [**protocols**](../modules/protocols) module.

Return the stable canonical id for a raw platform address.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def canonicalize(platform: str, raw_user_id: str) -> str
```

## Parameters

<ParamField query="platform" type="str" required={true}>
  The platform name (e.g. `"whatsapp"`).
</ParamField>

<ParamField query="raw_user_id" type="str" required={true}>
  The raw address as delivered on the wire.
</ParamField>

### Returns

<ResponseField name="Returns" type="str">
  The reconciled canonical id, or `raw_user_id` unchanged when no
  reconciliation is known.
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L2110">
  `praisonaiagents/gateway/protocols.py` at line 2110
</Card>
