---
title: "API Security"
canonical: "https://help.agiloft.com/space/HELP/43714573/API+Security"
format: markdown
---
> Macro (anchor)

Agiloft CLM provides controls for access to its SOAP and REST APIs, including group permissions, IP restrictions, and authentication. To configure API access, go to **Setup > System > Manage Web Services**. There, you can enable or disable the SOAP API and configure access for both APIs.

At the top of the page, you can enable SOAP API by clicking Enable WS if it isn’t activated, or disable SOAP if it’s currently enabled.

# Group Permissions and IP Restrictions

The next section controls group permissions and IP address restrictions for SOAP, followed by the same settings for REST. First, you can select the groups that are permitted to use the interface. If a user does not belong to a group that is selected in these drop-down lists, they are restricted with a 403 access error, even if they have create/edit/delete permissions on the affected records.

Four [global variables](https://agiloft-public.atlassian.net/wiki/spaces/HELP/pages/43713942) allow you to define a set of IP addresses for SOAP and REST blacklisting and whitelisting:

- Security: REST IP Blacklist
- Security: REST IP Whitelist
- Security: SOAP IP Blacklist
- Security: SOAP IP Whitelist

IP addresses should be comma separated, and address ranges should be indicated with a dash. 

> ℹ️ **Example**
> ℹ️ 
> ℹ️ 10.168.6.102, 10.169.7.132-10.169.7.150

# REST Authentication

The REST client application must log in using valid credentials for a knowledgebase. Agiloft CLM verifies these credentials and if valid creates an HTTP session that the client can use in subsequent calls. For details on using OAuth 2.0 for authentication, see [Use OAuth2 to Access REST API](https://agiloft-public.atlassian.net/wiki/spaces/HELP/pages/43716464).

## Passing User Credentials in the POST Body

If you use basic authentication, you can pass user credentials in the request as `login={login}&password={password}`. To avoid including credentials in the URL, use a POST request instead of GET and pass the parameters in the request body. POST requests are supported for `/ewws/EWRead`, `/ewws/EWSelect`, `/ewws/EWCreate`, `/ewws/EWUpdate`, and `/ewws/EWDelete` methods. In addition, make sure you use HTTPS for all REST API requests. For more information on constructing a REST request via POST, see [URL Conventions](https://agiloft-public.atlassian.net/wiki/spaces/HELP/pages/43715778). 

## JSON Web Tokens

You can also use JSON Web Tokens (JWT) to retrieve data using an access token instead of using login credentials each time. For more information, see [REST - Login](https://agiloft-public.atlassian.net/wiki/spaces/HELP/pages/43714204).

# Access Permissions

Access permissions are based on the authorized user's group permissions in Agiloft CLM. API calls will return only the data that the API user has access to. 

> 📝 In addition to the user's group permissions, it is necessary to grant REST access to the group via **Setup **> **System** > **Manage Web Services** > **Groups allowed for REST.**

You can also control which REST API operations a user can perform by configuring scopes. When scopes are defined, any operation that the user doesn't have access to will be rejected. For more information, see [Control Access to REST API Operations](https://agiloft-public.atlassian.net/wiki/spaces/HELP/pages/43714795).

# Encryption

You can encrypt SOAP and REST calls. For example, consider a call to read data from a contract record: `https://\{localhost}/ewws/EWRead?$kb=KBNAME&$table=contract` 

Omit the variables likely to change, such as the ID value, from the string. 

1. Go to **Setup > Access > Automatic Login Hotlinks**.
2. Enter the string constructed above into the input box, select an expiration time, and click Encrypt.  
 > Macro (inline-media-image)
3. The encrypted URL can be used in the same way as the standard URL, and parameters can be added to it in the standard way. For example:
  The system trusts the encrypted URL, so no password is required.

# Statefulness

Though stateless in appearance, Agiloft Web Services are stateful by nature. A certain set of information can be shared as a "session" between multiple calls and there is usually no good reason to recreate it on every call. A typical integration scenario obeys the pattern of "login, do multiple calls, logout". 

The statefulness is supported via a widely used pattern of obtaining a session token first via the EWLogin method and explicitly passing it with each subsequent call performed. 

Once the session is finished it's advisable to destroy the session with a call to EWLogout to ensure proper freeing of server resources. For more information, see [https://nordicapis.com/defining-stateful-vs-stateless-web-services/](https://nordicapis.com/defining-stateful-vs-stateless-web-services/). 

# Failed Logins

The SOAP API handles a series of failed logins in the same fashion as the GUI. It will produce an error if the account becomes blocked due to multiple unsuccessful login attempts.

# SSL Support

The SOAP API relies on the underlying application server and front-end web server (if present) for SSL support.

#### Related articles

> Macro (contentbylabel)