Note: Beagle Security API v1 has been deprecated. We recommend that you upgrade to v2
Create a project
Used to create a new project.
API
POSThttps://api.beaglesecurity.com/rest/v2/projects
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 project
description string Description of the project
Example request
curl --location --request POST \
'https://api.beaglesecurity.com/rest/v2/projects' \
--header 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "My New Project",
"description": "A sample project for testing"
}'
// This token will be generated from Beagle security settings -> Access token
BeagleSecurityClient client = BeagleSecurityClientBuilder.instance()
.withAPIToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build();

// Create project
String projectName = "My New Project";
String description = "A sample project for testing";
Project project = client.createProject(projectName, description);
Response
Name Type Description
name string Name of the project
description string Description of the project
projectKey string A unique key for identifying the project
code string Status code for the API call.
Values are:
SUCCESSAPI call is success
PLAN_NOT_SUPPORTEDYour plan does not support this feature.
PROJECT_ALREADY_EXISTSProject already exists in your account.
INVALID_SESSIONInvalid session
FAILEDFailed to create project.
NOT_AUTHORIZEDUser authentication failed.
message string Success/failure message for the API call
Example response
{
"name": "My New Project",
"description": "A sample project for testing",
"projectKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"code": "SUCCESS",
"message": "Project created successfully."
}
{
"code": "PROJECT_ALREADY_EXISTS",
"message": "Project already exists in your account."
}
{
"code": "NOT_AUTHORIZED",
"message": "User authentication failed."
}