My agent says 'not authorized'
Almost always the wrong key, or the right key for the wrong publication.
Check which key it has
Publication keys (dp_…) work for one publication only. A key from another publication gets 'Not authorized for this publication'. The master key is needed for master-only tools.
Check the publication id
Copy the id from the dashboard URL: /dashboard/pubs/<id>. A typo here looks exactly like a key problem.
Check the key still exists
On Overview, open the Agent API keys panel. If the key was deleted or rotated, the agent needs the new one.
Do it now
Open your publication's API keys →