Etiquetas de contacto
Añadir una etiqueta a un contacto
Asocia una etiqueta reutilizable existente a un contacto de Instagram por ID y devuelve el conjunto completo de etiquetas actuales del contacto.
PUT
/
api
/
v1
/
contacts
/
{contactId}
/
tags
/
{tagId}
Add a tag to a contact
curl --request PUT \
--url https://levios.app/api/v1/contacts/{contactId}/tags/{tagId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://levios.app/api/v1/contacts/{contactId}/tags/{tagId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://levios.app/api/v1/contacts/{contactId}/tags/{tagId}"
payload = { "account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "api_invalid_content_length",
"message": "Invalid Content-Length.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unauthorized",
"message": "Authentication required.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_account_not_granted",
"message": "This credential is not authorized for the request.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_contact_tag_not_found",
"message": "The requested contact tag was not found.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_contact_tag_limit_reached",
"message": "The contact tag limit has been reached.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_body_too_large",
"message": "The JSON request body exceeds 1 MiB.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unsupported_media_type",
"message": "Content-Type must be application/json.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_validation_error",
"message": "The request does not match the declared schema.",
"correlation_id": "<string>",
"details": {
"issues": [
{
"code": "<string>",
"path": [
1
]
}
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_contact_tag_response_unavailable",
"message": "The contact tag changed, but its response could not be verified. Do not retry automatically.",
"correlation_id": "<string>",
"details": {
"committed": true,
"retryable": false
}
}
}{
"error": {
"code": "api_account_resolution_unavailable",
"message": "The reachable account set could not be read.",
"correlation_id": "<string>"
}
}Añade
La respuesta contiene
tagId al contacto identificado por contactId. Ambos UUIDs deben
pertenecer a la cuenta de Instagram seleccionada.
Tu clave de API necesita el permiso contacts:write. Envía account_id como
el único campo del cuerpo de la solicitud.
curl --request PUT \
--url "https://levios.app/api/v1/contacts/${LEVIOS_CONTACT_ID}/tags/${LEVIOS_TAG_ID}" \
--header "Authorization: Bearer ${LEVIOS_API_KEY}" \
--header 'Content-Type: application/json' \
--data @- <<JSON
{
"account_id": "${LEVIOS_ACCOUNT_ID}"
}
JSON
contact_id y el array tags completo y actual del
contacto. Cada etiqueta contiene id y name.
Añadir una etiqueta ya asignada no crea un duplicado. La operación es
idempotente. Un contacto puede tener hasta 100 etiquetas asignadas.
Si la API devuelve
api_contact_tag_response_unavailable con committed: true
y retryable: false, la asignación cambió, pero no se pudo verificar la
respuesta. No reintentes la operación automáticamente. Lee el contacto para
comprobar sus etiquetas actuales.Add a tag to a contact
curl --request PUT \
--url https://levios.app/api/v1/contacts/{contactId}/tags/{tagId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://levios.app/api/v1/contacts/{contactId}/tags/{tagId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://levios.app/api/v1/contacts/{contactId}/tags/{tagId}"
payload = { "account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "api_invalid_content_length",
"message": "Invalid Content-Length.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unauthorized",
"message": "Authentication required.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_account_not_granted",
"message": "This credential is not authorized for the request.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_contact_tag_not_found",
"message": "The requested contact tag was not found.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_contact_tag_limit_reached",
"message": "The contact tag limit has been reached.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_body_too_large",
"message": "The JSON request body exceeds 1 MiB.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_unsupported_media_type",
"message": "Content-Type must be application/json.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_validation_error",
"message": "The request does not match the declared schema.",
"correlation_id": "<string>",
"details": {
"issues": [
{
"code": "<string>",
"path": [
1
]
}
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded.",
"correlation_id": "<string>"
}
}{
"error": {
"code": "api_contact_tag_response_unavailable",
"message": "The contact tag changed, but its response could not be verified. Do not retry automatically.",
"correlation_id": "<string>",
"details": {
"committed": true,
"retryable": false
}
}
}{
"error": {
"code": "api_account_resolution_unavailable",
"message": "The reachable account set could not be read.",
"correlation_id": "<string>"
}
}
