Authorization

/auth

Endpoint:

POST {url}/api/auth

Headers:

Content-Type: application/json

📥Request body:

Content-Type: application/json

CampoTipoDescripciónObligatorioEjemplo
api_keystringAPI key for authentication."abc123xyz"
profile_uuidstringUUID of the associated profile."123e4567-e89b-12d3-a456-426614174000"
replacementsjsonOptional, allows profile settings to be overwritten{ "config":{ "sdk":true } }
metadatajsonAllows metadata to be sent in a callback call{ "contractId" : 12132, "callbackToken": "sdgfsa645njfg9834nfgd835TokenPruebas" }
short_url_pwcsbooleanOptional. Indicates whether the PWCS URL should be shortened.https://tcl.is/fUBnrLg80Z
token_duration_minutesintOptional. Indicates the duration of the token in minutes120
match_datajsonOptional.Data for validation or cross-checking information{"identifier": "12345678Z"}
tfajsonConfiguration for Two-Factor Authentication (2FA). This object allows users to receive a verification code via an external channel to complete the authorization process. It contains the destination phone number and the delivery type (either whatsapp or sms).{"tfa": { "phone": "+34606606606", "type": "whatsapp" }}
send_linkjsonConfiguration for sending the link via phone or email. Type: phone | email{"send_link": { "type": "phone", "value": "+34606606606" }}

Examples Reques

Basic

{
  "api_key": "API_KEY",
  "profile_uuid": "UUID",
  "short_url_pwcs": true
}

Advanced (custom configuration)

{
    "api_key": "API_KEY",
    "profile_uuid": "UUID",
    "short_url_pwcs": true,
    "metadata":{
        "contractId" : 12132,
        "callbackToken": "sdgfsa645njfg9834nfgd835TokenPruebas"
    },
    "replacements": 
    {
        "email_alert" : "[email protected]",
        "redirect" : "http://redirect",
        "redirect_ko": "http://redirect_KO",
        "callback": "http://callback",
        "callback_ko": "http://callback_ko"
    },
    "match_data":{
        "identifier" : "12345678Z",
        "iban": "ES1234567890123456789010",
        "name": "Juan",
        "surname": "Perez Tirado",
        "cif": "B1234567C"
    },
    "tfa":{ 
        "phone": "+34606606606",
        "type": "whatsapp" 
    },
    "send_link":{ 
        "type": "phone",
        "value": "34606606606" 
    } 
}

📤 Responses
✅ 200 - OK

Description: Login successful.

Example Response:

{
  "message": "Login correcto",
  "expiredAt": "2026-01-12T12:34:56Z",
  "process": "UUID",
  "company": "Company Name",
  "pwcs_url": "https://short.url/xyz123",
  "image_qr": "iVBORw0KGgoAAAANS...",
  "auth_uuid": "abcdef12-3456-7890-abcd-ef1234567890"
}

❌ 401 - Unauthorized

Description: Invalid credentials or unauthorized access.

Example Response:

{
  "result": "ko",
  "error": {
    "error_code": 1001,
    "msg": "Unauthorized"
  }
}

💥 500 - Internal Server Error

Description: Unexpected error during authentication.

Example Response:

{
  "message": "Error interno del servidor"
}