Skip to main content
POST
http://api.gu1.ai
/
events
/
user
Create
curl --request POST \
  --url http://api.gu1.ai/events/user \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "eventType": "<string>",
  "userId": "<string>",
  "entityId": "<string>",
  "entityExternalId": "<string>",
  "taxId": "<string>",
  "timestamp": "<string>",
  "deviceId": "<string>",
  "deviceDetails": {},
  "ipAddress": "<string>",
  "country": "<string>",
  "isVpn": true,
  "isProxy": true,
  "isNewDevice": true,
  "failedAttemptsCount": 123,
  "destinationAccountId": "<string>",
  "destinationCuit": "<string>",
  "previousValue": "<string>",
  "metadata": {},
  "userAgent": "<string>"
}
'
{
  "success": true,
  "event": {
    "event.id": "<string>",
    "event.eventType": "<string>",
    "event.userId": "<string>",
    "event.entityId": "<string>",
    "event.entityExternalId": "<string>",
    "event.taxId": "<string>",
    "event.timestamp": "<string>",
    "event.deviceId": "<string>",
    "event.ipAddress": "<string>",
    "event.country": "<string>",
    "event.createdAt": "<string>"
  },
  "entity": {
    "entity.id": "<string>",
    "entity.wasCreated": true
  }
}

Overview

Creates a new user event to track actions and behaviors within your application. Events are used for fraud detection, compliance monitoring, behavioral analytics, and audit trails. The system automatically registers devices and can optionally create entities when they don’t exist.
📋 Events automatically register devices when deviceId and deviceDetails are provided, eliminating the need for separate device management.

Endpoint

POST https://api.gu1.ai/events/user

Authentication

Requires a valid API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Query Parameters

withAutoEntity
boolean
default:"false"
Enable automatic entity creation when an entity with the provided taxId doesn’t exist. When true, if the event includes a taxId and no entity exists with that tax ID, a new person or company entity will be automatically created.Example: ?withAutoEntity=true

Request Body

eventType
string
required
Type of event being tracked. Must be one of the 41 supported event types (see Event Types section below).Example: "LOGIN_SUCCESS"
userId
string
Your internal user identifier. Used to group events by user across different entities.Example: "user_12345"
entityId
string
gu1’s entity UUID. Provide this if you have the internal gu1 ID.
Entity Identification: You must provide at least ONE of: entityId, entityExternalId, or taxId. These fields support OR logic, so the system will find the entity using any of these identifiers.
entityExternalId
string
Your external entity identifier. This is your unique ID for the entity in your system.Example: "user_12345"
taxId
string
Tax identification number (CPF, CNPJ, CUIT, etc.). When combined with ?withAutoEntity=true, this will create the entity if it doesn’t exist.Example: "20242455496"
timestamp
string
When the event occurred in ISO 8601 datetime format. If not provided, defaults to the current server time.Example: "2026-01-30T14:30:00Z"
deviceId
string
Unique identifier for the device. This should be a stable identifier that persists across sessions.Example: "840e89e4d46efd67"
deviceDetails
object
Detailed device information. When provided, the device will be automatically registered or updated.Structure:
{
  "platform": "android",
  "osName": "Android",
  "osVersion": "Android 16",
  "manufacturer": "samsung",
  "model": "SM-A156M",
  "brand": "samsung",
  "browser": "Chrome",
  "browserVersion": "120.0.6099.129",
  "latitude": -34.6037,
  "longitude": -58.3816,
  "city": "Buenos Aires",
  "region": "Buenos Aires",
  "country": "Argentina",
  "countryCode": "AR",
  "additionalDetails": {}
}
ipAddress
string
IP address from which the event originated (IPv4 or IPv6).Example: "10.40.64.231"
country
string
ISO 3166-1 alpha-2 country code where the event occurred.Example: "AR"
isVpn
boolean
default:"false"
Whether the connection is through a VPN
isProxy
boolean
default:"false"
Whether the connection is through a proxy
isNewDevice
boolean
default:"false"
Whether this is the first time seeing this device for this entity
failedAttemptsCount
number
default:"0"
Number of failed authentication attempts (for authentication events)Example: 3
destinationAccountId
string
Destination account identifier for transfer events (CBU, CVU, etc.)Example: "0170042640000004234411"
destinationCuit
string
Destination CUIT for transfer eventsExample: "27281455496"
previousValue
string
Previous value for credential change events. This will be automatically hashed using SHA-256 for security.Example: "old_password_hash"
metadata
object
Additional event-specific data as key-value pairs. Use this for custom fields specific to your use case.Example:
{
  "amount": 5000,
  "currency": "ARS",
  "concept": "Payment",
  "reference": "INV-12345"
}
userAgent
string
Browser user agent string for web eventsExample: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36..."

