---
title: POST /api/login
description: "POST`/api/login` ## Code Samples ```curl curl --request POST --url 'https://test-api-v1.eezytool.ch/api/login' --header 'Content-Type: application/json' --data '{ \"username\": \"string\", \"password\": \"string\" }' const response = await fetch('https://test-api-v1.eezytool.ch/api/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ \"username\": \"string\", \"password\": \"string\" })…"
url: "https://test.eezytool.ch/docs/post-api-login/"
updated: "2026-10-15"
category: API documentation / UserAuth
---

# POST /api/login

POST`/api/login`

## Code Samples

```curl

                curl --request POST 
  --url 'https://test-api-v1.eezytool.ch/api/login' 
  --header 'Content-Type: application/json' 
  --data '{
    "username": "string",
    "password": "string"
}'

                const response = await fetch('https://test-api-v1.eezytool.ch/api/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "username": "string",
    "password": "string"
})
});

const data = await response.json();
console.log(data);

                import requests

headers = {
    "Content-Type": "application/json"
}

payload = {
    "username": "string",
    "password": "string"
}

response = requests.post("https://test-api-v1.eezytool.ch/api/login", headers=headers, json=payload)

print(response.json())

                <?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://test-api-v1.eezytool.ch/api/login',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
  'Content-Type: application/json'
  ],
  CURLOPT_POSTFIELDS => '{
    "username": "string",
    "password": "string"
}',
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;

                using System.Net.Http;
using System.Text;

var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://test-api-v1.eezytool.ch/api/login");
request.Content = new StringContent(@"{
    ""username"": ""string"",
    ""password"": ""string""
}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

                import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://test-api-v1.eezytool.ch/api/login"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
    "username": "string",
    "password": "string"
}
"""))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Request Body

Content type: `application/json` — **required**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `username` | string | Optional |  |
| `password` | string | Optional |  |

```json

                {
    "username": "string",
    "password": "string"
}
```

## Responses

### 200 — OK
