curl -X POST https://api.u1.archetypeai.app/v0.5/lens/delete \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lens_id": "lns-test-lens-85c01267"
}'
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.post(
"https://api.u1.archetypeai.app/v0.5/lens/delete",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json={
"lens_id": "lns-test-lens-85c01267"
}
)
result = response.json()
if result.get("is_valid") == False:
print(f"Error deleting lens: {result['errors']}")
else:
print(f"Lens deleted: {result['lens_id']}")
const response = await fetch('https://api.u1.archetypeai.app/v0.5/lens/delete', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
lens_id: 'lns-test-lens-85c01267'
})
});
const result = await response.json();
if (result.is_valid === false) {
console.error('Error:', result.errors);
} else {
console.log(`Lens deleted: ${result.lens_id}`);
}
{
"is_valid": true,
"lens_id": "lns-test-lens-85c01267",
"errors": []
}
{
"errors": [
{
"code": "lens_not_found",
"message": "The specified lens was not found.",
"suggestion": "Verify the lens identifier and ensure it exists before retrying.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "lens_not_modifiable",
"message": "The specified lens is non-modifiable.",
"suggestion": "Check whether the lens is modifiable before attempting modifications.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
Internal Server Error
Lens API
Delete Lens
Deletes a lens template
POST
/
lens
/
delete
curl -X POST https://api.u1.archetypeai.app/v0.5/lens/delete \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lens_id": "lns-test-lens-85c01267"
}'
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.post(
"https://api.u1.archetypeai.app/v0.5/lens/delete",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json={
"lens_id": "lns-test-lens-85c01267"
}
)
result = response.json()
if result.get("is_valid") == False:
print(f"Error deleting lens: {result['errors']}")
else:
print(f"Lens deleted: {result['lens_id']}")
const response = await fetch('https://api.u1.archetypeai.app/v0.5/lens/delete', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
lens_id: 'lns-test-lens-85c01267'
})
});
const result = await response.json();
if (result.is_valid === false) {
console.error('Error:', result.errors);
} else {
console.log(`Lens deleted: ${result.lens_id}`);
}
{
"is_valid": true,
"lens_id": "lns-test-lens-85c01267",
"errors": []
}
{
"errors": [
{
"code": "lens_not_found",
"message": "The specified lens was not found.",
"suggestion": "Verify the lens identifier and ensure it exists before retrying.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "lens_not_modifiable",
"message": "The specified lens is non-modifiable.",
"suggestion": "Check whether the lens is modifiable before attempting modifications.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
Internal Server Error
Overview
This endpoint deletes a lens template, removing it from the list of available lens templates. Note that deleting the lens template does not stop or delete any active lens sessions based on the template.Request
The unique lens ID to delete. This is returned when the lens template is created.
Response
Whether the deletion was successful. Check this field to detect errors.
The ID of the lens that was deleted (or attempted to delete).
Array of error messages if the deletion failed.
curl -X POST https://api.u1.archetypeai.app/v0.5/lens/delete \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lens_id": "lns-test-lens-85c01267"
}'
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.post(
"https://api.u1.archetypeai.app/v0.5/lens/delete",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json={
"lens_id": "lns-test-lens-85c01267"
}
)
result = response.json()
if result.get("is_valid") == False:
print(f"Error deleting lens: {result['errors']}")
else:
print(f"Lens deleted: {result['lens_id']}")
const response = await fetch('https://api.u1.archetypeai.app/v0.5/lens/delete', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
lens_id: 'lns-test-lens-85c01267'
})
});
const result = await response.json();
if (result.is_valid === false) {
console.error('Error:', result.errors);
} else {
console.log(`Lens deleted: ${result.lens_id}`);
}
{
"is_valid": true,
"lens_id": "lns-test-lens-85c01267",
"errors": []
}
{
"errors": [
{
"code": "lens_not_found",
"message": "The specified lens was not found.",
"suggestion": "Verify the lens identifier and ensure it exists before retrying.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "lens_not_modifiable",
"message": "The specified lens is non-modifiable.",
"suggestion": "Check whether the lens is modifiable before attempting modifications.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
Internal Server Error
Was this page helpful?
⌘I