Event Types

📋 Choose the most specific event type that matches your use case. Use OTHER_EVENT only when no specific type applies.

Authentication Events

  • LOGIN_SUCCESS - Successful login
  • LOGIN_FAILED - Failed login attempt
  • LOGOUT - User logout
  • TOKEN_GENERATED - Authentication token generated

Credential Change Events

  • PASSWORD_CHANGE - Password successfully changed
  • PASSWORD_CHANGE_FAILED - Failed password change attempt
  • EMAIL_CHANGE - Email address changed
  • PHONE_CHANGE - Phone number changed
  • PIN_CHANGE - PIN changed

Account Management Events

  • ACCOUNT_LINKED - Bank account linked
  • CONTACT_CREATED - Contact created
  • CONTACT_DELETED - Contact deleted
  • ADDRESS_CHANGED - Address updated
  • DEVICE_ADDED - New device added
  • DEVICE_DELETED - Device removed

Email Management Events

  • EMAIL_CREATED - Email created
  • EMAIL_ELIMINATED - Email eliminated
  • NAVIGATION - Page or screen navigation

Transfer Events

  • TRANSFER_SUCCESS - Successful transfer
  • TRANSFER_FAILED - Failed transfer attempt
  • TRANSFER_SCHEDULED - Transfer scheduled for future

Balance Events

  • BALANCE_CHECK - Account balance checked
  • BALANCE_CHECK_FAILED - Balance check failed

Account Access Events

  • ACCOUNTS_VIEW - Accounts list viewed
  • ACCOUNTS_VIEW_FAILED - Accounts view failed

Transaction Events

  • TRANSACTIONS_VIEW - Transaction history viewed
  • TRANSACTIONS_VIEW_FAILED - Transaction view failed

Recipient Events

  • SEARCH_RECIPIENTS - Recipients searched
  • SEARCH_RECIPIENTS_FAILED - Recipients search failed
  • SCHEDULE_RECIPIENT_FAILED - Recipient scheduling failed

Profile Events

  • PROFILE_VIEW - User profile viewed
  • PROFILE_UPDATED - User profile updated

Message Events

  • MESSAGES_VIEW - Messages viewed
  • MESSAGES_VIEW_FAILED - Messages view failed

Account Holder Events

  • ACCOUNT_HOLDERS_VIEW - Account holders viewed
  • ACCOUNT_HOLDERS_VIEW_FAILED - Account holders view failed

Alias Events

  • ALIAS_VIEW - Alias viewed
  • ALIAS_VIEW_FAILED - Alias view failed
  • ALIAS_CHANGE - Alias changed
  • ALIAS_CHANGE_FAILED - Alias change failed

Other Events

  • OTHER_EVENT - Custom or generic event

Response

success
boolean
Indicates if the request was successful
event
object
The created event object
event.id
string
gu1’s internal event UUID
event.eventType
string
Type of event created
event.userId
string
User identifier
event.entityId
string
Associated entity UUID
event.entityExternalId
string
External entity identifier
event.taxId
string
Tax identification number
event.timestamp
string
Event timestamp (ISO 8601)
event.deviceId
string
Device identifier
event.ipAddress
string
IP address
event.country
string
Country code
event.createdAt
string
Event record creation timestamp
entity
object
Entity information (when auto-created or existing)
entity.id
string
Entity UUID
entity.wasCreated
boolean
Whether the entity was auto-created by this event

