Users

Function-calling namespace: users

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

blockUser

Source: backend/endpoints/users/block-user

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-
organizationIdstringYes-
blockedBystringNo-

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

FieldTypeRequiredConstraints
stackUserIdstringYes-
organizationIdstringNo-
emailstringYes-
displayNamestringNo-
avatarUrlstringNo-
rolestringYes-
rolesarray<string>No-
isActivebooleanNonullable
isBlockedbooleanNonullable

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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

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

FieldTypeRequiredConstraints
stackUserIdstringYes-
organizationIdstringYes-

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

FieldTypeRequiredConstraints
searchstringNo-
statusstringNo-
verifiedbooleanNonullable
organizationIdstringNo-
filterobjectNo-
sortBystringNo-
sortOrderstringNo-
pageintegerNo-
pageSizeintegerNo-

Nested Field Structures

filter

FieldTypeRequiredConstraints
statusstringNo-
verifiedbooleanNonullable
organizationIdstringNo-
sortBystringNo-
sortOrderstringNo-

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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

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

FieldTypeRequiredConstraints
stackUserIdstringYes-
organizationIdstringNo-

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

FieldTypeRequiredConstraints
organizationIdstringYes-
pageintegerNo-
pageSizeintegerNo-

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

FieldTypeRequiredConstraints
searchstringNo-
sortBystringNo-
sortOrderstringNo-
pageintegerNo-
pageSizeintegerNo-

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

FieldTypeRequiredConstraints
organizationIdstringYes-
searchstringNo-
rolestringNo-
rolesarray<string>No-
statusarray<string>No-
onboardingStatusarray<string>No-
dateFilterTypestringNo-
dateFromstringNo-
dateTostringNo-
specificDatestringNoformat: YYYY-MM-DD
pageintegerNo-
pageSizeintegerNo-
includeTableFieldsbooleanNo-

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": {} }

Source: backend/endpoints/users/search

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
querystringNo-
rolestringNo-
pageintegerNo-
pageSizeintegerNo-

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

FieldTypeRequiredConstraints
stackUserIdstringYes-
stackTeamIdstringYes-
emailstringYes-
displayNamestringNonullable
titlestringNonullable
avatarUrlstringNonullable
rolestringNonullable
rolesarray<string>No-
organizationTypestringNonullable
addressStreetstringNonullable
addressCitystringNonullable
addressStatestringNonullable
addressPostalCodestringNonullable
addressCountrystringNonullable

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

FieldTypeRequiredConstraints
stackUserIdstringYes-
organizationIdstringYes-

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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
stackUserIdstringNonullable
organizationBranchIdsarray<string>Nonullable
emailstringNonullable
titlestringNonullable
displayNamestringNonullable
avatarUrlstringNonullable
rolestringNonullable
rolesarray<string>Nonullable
isActivebooleanNonullable
isBlockedbooleanNonullable
blockedAtintegerNounix-ms timestamp; nullable
blockedBystringNonullable
lastLoginAtintegerNounix-ms timestamp; nullable
isVerifiedbooleanNonullable
verifiedAtintegerNounix-ms timestamp; nullable
verifiedBystringNonullable
genderstringNonullable
yoeintegerNonullable
totalReviewsintegerNonullable
averageRatingsnumberNonullable
createdAtintegerNounix-ms timestamp; nullable
updatedAtintegerNounix-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

FieldTypeRequiredConstraints
stackUserIdstringYes-
organizationIdstringYes-
rolesarray<string>Yesmin: 1; dive
rolestringNo-

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": {} }