Generating JWT for REST APIs

This section provides reference information about the REST API that is used to generate JWT.

Base URL

https://{Appliance IP address}/api/v1/auth

In the base URL, Appliance IP address specifies the IP address of the specified ESA or DSG.

Path

/login/token

Method

POST

Request Body Parameters

The Request Body Parameters are used to authenticate the APIs.

ParameterDescriptionData TypeMandatory / Optional
loginnameSpecify the name of the user that has access to generate JWTStringMandatory
passwordSpecify the password of the userStringMandatory

Request

POST https://<Appliance IP address>/api/v1/auth/login/token

Response

HTTP Status CodeSample ResponseDescription
200 OK{
"status": 0,
"messages": [],
"data": null
}
The token is created
401 UnauthorizedIncorrect credentials
400 Bad Request{
"status": 400, "messages":["Incorrect syntax"],
"data": null
}
Incorrect syntax
403 ForbiddenUser does not have permission to create JWT

Response Definitions (Response Schema or Response Model)

Response ItemDescriptionData Type
statusStatus of creation of the API requestsBoolean
messagesResponse messages from API, such as, error messages, warnings, or information textList
dataData returned by API requests

Response Headers

The generated token is available in the PTY_ACCESS_JWT_TOKEN field.

Exception

None

Sample Request

curl -X POST https://<Applaince IP address>/api/v1/auth/login/token -d "loginname=<username>&password=<password>"

Sample Response

{
"status": 0,
"messages": [],
"data": null
}

Last modified : October 31, 2025