# POST /admin/authenticationservers

> Register another DS Server instance as an authentication server with a name and serverUrl; the values aren't checked and the response is the new server's ID.

- **Product:** DS Server
- **Section:** Documentation
- **Kind:** Endpoint
- **Path:** DS Server > API Reference > Web API > Administration > /authenticationservers > POST /admin/authenticationservers
- **678 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/web-api/administration/authenticationservers/post/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/web-api/administration/authenticationservers/post/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/web-api/administration/authenticationservers/post/llms-full.txt

---

`POST` `https://example.com/admin/authenticationservers`

### Description

Adds a new authentication server, as **Register** on the **Authentication** page of the admin portal does. The endpoint was added in DS Server 3.1.0.

DS Server doesn't check the values: it neither requires the fields nor validates the URL or contacts the server.

### Examples

The following sample registers the DS Server instance at `https://ds2.example.com` as an authentication server.

```bash
# Request:
curl --request POST 'https://trial.dsserver.io/admin/authenticationservers' \
    --header 'Authorization: Basic YWRtaW46YWRtaW5hZG1pbg==' \
    --header 'Content-Type: application/json' \
    --data-raw '{
            "name": "Server 2",
            "serverUrl": "https://ds2.example.com"
        }'

# Result:
1
```

### Authorization

This endpoint supports the Basic authorization method:

#### Basic

| Header field | Description |
|---|---|
| Authorization | The username "admin" and your admin password are combined into a string separated by a colon, e.g.: admin:password. The resulting string is encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line. The authorization method and a space i.e. "Basic " is then put before the encoded string. For example: `Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l` |

### Request Payload

| Type | Value |
|---|---|
| AuthenticationServer | The AuthenticationServer object contains the name and the URL of the authentication server. |

#### AuthenticationServer

| Name | Type | Value | Optional |
|---|---|---|---|
| name | String | A user friendly name for the authentication server. | yes |
| serverUrl | String | The base URL of the DS Server instance, for example `https://ds2.example.com`. DS Server appends the paths of the endpoints it calls, such as `/oauth/validatetoken`. | yes |

### Success Response

| Status | Description |
|---|---|
| 200 | On success, the HTTP status code in the response header is 200 (OK). The return value is the new ID of the added authentication server. |

### Error Response

| Status | Description |
|---|---|
| 401 | A 401 (Unauthorized) is returned, if the user is not authorized. |
| 400 | A 400 (Bad Request) is returned, if the body is missing or isn't valid JSON. The body is the JSON string "Requst body cannot be empty." (spelled this way by DS Server). |
| 415 | A 415 (Unsupported Media Type) is returned, if the `Content-Type` header isn't `application/json`. |

---

## Nearby

- **Previous:** [GET /admin/authenticationservers](https://docs.textcontrol.com/ds-server/reference/web-api/administration/authenticationservers/get/llms-full.txt)
- **Next:** [/admin/authenticationservers/{id}](https://docs.textcontrol.com/ds-server/reference/web-api/administration/authenticationservers-id/llms-full.txt)
