> For the complete documentation index, see [llms.txt](https://docs.eu-pactum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eu-pactum.com/procurement-api/api-authentication/client-credentials.md).

# Client Credentials

The client crendentials flow allows a client application to auhtenticate agains Pactum's server, by using a `client_id` and `client_secret`. The flow is described in the specification [OAuth 2.0 RFC 6749, section 4.4](https://tools.ietf.org/html/rfc6749#section-4.4).

For instructions on how to use the credentials, you can read instructions in [Auth0 documentation](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow).

### Token endpoint

The endpoint is located at:

```python
 ${baseURL}/auth/v1/oauth/token
```

Pactum API base URL per datacenter:

* US: <https://procurement.us.pactum.com>
* EU: <https://procurement.eu.pactum.com>

### Client creation

Pactum allows customer Admins to create API client credentials through the Negotiation Suite. By navigating to Settings -> API Clients you are presented with a list of API clients.

<figure><img src="https://2769938103-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FM7KTpbu7nDWmneLhlf%2Fuploads%2FCDVYJQtMOejwqydPqcNA%2Fimage.png?alt=media&amp;token=c6b2859b-3edb-4835-993c-2c59fe9a088c" alt=""><figcaption><p>API clients list</p></figcaption></figure>

By clicking the "Add API Client" you will be able to create to create a new client. You will need to specify:

* Client Name - a descriptive name for the client - ideally specifying the source system name
* Environment - if this client is meant for Sandbox or Production workspace access
* Workspaces - specify which workspaces the client can access

{% hint style="info" %}
The creation of API credentials is not restricted, but using the API in a Productions use-case would need to be aligned with the Pactum team and may be subject to additional pricing.
{% endhint %}

<figure><img src="https://2769938103-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FM7KTpbu7nDWmneLhlf%2Fuploads%2Fg4iBWVSW10j2CrjDPrIR%2Fimage.png?alt=media&amp;token=ed102856-a1fe-49c3-8d97-a31a5f0fe0d6" alt=""><figcaption><p>API client creation</p></figcaption></figure>

On the second screen you are presented with a summary of the Client details and the credentials.

{% hint style="info" %}
It is important to be aware that you will only be able to see the `client_secret` only once. You should store this in a secure place, like a company managed password manager or secrets storage.
{% endhint %}

<figure><img src="https://2769938103-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FM7KTpbu7nDWmneLhlf%2Fuploads%2F6xTZmOjfFheL0yJiU8a8%2Fimage.png?alt=media&amp;token=8600d575-54b4-4a34-a59a-ddccdd861d83" alt=""><figcaption><p>Client credentials</p></figcaption></figure>

After creation you will be able to manage the client in the List view under Actions:

* Remove - delete the client and it's access
* Edit - you can change the name and workspace accesses
* Copy - can be used to conveniently duplicate a client

### Credentials rotation

When needing to rotate credentials, either due to policy or leakage, you can conveniently use the "Copy" function and create a new client that has access to the same workspaces. Then by configuring your system to use the new credentials, you can remove the old client so that it can't be used anymore.
