# Custom API

## What is Custom API?

Custom API actions facilitate the connection to an external system outside of Plumber. This is beneficial if your workflow requires interaction with an external system.

{% hint style="warning" %}
Limited support shall be provided for Custom API actions, as they are intended for advanced users.
{% endhint %}

## Getting started

The implementation might require some changes to the system receiving raw data from Plumber. Speak to the system owner or pass this guide to the relevant stakeholders to facilitate the process.

{% hint style="info" %}
If you wish to whitelist traffic from Plumber, please specify the following IP addresses

* 52.76.216.61
* 52.74.55.209
* 18.139.42.66
  {% endhint %}

## Support policy&#x20;

Please note that our team may not respond to queries about this feature as it is not currently a priority area. Whilst the feature remains available for use, users should consult their technical teams or documentation for implementation support. We are focusing our efforts on other strategic priorities and core system functionality. If you find any information lacking in this document, we are more than happy to update it to better serve your needs.

## Connecting to a system

1. Click "Connect"

<figure><img src="/files/kEX0yo603j4p8tkstfSk" alt=""><figcaption></figcaption></figure>

2. Under "choose connection", click "+ Add new connection"
3. Under "Label", give a name you like for the connection. This is just for your own identification purpose.
4. Under "Headers", enter the identifying parameters for the system you're interacting with.

## Make a HTTP request

<table><thead><tr><th>Field</th><th width="334.2083740234375">Description</th><th>Required?</th></tr></thead><tbody><tr><td>Method</td><td><p>Available HTTP methods for requests:</p><ol><li>GET</li><li>DELETE</li><li>PATCH</li><li>POST</li><li>PUT</li></ol></td><td>✔️</td></tr><tr><td>URL</td><td>All URLs with a query string will be properly re-encoded. URLs from Plumber (e.g., https://plumber.gov.sg/webhooks/...) are not permitted.</td><td>✔️</td></tr><tr><td>Custom Headers</td><td>Add custom headers here.</td><td></td></tr><tr><td>Data</td><td><p>Ensure the JSON data is properly formatted. Each key-value pair should be enclosed in curly braces <code>{}</code> with key names in double quotes and values appropriately quoted or unquoted per JSON standards. Use a comma <code>,</code> to separate pairs and validate against a JSON validator to prevent syntax errors.<br><br></p><p>Example:</p><div><figure><img src="/files/MvYDjIflYnC4cZ2tmEtQ" alt=""><figcaption></figcaption></figure></div><p>How to address invalid JSON data errors:</p><ul><li>Ensure that you use <strong>"</strong>double quotes<strong>"</strong> instead of 'single quotes<strong>'</strong></li><li>Ensure that you are not using curly or fancy quotes: <strong>“</strong> <strong>”</strong></li></ul></td><td></td></tr></tbody></table>

## FAQ

<details>

<summary>Can Plumber connect to systems in the intranet space?</summary>

Plumber can access intranet systems if specific conditions are fulfilled. To enable integration, intranet systems must whitelist the Plumber IP addresses provided above. Without this whitelisting, Plumber might not be able to connect to any systems within the intranet space.

</details>

<details>

<summary>What can I include in the 'Data' field?</summary>

The 'Data' field requires valid JSON input. Please use correct JSON formatting with key-value pairs inside curly braces { }. For more details on JSON formatting, visit [this resource](https://json.org/example.html).

{% hint style="info" %}
💡 **Tip**: You can use tools like the JSON formatter in VSCode or an online JSON validator to quickly check if your data is valid
{% endhint %}

Example:

<figure><img src="/files/MvYDjIflYnC4cZ2tmEtQ" alt=""><figcaption></figcaption></figure>

How to address invalid JSON data errors:

* Ensure that you use **"**&#x64;ouble quote&#x73;**"** instead of 'single quote&#x73;**'**
* Ensure that you are not using curly or fancy quotes: **“** **”**
* Ensure that there are not trailing commas

</details>

<details>

<summary>What is meant by limited support for custom APIs?</summary>

You may use this feature, but technical knowledge is essential. Users must manage their own API configurations and troubleshooting. While we will assist with some basic issues, we won't write code or solve complex problems. Most implementation queries should be handled independently. We'll only intervene if the core system breaks; otherwise, rely on your own technical expertise or development team.

</details>

<details>

<summary>Can I use Custom API to send attachments?</summary>

The Custom API action allows you to send a JSON body, but it doesn't support file attachments.

</details>


---

# 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://guide.plumber.gov.sg/user-guides/actions/custom-api.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.
