API Reference

We recommend using the FlowCov Bash Upload Script to upload reports. However, you can also use our REST API if you want to customize the requests in ways the Bash Script Parameters does not cover.

Building the request

To upload a new build, you need to send a request to the build upload endpoint, containing the build data in the request body. You usually want to use the default host , unless you're using an on-premise installation of FlowCov. In that case, use your custom host. Your API key needs to be sent as query parameter.

  • Request Method: POST
  • Host: https://app.flowcov.io/
  • Endpoint: api/v0/build/upload
  • Query Parameter: ?apiKey={API_KEY}
  • Body: See the request body section below

So the final request should look like this:

POST https://app.flowcov.io/api/v0/build/upload?apiKey={API_KEY}

Request body

The request body contains the build details. It looks like this:

{
"repositoryId": "3b33168f-94b9-444f-bb7d-783f97bf2348",
"ci": true,
"commitId": "a7bc152",
"commitMessage": "Initial commit",
"commitAuthor": "John Doe <j.doe@flowcov.io>",
"branchName": "master",
"data": []
}

This section contains detailed information on each of the parameters specified above.

repositoryId

  • Type: string
  • Required: true

This field contains the target repository in which the build will be saved.

ci

  • Type: boolean
  • Required: true

This field specifies the build type. If you pass true, it will be treated as a CI build, else it will be treated as a local build.

commitId

  • Type: string
  • Required: false

This field specifies the commit id and will be used to generate links to your Git repository. If you omit this field, no commit ID will be set for this build.

commitMessage

  • Type: string
  • Required: false

This field specifies the commit message displayed in the UI. If you omit this field, no message will be set for this build.

commitAuthor

  • Type: string
  • Required: false

This field specifies the commit author displayed in the UI. For the name to be correctly detected, it must be specified in the format AUTHOR_NAME <AUTHOR_EMAIL>, for example John Doe <j.doe@flowcov.io>. If you omit this field, no author will be set for this build.

branchName

  • Type: string
  • Required: false

This field specifies the branch that this build will be linked to. It is used to logically group builds in the UI. If you omit this field, no branch will be set for this build.

data

  • Type: Array
  • Required: true

This field contains the actual reports. To fill this field, copy the content of the flowCovReport.json files generated during your build. Then concat them into an array. This field may consist of an empty array, but not null.

Response codes

The API returns one of the following response codes:

  • 200: The build was successfully created.
  • 400: Your request was invalid.
  • 401: You did not provide an API key.
  • 403: This response can have several reasons:
    • Your API key was missing or invalid
    • You do not have permissions to write to this repository
    • The repository does not exist
  • 500: Something went wrong and we did not handle this. Please contact us and provide the request date, time, and body, so we can fix this as soon as possible.