Is it possible to determine if a directory exists using the api

Using the get file api i can determine if a file exists, but it seems to always return a 404 when checking if a directory exists. Is there a way to determine if a directory exists using the api?