Skip to content

User Management

Manage user profiles, settings, and account data.

User Object

json
{
  "id": "usr_abc123def456",
  "phone": "+26878422613",
  "name": "John Doe",
  "email": "[email protected]",
  "avatar_url": "https://api.yeboid.com/avatars/usr_abc123.jpg",
  "kyc_status": "VERIFIED",
  "kyc_country": "SZ",
  "kyc_birthday": "1990-05-15",
  "kyc_verified_at": "2024-01-15T10:30:00Z",
  "created_at": "2023-06-01T08:00:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "metadata": {}
}

Fields

FieldTypeDescription
idstringUnique user identifier
phonestringPhone number (E.164 format)
namestringDisplay name
emailstringEmail address
avatar_urlstringProfile picture URL
kyc_statusstringNONE, PENDING, VERIFIED, REJECTED
kyc_countrystringISO 3166-1 alpha-2 country code
kyc_birthdaystringDate of birth (YYYY-MM-DD)
kyc_verified_atstringISO 8601 timestamp
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp
metadataobjectCustom key-value data

Get Current User

Retrieve the authenticated user's profile.

GET /api/v1/users/me

Request:

bash
curl https://api.yeboid.com/api/v1/users/me \
  -H "Authorization: Bearer ACCESS_TOKEN"

Response:

json
{
  "id": "usr_abc123def456",
  "phone": "+26878422613",
  "name": "John Doe",
  "email": "[email protected]",
  "avatar_url": "https://api.yeboid.com/avatars/usr_abc123.jpg",
  "kyc_status": "VERIFIED",
  "kyc_country": "SZ",
  "created_at": "2023-06-01T08:00:00Z"
}

Update Profile

Update the authenticated user's profile.

PATCH /api/v1/users/me

Request:

bash
curl -X PATCH https://api.yeboid.com/api/v1/users/me \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "email": "[email protected]"
  }'

Updatable Fields:

FieldTypeNotes
namestring1-100 characters
emailstringMust be valid email
metadataobjectCustom data (max 10KB)

Response:

json
{
  "id": "usr_abc123def456",
  "phone": "+26878422613",
  "name": "Jane Doe",
  "email": "[email protected]",
  "updated_at": "2024-02-28T14:30:00Z"
}

Upload Avatar

Upload or update the user's profile picture.

POST /api/v1/users/me/avatar

Request:

bash
curl -X POST https://api.yeboid.com/api/v1/users/me/avatar \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -F "[email protected]"

Requirements:

  • Formats: JPEG, PNG, WebP
  • Max size: 5MB
  • Recommended: 256x256 or larger (will be resized)

Response:

json
{
  "avatar_url": "https://api.yeboid.com/avatars/usr_abc123_v2.jpg"
}

Delete Avatar

Remove the user's profile picture.

DELETE /api/v1/users/me/avatar

Request:

bash
curl -X DELETE https://api.yeboid.com/api/v1/users/me/avatar \
  -H "Authorization: Bearer ACCESS_TOKEN"

Update Metadata

Store custom data on the user profile.

PATCH /api/v1/users/me/metadata

Request:

bash
curl -X PATCH https://api.yeboid.com/api/v1/users/me/metadata \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "preferences": {
      "notifications": true,
      "theme": "dark"
    },
    "tier": "premium"
  }'

Response:

json
{
  "metadata": {
    "preferences": {
      "notifications": true,
      "theme": "dark"
    },
    "tier": "premium"
  }
}

TIP

Metadata is useful for storing app-specific user preferences without managing a separate database.

Delete Account

Permanently delete the user's account.

DELETE /api/v1/users/me

Request:

bash
curl -X DELETE https://api.yeboid.com/api/v1/users/me \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'

DANGER

This action is irreversible. All user data will be permanently deleted.

Server-to-Server: Get User by ID

For server-side applications with an API key.

GET /api/v1/users/:id

Request:

bash
curl https://api.yeboid.com/api/v1/users/usr_abc123def456 \
  -H "Authorization: Bearer SERVER_API_KEY"

Response:

json
{
  "id": "usr_abc123def456",
  "phone": "+26878422613",
  "name": "John Doe",
  "kyc_status": "VERIFIED",
  "kyc_country": "SZ",
  "created_at": "2023-06-01T08:00:00Z"
}

Server-to-Server: Search Users

Search users by phone number.

GET /api/v1/users?phone=:phone

Request:

bash
curl "https://api.yeboid.com/api/v1/users?phone=%2B26878422613" \
  -H "Authorization: Bearer SERVER_API_KEY"

Response:

json
{
  "data": [
    {
      "id": "usr_abc123def456",
      "phone": "+26878422613",
      "name": "John Doe",
      "kyc_status": "VERIFIED"
    }
  ],
  "has_more": false
}

Errors

CodeDescription
user_not_foundUser doesn't exist
invalid_emailEmail format is invalid
email_takenEmail is already in use
file_too_largeAvatar exceeds 5MB
invalid_file_typeAvatar must be JPEG, PNG, or WebP

Universal Authentication for Africa