# Accounts

API reference · v1.0.0

The accounts of your end users: give an account created without a domain its domain, and
choose how Flavio works for it and the language it writes in.

**Base URL**: There is no single base URL: each partner works on its own domain, under its own brand, so your customers never see ours. We give you yours when we set you up together. The examples use app.acmeseo.com.

## Update account

`PATCH /api/accounts/{uuid}`

Changes the details of an account. An account created without a domain gets one with
`domain`: send it once the website is live there. Flavio starts its first scan right away
and, from then on, scans it on its own every `scan_interval` days (in
`product_details.features` of the account): there is no scan to ask for. The timeline
records each one as `scan.completed`.

When the first scan ends, Flavio links the pages of the plan to the ones it found, checks
what was answered with `acknowledge` (a page to create is `resolved` once found at its
path), measures **Get AI readiness** and opens interventions for what is missing.

### Authentication

- `Authorization` (header, Bearer JWT): The JWT of one account (HMAC-SHA256, signed with the API Key), sent as `Authorization: Bearer <JWT>`. It gives access to that account only: every operation of Flavio Agent, Webhooks, Site data and Keywords, competitors and pages, and updating the account.

### Parameters

- `uuid` (path, string, required): UUID of the Account to update

### Request body

`application/vnd.marketgoo.api+json`

- `data` (object)
  - `type` (string, required): Required json:api item type. Always `account`.
  - `id` (string, required): The ID of the account to update. **MUST** match the `uuid` parameter in the URL
  - `attributes` (object)
    - `domain` (string): The domain of the website, for an account created without one. Send it once the website is live there: Flavio scans it right away, and then every `scan_interval` days on its own. It cannot be changed once given: `400` if the account already has one
    - `flavio_mode` (string): How Flavio works for the account. With `on_demand`, the default, Flavio works when you ask it to. With `loop`, Flavio also works by itself every so often: it asks for a new scan when the last one is old, asks AI assistants about the business once a month, brings in the data of the connected sources and writes the first plan when there is none. Only for accounts with Flavio. Allowed values: `on_demand`, `loop`
    - `lang` (string): The language of the account's user, such as `en` or `es`. Flavio writes the texts of the account in it, such as the plan and the interventions

### Request

cURL:

```bash
curl -X PATCH https://app.acmeseo.com/api/accounts/{uuid} \
  -H "Authorization: Bearer <JWT>" \
  -H "Accept: application/vnd.marketgoo.api+json" \
  -H "Content-Type: application/vnd.marketgoo.api+json" \
  -d '{
  "data": {
    "type": "account",
    "id": "{uuid}",
    "attributes": {
      "domain": "bloomandco.example"
    }
  }
}'
```

HTTP:

```http
PATCH /api/accounts/{uuid} HTTP/1.1
Host: app.acmeseo.com
Authorization: Bearer <JWT>
Accept: application/vnd.marketgoo.api+json
Content-Type: application/vnd.marketgoo.api+json

{
  "data": {
    "type": "account",
    "id": "{uuid}",
    "attributes": {
      "domain": "bloomandco.example"
    }
  }
}
```

### Responses

#### 200 OK

`application/vnd.marketgoo.api+json`

