> For the complete documentation index, see [llms.txt](https://spe-uob.gitbook.io/healthcare-data-lake/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spe-uob.gitbook.io/healthcare-data-lake/api/usage.md).

# 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 %}
