Note: Beagle Security API v1 has been deprecated. We recommend that you upgrade to v2
Modify a project
Used to modify an existing project.
API
PUThttps://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 |
|---|---|---|---|
| projectKey | string | Success/failure message for the API call | |
| name | string | Name of the project | |
| description | string | Description of the project |
Example request
curl --location --request PUT \
'https://api.beaglesecurity.com/rest/v2/projects' \
--header 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"projectKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"name": "Default project",
"description": "This is a default project."
}'
// This token will be generated from Beagle security settings -> Access token
BeagleSecurityClient client = BeagleSecurityClientBuilder.instance()
.withAPIToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build();
// Modify a project
UUID projectKey = UUID.fromString("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
String projectName = "Default project";
String description = "This is a default project.";
Project project = client.modifyProject(projectKey, 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 modify project.
NOT_AUTHORIZEDUser authentication failed.
|
| message | string | Success/failure message for the API call |
Example response
{
"name": "Default project",
"description": "This is a default project.",
"projectKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"code": "SUCCESS",
"message": "Success."
}
{
"code": "INVALID_SESSION",
"message": "Given token is invalid"
}
{
"code": "NOT_AUTHORIZED",
"message": "Not authorized"
}