Financial documents access - API - sometime it comes back with XBLR sometimes PDF

How are you requesting this? What URL? What “Accept” http header are you sending, if any? Are you using a live application or the test / sandbox?

See the posts on this thread relating to how to find out what data formats are available for a given filing, and how to then request the one you want.