# How to delete a variant with API in Emedgene Curate

Since v38 of the Emedgene platform, deleting a variant in Curate is a self-serve functionality. It requires the use of the API in a browser page that lets a user send the request to delete the variant.

Instructions on the use of API in Emedgene and Curate can be found [here](https://help.emg.illumina.com/emedgene-analyze-manual/integrations/api-beginner-guide) and [here](https://help.emg.illumina.com/integrations/api-beginner-guide), respectively.

In order to delete a variant in Curate, a user first needs to use one of two python scripts provided in the documentation to create a Bearer Token - it will be used to log in to the API page. Here, the script using credentials as the log in method will be used.

1. Install python3 programming language, as well as a library called "requests" (this can be done in the console terminal with `pip install requests`).
2. Adequate permissions must be given in Admin Console. For instance, the Curate variant deletion requires a role with the scope "kms\_delete\_variant".
3. In the following script, replace your-domain, your-email and your-password by the organisation and login credentials. Save the script with the .py file extension, eg, 'emg\_credentials\_script.py'.

import requests

route\_login\_platform = '<https://your-domain.emg.illumina.com/api/auth/v2/api_login/>'

payload = {"username": 'your-email', "password": 'your-password'}

response = requests.post(route\_login\_platform, json=payload)

access\_token = response.json().get('access\_token')

token\_type = response.json().get('token\_type')

print(f'{token\_type.capitalize()} {access\_token}')

4. In the console terminal, run the script with python3 emg\_credentials\_script.py, and copy the string of characters after "Bearer", excluding the space.
5. Navigate to the Swagger API page in a browser: <https://your-domain.emg.illumina.com/api/kms/apidoc/swagger>
6. Select the button "Authorize" in the upper right corner, and paste the Bearer Token, then select "Authorize".

![](/files/x63jpdVnKE2kbPl9VJ8C)

7. Once done, scroll down to the "Delete variant from Curate" option and select it. Select "try it out" and delete the "roles" field (it should be empty).

![](/files/foQQqEjC4mwZ2Byn3ffG)

8. In "variant\_id", copy the number from the variant to be deleted from Curate. This ID can be found in the curate URL, for example in [https://your-domain.emg.illumina.com/kms/v1/#/variants/**1133871**/1133848?ref=GRCh38](https://your-domain.emg.illumina.com/kms/v1/#/variants/1133871/1133848?ref=GRCh38), 1133871 is the variant\_id. Select "Execute" to delete the variant.

\
\
\ <br>

|                                                                                                                                                                                                                                                                                                                                                                 |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| *For any feedback or questions regarding this article (Illumina Knowledge Article #9725), contact Illumina Technical Support* [*techsupport@illumina.com*](mailto:techsupport@illumina.com?subject=Question%2FFeedback%20Regarding%20Illumina%20Knowledge%20Article%20#000009725%20-%20Software%20\&body=Dear%20Illumina%20Technical%20Support,%0D%0A%0D%0A)*.* |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://knowledge.illumina.com/software/cloud-software/software-cloud-software-reference_material-list/000009725.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
