API Requirements for Use in Controlled Flow

Last updated on Jun 24, 2026

πŸ“„Model Document for Usage**:** API Specification Document

  1. What API information do we need to receive?
  • To configure Controlled Flow with any API, the documentation must provide the following data.

1.1 API Endpoint:

  • Main Base URL.

  • Specific endpoint that will be used by Controlled Flow.

2. Where to get or generate the API access key?

2.1 API Key:

  • Information on where to generate or access the API key.

  • If you already have the key, just send it.

2.2 Does the API use a generated token?

  • If the API requires a token generated via another endpoint, we need:

  • Endpoint responsible for generating the token.

  • Necessary credentials.

  • Expected response format.

3. API Documentation

  • The documentation should be up-to-date and include:

  • Description of the endpoints.

  • Supported methods.

  • Recent payload example.

  • Structure of fields that Controlled Flow will need to extract.

4. What parameters do we need to test the API?

  • Test parameter examples:

  • Email

  • CPF

  • Order number

  • Other identifiers used by the API.

5. Examples of Ideal Documentation

  • An ideal documentation should contain:

  • Base URL + detailed endpoints.

  • Method (GET, POST, PUT, DELETE).

  • Necessary headers.

  • Request example (JSON).

  • Response example (JSON).

  • Explanation of each field.

  • Authentication flow (if any).

6. Common errors and how to handle them.

The documentation should list the main errors returned by the API, with clear explanations so we can identify, interpret, and correct them properly in case of failures. It's important to include:

  1. Most common HTTP codes, such as:

    • *400 (Bad Request),

    • 401 (Unauthorized),

    • 403 (Forbidden),

    • 404 (Not Found),

    • 409 (Conflict),

    • 422 (Unprocessable Entity),

    • 429 (Too Many Requests),

    • 500 (Internal Server Error).*

  2. Probable cause description for each error, for example:

    • Invalid or missing parameters.

    • Authentication failure or expired token.

    • Excessive requests (rate limit).

    • Endpoint temporarily unavailable.

    • Internal server error of the API.

  3. Error response example, including the JSON format returned and relevant fields, such as:

    • error

    • message

    • code

  4. Guidelines for correction or handling, such as:

    • Generate or renew the token.

    • Adjust required parameters.

    • Wait a few seconds before resending (in case of 429).