> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/administration-and-setup/workflow/cards-overview/call-api-guide.md).

# Call the DocBits API

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-4cc081844222e8928c69949b999b8c8eba0fad5c%2FThen_Call_API.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

Observed card: `call_api`, template `6ca5e621-af72-4f55-aa2e-b3caa288722a`, version `1`. Use the version actually offered in your organization.

## Purpose

Use `call_api` to call an endpoint within the configured DocBits API. The endpoint is a relative path appended to the DocBits API base address. Entering an arbitrary external URL does not configure a third-party API integration.

## Configuration

Set the endpoint path, HTTP method, query parameters and request data supported by that endpoint. The request uses the current DocBits user context. Missing `org_id` and `triggered_by_docflow` values are added automatically. Parameter and data objects, or their supported text representation, must be valid for this card version. This version does not provide a general JSON response-field mapping.

## Result and limits

The response body is converted to a Boolean: plain `true`, `1`, `yes` or `on` becomes true; an unrecognized response, including an arbitrary JSON object, defaults to false. HTTP status alone does not determine the Boolean result. A timeout or request exception returns false. In card-testing mode the call is simulated and returns true without sending the request; this does not prove authentication, reachability or endpoint behavior.

## Practical example

When I need a Boolean result from a configured DocBits API endpoint, I use this card after the required conditions. In an isolated test, select an existing, documented, read-only DocBits endpoint with the intended Boolean response contract and the appropriate method, for example `GET`. Use only its supported demo parameters.

Expected result and counterexample: for a hypothetical HTTP `200` response whose complete body is `true`, the card result is true. With body `false`, it is false. A body such as `{"approved": true}` is not automatically mapped to true. Check the actual response and logs separately. This is a source-reviewed worked example; no request or workflow was executed.

## Troubleshooting

The HTTPS request card uses a configured HTTPS URL and its own headers. `call_api` uses a relative DocBits API path and the current DocBits user context; its result is derived from response text. Choose by endpoint and response contract, not by a simple-versus-complex API distinction.

[Reference](/administration-and-setup/workflow/cards-overview/then/action/call-api.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/administration-and-setup/workflow/cards-overview/call-api-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
