API Reference - User Metadata
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108063
← Back to API Reference | Getting Started
User Metadata
User Metadata stores arbitrary key-value data attached to any database object on your directory. Each record links a key and value to a specific database table and record ID, enabling flexible extensible attributes for members, subscription types, and other objects.
users_meta — DB table: users_metaThe User Metadata Object
| Field | Type | Description |
|---|---|---|
meta_id | integer | Unique metadata record ID (primary key, read-only) |
database | string | Name of the database/table this metadata is attached to (EG users, subscription_types) |
database_id | integer | ID of the record in the referenced database this metadata belongs to |
key | string | Metadata key name |
value | text | Metadata value (stored as longtext, can hold any string or serialized data) |
date_added | string | Date the record was created, formatted as YYYYMMDDHHmmss |
revision_timestamp | timestamp | Timestamp of the last update to this record (auto-managed by the database) |
List User Metadata Records
Returns a paginated list of user metadata records.
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/users_meta/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"tablesExists": true,
"meta_id": "35660",
"database": "subscription_types",
"database_id": "4",
"key": "hide_initial_amount",
"value": "0",
"date_added": "20190423170430",
"revision_timestamp": "2019-04-23 19:04:30"
},
{
"tablesExists": true,
"meta_id": "40618",
"database": "subscription_types",
"database_id": "4",
"key": "hide_monthly_amount",
"value": "0",
"date_added": "20211118062901",
"revision_timestamp": "2024-08-30 22:23:45"
}
],
"total": "5939",
"current_page": 1,
"total_pages": 2970,
"next_page": "MipfKjI="
}Retrieve a User Metadata Record
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/users_meta/get/35660" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"tablesExists": true,
"meta_id": "35660",
"database": "subscription_types",
"database_id": "4",
"key": "hide_initial_amount",
"value": "0",
"date_added": "20190423170430",
"revision_timestamp": "2019-04-23 19:04:30"
}
],
"total": "5939",
"current_page": 1,
"total_pages": 238,
"next_page": "MipfKjI1"
}Create a User Metadata Record
Creates a new metadata key-value pair attached to a specific database record.
Example Request
curl -X POST "https://www.yourdomain.com/api/v2/users_meta/create" \ -H "X-Api-Key: your-api-key-here" \ -d "database=users" \ -d "database_id=1" \ -d "key=custom_attribute" \ -d "value=custom_value" \ -d "date_added=20260403120000"
Example Response
{
"status": "success",
"message": {
"meta_id": "930268",
"database": "users",
"database_id": "1",
"key": "custom_attribute",
"value": "custom_value",
"date_added": "20260403120000",
"revision_timestamp": null
}
}Update a User Metadata Record
Example Request
curl -X PUT "https://www.yourdomain.com/api/v2/users_meta/update" \ -H "X-Api-Key: your-api-key-here" \ -d "meta_id=930268" \ -d "value=updated_value"
Example Response
{
"status": "success",
"message": {
"meta_id": "930268",
"database": "users",
"database_id": "1",
"key": "custom_attribute",
"value": "updated_value",
"date_added": "20260403120000",
"revision_timestamp": "2026-04-03 23:23:29"
}
}Delete a User Metadata Record
Example Request
curl -X DELETE "https://www.yourdomain.com/api/v2/users_meta/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "meta_id=930268"
Example Response
{
"status": "success",
"message": "users_meta record was deleted"
}