Create an element
POST
/ui_identifiers
Base URL
https://app.testsigma.com/api/v1
Create a new element (UI identifier) in the specified application version.
Authenticate with your API key as a
Bearer token in the
Authorization header. Generate a key →REQUEST BODY
name | Name for the new element. |
locatorType | Locator strategy — xpath, css_selector, id, name, classname, linktext, tagname. |
definition | The locator expression. |
createdBy | User ID of the creator. |
status | Review status — READY or DRAFT. |
screenNameId | ID of the screen to associate the element with. |
applicationVersionId | ID of the application version. |
createdType | Creation mode — CHROME, ADVANCED, or MANUAL. |
RESPONSE ATTRIBUTES
id | ID of the newly created element. |
name | Name of the created element. |
locatorType | Locator strategy used. |
definition | Locator expression. |
status | Review status. |
REQUEST
curl -X POST \
'https://app.testsigma.com/api/v1/ui_identifiers' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"name": "Submit Button",
"locatorType": "xpath",
"definition": "//button[@type='submit']",
"createdBy": 9,
"status": "READY",
"screenNameId": 12,
"applicationVersionId": 39,
"createdType": "MANUAL"
}'const response = await fetch('https://app.testsigma.com/api/v1/ui_identifiers', {
method: 'POST',
headers: {
'Authorization': 'Bearer <API_KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Submit Button",
"locatorType": "xpath",
"definition": "//button[@type='submit']",
"createdBy": 9,
"status": "READY",
"screenNameId": 12,
"applicationVersionId": 39,
"createdType": "MANUAL"
})
});
const data = await response.json();import requests
response = requests.post(
'https://app.testsigma.com/api/v1/ui_identifiers',
headers={
'Authorization': 'Bearer <API_KEY>',
'Content-Type': 'application/json'
},
json={
"name": "Submit Button",
"locatorType": "xpath",
"definition": "//button[@type='submit']",
"createdBy": 9,
"status": "READY",
"screenNameId": 12,
"applicationVersionId": 39,
"createdType": "MANUAL"
}
)
data = response.json()RESPONSE200OK
{
"id": 103,
"name": "Submit Button",
"locatorType": "xpath",
"definition": "//button[@type='submit']",
"status": "READY",
"screenNameId": 12,
"applicationVersionId": 39,
"createdType": "MANUAL",
"createdById": 9
}