# Builderly API reference

Base URL: http://multibeton-bulgaria.com
Generated from the running server on 2026-11-05T12:19:34.647Z. Every mounted route is listed with the access it needs, the parameters its handler reads and the data models it uses.

## Authentication

Send `Authorization: Bearer <token>` where a route needs a token. Add `?ionic=true` to get JSON from routes that also render pages.

- **Admin token** (`admin`): Bearer token of a site admin (Authorization: Bearer <token>).
- **User token** (`user`): Bearer token of a signed-in user of the site.
- **Optional user** (`optional-user`): Works without a token; a user token personalises the answer.
- **User with access** (`user-priv`): A signed-in user whose plan grants access to the item.
- **Page access** (`page-priv`): Pages limited to some users check the token when one is sent.
- **Webhook signature** (`webhook`): Called by a provider; verified by its signature.
- **reCAPTCHA** (`recaptcha`): Needs a reCAPTCHA token from the site form.
- **System** (`system`): Internal - called by the platform itself.

### For AI assistants: getting a token

Public endpoints (Access: Public) need no token. Everything else - changing the site, or reading its orders, bookings, customers and other private data - needs the site owner's API token.

You cannot create a token yourself, and you must not ask for the owner's password. Ask the user for a token instead - you can send them this message as it is:

