
# Public REST API

Create an API client so your own systems can read data from Noon.

## How it works

Each API client has a client ID, a secret, and scopes. **View organization** lets a client read your organization's name and domain. To request a scope that isn't listed, chat with the Noon team.

A client exchanges its ID and secret for an access token that lasts 1 hour and carries the client's scopes. Client changes are recorded in the **Audit log**.

## Test a connection from your own system

Before a script or tool relies on Noon, test the connection. The call only reads, so a mistake in the setup changes nothing in Noon.

<figure><img src="https://help.noon.security/_assets/be30ed3f2531/integrations-api-clients.png" alt="Public REST API page with a list of API clients and the Create API client button"><figcaption></figcaption></figure>

{% stepper %}
{% step %}
### Open the Public REST API page

Go to [**Integrations**](https://app.noon.security/integrations) and click **Public REST API**.

<figure><img src="https://help.noon.security/_assets/2194e4344673/integrations-overview.png" alt="Integrations page with the Public REST API card"><figcaption></figcaption></figure>
{% endstep %}
{% step %}
### Create the client

Click **Create API client**. Type a name under **Name**, select the scopes the system needs under **Scopes**, for example **View organization**, then click **Create**.

<figure><img src="https://help.noon.security/_assets/1eb3d139b5f6/integrations-api-create-dialog.png" alt="Create API client dialog with a name field and the View organization scope" width="400"><figcaption></figcaption></figure>
{% endstep %}
{% step %}
### Save the secret

{% hint style="warning" %}
Noon shows the secret once. If you lose it, rotate the secret.
{% endhint %}

Copy the **Client ID** and **Client secret**, then click **I've saved it**.

<figure><img src="https://help.noon.security/_assets/abf6ea7ba4d8/integrations-api-secret-dialog.png" alt="Save your client secret dialog showing the client ID and client secret" width="400"><figcaption></figcaption></figure>
{% endstep %}
{% step %}
### Call the API

Send a `POST` to `https://app.noon.security/api/oauth/token` with the client ID as the username and the secret as the password in an HTTP Basic header, and `grant_type=client_credentials` in the body. Add `scope` to ask for fewer scopes than the client holds. Send the returned `access_token` as a bearer token to `GET /api/public/v1/organization`.

The call returns your organization's `id`, `name`, and `domain`.

The full requests are in the API reference: [Get access token](https://apidocs.noon.security/reference/getaccesstoken) and [Get organization](https://apidocs.noon.security/reference/getorganization). You can also click **View API docs** on the Public REST API page.
{% endstep %}
{% endstepper %}

## Shut off a system's access

When a secret leaks or a tool is retired, click **⋯** on the client row. Give each system its own client so you can cut off one without breaking the others.

<figure><img src="https://help.noon.security/_assets/bab831ea6ed6/integrations-api-client-menu.png" alt="Client row menu with Edit, Rotate secret, and Delete"><figcaption></figcaption></figure>

* **Rotate secret**: for a leak. The old secret stops working at once.
* **Delete**: for a retired tool. **Last used** shows which clients nobody uses.
* **Edit**: change the name or scopes. Tokens already issued keep their old scopes until they expire.

{% hint style="danger" %}
Deleting a client cuts off every system that uses it. This can't be undone.
{% endhint %}