Examples

Login Event

curl -X POST https://api.gu1.ai/events/user \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "eventType": "LOGIN_SUCCESS",
    "entityExternalId": "user_12345",
    "userId": "user_12345",
    "deviceId": "840e89e4d46efd67",
    "ipAddress": "10.40.64.231",
    "country": "AR",
    "deviceDetails": {
      "platform": "android",
      "manufacturer": "samsung",
      "model": "SM-A156M",
      "osVersion": "Android 16"
    }
  }'

Transfer Event

curl -X POST https://api.gu1.ai/events/user \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "eventType": "TRANSFER_SUCCESS",
    "entityExternalId": "user_12345",
    "destinationAccountId": "0170042640000004234411",
    "destinationCuit": "27281455496",
    "metadata": {
      "amount": 5000,
      "currency": "ARS",
      "concept": "Payment"
    }
  }'

Auto-Create Entity

curl -X POST "https://api.gu1.ai/events/user?withAutoEntity=true" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "eventType": "LOGIN_SUCCESS",
    "taxId": "20242455496",
    "userId": "user_12345"
  }'

Response Example

{
  "success": true,
  "event": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "eventType": "LOGIN_SUCCESS",
    "userId": "user_12345",
    "entityId": "550e8400-e29b-41d4-a716-446655440000",
    "entityExternalId": "user_12345",
    "taxId": "20242455496",
    "timestamp": "2026-01-30T14:30:00Z",
    "deviceId": "840e89e4d46efd67",
    "ipAddress": "10.40.64.231",
    "country": "AR",
    "createdAt": "2026-01-30T14:30:00Z"
  },
  "entity": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "wasCreated": false
  }
}

Error Responses

400 Bad Request

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "At least one entity identifier is required: entityId, entityExternalId, or taxId"
  }
}

401 Unauthorized

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}

403 Forbidden

{
  "success": false,
  "error": {
    "code": "FORBIDDEN",
    "message": "Insufficient permissions to create events"
  }
}

404 Not Found

{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Entity not found. Use ?withAutoEntity=true to auto-create entities."
  }
}

500 Internal Server Error

{
  "success": false,
  "error": {
    "code": "EVENT_CREATE_FAILED",
    "message": "Failed to create event"
  }
}

Use Cases

Track Authentication Patterns

// Track successful and failed logins
await createEvent({
  eventType: 'LOGIN_SUCCESS',
  entityExternalId: userId,
  deviceId: deviceFingerprint,
  ipAddress: req.ip
});

// Failed login with attempt count
await createEvent({
  eventType: 'LOGIN_FAILED',
  entityExternalId: userId,
  failedAttemptsCount: 3
});

Monitor Transfer Activity

// Track transfers for fraud detection
await createEvent({
  eventType: 'TRANSFER_SUCCESS',
  entityExternalId: userId,
  destinationAccountId: destinationAccount,
  metadata: {
    amount: transferAmount,
    currency: 'ARS'
  }
});

Compliance Audit Trail

// Track all profile changes
await createEvent({
  eventType: 'PROFILE_UPDATED',
  entityExternalId: userId,
  metadata: {
    fieldsChanged: ['email', 'phone'],
    previousEmail: 'old@example.com',
    newEmail: 'new@example.com'
  }
});

Best Practices

Always Include Timestamps

Provide explicit timestamps when events are queued or buffered to maintain accurate chronological ordering.

Track Both Success and Failure

Always track both successful and failed events for comprehensive fraud detection and analytics.

Use Structured Metadata

Keep metadata consistent across similar event types to enable better analysis and querying.

Device Information

Always include device information when available to enable device-based fraud detection rules.

Handle Auto-Creation Carefully

Use withAutoEntity=true only when you’re confident the tax ID is valid and you want entities created automatically.

Next Steps