Teams endpoint

GET /pro/api/teams

Retrieves all teams, ordered by name.

Sample request:

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

Result:

[
  {
    "id": 1,
    "name": "Test Team 1",
    "team_since": "2015-05-21",
    "created_at": "2015-05-21T16:30:45Z",
    "updated_at": "2015-07-29T11:01:37Z",
    "projects": [
      {
        "id": 1,
        "name": "Test Project"
      },
      {
        "id": 2,
        "name": "Test Project 2"
      },
      {
        "id": 3,
        "name": "Test Project 3"
      }
    ]
  },
  {
    "id": 2,
    "name": "Test Team 2",
    "team_since": "2015-07-29",
    "created_at": "2015-07-29T11:00:24Z",
    "updated_at": "2015-07-29T11:02:02Z",
    "projects": [

    ]
  },
  {
    "id": 3,
    "name": "Test Team 3",
    "team_since": "2015-07-29",
    "created_at": "2015-07-29T11:02:11Z",
    "updated_at": "2015-07-29T11:02:11Z",
    "projects": [

    ]
  }
]

GET /pro/api/teams/:id

Retrieves a single team.

Sample request:

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

Result:

{
  "id": 1,
  "name": "Test Team 1",
  "team_since": "2015-05-21",
  "created_at": "2015-05-21T16:30:45Z",
  "updated_at": "2015-07-29T11:01:37Z",
  "projects": [
    {
      "id": 1,
      "name": "Test Project"
    },
    {
      "id": 2,
      "name": "Test Project 2"
    },
    {
      "id": 3,
      "name": "Test Project 3"
    }
  ]
}

POST /pro/api/teams

Creates a team. The attributes for the team 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
team Pass it the name parameter
name Pass it the name of the team you want to create within Dradis
team_since (optional) Pass the date you started working with this team in yyyy-mm-dd format. Otherwise, today's date will be used.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  -H 'Content-type: application/json' \
  -X POST \
  -d '{"team":{"name":"Test Team 4", "team_since":"2017-12-31"}}' \
  https://dradis-pro.dev/pro/api/teams

Result:

{
  "id": 4,
  "name": "Test Team 4",
  "team_since": "2017-12-31",
  "created_at": "2018-10-26T02:51:58.000Z",
  "updated_at": "2018-10-26T02:51:58.000Z",
  "projects": [

  ]
}

PUT /pro/api/teams/:id

Updates a team. 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 accepted parameters

Sample request:

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

Result:

{
  "id": 4,
  "name": "Test Team 4 - Updated",
  "team_since": "2017-12-31",
  "created_at": "2018-10-26T02:51:58.000Z",
  "updated_at": "2018-10-27T02:51:58.000Z",
  "projects": [

  ]
}

PATCH /pro/api/teams/:id/discard

This soft-deletes a team, 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/teams/4/discard

PATCH /pro/api/teams/:id/undiscard

Restoring a deleted team 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/teams/4/undiscard

DELETE /pro/api/teams/:id

Deletes a team. Only soft-deleted teams can be deleted; in other words, if you are deleting a team 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"' \
  -X DELETE \
  https://dradis-pro.dev/pro/api/teams/4

Result:

{
  message: "Resource deleted successfully"
}

Next help article: Users 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.