> For the complete documentation index, see [llms.txt](https://help.supplyd.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.supplyd.co/api/authentication.md).

# Authentication

Supply'd's API uses OAuth to authenticate client applications, and if your application supports OAuth Discovery then our metadata URL is:

`https://app.supplyd.co/.well-known/oauth-authorization-server`

## Automatic client registration

Supply'd supports CIMD, and the URL to register a new client is:

`https://app.supplyd.co/oauth/authorise`

## Manually register a client application

You can register a client application view the Integration Settings page:

1. Log in to the Supply'd dashboard if you aren't logged-in already
2. On the top-right, click your name, then in the dropdown click Settings
3. Scroll down and click on Integrations, then switch to the Application tab
4. On the top-right, click the Add button, then fill out the form and click Save
5. Copy-paste and save your new Client ID 😊

If your application is secure then you can generate a Client Secret by clicking the Generate Client Secret button and copy-pasting the secret that appears, otherwise our API supports PKCE for insecure applications.

## Access control and scopes

At the moment our OAuth implementation follows the permissions of the user and we accept no scopes. In the future we'll be adding truly granular permissions to our API which be documented here once that's deployed.

Some endpoints have mixed-permissions which will cause some data to be omitted if your API key has not been granted access, for example:

1. Purchase Order endpoints will not include Supplier details without access to Suppliers
2. Sales Order endpoints will not include Customer details without access to Customers

## Creating a new connection

We only support OAuth's Authorisation Code flow, which you can read about here:

<https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/>

The two endpoints you'll need are:

* Authorisation: `https://app.supplyd.co/oauth/authorise`
* Token exchange: `https://app.supplyd.co/oauth/token`

Upon a successful connection you can verify by sending a request to `GET /v1/whoami`&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.supplyd.co/api/authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
