Mangools/API

Draft a brand profile from the homepage

Draft a short brand profile for a new or existing monitor: what the brand does, its products or services, who they are for and its type of business. POST /aiwatcher/prompts/generate generates prompt suggestions from it.

The brand's homepage is read with one plain GET, without subpages, and an AI model drafts the profile from it (source is homepage). When the homepage cannot be read, the profile is drafted from what an AI model knows about the brand: source is ai_memory and fallback_reason says why. Nothing is saved, except that a regeneration is counted on the monitor named by monitor_id. Save the profile with POST /aiwatcher/monitor or PUT /aiwatcher/monitor/{id}/brand-profile.

Request body:

  • brand — brand name, 2 to 50 characters
  • domain — brand domain whose homepage is read
  • brandVariations — optional brand name variations, at most 10
  • location_id — location the AI answers are collected for (see /mangools/locations)
  • language_id — optional language the profile is written in
  • previous — optional profile the user is editing; the draft then replaces only what the user has not touched: items and fields with origin user are kept, and keys in removed_keys stay removed
  • monitor_id — optional ID of the monitor the profile is for
  • mode — build (default) or regenerate; regenerating is capped at 5 per monitor, counted on the monitor when monitor_id is sent and from previous.regenerations when it is not

Response:

  • profile — the drafted profile
  • regenerations_left — regenerations still allowed
POST
/aiwatcher/brand-profile/build

Authorization

ApiKeyAuth
x-access-token<token>

API token issued for your Mangools account, sent as an API key in the x-access-token HTTP header. This is NOT a standard RFC 6750 Authorization: Bearer <token> header. Auto-generated clients should be configured to send the token in x-access-token accordingly.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.mangools.com/v3/aiwatcher/brand-profile/build" \  -H "Content-Type: application/json" \  -d '{    "brand": "string",    "domain": "string",    "location_id": 1  }'
{
  "profile": {
    "about": "string",
    "about_origin": "site",
    "products": [
      {
        "key": "string",
        "name": "string",
        "description": "string",
        "origin": "site"
      }
    ],
    "audiences": [
      {
        "key": "string",
        "name": "string",
        "origin": "site"
      }
    ],
    "business_type": "string",
    "business_type_origin": "site",
    "removed_keys": [
      "string"
    ],
    "source": "homepage",
    "fallback_reason": "timeout",
    "built_for": {
      "domain": "string",
      "brand": "string"
    },
    "homepage_read_at": "2019-08-24T14:15:22Z",
    "saved_at": "2019-08-24T14:15:22Z",
    "regenerations": 0
  },
  "regenerations_left": 0
}
{
  "error": {
    "type": "AuthError",
    "message": "Invalid API Key"
  }
}
{
  "error": {
    "type": "ValidationError",
    "message": "Your request is invalid",
    "errors": [
      "Your request is invalid"
    ]
  }
}
{
  "error": {
    "type": "FailedDependencyException",
    "message": "The AI model did not answer, the brand profile could not be drafted"
  }
}
{
  "error": {
    "type": "RateLimit",
    "message": "The brand profile can be regenerated at most 5 times"
  }
}
{
  "error": {
    "type": "Error",
    "message": "Internal server error"
  }
}