# Building an Evidence Tree URL

Within the Rainbird Studio access is provided to a visual representation of the [Evidence Tree](/rainbird/evidence/the-evidence-tree.md).

Whilst this is designed primarily for Rainbird Authors, rather than end-users, some clients wants to store a link to the Evidence Tree alongside query results within their own systems for audit purposes.

Where this is necessary Evidence Tree URL can be programmatically built with the following data:

* URL structure
* Hostname
* Fact ID
* Session ID

## URL Structure

The Evidence Tree app URL is structured as follows:

```url
[STUDIO_HOSTNAME]/evidence:id=[FACT_ID]&api=[API_HOSTNAME]&sid=[SESSION_ID]
```

## Hostname

The following details the Studio and API hostname for some of our environments:

| Environment                 | Studio hostname                     | API hostname                            |
| --------------------------- | ----------------------------------- | --------------------------------------- |
| Community                   | <https://app.rainbird.ai>           | <https://api.rainbird.ai>               |
| Enterprise (UK & Europe)    | <https://enterprise.rainbird.ai>    | <https://enterprise-api.rainbird.ai>    |
| Enterprise (South America)  | <https://sa-enterprise.rainbird.ai> | <https://sa-enterprise-api.rainbird.ai> |
| Example private environment | <https://clientname.rainbird.ai>    | <https://clientname-api.rainbird.ai>    |

An example for Enterprise (UK & Europe) would be:

```url
https://enterprise.rainbird.ai/evidence?id=[FACT_ID]&api=https://enterprise-api.rainbird.ai&sid=[SESSION_ID]
```

## Fact ID

The ID used to fetch the evidence tree that lead to this decision. Received in the resultResponse for each object in the result array. i.e. if there are multiple results to a query, there will be a Fact ID for each result.

## Session ID

The ID for the session in which the results are provided. Received from the /start request.

## Evidence Security

In order to ensure the Evidence Tree can be accessed via the URL a method to pass the evidence key in the header needs to be established, or link sharing needs to be enabled.

Further information on this can be found in the [Evidence Tree](/rainbird/evidence/the-evidence-tree.md#evidence-tree-access-control) section.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rainbird.ai/rainbird/developer-docs/api-guide/building-an-evidence-tree-url.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
