## MedplumClient.pushToAgent() method

Pushes a message to an agent.

**Signature:**

```typescript
pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string, waitForResponse?: boolean, options?: PushToAgentOptions): Promise<any>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| agent | Agent \| Reference<Agent> | The agent to push to. |
| destination | Device \| Reference<Device> \| string | The destination device. |
| body | any | The message body. |
| contentType | string | _(Optional)_ Optional message content type. |
| waitForResponse | boolean | _(Optional)_ Optional wait for response flag. |
| options | [PushToAgentOptions](/content/docs/sdk/core.pushtoagentoptions) | _(Optional)_ Optional fetch options. |

**Returns:**

Promise<any>

Promise to the result. If waiting for response, the result is the response body. Otherwise, it is an operation outcome.

- [MedplumClient.pushToAgent() method](/content/docs/sdk/core.medplumclient.pushtoagent#medplumclientpushtoagent-method/index.html)
- [Parameters](/content/docs/sdk/core.pushtoagent#parameters/index.html)
