Create a Project

Coverity on Polaris

Version
latest
You can create a new project by sending a POST request.

Anyone can create a project by submitting the basic project information. When you create the project, you become the project administrator, and you can grant access to the project for users and groups. Use the following process to create the project through the API.

Submit the project info in a request:
Post https://subdomain.cop.blackduck.com/api/common/v0/projects

{
  "data": 
    {
      "type": "project",
      "attributes": {
        "name": "KD-test-project5",
        "properties": {
        	"customId":"8675309",
        	"group":"Polaris"
        }
      }
    }
}

The request must include a name for the project, by assigning a value to data.attributes.name. This example also assigns project properties called customId and group. Property keys are allowed to contain alphanumeric characters, underscores, and dashes – nothing else. The values for those keys don't have the same restrictions.

Response:

 {
  "data": 
    {
      "type": "project",
      "id": "ccc82255-a7db-4e9d-ac3a-ebb61664daca",
     "attributes": {
        "name": "KD-test-project5",
        "properties": {
        	"customId":"8675309",
        	"group":"Polaris"
        }
      },
      "relationships": {},
      "links": {
        "self": {
          "href": "https://subdomain.cop.blackduck.com/api/common/v0/projects/ccc82255-a7db-4e9d-ac3a-ebb61664daca",
          "meta": {
            "durable": "urn:x-swip:projects:ccc82255-a7db-4e9d-ac3a-ebb61664daca"
          }
        }
      },
      "meta": {
        "etag": "w/4cf186a0ad7cde51ba1e99a98166a55fccc0d57f",
        "organization-id": "6a4epmhfv93h5fpqfb9cubpchs",
        "in-trash": false
      }
    },
}
                      
                    

This response includes the properties created in the request, and an id value that is automatically assigned by Coverity on Polaris.