# Usage

## FHIR Resource

<mark style="color:green;">`POST`</mark> `https://healthlake.spe-uob.bris.ac.uk/v1/{Resource}`

This endpoint allows you to create new FHIR records.

#### Path Parameters

| Name     | Type   | Description                           |
| -------- | ------ | ------------------------------------- |
| Resource | string | The FHIR resource type of the record. |

#### Headers

| Name          | Type   | Description                                                                            |
| ------------- | ------ | -------------------------------------------------------------------------------------- |
| Authorization | string | API access token (IdToken). Instructions on generating this are in the sub-file below. |

{% tabs %}
{% tab title="200 Record saved." %}

```
{ "message": "Success" }
```

{% endtab %}

{% tab title="401 IdToken not inputed correctly. Please input the token as a header value without any prefixes such as "Token" or "Bearer"." %}

```
{ "Message": "Unauthorized" }
```

{% endtab %}

{% tab title="403 Wrong or mispelled IdToken or URL path." %}

```
{ "Message": "Access Denied" }
```

{% endtab %}

{% tab title="405 That's an unsupported or invalid FHIR resource specified in the URL path. " %}

```
{ "message": "Error: invalid or unsupported FHIR resource\n" }
```

{% endtab %}

{% tab title="500 We did something wrong. Please file a bug report here." %}

```
{ "message": "Error"}
```

{% endtab %}

{% tab title="502 API URL pointing to non-existing API or mispelled path." %}

```
{ "message": "Internal server error"}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If using Postman for testing, it is easier and safer to add the Authorization header by going into the "Authorization" tab and selecting "Bearer token" form the drop-down list and pasting the IdToken there.
{% endhint %}


---

# 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://spe-uob.gitbook.io/healthcare-data-lake/api/usage.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.
