Users
Function-calling namespace: users
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
blockUser
Source: backend/endpoints/users/block-user
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
organizationId | string | Yes | - |
blockedBy | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "blockUser",
"data": {
"stackUserId": "stackuser_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }create
Source: backend/endpoints/users/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
organizationId | string | No | - |
email | string | Yes | - |
displayName | string | No | - |
avatarUrl | string | No | - |
role | string | Yes | - |
roles | array<string> | No | - |
isActive | boolean | No | nullable |
isBlocked | boolean | No | nullable |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "create",
"data": {
"stackUserId": "stack_user_123",
"organizationId": "org_123",
"email": "user@example.com",
"displayName": "Alex Johnson",
"role": "patient",
"roles": [
"patient"
]
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/users/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "delete",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }deleteByStackUserId
Source: backend/endpoints/users/delete-by-stack-user-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
organizationId | string | Yes | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "deleteByStackUserId",
"data": {
"stackUserId": "stackuser_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getAllDoctors
Source: backend/endpoints/users/get-all-doctors
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
search | string | No | - |
status | string | No | - |
verified | boolean | No | nullable |
organizationId | string | No | - |
filter | object | No | - |
sortBy | string | No | - |
sortOrder | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
Nested Field Structures
filter
| Field | Type | Required | Constraints |
|---|---|---|---|
status | string | No | - |
verified | boolean | No | nullable |
organizationId | string | No | - |
sortBy | string | No | - |
sortOrder | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "getAllDoctors",
"data": {
"organizationId": "org_123",
"status": "scheduled",
"filter": {
"status": "scheduled",
"verified": true,
"organizationId": "org_123",
"sortBy": "value",
"sortOrder": "value"
}
}
}'Example Response
{ "status": "ok", "data": {} }getById
Source: backend/endpoints/users/get-by-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "getById",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getByStackUserId
Source: backend/endpoints/users/get-by-stack-user-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
organizationId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "getByStackUserId",
"data": {
"stackUserId": "stackuser_123"
}
}'Example Response
{ "status": "ok", "data": {} }getDoctors
Source: backend/endpoints/users/get-doctors
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
page | integer | No | - |
pageSize | integer | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "getDoctors",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }list
Source: backend/endpoints/users/list
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
search | string | No | - |
sortBy | string | No | - |
sortOrder | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "list",
"data": {
"search": "value",
"sortBy": "value",
"sortOrder": "value",
"page": 1,
"pageSize": 1
}
}'Example Response
{ "status": "ok", "data": {} }listByOrganization
Source: backend/endpoints/users/list-by-organization
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
search | string | No | - |
role | string | No | - |
roles | array<string> | No | - |
status | array<string> | No | - |
onboardingStatus | array<string> | No | - |
dateFilterType | string | No | - |
dateFrom | string | No | - |
dateTo | string | No | - |
specificDate | string | No | format: YYYY-MM-DD |
page | integer | No | - |
pageSize | integer | No | - |
includeTableFields | boolean | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "listByOrganization",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }search
Source: backend/endpoints/users/search
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
query | string | No | - |
role | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "search",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }syncFromStackAuth
Source: backend/endpoints/users/sync-from-stack-auth
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
stackTeamId | string | Yes | - |
email | string | Yes | - |
displayName | string | No | nullable |
title | string | No | nullable |
avatarUrl | string | No | nullable |
role | string | No | nullable |
roles | array<string> | No | - |
organizationType | string | No | nullable |
addressStreet | string | No | nullable |
addressCity | string | No | nullable |
addressState | string | No | nullable |
addressPostalCode | string | No | nullable |
addressCountry | string | No | nullable |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "syncFromStackAuth",
"data": {
"stackUserId": "stackuser_123",
"stackTeamId": "org_123",
"email": "user@example.com"
}
}'Example Response
{ "status": "ok", "data": {} }unblockUser
Source: backend/endpoints/users/unblock-user
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
organizationId | string | Yes | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "unblockUser",
"data": {
"stackUserId": "stackuser_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/users/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
stackUserId | string | No | nullable |
organizationBranchIds | array<string> | No | nullable |
email | string | No | nullable |
title | string | No | nullable |
displayName | string | No | nullable |
avatarUrl | string | No | nullable |
role | string | No | nullable |
roles | array<string> | No | nullable |
isActive | boolean | No | nullable |
isBlocked | boolean | No | nullable |
blockedAt | integer | No | unix-ms timestamp; nullable |
blockedBy | string | No | nullable |
lastLoginAt | integer | No | unix-ms timestamp; nullable |
isVerified | boolean | No | nullable |
verifiedAt | integer | No | unix-ms timestamp; nullable |
verifiedBy | string | No | nullable |
gender | string | No | nullable |
yoe | integer | No | nullable |
totalReviews | integer | No | nullable |
averageRatings | number | No | nullable |
createdAt | integer | No | unix-ms timestamp; nullable |
updatedAt | integer | No | unix-ms timestamp; nullable |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "update",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }updateRoles
Source: backend/endpoints/users/update-roles
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackUserId | string | Yes | - |
organizationId | string | Yes | - |
roles | array<string> | Yes | min: 1; dive |
role | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "users",
"apiName": "updateRoles",
"data": {
"stackUserId": "stackuser_123",
"organizationId": "org_123",
"roles": [
"value"
]
}
}'Example Response
{ "status": "ok", "data": {} }