# Editing the published semantic type using the API

Available in...

* Cloud API Services Platform
* Cloud Big Data
* Cloud Big Data Platform
* Cloud Data Fabric
* Cloud Data Integration
* Cloud Data Management Platform
* Cloud Pipeline Designer Standard Edition
* Data Fabric
* Qlik Talend Cloud Enterprise Edition

You need to create a sandbox for the semantic type you want to edit.

## Procedure

1. If you do not have a personal access token yet, generate one. For further information, see [Generating a Personal Access Token](https://help.qlik.com/talend/r/en-US/Cloud/management-console-user-guide/cloud-access-token).
2. Open Talend API Tester in your browser.
3. From the Repository tab, select Put in the Method drop-down list.
4. Enter the following URL: https://tds.{region}.cloud.talend.com/semanticservice/categories/{{categoryID}}/sandbox/

   You'll find a list of the URLs to use for each data center in [Accessing Talend Cloud applications](https://help.qlik.com/talend/en-US/installation-guide-windows/Cloud/talend-cloud-application-url).

   {{categoryID}} is the identifier returned when you created the semantic type, for example: 5f80848e51b6b16703a4318d.
5. Click the Add header button and enter Authorization in the name field and Bearer followed by a whitespace and your token in the value field.
6. Click the Add header button and enter Cookie in the name field, then leave the value field empty.
7. Click Send.

## Results

The API returns a 200 HTTP code to inform you that the request was successful.

The response includes the semantic type details in JSON format, with a state field with the value SANDBOX.

```
{
    "id": "5f80848e51b6b16703a4318d",
    "name": "CODICE_FISCALE_CREATED_VIA_API",
    "label": "Codice Fiscale (created via API)",
    "type": "REGEX",
    "creator": "6be3b335-05c9-4a3b-92d6-c5821f398bac",
    "createdAt": 1602258062631,
    "regEx": {
        "mainCategory": "AlphaNumeric",
        "validator": {
            "patternString": "^[A-Z]{6}[0-9]{2}[A-Z][0-9]{2}[A-Z][0-9]{3}[A-Z]$",
            "caseInsensitive": true,
            "re2jCompliant": true,
            "generexCompliant": true
        }
    },
    "modifiedAt": 1602262635946,
    "lastModifier": "6be3b335-05c9-4a3b-92d6-c5821f398bac",
    "completeness": false,
    "publishedAt": 1602261762924,
    "lastPublisher": "6be3b335-05c9-4a3b-92d6-c5821f398bac",
    "state": "SANDBOX"
}
```

## What to do next

After making changes, you need to [Saving a semantic type as a draft using the API](https://help.qlik.com/talend/en-US/data-stewardship-user-guide/Cloud/api-tsd-save-draft) and [Publish the draft semantic type using the API](https://help.qlik.com/talend/en-US/data-stewardship-user-guide/Cloud/api-tsd-publish-draft).