How to test API calls here in the documentation

The Asaas interactive documentation lets you test API calls directly in it! See the step by step below.

⚠️

Before testing

Requests run in this documentation are sent to the Sandbox (https://api-sandbox.asaas.com/v3).

Use an API key created in the Sandbox. A Production key is not valid in this environment and will result in 401 Unauthorized.

Create your Sandbox account and generate an API key for testing.

Each endpoint in the API Reference has an interactive console. With it, you fill in the parameters, send the request to the Sandbox, and see the API response without leaving the documentation.

1. Choose the endpoint

In the side menu, select the endpoint you want to test, for example List customers.

The page shows the method, the URL, the operation description, and the accepted parameters.

2. Provide your API key

In the panel on the right, under Credentials, fill in the access_token field with your Sandbox API key.

The key remains available for the next requests while you browse the documentation.

Learn how to configure authentication

3. Fill in the parameters

Provide the request parameters in the fields on the page:

  • Path Params: identifiers that are part of the URL, such as a resource id;
  • Query Params: filters and pagination, such as offset and limit;
  • Body Params: data sent in the request body for create and update endpoints.

Required fields are marked as required.

4. Run the request

Click Try It!.

The console sends the request to the Sandbox and shows the result under Response, with the HTTP status and the returned JSON.

Before running it, you can also check the response examples available in the same panel.

5. Generate the request code

Under Language, select the language you want, such as Shell, Node, Ruby, PHP, or Python.

The code example is updated with the parameters you provided and can be copied into your application.

📘

Real requests in the Sandbox

Requests run from the console create, change, or remove real data in your Sandbox account.

Use fictitious data and avoid entering personal data of third parties.

Common errors

StatusLikely causeHow to fix
401 UnauthorizedAPI key missing, invalid, or from ProductionProvide a valid API key created in the Sandbox
400 Bad RequestRequired parameter missing or in an invalid formatReview the fields listed in errors
404 Not FoundIdentifier does not exist in the Sandbox accountConfirm that the id provided belongs to your account

See the HTTP response codes.

Next steps