EndpointsAddressbook

Addressbook

Function-calling namespace: addressbook

  • 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.

create

Source: backend/endpoints/addressbook/create

Input Fields

FieldTypeRequiredConstraints
userIdstringYes-
addressTypestringYesoneof: HOME
addressstringYes-
citystringYes-
statestringYes-
countrystringYes-
postcodestringYes-
latitudenumberNonullable
longitudenumberNonullable
isDefaultbooleanNo-

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": "addressbook",
  "apiName": "create",
  "data": {
    "userId": "user_123",
    "addressType": "home",
    "address": "221B Baker Street",
    "city": "Bengaluru",
    "state": "Karnataka",
    "country": "India",
    "postcode": "560001"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getActiveByUserId

Source: backend/endpoints/addressbook/get-active-by-user-id

Input Fields

FieldTypeRequiredConstraints
userIdstringYes-

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": "addressbook",
  "apiName": "getActiveByUserId",
  "data": {
    "userId": "user_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getById

Source: backend/endpoints/addressbook/get-by-id

Input Fields

FieldTypeRequiredConstraints
idstringYes-

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": "addressbook",
  "apiName": "getById",
  "data": {
    "id": "id_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getByUserId

Source: backend/endpoints/addressbook/get-by-user-id

Input Fields

FieldTypeRequiredConstraints
userIdstringYes-

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": "addressbook",
  "apiName": "getByUserId",
  "data": {
    "userId": "user_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

softDelete

Source: backend/endpoints/addressbook/soft-delete

Input Fields

FieldTypeRequiredConstraints
idstringYes-

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": "addressbook",
  "apiName": "softDelete",
  "data": {
    "id": "id_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

update

Source: backend/endpoints/addressbook/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
addressTypestringNooneof: HOME
addressstringNonullable
citystringNonullable
statestringNonullable
countrystringNonullable
postcodestringNonullable
latitudenumberNonullable
longitudenumberNonullable
isActivebooleanNonullable
isDefaultbooleanNonullable

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": "addressbook",
  "apiName": "update",
  "data": {
    "id": "id_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }