Deactivate Profile
Este endpoint permite cambiar el estado de un perfil de usuario, deshabilitando a un usuario y restringiendo el uso ese perfil para própositos de login, cambio de contraseña y otras operaciones.
Endpoint
Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {{access_token}} | access_token obtained in Atenea |
Method: PATCH
URL: https://api.trust.lat/trust-idp/v1/companies/:company_id/profiles/:uuid/status
Path Variables:
Key | Value Example | Description |
---|---|---|
company_id | -1 | Identificador de la compañia, provisto por la empresa Trust. Obligatorio |
uuid | ffffffff-ffff-ffff-ffff-ffffffffffff | Identificador único del perfil de usuario. Obligatorio. |
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea.
Body
Fields
- operation: Parámetro utilizado para específicar la operación a ejecutar. Debe tener por valor deactivate para este endpoint. Obligatorio.
Code Examples
- Curl
- JavaScript
- Python
curl --location --request PATCH 'https://api.trust.lat/trust-idp/v1/companies/:company_id/profiles/:uuid/status' \
--header 'Authorization: Bearer `{{access_token}}`' \
--header 'Content-Type: application/json' \
--data-raw '{
"operation": "deactivate"
}'
import requests
import json
url = "https://api.trust.lat/trust-idp/v1/companies/:company_id/profiles/:uuid/status"
payload = json.dumps({
"operation": "deactivate"
})
headers = {
'Authorization': 'Bearer `{{access_token}}`',
'Content-Type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({
"operation": "deactivate"
});
var config = {
method: 'patch',
url: 'https://api.trust.lat/trust-idp/v1/companies/:company_id/profiles/:uuid/status',
headers: {
'Authorization': 'Bearer `{{access_token}}`',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Responses
HTTP Code: 200 OK
Profile Deactivated Succesfully
{
"code": 200,
"resource": "Profile",
"data": {
"active": false,
"uuid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"nin": "123456789",
"username": "tlat",
"phone_number": "+56912345678",
"email": "tlat@email.com",
"name": "test",
"lastname": "latin",
"birthday": null,
"nationality": null,
"timezone": null,
"trusted_fields": {},
"field_expiration_time": {},
"two_factor_authentication": [],
"identification_provider": "test_idp"
},
"message": "Activated"
}
HTTP Code: 401 Unauthorized
Invalid Token
{
"status": 401,
"error": "Invalid or expired token"
}
HTTP Code: 403 Forbidden
Failed Validation
{
"code": 403,
"message": "Forbidden"
}
HTTP Code: 404 Not Found
Profile Not Found
{
"code": 404,
"resource": "Profile",
"message": "Not found"
}
HTTP Code: 409 Conflict
Profile Is Not Active
{
"code": 409,
"resource": "Profile",
"message": "Conflict",
"errors": "Profile is not active"
}