For the public APIs, there is no staging environment for testing. We suggest creating a separate app ID and developer/test account (if necessary) for your testing/automation purposes.
For the Ads API, a staging environment does exist. If you've been approved for an Ads API account, you should already have access. Per the Getting Started documentation:
The sandbox Advertising API is available at https://ads-api-sandbox.twitter.com. You can perform actions here on most Advertising API resources by replacing the host component of the URI to be executed. When making an initial request to GET accounts in the sandbox, an account record will be generated for you from which you can perform the remainder of your operations. Data within the sandbox is subject to occasional reset.The accounts, campaigns, and line items within the sandbox are unique to the “current user.”
Additionally, we have a couple of FAQ entries on the sandbox:
As a final note, the staging environment has an account delete endpoint. This allows you to "reset" or "clear" data from the staging environment, if you need to run repeatable testing/use cases accordingly.