# Uploading Test Data

## Upload Example Using cURL

In the following, we provide an example of how to push your Test data into Logilica for storage and built-in analytics.

{% hint style="info" %}
**Important**: Ensure the repository you build from is already **onboarded** in Logilica.

The [Repositories API](https://docs.logilica.com/advanced/import/repositories) can be used to retrieve the `repoId` for the endpoint.
{% endhint %}

The cURL POST command is below. Note, that the POST command includes the example API token `lgca_UeRxFs_3RYRJEJtdYp7j7Wa6DirG5NjiYslsb` and the example workspace `myworkspace`. The command URL also includes a placeholder for the repoID to associate the uploaded issues with.

{% code fullWidth="false" %}

```curl
curl --location --request POST 'https://logilica.io/api/import/v1/coverage/<repoID>/test_run/create' \
--header 'X-lgca-token: lgca_UeRxFs_3RYRJEJtdYp7j7Wa6DirG5NjiYslsb' \
--header 'x-lgca-domain: myworkspace' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
        "id": "123",
        "testID": "test1",
        "commitHash": "8c39c46e512541fd9431fad3109cfab1816cfdbb",
        "branch": "master",
        "name": "Test Run 1",
        "outcome": "success",
        "outcomeCategory": "Pass",
        "duration": 1234567890,
        "timestamp": 1738813508,
        "additionalFields": [
            {
                "key": "type",
                "value": "unit"
            },
            {
                "key": "foor",
                "value": "bar"
            }
        ],
        "pullRequest": "1357"
    },
    {
        "id": "456",
        "testID": "test2",
        "commitHash": "qdbjtecjed35b9d5d5bb2854e908c5a29edfcd61",
        "branch": "master",
        "name": "Test Run 2",
        "outcome": "failed",
        "outcomeCategory": "Failure",
        "duration": 1234567890,
        "timestamp": 1738813508,
        "additionalFields": [
            {
                "key": "type",
                "value": "integration"
            }
        ],
        "pullRequest": "2468"
    }
]'
```

{% endcode %}

## API Schema for Importing Test Data

{% openapi src="<https://3637178088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvMP8keAdyp2axoLILtL5%2Fuploads%2Fgit-blob-d8a87b720df94b60e4756c4b7d2c1bfce151c6a1%2Fopenapi.json?alt=media>" path="coverage/{repoID}/test\_result/create" method="post" %}
[openapi.json](https://3637178088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvMP8keAdyp2axoLILtL5%2Fuploads%2Fgit-blob-d8a87b720df94b60e4756c4b7d2c1bfce151c6a1%2Fopenapi.json?alt=media)
{% endopenapi %}

{% openapi src="<https://3637178088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvMP8keAdyp2axoLILtL5%2Fuploads%2Fgit-blob-d8a87b720df94b60e4756c4b7d2c1bfce151c6a1%2Fopenapi.json?alt=media>" path="coverage/{repoID}/commit/create" method="post" %}
[openapi.json](https://3637178088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvMP8keAdyp2axoLILtL5%2Fuploads%2Fgit-blob-d8a87b720df94b60e4756c4b7d2c1bfce151c6a1%2Fopenapi.json?alt=media)
{% endopenapi %}

## Questions?

If you have any questions or run into issues, please contact us at <support@logilica.com>.
