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

# Accessing Recordings

> Access call recordings from the webhook payload

## Handling Recording Format

Recordings will be sent to your webhooks in the key `recording_wav` as base64 string buffers.

Use `Buffer.from` to convert the base64 string into a writable buffer, like so:

```typescript theme={null}
router.post('/webhook', securityMiddleware, async (req: Request, res: Response) => {
  const payload: WebhookPayload = req.body as WebhookPayload;
  if (payload.type === "call") {
    const data: Call = payload.data as Call;
    if (data.recording_wav) {
      // convert base64 string to a buffer
      const recordingBuffer = Buffer.from(data.recording_wav, "base64");
      const fileName = `RECORDING-${Date.now()}.wav`;

      // write the file locally or upload to cloud
      await fs.writeFile(fileName, recordingBuffer);
      // await uploadFileToS3('recordings', fileName, recordingBuffer);
    }
  }
});
```

## Extra Server Middleware

Make sure to use the `express.json({ limit: '1gb' })` middleware on your server to allow incoming large payloads.

<CardGroup cols={2}>
  <Card title="Getting an API Key" icon="pen-to-square" href="/quickstart">
    Get your docs set up locally for easy development
  </Card>

  <Card title="Access your dashboard" icon="image" href="https://app.penciled.com">
    Preview your changes before you push to make sure they're perfect
  </Card>
</CardGroup>
