Projects endpoint

GET /pro/api/projects

Retrieves all projects, ordered by modification time (most recent first).

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  https://dradis-pro.dev/pro/api/projects

Result:

[
  {
    "id": 3,
    "name": "Test Project 3",
    "client": {
      "id": 1,
      "name": "Security Roots"
    },
    "created_at": "2015-07-27T13:12:31Z",
    "updated_at": "2015-07-27T13:12:31Z",
    "authors": [
      {
        "email": "my@email.com"
      }
    ],
    "owners": [
      {
        "email": "my@email.com"
      }
    ],
    "custom_fields": [
    {
      "id": 1,
      "name": "Assessment Type",
      "value": "Webapp"
    }
    ]
  },
  {
    "id": 2,
    "name": "Test Project 2",
    "client": {
      "id": 1,
      "name": "Security Roots"
    },
    "created_at": "2015-07-27T13:11:18Z",
    "updated_at": "2015-07-27T13:11:18Z",
    "authors": [
      {
        "email": "my@email.com"
      }
    ],
    "owners": [
      {
        "email": "my@email.com"
      }
    ],
    "custom_fields": [
    {
      "id": 1,
      "name": "Assessment Type",
      "value": "Webapp"
    }
    ]
  },
  {
    "id": 1,
    "name": "Test Project 1",
    "client": {
      "id": 1,
      "name": "Security Roots"
    },
    "created_at": "2015-07-06T15:55:30Z",
    "updated_at": "2015-07-07T08:28:22Z",
    "authors": [
      {
        "email": "my@email.com"
      }
    ],
    "owners": [
      {
        "email": "my@email.com"
      }
    ],
    "custom_fields": [
    {
      "id": 1,
      "name": "Assessment Type",
      "value": "PenTest"
    }
    ]
  }
]

GET /pro/api/projects/:id

Retrieves a single project.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  https://dradis-pro.dev/pro/api/projects/1

Result:

{
  "id": 1,
  "name": "Test Project 1",
  "client": {
    "id": 1,
    "name": "Security Roots"
  },
  "created_at": "2015-07-06T15:55:30Z",
  "updated_at": "2015-07-07T08:28:22Z",
  "authors": [
    {
      "email": "my@email.com"
    }
  ],
  "owners": [
    {
      "email": "my@email.com"
    }
  ],
    "custom_fields": [
    {
      "id": 1,
      "name": "Assessment Type",
      "value": "Webapp"
    },
    {
      "id": 2,
      "name": "Recurrence",
      "value": "One off"
    }
  ]
}

POST /pro/api/projects

Creates a project. The attributes for the project must be provided in the POST body as JSON. HTTP status 201 will be returned if the creation completes successfully, and a Location header will be sent with the response, set to the URL of the newly created resource.

Accepted Parameter Use
project Pass it the name, team_id and report_template_properties_id parameters
name Pass it the name of the project you want to create within Dradis
team_id Assigns the project to a client. Pass it the ID number of the client the project should be associated with within Dradis.
report_template_properties_id (optional) Assigns a default report template to the project
author_ids (optional) Assigns users as authors to the project. If not specified, only the user performing the request will be added as author.
template (optional) Associate with a project template to pre-populate the project with data. Pass this the project template name.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"'\
  -H 'Content-type: application/json' \
  -X POST \
  -d '{"project":{"name":"Test Project 4","team_id":"1", "report_template_properties_id":"4", "author_ids": [4, 5], "template":"Welcome Project Template"}}' \
  https://dradis-pro.dev/pro/api/projects

Result:

{
  "id": 4,
  "name": "Test Project 4",
  "client": {
    "id": 1,
    "name": "Security Roots"
  },
  "project_creation": {
    "state": "being_created"
  },
  "created_at": "2015-07-28T15:14:24Z",
  "updated_at": "2015-07-28T15:14:24Z",
  "authors": [
    {
      "email": "my@email.com",
    },
    {
      "email": "user4@email.com",
    },
    {
      "email": "user5@email.com",
    }
  ],
  "owners": [
    {
      "email": "my@email.com"
    }
  ]
}
The project_creation attribute in the response indicates if the created project is still in the process of building. The possible states are:
  • being_created - The project is still in the process of building.
  • completed - The project is done building.