> To work with your site through its API, I need an API token from you:
> 1. Sign in to your Builderly admin: https://admin.max-media.io
> 2. Open Developers > API reference (or go straight to https://admin.max-media.io/tabs/site-builder/api-docs).
> 3. Press "Generate token", copy the token and paste it here.
> The token acts as you, so only share it in this chat. You can cancel it at any time by signing out of all devices.

Then send it with every request as `Authorization: Bearer <token>`, and add `?ionic=true` to get JSON. Calls go to the site's own address (its domain), not to the reference's.

The token acts as the user: say what you will change and wait for their yes before any request that creates, changes or deletes something, never repeat the token back, and never put it in a link or a file you share.

## Status codes

| Code | Name | Meaning |
| --- | --- | --- |
| 200 | OK | It worked. The answer is the object or list asked for. |
| 201 | Created | The object was created. Some endpoints send it back; others send an empty body. |
| 202 | Accepted | The work was started and finishes in the background - for example a video being processed ({ "status": "processing" }). Check back on the object. |
| 204 | No Content | It worked, and there is nothing to send back - for example after removing a staff member. |
| 301 | Moved Permanently | The address changed; follow the Location header. |
| 400 | Bad Request | The request was refused as sent: a required field is missing, a value has the wrong type or fails validation. The body says what - often as plain text. |
| 401 | Unauthorized | No token, or one that is invalid or signed out. Without ?ionic=true, some endpoints answer this with the HTML login page instead of JSON. |
| 402 | Payment Required | The content needs a subscription: the user has no price plan that unlocks it. |
| 403 | Forbidden | The token is valid but may not do this - the record belongs to someone else, or the user is not an admin. AI builder endpoints also answer 403 when the account is out of credits. |
| 404 | Not Found | No object with that ID or URL slug, or no such endpoint. |
| 409 | Conflict | It clashes with the current state: the item is already being processed, a version is already applied, or an AI plan or preview is no longer available. |
| 410 | Gone | It existed but is no longer there - for example a comment already deleted on the social network. |
| 412 | Precondition Failed | A rule the request must meet is not met - for example push notifications of the same type at least 48 hours apart. |
| 418 | I'm a teapot | An account confirmation or password reset link was used with an email that does not match it. |
| 421 | Misdirected Request | The domain is not a Builderly site. Call the site's own address. |
| 422 | Unprocessable Content | The request was understood but could not be done - for example the AI could not read the website it was asked to clone. The message says what to try instead. |
| 429 | Too Many Requests | Slow down: the site's request limit was reached, an AI chat already has a request running, or the hourly limit of AI search answers is used up. Wait and retry. |
| 500 | Internal Server Error | Something failed on the server. Retrying later may work; if it keeps failing, the request may be one the endpoint does not handle. |
| 502 | Bad Gateway | A service the request depends on failed - for example the address a redirect forwards to. |
| 503 | Service Unavailable | Used by the lead form when an order is below its minimum value, not only for outages: read the message. |

Errors do not share one shape: depending on the endpoint the body is plain text, { "error": "..." }, { "message": "..." } or empty. Rely on the status code, and show the body to the user as the reason.

## Endpoints

### Marketing & notifications

Reaching the site's users: push notifications, newsletters, automations and QR codes.

#### Advertisment

##### Create an ad
`POST /ads`
Creates an ad from the fields sent.
- Access: Admin token
- Status codes: 201, 400, 401, 500
- Models: Advertisment

##### Retrieve an ad
`GET /ads/:id`
Returns one ad, found by its ID.
- Access: Admin token
- Path:
  - `id` (string): The ID of the ad.
- Status codes: 200, 401, 404, 500
- Models: Advertisment

##### Update an ad
`PATCH /ads/:id`
Changes the fields sent; the others stay as they are.
- Access: Admin token
- Path:
  - `id` (string): The ID of the ad.
- Status codes: 200, 400, 401, 500
- Models: Advertisment

##### Delete an ad
`DELETE /ads/:id`
Deletes the ad. This cannot be undone.
- Access: Admin token
- Path:
  - `id` (string): The ID of the ad.
- Returns: an empty answer on success.
- Status codes: 200, 401, 404, 500
- Models: Advertisment

#### Alert

##### List all alerts
`GET /alerts`
Returns the site's alerts, newest first unless a sort is given.
- Access: Admin token
- Returns: a list of Alert objects.
- Status codes: 200, 401, 500
- Models: Alert

##### Create an alert
`POST /alerts`
Create new alert.
- Access: Admin token
- Status codes: 201, 400, 401, 500

##### Retrieve an alert
`GET /alerts/:id`
Returns one alert, found by its ID.
- Access: Admin token
- Path:
  - `id` (string): The ID of the alert.
- Returns: the Alert object.
- Status codes: 200, 401, 404, 500
- Models: Alert

#### Automation

##### List all automations
`GET /automations`
Returns the site's automations, newest first unless a sort is given.
- Access: Admin token
- Returns: a list of Automation objects.
- Status codes: 200, 401, 500
- Models: Automation

##### Create an automation
`POST /automations`
Creates an automation from the fields sent.
- Access: Admin token
- Returns: the Automation object.
- Status codes: 201, 400, 401, 500
- Models: Automation

##### Retrieve an automation
`GET /automations/:id`
Returns one automation, found by its ID.
- Access: Admin token
- Path:
  - `id` (string): The ID of the automation.
- Returns: the Automation object.
- Status codes: 200, 401, 404, 500
- Models: Automation

##### Update an automation
`PATCH /automations/:id`
Changes the fields sent; the others stay as they are.
- Access: Admin token
- Path:
  - `id` (string): The ID of the automation.
- Returns: the Automation object.
- Status codes: 200, 400, 401, 404, 500
- Models: Automation

##### Delete an automation
`DELETE /automations/:id`
Deletes the automation. This cannot be undone.
- Access: Admin token
- Path:
  - `id` (string): The ID of the automation.
- Returns: an empty answer on success.
- Status codes: 200, 401, 404, 500
- Models: Automation

##### List all models
`GET /get-model/:model`
Returns the site's models, newest first unless a sort is given.
- Access: Admin token
- Path:
  - `model` (string): The model's model.
- Status codes: 200, 401, 500

#### Connected Account

##### List all connected accounts
`GET /connected-accounts`
Returns the site's connected accounts, newest first unless a sort is given.
- Access: User token
- Returns: a list of ConnectedAccount objects.
- Status codes: 200, 401, 500
- Models: ConnectedAccount

##### Retrieve a connected accounts on behalf of
`GET /connected-accounts-by-on-behalf-of/:id`
Returns one connected accounts on behalf of, found by its ID.
- Access: User token
- Path:
  - `id` (string): The ID of the connected accounts on behalf of.
- Status codes: 200, 401, 404, 500
- Models: ConnectedAccount

##### Retrieve a connected accounts on behalf of
`GET /connected-accounts-on-behalf-of/:id`
Returns one connected accounts on behalf of, found by its ID.
- Access: User token
- Path:
  - `id` (string): The ID of the connected accounts on behalf of.
- Status codes: 200, 401, 404, 500
- Models: ConnectedAccount

##### Change the status of a connected account
`PATCH /connected-accounts-status/:id`
Update ConnectedAccount by id.
- Access: User token
- Path:
  - `id` (string): The ID of the connected account.
- Returns: the ConnectedAccount object.
- Status codes: 200, 400, 401, 403, 404, 500
- Models: ConnectedAccount

##### Retrieve a connected account
`GET /connected-accounts/:id`
Returns one connected account, found by its ID.
- Access: User token
- Path:
  - `id` (string): The ID of the connected account.
- Returns: the ConnectedAccount object.
- Status codes: 200, 401, 404, 500
- Models: ConnectedAccount

##### Update a connected account
`PATCH /connected-accounts/:id`
Update ConnectedAccount by id.
- Access: User token
- Path:
  - `id` (string): The ID of the connected account.
- Returns: the ConnectedAccount object.
- Status codes: 200, 400, 401, 403, 404, 500
- Models: ConnectedAccount

##### Delete a connected account
`DELETE /connected-accounts/:id`
Delete ConnectedAccount record by id.
- Access: User token
- Path:
  - `id` (string): The ID of the connected account.
- Returns: an empty answer on success.
- Status codes: 200, 401, 403, 404, 500
- Models: ConnectedAccount

##### List all connected accounts
`GET /my-connected-accounts`
Returns the site's connected accounts, newest first unless a sort is given.
- Access: User token
- Returns: a list of ConnectedAccount objects.
- Status codes: 200, 401, 500
- Models: ConnectedAccount

##### Send an account connection request
`POST /send-account-connection-request`
Send an account connection request.
- Access: User token
- Body:
  - `email` (string): An email address.
- Status codes: 201, 400, 401, 500
- Models: User, ConnectedAccount

#### Instagram

##### Retrieve the instagram
`GET /get-instagram`
Returns the instagram.
- Access: Public
- Query:
  - `profile` (string): Only instagrams with this profile.
  - `first` (string): Only instagrams with this first.
- Status codes: 200, 500

#### Push Notification

##### Create a push notification
`POST /push-notification`
Create new PushNotification.
- Access: Admin token
- Body:
  - `title` (string): The push notification's title.
  - `body` (string): The push notification's body.
  - `image` (string): The push notification's image.
  - `sendTo` (string): The push notification's send to.
  - `type` (string): The push notification's type.
  - `url` (string): The push notification's URL slug, as in its address on the site.
- Returns: the PushNotification object.
- Status codes: 201, 400, 401, 412, 500
- Models: PushNotification, MyContact, PushToken, UserEngagementNotification

##### Retrieve the push notification info
`GET /push-notification-info`
Get a summary info of push notifications.
- Access: Admin token
- Status codes: 200, 401, 500
- Models: PushToken

##### Retrieve the push notification
`GET /push-notification/timer`
Returns the push notification.
- Access: Admin token
- Query:
  - `sendTo` (string): Only push notifications with this send to.
- Returns: the PushNotification object.
- Status codes: 200, 401, 500
- Models: PushNotification

#### Push Token

##### Retrieve the push token
`GET /push-token`
Returns the push token.
- Access: Admin token
- Returns: the PushToken object.
- Status codes: 200, 401, 500
- Models: PushToken

##### Retrieve a push token
`GET /push-token/:id`
Returns one push token, found by its ID.
- Access: Admin token
- Path:
  - `id` (string): The ID of the push token.
- Returns: the PushToken object.
- Status codes: 200, 401, 404, 500
- Models: PushToken

## Objects

### Advertisment

- `name`: String, required
- `media`: ObjectId
- `alt`: String
- `link`: String
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### Alert

- `type`: String, required
- `heading`: String, required
- `message`: String, required
- `meta_id`: ObjectId, → Meta
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### Automation

- `title`: String, required
- `webhook_url`: String, required
- `event_type`: String, required
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### ConnectedAccount

- `on_behalf_of`: ObjectId, required, → User
- `user_account`: ObjectId, required, → User
- `status`: String, default "pending"
- `is_authorized_to.create_posts`: Boolean, default false
- `is_authorized_to.send_messages`: Boolean, default false
- `is_authorized_to.answer_delete_comments`: Boolean, default false
- `is_authorized_to.access_engagements`: Boolean, default false
- `is_authorized_to.access_boosted_posts`: Boolean, default false
- `is_authorized_to.access_analytics`: Boolean, default false
- `is_authorized_to.alter_profile_settings`: Boolean, default false
- `is_authorized_to.catalogue_access.alter_products`: Boolean, default false
- `is_authorized_to.catalogue_access.alter_services`: Boolean, default false
- `is_authorized_to.catalogue_access.alter_blogposts`: Boolean, default false
- `is_authorized_to.catalogue_access.alter_price_plans`: Boolean, default false
- `is_authorized_to.catalogue_access.alter_programs`: Boolean, default false
- `is_authorized_to.catalogue_access.alter_orders`: Boolean, default false
- `is_authorized_to.catalogue_access.alter_bookings`: Boolean, default false
- `is_authorized_to.catalogue_access.alter_subscriptions`: Boolean, default false
- `is_authorized_to.catalogue_access.alter_purchases`: Boolean, default false
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### MyContact

The site's name and contact details.

- `zip_code`: String, required - Postal/ZIP code.
- `city`: String, required - The city where the business is located.
- `address`: String, required - The street address.
- `contact`: String
- `email`: String, required - The public contact email address.
- `google_app`: String
- `workhours`: String
- `logo`: ObjectId
- `site_name`: String, required - The business/site name shown publicly.
- `domain`: String, required
- `stock_domain`: String
- `isMarket`: Boolean, required, default false
- `forbidden_collections`: Object[]
  - `collection_id`: ObjectId, → Collection
  - `_id`: ObjectId
- `isInit`: Boolean, default false
- `template`: String, default "0000"
- `lang`: String - 2-letter language code (e.g. "en", "fr", "de").
- `allowedComponents.services`: Boolean, default true
- `allowedComponents.products`: Boolean, default true
- `allowedComponents.blogposts`: Boolean, default true
- `allowedComponents.programs`: Boolean, default true
- `favicon`: ObjectId
- `cacheEnabled`: Boolean
- `has_completed_startup_prompt`: Boolean, default true
- `gmb_location`: String
- `ga_property`: String
- `site_generated_at`: Date
- `admin_first_opened_at`: Date
- `admin_last_opened_at`: Date
- `admin_in_app_browser`: Boolean
- `domain_suggestions`: Mixed
- `_id`: ObjectId

### PushNotification

- `title`: String, required
- `body`: String
- `image`: String
- `send_to`: String
- `type`: String
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### PushToken

- `user`: String
- `is_admin`: Boolean, default false
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### User

A person with an account on the site - customer, staff member or admin.

- `name`: String
- `email`: String, required
- `avatar`: ObjectId
- `social_avatar`: String
- `isAdmin`: Boolean, default false
- `isStaff`: Boolean, default false
- `owner_id`: ObjectId
- `organization_name`: String
- `firstname`: String
- `lastname`: String
- `phone_number`: String
- `address`: String
- `city`: String
- `state`: String
- `country`: String
- `zip_code`: String
- `tax_identification_number`: String
- `notes`: String
- `isConfirmed`: Boolean, default false
- `number_of_sales`: Number, default 0
- `stripe_id`: String
- `paypal_id`: String
- `access_level`: Number
- `can_edit.site`: Boolean, default true
- `can_edit.crm`: Boolean, default true
- `can_edit.store`: Boolean, default true
- `can_edit.payments`: Boolean, default true
- `can_edit.staff`: Boolean, default true
- `validation_code`: String
- `price_plans`: ObjectId[], → PricePlan
- `emotion`: String
- `political_spectrum`: String
- `language`: Mixed
- `interests`: Mixed
- `app_category`: Mixed
- `user_profile`: Mixed
- `user_economics`: String
- `user_education`: String
- `marital_status`: String
- `age`: String
- `sex`: String
- `attractiveness`: String
- `following`: ObjectId[], → User
- `followers`: ObjectId[], → User
- `handle`: String
- `saved_posts`: ObjectId[], → Post
- `blocked_users`: ObjectId[], → User
- `blocked_by`: ObjectId[], → User
- `bio`: String
- `wallet`: Number, default 0
- `ip_location.city`: String
- `ip_location.continent_name`: String
- `ip_location.country_name`: String
- `ip_location.country_subdivision`: String
- `ip_location.location_latitude`: Number
- `ip_location.location_longitude`: Number
- `ip_location.last_updated`: Date
- `ip_location.ip_address`: String
- `ip_location.zip_code`: String
- `ip_location.dialing_code`: String
- `location`: Embedded
  - `type`: String, one of Point
  - `coordinates`: Number[]
  - `_id`: ObjectId
- `checkout_recovery_at`: Date
- `search_history`: String[]
- `isRestricted`: Boolean, default false
- `isMonetized`: Boolean, default false
- `monetization_request.isRequested`: Boolean, default false
- `monetization_request.requested_on`: Date
- `sentFollowersEmail`: Date
- `isShadowbanned`: Boolean, default false
- `custom_url`: Object[]
  - `heading`: String
  - `url`: String
  - `_id`: ObjectId
- `isWhitelisted`: Boolean, default false
- `isReviewedWhitelist`: Boolean, default false
- `advertiser_id`: String
- `selected_events`: String[]
- `profile_feed_style`: String, default "list"
- `hidden_users`: ObjectId[], → User
- `isVerified`: Boolean, default false
- `saved_products`: ObjectId[], → Product
- `saved_programs`: ObjectId[], → Program
- `saved_blogposts`: ObjectId[], → Blogpots
- `saved_services`: ObjectId[], → Service
- `last_used_miniapps`: ObjectId[], → MiniApp
- `has_disabled_seen`: Boolean, default false
- `other_address`: Object[]
  - `firstname`: String
  - `lastname`: String
  - `email`: String
  - `phone_number`: String
  - `address`: String
  - `city`: String
  - `state`: String
  - `country`: String
  - `zip_code`: String
  - `_id`: ObjectId
- `is_disabled`: Boolean, default false
- `delete_date`: Date
- `trial_price_plans`: Object[]
  - `end_date`: Date
  - `start_date`: Date
  - `price_plan`: ObjectId, → PricePlan
  - `_id`: ObjectId
- `lastActivity`: Date
- `attached_dynamic_models`: Object[]
  - `model`: ObjectId, → DynamicModel
  - `document`: ObjectId
  - `_id`: ObjectId
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date

### UserEngagementNotification

- `type`: String
- `title`: String, required
- `body`: String
- `owner_id`: ObjectId, → User
- `from`: ObjectId, → User
- `post`: ObjectId, → Post
- `group`: ObjectId, → Group
- `sendToAll`: Boolean, default false
- `comment`: ObjectId, → Comment
- `is_received`: Boolean, default false
- `is_seen`: Boolean, default false
- `url`: String
- `image`: String
- `service`: ObjectId, → Service
- `product`: ObjectId, → Product
- `blogpost`: ObjectId, → BlogPost
- `program`: ObjectId, → Program
- `booking`: ObjectId, → Booking
- `_id`: ObjectId
- `updatedAt`: Date
- `createdAt`: Date