- `data` (object)
  - `id` (string): The unique ID for the Account. This `id` is the same value returned in the `uuid` field of the Account object attributes.
  - `type` (string): Defines the type of the object returned in `attributes`.
  - `attributes` (object)
    - `uuid` (string): The unique resource identifier for this Account
    - `promo` (string, nullable): Promotional tag of this Account
    - `created_at` (string): Account creation date / time
    - `deleted_at` (string, nullable): The date / time on which this Account was deleted
    - `suspended_at` (string, nullable): The date / time on which this Account was suspended
    - `delete_date` (string, nullable): Account is still **active** but **marked for deletion** at this date / time.
    - `trial_period` (number, nullable): Number of trial days
    - `demo` (number)
    - `is_configured` (boolean): This is a `boolean` field that flags active user interaction of the tool. If this field is `true`, the user has passed and configured the initial Wizard, marking the active usage of the product.
    - `product` (string): Type of product
    - `product_details` (object): The account's product: its name, its features and whether it is free
      - `name` (string): Visible name of the product
      - `features` (object): What a product includes and its limits, such as the number of keywords and competitors.
        - `api_only` (boolean)
        - `allow_anonymous` (boolean)
        - `max_keywords` (number, nullable): Maximum number of keywords allowed
        - `max_competitors` (number, nullable): Maximum number of competitors allowed
        - `max_pages` (number): Maximum number of web pages scanned in each scan
        - `ofs_tool` (boolean)
        - `max_tasks` (number, nullable): Maximum number of tasks (`null`: no limit)
        - `pdf_download` (boolean): Whether the results can be downloaded as a PDF
        - `scan_interval` (number): Interval of days between each automatic scan
        - `scan_on_demand` (boolean)
        - `social` (boolean)
        - `max_recipients` (number, nullable)
        - `show_wp_instructions` (boolean)
        - `have_plugin` (string, nullable): The plugin the product is for, such as `wordpress`, or `null`
        - `plugin_basename` (string, nullable): The base name of that plugin, such as `marketgoo-seo`
        - `advanced_tools` (boolean)
        - `advanced_popularity` (boolean)
        - `meta_suggestions` (number): AI meta description suggestions a site can ask for each day
        - `optimize_suggestions` (number): AI page optimization suggestions a site can ask for each month
        - `local_business` (boolean)
        - `local_business_ai` (boolean)
      - `free` (boolean): Whether the product is free
    - `partner_token` (string, nullable): The partner token this account is linked to
    - `domain` (string, nullable): The domain for this Account web site, or `null` if the account has none
    - `flavio_mode` (string): How Flavio works for the account. With `on_demand`, the default, Flavio works when you ask it to. With `loop`, Flavio also works by itself every so often: it asks for a new scan when the last one is old, asks AI assistants about the business once a month, brings in the data of the connected sources and writes the first plan when there is none. Only for accounts with Flavio. Allowed values: `on_demand`, `loop`
    - `subscription` (object, nullable): The account's subscription, or `null` if it has none
      - `type` (number)
      - `interval` (number)
      - `gateway` (string): The payment gateway of the subscription
      - `gateway_id` (string): The subscription's ID in the payment gateway
    - `name` (string): The name of the user
    - `email` (string): The email of the user
    - `ulid` (string)
    - `lang` (string): The language of the user
    - `site` (object): Only when the account has a domain
      - `frozen_at` (string, nullable): The date / time on which the site was frozen
      - `domain` (string): The domain for this site
      - `created_at` (string): Site creation date / time (UTC)
      - `checked_at` (string): Date / time of the last automatic scan
      - `thumbnail` (string, nullable): Thumbnail filename. Use the following table to prefix this filename and get the correct thumbnail size and type: | Type    | Size                  | Prefix path                     | |---------|-----------------------|---------------------------------| | Desktop | Medium (400x300)      | /thumbnails/desktop/medium      | | Desktop | Small (200x150)       | /thumbnails/desktop/small       | | Desktop | Thumbnail (100x75)    | /thumbnails/desktop/thumbnail   | | Mobile  | Medium (320x568)      | /thumbnails/mobile/medium       | | Mobile  | Small (160x284)       | /thumbnails/mobile/small        | | Mobile  | Thumbnail (80x142)    | /thumbnails/mobile/thumbnail    | | Mobile  | Lighthouse report     | /thumbnails/mobile/lighthouse   | | Tablet  | Medium (400x300)      | /thumbnails/tablet/medium       | | Tablet  | Small (200x150)       | /thumbnails/tablet/small        | | Tablet  | Thumbnail (100x75)    | /thumbnails/tablet/thumbnail    | Add this thumbnail filename to the prefix path to create the final URL path to the desired thumbnail type and size. For example: `https://app.acmeseo.com/thumbnails/desktop/medium/fb8a42eaaad1eaf41f73e3643140e8f87a15f057.webp` The Lighthouse report is the Google Lighthouse report of the homepage on mobile, in JSON. Its filename is the same with the `.json` extension instead of `.webp`: `https://app.acmeseo.com/thumbnails/mobile/lighthouse/fb8a42eaaad1eaf41f73e3643140e8f87a15f057.json`
      - `error` (object, nullable): Only present when the site could not be checked: the HTTP status and the cURL code and message
        - `http_status` (number)
        - `curl_status` (number)
        - `curl_message` (string)
      - `config` (object): The settings of the site, as your customer or your integration saved them
        - `company_name` (string, nullable): The name of the business
        - `is_local` (boolean): Whether it is a local business: `true` when `city` is set
        - `city` (string, nullable): The city of a local business, empty if it is not one
        - `country` (string): The country the site targets, as a lowercase `ISO 3166-1 alpha-2` code
        - `webmaster_email` (string, nullable): The email of the person in charge of the site
        - `webmaster_name` (string, nullable): The name of the person in charge of the site
        - `goal` (string, nullable): The main goal of the site, `customers`, `visibility` or `loyalty` (older accounts may have other values), or `null` if it is not set
        - `industry` (string, nullable): The industry of the business: `finance`, `education`, `tech-ecommerce`, `entertainment`, `food-services`, `real-estate`, `healthcare-wellness`, `travel-hospitality`, `home-services` or `other`
        - `cms` (string): The CMS of the site, as detected in the last scan
        - `google_oauth` (object, nullable): The Google services connected to the account, or `null` if none is
          - `profile` (object): The property connected in each service
            - `google_analytics` (object, nullable): The Google Analytics property, or `null`
              - `name` (string): The name of the property
              - `web_property_id` (string): The ID of the property
            - `google_search_console` (object, nullable): The Google Search Console property, or `null`
              - `web_property_id` (string): The URL of the property
            - `google_business` (object, nullable): The Google Business Profile location, or `null`
              - `id` (string): The ID of the location in Google
              - `name` (string): The name of the business on Google
              - `account_id` (string): The ID of the Google account the location belongs to
              - `account_name` (string): The name of that Google account
              - `address` (string, nullable): The address of the business, or `null`
              - `phone` (string, nullable): The main phone of the business, or `null`
              - `website` (string, nullable): The website the profile links to, or `null`
              - `place_id` (string, nullable): The Google Maps place ID, or `null`
          - `scopes` (object): Whether your customer gave access to each service
            - `google_analytics` (boolean)
            - `google_search_console` (boolean)
            - `google_business` (boolean)
          - `need_authentication` (boolean): `true` when the connection has expired or was revoked and your customer has to connect again
        - `phone_prefix` (string, nullable): The international calling code of the business phone
        - `phone_number` (string, nullable): The phone number of the business
        - `logo` (string, nullable): The absolute URL of the business logo
        - `openai` (object): How many AI suggestions are left
          - `meta_tries_left` (integer): AI meta description suggestions left today (`meta_suggestions` of the product, every day)
          - `optimize_tries_left` (integer): AI page optimization suggestions left this month (`optimize_suggestions` of the product, every month)
        - `tools` (object): What was saved in the tools of the site
          - `structureddata` (object, nullable): The data last saved in the structured data generator (`LocalBusiness`), or `null`