To check a recently created project's project_creation state, send a request to GET /pro/api/projects/:id.

PUT /pro/api/projects/:id

Updates a project. The attributes to be updated must be provided in the POST body as JSON. HTTP status 200 will be returned if the update completes successfully.

See POST above for details on the accepted parameters.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  -H 'Content-type: application/json' \
  -X PUT \
  -d '{"project":{"name":"Test Project 4 - Updated"}}' \
  https://dradis-pro.dev/pro/api/projects/4

Result:

{
  "id": 4,
  "name": "Test Project 4 - Updated",
  "client": {
    "id": 1,
    "name": "Security Roots"
  },
  "created_at": "2015-07-28T15:14:24Z",
  "updated_at": "2015-07-28T15:14:24Z",
  "authors": [
    {
      "id": 1,
      "email": "my@email.com"
    }
  ],
  "owners": [
    {
      "id": 1,
      "email": "my@email.com"
    }
  ]
}

PUT /pro/api/projects/:id/owner

Updates a project's owner. The attributes to be updated must be provided in the POST body as JSON. HTTP status 200 will be returned if the update completes successfully.

Accepted Parameter Use
project Pass it the owner parameter
owner_id Pass it the ID number of the user you want to assign as the new project owner

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  -H 'Content-type: application/json' \
  -X PUT \
  -d '{"project":{"owner_id":"7"}}' \
  https://dradis-pro.dev/pro/api/projects/4/owner

Result:

{
  "id": 4,
  "name": "Test Project 4 - Updated",
  "client": {
    "id": 1,
    "name": "Security Roots"
  },
  "created_at": "2015-07-28T15:14:24Z",
  "updated_at": "2015-07-28T15:14:24Z",
  "authors": [
    {
      "id": 1,
      "email": "my@email.com"
    }
  ],
  "owners": [
    {
      "id": 7,
      "email": "owner@email.com"
    }
  ]
}

PATCH /pro/api/projects/:id/discard

This archives a project, so it is moved out of the active projects view but not deleted. HTTP status 200 will be returned if the deletion completes successfully.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  -X PATCH \
  https://dradis-pro.dev/pro/api/projects/4/archive

PATCH /pro/api/projects/:id/undiscard

You can also unarchive a project. HTTP status 200 will be returned if the deletion completes successfully.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  -X PATCH \
  https://dradis-pro.dev/pro/api/projects/4/unarchive

PATCH /pro/api/projects/:id/discard

This soft-deletes a project, i.e. moves it to trash from where it can be recovered. HTTP status 200 will be returned if the deletion completes successfully.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  -X PATCH \
  https://dradis-pro.dev/pro/api/projects/4/discard

PATCH /pro/api/projects/:id/undiscard

Restoring a deleted project is similar. HTTP status 200 will be returned if the deletion completes successfully.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  -X PATCH \
  https://dradis-pro.dev/pro/api/projects/4/undiscard

DELETE /pro/api/projects/:id

Deletes a project. Only soft-deleted projects can be deleted; in other words, if you are deleting a project that was not in the trash already, you will need to DISCARD it before deleting. HTTP status 200 will be returned if the deletion completes successfully.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  -H 'Content-type: application/json' \
  -X DELETE \
  https://dradis-pro.dev/pro/api/projects/4

Result:

{
  message: "Resource deleted successfully"
}

Next help article: Nodes endpoint →

Streamline InfoSec Project Delivery

Learn practical tips to reduce the overhead that drags down security assessment delivery with this 5-day course. These proven, innovative, and straightforward techniques will optimize all areas of your next engagement including:

  • Scoping
  • Scheduling
  • Project Planning
  • Delivery
  • Intra-team Collaboration
  • Reporting and much more...

Your email is kept private. We don't do the spam thing.