> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vlenseg.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vlenseg.com/_mcp/server.

# AdminLogin

POST https://api.vlenseg.com/api/credentials/Login
Content-Type: application/json

Reference: https://docs.vlenseg.com/api-reference/vlens-api/credentials/post-credentials-login

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: example-openapi
  version: 1.0.0
paths:
  /api/credentials/Login:
    post:
      operationId: post-credentials-login
      summary: AdminLogin
      tags:
        - credentials
      parameters:
        - name: ApiKey
          in: header
          description: Static API key issued to your tenant. Required on every request.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Credentials_postCredentialsLogin_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                userNameOrEmailAddress:
                  type: string
                password:
                  type: string
                tenancyName:
                  type: string
              required:
                - userNameOrEmailAddress
                - password
                - tenancyName
servers:
  - url: https://api.vlenseg.com
    description: Production
components:
  schemas:
    ApiCredentialsLoginPostResponsesContentApplicationJsonSchemaDataUser:
      type: object
      properties:
        name:
          type: string
        surname:
          type: string
        fullName:
          type: string
        userName:
          type: string
        emailAddress:
          type: string
        phoneNumber:
          type: string
        idNumber:
          type: string
      required:
        - name
        - surname
        - fullName
        - userName
        - emailAddress
        - phoneNumber
        - idNumber
      title: ApiCredentialsLoginPostResponsesContentApplicationJsonSchemaDataUser
    ApiCredentialsLoginPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        hasPendingRequest:
          type: string
        isEmailConfirmationRequired:
          type: string
        isEmailConfirmed:
          type: string
        isPhoneNumberConfirmationRequired:
          type: string
        isPhoneNumberConfirmed:
          type: string
        phoneNumberOtp:
          type: string
        phoneNumberOtpRequestId:
          type: string
        isDigitalIdentityVerified:
          type: string
        accessToken:
          type: string
        encryptedAccessToken:
          type: string
        expireInSeconds:
          type: string
        userName:
          type: string
        userFullName:
          type: string
        user:
          $ref: >-
            #/components/schemas/ApiCredentialsLoginPostResponsesContentApplicationJsonSchemaDataUser
      required:
        - hasPendingRequest
        - isEmailConfirmationRequired
        - isEmailConfirmed
        - isPhoneNumberConfirmationRequired
        - isPhoneNumberConfirmed
        - phoneNumberOtp
        - phoneNumberOtpRequestId
        - isDigitalIdentityVerified
        - accessToken
        - encryptedAccessToken
        - expireInSeconds
        - userName
        - userFullName
        - user
      title: ApiCredentialsLoginPostResponsesContentApplicationJsonSchemaData
    Credentials_postCredentialsLogin_Response_200:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/ApiCredentialsLoginPostResponsesContentApplicationJsonSchemaData
        error_code:
          type: string
        error_message:
          type: string
      required:
        - data
        - error_code
        - error_message
      title: Credentials_postCredentialsLogin_Response_200
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: ApiKey
      description: Static API key issued to your tenant. Required on every request.

```

## Examples



**Request**

```json
{
  "userNameOrEmailAddress": "{{adminUser}}",
  "password": "{{adminUserPass}}",
  "tenancyName": "{{tenancyName}}"
}
```

**Response**

```json
{
  "data": {
    "hasPendingRequest": "<boolean>",
    "isEmailConfirmationRequired": "<boolean>",
    "isEmailConfirmed": "<boolean>",
    "isPhoneNumberConfirmationRequired": "<boolean>",
    "isPhoneNumberConfirmed": "<boolean>",
    "phoneNumberOtp": "<string>",
    "phoneNumberOtpRequestId": "<uuid>",
    "isDigitalIdentityVerified": "<boolean>",
    "accessToken": "<string>",
    "encryptedAccessToken": "<string>",
    "expireInSeconds": "<integer>",
    "userName": "<string>",
    "userFullName": "<string>",
    "user": {
      "name": "<string>",
      "surname": "<string>",
      "fullName": "<string>",
      "userName": "<string>",
      "emailAddress": "<string>",
      "phoneNumber": "<string>",
      "idNumber": "<string>"
    }
  },
  "error_code": "<integer>",
  "error_message": "<string>"
}
```

**SDK Code**

```python Credentials_postCredentialsLogin_example
import requests

url = "https://api.vlenseg.com/api/credentials/Login"

payload = {
    "userNameOrEmailAddress": "{{adminUser}}",
    "password": "{{adminUserPass}}",
    "tenancyName": "{{tenancyName}}"
}
headers = {
    "ApiKey": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Credentials_postCredentialsLogin_example
const url = 'https://api.vlenseg.com/api/credentials/Login';
const options = {
  method: 'POST',
  headers: {ApiKey: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"userNameOrEmailAddress":"{{adminUser}}","password":"{{adminUserPass}}","tenancyName":"{{tenancyName}}"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Credentials_postCredentialsLogin_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.vlenseg.com/api/credentials/Login"

	payload := strings.NewReader("{\n  \"userNameOrEmailAddress\": \"{{adminUser}}\",\n  \"password\": \"{{adminUserPass}}\",\n  \"tenancyName\": \"{{tenancyName}}\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("ApiKey", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Credentials_postCredentialsLogin_example
require 'uri'
require 'net/http'

url = URI("https://api.vlenseg.com/api/credentials/Login")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["ApiKey"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"userNameOrEmailAddress\": \"{{adminUser}}\",\n  \"password\": \"{{adminUserPass}}\",\n  \"tenancyName\": \"{{tenancyName}}\"\n}"

response = http.request(request)
puts response.read_body
```

```java Credentials_postCredentialsLogin_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.vlenseg.com/api/credentials/Login")
  .header("ApiKey", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"userNameOrEmailAddress\": \"{{adminUser}}\",\n  \"password\": \"{{adminUserPass}}\",\n  \"tenancyName\": \"{{tenancyName}}\"\n}")
  .asString();
```

```php Credentials_postCredentialsLogin_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.vlenseg.com/api/credentials/Login', [
  'body' => '{
  "userNameOrEmailAddress": "{{adminUser}}",
  "password": "{{adminUserPass}}",
  "tenancyName": "{{tenancyName}}"
}',
  'headers' => [
    'ApiKey' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Credentials_postCredentialsLogin_example
using RestSharp;

var client = new RestClient("https://api.vlenseg.com/api/credentials/Login");
var request = new RestRequest(Method.POST);
request.AddHeader("ApiKey", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"userNameOrEmailAddress\": \"{{adminUser}}\",\n  \"password\": \"{{adminUserPass}}\",\n  \"tenancyName\": \"{{tenancyName}}\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Credentials_postCredentialsLogin_example
import Foundation

let headers = [
  "ApiKey": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "userNameOrEmailAddress": "{{adminUser}}",
  "password": "{{adminUserPass}}",
  "tenancyName": "{{tenancyName}}"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vlenseg.com/api/credentials/Login")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```