```json
{
  "data": {
    "type": "account",
    "id": "{uuid}",
    "attributes": {
      "uuid": "{uuid}",
      "promo": "xmas-promo",
      "created_at": "2026-05-19T16:52:09Z",
      "deleted_at": null,
      "suspended_at": null,
      "delete_date": null,
      "trial_period": 0,
      "demo": 0,
      "is_configured": true,
      "product": "evolution",
      "product_details": {
        "name": "Pro",
        "features": {
          "api_only": false,
          "allow_anonymous": false,
          "max_keywords": 20,
          "max_competitors": 4,
          "max_pages": 1000,
          "ofs_tool": true,
          "max_tasks": null,
          "pdf_download": true,
          "scan_interval": 1,
          "scan_on_demand": true,
          "social": false,
          "max_recipients": null,
          "show_wp_instructions": false,
          "have_plugin": null,
          "plugin_basename": null,
          "advanced_tools": true,
          "advanced_popularity": true,
          "meta_suggestions": 3,
          "optimize_suggestions": 20,
          "local_business": true,
          "local_business_ai": true
        },
        "free": false
      },
      "partner_token": "acme-cloud",
      "domain": "www.marketgoo.com",
      "subscription": {
        "type": 2,
        "interval": 1,
        "gateway": "stripe",
        "gateway_id": "sub_1AbCdEfGhIjKlMnOpQrStUvW"
      },
      "name": "John Doe",
      "email": "john@doe.com",
      "ulid": "8d1f6b0c2a9e4f7d3b5c1a0e9f8d7c6b5a4e3d2c",
      "lang": "en",
      "site": {
        "frozen_at": null,
        "domain": "www.marketgoo.com",
        "created_at": "2026-05-19T16:52:09Z",
        "checked_at": "2026-10-29T16:52:50Z",
        "thumbnail": "fb8a42eaaad1eaf41f73e3643140e8f87a15f057.webp"
      }
    }
  }
}
```

#### 400 Bad Request

`application/vnd.marketgoo.api+json`

- `errors` (object[])
  - `code` (number): Numeric error code
  - `title` (string): Error message title
  - `detail` (string): Error message detail
  - `source` (object): This is the parameter that triggered the error
    - `pointer` (string)

```json
{
  "errors": [
    {
      "code": 1023,
      "title": "Invalid Email",
      "detail": "The 'email' parameter is empty or invalid.",
      "source": {
        "pointer": "/data/attributes/email"
      }
    }
  ]
}
```

#### 404 Not Found

`application/vnd.marketgoo.api+json`

- `errors` (object[])
  - `status` (number): HTTP status
  - `title` (string): Error message title
  - `detail` (string): Error message detail

```json
{
  "errors": [
    {
      "status": 404,
      "title": "Not Found",
      "detail": "The requested account ID was not found"
    }
  ]
}
```
