Secrets like passwords and API keys cannot be documented in plain text.

But you can and should document everything around them.

In Document your secrets, I write about how to document your secrets in a developer team.

Alex Chan writes in How I use the notes field in my password manager how they document their personal passwords using the Notes field in the password manager to store extra information.