Note: Beagle Security API v1 has been deprecated. We recommend that you upgrade to v2
Create an application
Used to create a new application.
API
POSThttps://api.beaglesecurity.com/rest/v2/applications
Required scope: edit_project
Request headers
Name Value
Content-Type application/json
Authorization Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request body
Name Type Description Required
name string Name of the application
url string URL of the application
projectKey string A unique key for identifying the project
type string Used to specify whether it's WEB or API. If left blank, default will be set to web.
Possible values are:
WEB Current application is a WEB.
API Current application is an API.
Example request
curl --location --request POST \
'https://api.beaglesecurity.com/rest/v2/applications' \
--header 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Default application",
"url": "https://example.com",
"projectKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"type": "WEB"
}'
// This token will be generated from Beagle security settings -> Access token
BeagleSecurityClient client = BeagleSecurityClientBuilder.instance()
.withAPIToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build();

// Create application
String applicationName = "Default application";
String url = "https://example.com";
UUID projectKey = UUID.fromString("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
ApplicationType applicationType = ApplicationType.WEB;
Application application = client.createApplication(applicationName, url, projectKey, applicationType);
Response
Name Type Description
name string Name of the application
url string URL of the application
applicationToken string A unique token for identifying the application in your account
projectKey string A unique key for identifying the project
signatureStatus string Used to know the domain verification status.
Possible values are:
Verified Application is verified.
NotVerified Application is not verified.
hostingType string Specifies whether it's WEB or API. If left blank, default will be set to WEB.
Possible values are:
WEB Current application is a WEB.
API Current application is an API.
code string Status code for the API call.
Values are:
SUCCESS API call is success
PLAN_NOT_SUPPORTED Your plan does not support this feature.
PROJECT_ALREADY_EXISTS Project already exists in your account.
INVALID_SESSION Invalid session
FAILED Failed to create application.
NOT_AUTHORIZED User authentication failed.
message string Success/failure message for the API call
Example response
{
"name": "Default application",
"url": "https://example.com",
"applicationToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"projectKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"signatureStatus": "NotVerified",
"hostingType": "WEB",
"code": "SUCCESS",
"message": "Success."
}
{
"code": "URL_ALREADY_ADDED",
"message": "Given url is already added as an application."
}
{
"code": "NOT_AUTHORIZED",
"message": "Not authorized"
}