Skip to main content
POST
/
users
/
find-or-create
Find or create user
curl --request POST \
  --url http://localhost:4000/v1/users/find-or-create \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "username": "john_doe",
  "address": "0x123abc456def789012345678901234567890abcd",
  "id_x": 1234567890,
  "privy_id": "did:privy:cmflfuqfy004xla0cbguzvtmw",
  "privy_address": "0x456def789012345678901234567890abcdef123"
}
'
{
  "data": {
    "user": {
      "id": "uuid-here",
      "username": "john_doe",
      "address": "0x123...",
      "email": null,
      "created_at": "2025-01-01T00:00:00Z",
      "updated_at": "2025-01-01T00:00:00Z"
    },
    "user_onboarded": {
      "id": "uuid-onboarded",
      "id_mini_app_onboarding": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "twitter_handle": "ojolote",
      "id_mini_app": null,
      "id_user": null,
      "id_x": null,
      "created_at": "2025-01-01T00:00:00Z",
      "updated_at": null
    },
    "created": false,
    "on_whitelist": true,
    "disabled": false,
    "onboarded": true,
    "users_onboarded": 100
  },
  "message": "User found successfully",
  "statusCode": 200,
  "path": "users/find-or-create"
}

Authorizations

Authorization
string
header
required

Use this format: ApiKey <your_api_key>

Body

application/json
username
string
required

Twitter username (obligatorio)

Maximum string length: 50
Example:

"john_doe"

address
string
required

Ethereum wallet address (obligatorio, único)

Maximum string length: 42
Example:

"0x123abc456def789012345678901234567890abcd"

id_x
number

Unique identifier for the user

Example:

1234567890

privy_id
string

Privy unique identifier

Example:

"did:privy:cmflfuqfy004xla0cbguzvtmw"

privy_address
string

Privy wallet address

Maximum string length: 42
Example:

"0x456def789012345678901234567890abcdef123"

Response

User found successfully

user
object
required

User data

user_onboarded
object
required

User onboarded data if available, null otherwise

created
boolean
required

Indicates if the user was created (true) or already existed (false)

Example:

true

disabled
object
required

Indicates if the user is disabled on the whitelist

Example:

false

onboarded
object
required

Indicates if the user is onboarded

Example:

true

users_onboarded
object
required

Number of users onboarded by this user

Example:

100

on_whitelist
boolean

Indicates if the user is on the whitelist

Example:

true