{"openapi":"3.1.2","info":{"title":"Fusio API","version":"1.0.0","description":"The Fusio API lets your own tools work with Fusio: articles, emails, social posts, campaigns, files, contacts, leads, deals, ads and what Fusio knows about your company.\n\n## Address\n\nSend every request to `https://<host>/api`. Most paths start with `/v1/`. The bulk import of leads and deals starts with `/v2/sync/`.\n\n## Sign in with a key\n\nPut the key in the `Authorization` header:\n\n```http\nAuthorization: Bearer <key>\n```\n\nNever put the key in the address or in a shared file. There are two kinds of keys:\n\n- A **personal key** acts as you and can do only what you can do. Make it in the app under Settings → For developers → AI assistants.\n- An **app key** belongs to the company and is meant for your servers. Make it in the app under Settings → For developers → App keys.\n\n## Answer\n\nEvery answer has the same wrapper:\n\n```json\n{ \"status\": \"success\", \"message\": \"Request processed successfully\", \"payload\": {} }\n```\n\nThe data is always in `payload`. When something goes wrong, `status` is `error` and `payload.error` often holds a short code:\n\n| Status | What it means |\n|---|---|\n| 401 | The key is missing, too old, or you turned it off. |\n| 402 | Your company does not have enough AI credits. `payload` holds `requiredCredits`, `availableCredits` and `missingCredits`. |\n| 403 | The key may not do this (`insufficient_scope`), or keys may not use this address (`route_outside_surface`). |\n| 404 | This thing does not exist, or the key cannot see it. |\n| 409 | Someone changed the same data at the same moment (`concurrent_modification`). Nothing was saved, so send the same request again. Some addresses also answer 409 with their own code, and the reference says so at each one. |\n| 422 | The data did not pass the check. `errors` lists each field and why. When the data is fine but the request cannot be done right now, like a campaign that is not ready yet, you get the error wrapper instead: `message` says why, and sometimes `payload` adds details, like `blockers`. |\n| 429 | Too many requests. The `Retry-After` header tells you when to try again. |\n\n## Limits\n\nEach personal key may send 120 requests a minute. Some addresses have their own limit, and the reference says so at each one. Go over a limit and you get 429.\n\n## Lists, pages and filters\n\nLists take `page` and `perPage`. One page holds at most 100 items. Sort with `sort`; a minus means biggest first, like `sort=-publishedAt`. Write a filter as `filter[state]=published`. The reference lists the filters and sorts of each list.\n\n## Permissions\n\nYou give a key permissions (scopes) by area: read, write and run. Each address lists the permissions it needs. From \"Needs one of these permissions\" one is enough; the ones under \"Also needs\" are needed every time.\n\n- **Opt-in permissions**, like sending emails or publishing, are never given by default. You must tick them on purpose.\n- **Extra permissions** are needed only for some values. For example, saving an article as published needs `articles.publish` on top of `articles.write`. The reference says which values need what.\n\n## AI credits\n\nSome addresses make content with AI. They use your company's credits, and the reference marks them with a warning. Send `maxCredits` with each such request: the most it may cost. Without it you get 422. If the work would cost more, nothing happens and you get `max_credits_below_estimate`. You can also give a key a monthly credit limit. When the key reaches it, you get `monthly_credit_limit_reached`."},"servers":[{"url":"https://api.fusio.digital/api"}],"paths":{"/v1/ad-deployments/{deployment}/google-ads/sync":{"post":{"operationId":"ad-deployments.google-ads.sync","tags":["ads"],"parameters":[{"name":"deployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment, from `id` of the answer of `google-ads-search-campaigns.google-ads.deploy`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsDeploymentDetailData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Read a campaign from Google Ads","description":"Reads the campaign from Google Ads, saves what Fusio learned and returns both: the deployment and the campaign as Google Ads has it. Nothing changes in Google Ads. When you must connect Google Ads again, you get 409.\n\nNeeds one of these permissions: ads.write."}},"/v1/ad-deployments/{deployment}/google-ads/reconcile":{"post":{"operationId":"ad-deployments.google-ads.reconcile","tags":["ads"],"parameters":[{"name":"deployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment, from `id` of the answer of `google-ads-search-campaigns.google-ads.deploy`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsDeploymentDetailData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.google"]}],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Repair an unfinished sending","description":"> [!WARNING]\n> This links the campaign in your Google Ads account to Fusio again. For that a key needs `ads.execute.google`.\n\nUse it when sending to Google Ads stopped in the middle and the deployment has status reconciliation_required. Fusio finds the paused campaign it made in Google Ads, checks that every part is there and links it again. It returns the deployment and the campaign.\n\nWhen Fusio cannot find the whole campaign for sure, nothing is saved and you get 422. When another change of the deployment runs, you get 422 too.\n\nThis address allows 10 requests a minute, counted together with the other Google Ads sending addresses (apply, reconcile, status).\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/ad-deployments/{deployment}/google-ads/apply":{"post":{"operationId":"ad-deployments.google-ads.apply","tags":["ads"],"parameters":[{"name":"deployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment, from `id` of the answer of `google-ads-search-campaigns.google-ads.deploy`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planRevision":{"type":"string","pattern":"^[a-f0-9]{64}$","minLength":64,"maxLength":64,"description":"The `currentPlanRevision` of the deployment: 64 characters from 0–9 and a–f. When the plan changed since, you get 409."},"confirmActiveCampaign":{"type":"boolean","description":"true to say you know the campaign runs and the changes go live right away. When it runs and you send false, you get 422."}},"required":["planRevision","confirmActiveCampaign"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdDeploymentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.google"]}],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Send changes to Google Ads","description":"> [!WARNING]\n> This changes the campaign in your Google Ads account, also while it runs. For that a key needs `ads.execute.google`.\n\nSends what you changed in the Fusio campaign since the last sending to Google Ads: texts, links, keywords, ad groups and settings. It returns the deployment. See `hasUnsynchronizedChanges` and `canApplyChanges` first.\n\nThe Fusio campaign must be approved. You get 422 when there is nothing to send, when the deployment failed or needs repair, and when another sending runs.\n\nThis address allows 10 requests a minute, counted together with the other Google Ads sending addresses (apply, reconcile, status).\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/ad-deployments/{deployment}/google-ads/status":{"post":{"operationId":"ad-deployments.google-ads.status","tags":["ads"],"parameters":[{"name":"deployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment, from `id` of the answer of `google-ads-search-campaigns.google-ads.deploy`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/AdDeploymentRemoteStatus","description":"enabled (start the campaign, so it spends money) or paused (stop it)."}},"required":["status"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsDeploymentDetailData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.google"]}],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Start or pause a Google Ads campaign","description":"> [!WARNING]\n> Starting the campaign makes it spend money in Google Ads. For both a key needs `ads.execute.google`.\n\nStarts or pauses the campaign in Google Ads, with its ad groups, ads and keywords, and returns the deployment and the campaign.\n\nTo start it, the Fusio campaign must be approved and all changes sent with `ad-deployments.google-ads.apply`; otherwise you get 422. You get 422 also when the deployment needs repair, and when another change runs.\n\nThis address allows 10 requests a minute, counted together with the other Google Ads sending addresses (apply, reconcile, status).\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/ads/grid":{"get":{"operationId":"ads.grid","tags":["ads"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[platform]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The network, like google or facebook. For prospects it means the ads they came from. Social posts take several, split by commas."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[type]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The kind. One or more values, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["id","state","type","startsAt","createdAt","updatedAt","-id","-state","-type","-startsAt","-createdAt","-updatedAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexAdData"},"description":"The ads of this page."},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List ads in a table","description":"Returns your ads page by page, ready for a table, with problems and the numbers of the last 30 days. Use `filter`, `sort`, `page` and `perPage` as the shape of the list says.\n\nNeeds one of these permissions: ads.read."}},"/v1/ads/options":{"get":{"operationId":"ads.options","tags":["ads"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name. At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[platform]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The network, like google or facebook. For prospects it means the ads they came from. Social posts take several, split by commas."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionAdData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List ads for a picker","description":"Returns ads as short items for a picker.\n\nNeeds one of these permissions: ads.read."}},"/v1/ads/board/summary":{"get":{"operationId":"ads.board.summary","tags":["ads"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[platform]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The network, like google or facebook. For prospects it means the ads they came from. Social posts take several, split by commas."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[type]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The kind. One or more values, split by commas."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BoardSummaryData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Count the ads on the board","description":"Returns how many ads are in each column (state) of the board. Use the same `filter` as for the columns.\n\nNeeds one of these permissions: ads.read."}},"/v1/ads/board/{status}":{"get":{"operationId":"ads.board.column","tags":["ads"],"parameters":[{"name":"status","in":"path","required":true,"schema":{"type":"string","enum":["drafted","rejected","approved","published","scheduled","failed"]},"description":"The column: drafted, rejected, approved, published, scheduled or failed."},{"name":"cursor","in":"query","schema":{"type":["string","null"],"maxLength":512},"description":"Where the next page starts. Take it from nextCursor of the page before."},{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[platform]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The network, like google or facebook. For prospects it means the ads they came from. Social posts take several, split by commas."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[type]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The kind. One or more values, split by commas."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexAdData"},"description":"The ads of this page."},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List the ads of one board column","description":"Returns the ads of one state, page by page. Send `nextCursor` back as `cursor` to load more.\n\nNeeds one of these permissions: ads.read."}},"/v1/ads/generate":{"post":{"operationId":"ads.generate","tags":["ads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["linkedin"],"description":"The ad network: linkedin. You must have it connected."},"mode":{"$ref":"#/components/schemas/AdGenerationMode","description":"What AI makes: ad (a new ad from your brief), post (an ad from a published post of yours) or variants (copies of an ad with other texts)."},"brief":{"type":["string","null"],"maxLength":4000,"description":"What the ad should say, at most 4000 characters."},"objective":{"type":["string","null"],"enum":["website_traffic","post_engagement",null],"description":"The goal: website_traffic or post_engagement. Needed for mode ad."},"format":{"anyOf":[{"$ref":"#/components/schemas/AdFormat"},{"type":"null"}],"description":"The look of the ad, one that fits the network: single_image. Needed for mode ad."},"socialPostId":{"type":["integer","null"],"description":"The number of your published post on the same network. Needed for mode post."},"adId":{"type":["integer","null"],"description":"The number of your ad on the same network to make copies of. Needed for mode variants."},"count":{"type":["integer","null"],"enum":["3","5",null],"description":"How many copies: 3 or 5. Needed for mode variants."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["platform","mode"]}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdGenerationDispatchOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI write ads","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nStarts AI writing ads in the background. The new ads are drafts; nothing goes to the ad network. The answer is 202 with the job.\n\nYou get 422 when the network is not connected or when you send facebook, instagram or `placement`, and 402 when you do not have enough credits. Ads for Facebook and Instagram are written elsewhere, in Meta campaigns.\n\nThis address allows 10 requests a minute.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/ads/issue-counts":{"get":{"operationId":"ads.issue-counts","tags":["ads"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdIssueCountsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Count ads with problems","description":"Returns how many of your ads have a problem on each network, like a rejected or failed ad.\n\nNeeds one of these permissions: ads.read."}},"/v1/ads/overview":{"get":{"operationId":"ads.overview","tags":["ads"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[platform]","in":"query","required":true,"schema":{"type":["string","null"],"enum":["linkedin",null]},"description":"The ad network. Only linkedin works. You must send it."},{"name":"filter[adAccountId]","in":"query","schema":{"type":["integer","null"]},"description":"Only this ad account of yours on that network. Leave it out for all."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Show the ads overview","description":"Returns how your ads on one network did in a range of days: spend, impressions, clicks, the leads and deals they brought, and the numbers of each account and ad.\n\nThis address allows 120 requests a minute, counted together with the other overview addresses.\n\nNeeds one of these permissions: ads.read."}},"/v1/ads/{ad}/performance":{"get":{"operationId":"ads.performance","tags":["ads"],"parameters":[{"name":"ad","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdDailySeriesData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Show the numbers of an ad","description":"Returns the spend, impressions, clicks and conversions of one ad, as totals and by day.\n\nNeeds one of these permissions: ads.read."}},"/v1/ads/{ad}/audience-estimate":{"get":{"operationId":"ads.audience-estimate","tags":["ads"],"parameters":[{"name":"ad","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdAudienceEstimateOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Estimate how many people an ad reaches","description":"Asks the ad network how many people fit the targeting of the ad. Fusio keeps the answer for an hour.\n\nNeeds one of these permissions: ads.read."}},"/v1/ads/bulk":{"post":{"operationId":"ads.bulk","tags":["ads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/AdBulkAction","description":"What to do: move (change the state), duplicate (make draft copies) or delete."},"adIds":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":100,"uniqueItems":true,"description":"The numbers of the ads, from 1 to 100, each once."},"state":{"anyOf":[{"$ref":"#/components/schemas/AdState"},{"type":"null"}],"description":"The new state for move: drafted, rejected, approved, published, scheduled or failed. Needed for move."}},"required":["action","adIds"]},"example":{"action":"move","adIds":[640,641],"state":"approved"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/AdBulkResultData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"Bulk action finished","payload":[{"adId":640,"status":"succeeded","error":null},{"adId":641,"status":"failed","error":"invalid_state_transition"}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"x-fusio-opt-in-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Change many ads at once","description":"> [!WARNING]\n> Moving ads to approved, published or scheduled, and deleting ads that are in the ad network, changes them there. A key needs the execute permission of their network for that and for moving ads to failed: `ads.execute.google` or `ads.execute.linkedin`.\n\nDoes one thing with many ads and returns a result for each ad. One failed ad does not stop the others.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."}},"/v1/ads/{ad}/state":{"patch":{"operationId":"ads.set-state","tags":["ads"],"parameters":[{"name":"ad","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/AdState","description":"The new state: drafted, rejected, approved, published, scheduled or failed."}},"required":["state"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateAdData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"x-fusio-opt-in-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Change the state of an ad","description":"> [!WARNING]\n> Approving, publishing and scheduling an ad starts or changes it in the ad network. Any state other than drafted or rejected needs the execute permission of its network on a key: `ads.execute.google` or `ads.execute.linkedin`.\n\nMoves an ad to a new state and returns it. published and scheduled start it in the network; moving a running ad back to approved pauses it. When the ad starts in the future, published becomes scheduled.\n\nYou get 422 when the ad cannot go to that state, when you schedule it without a future start, and when the network does not take the change. While the state already changes, you get 409.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."}},"/v1/ads":{"post":{"operationId":"ads.store","tags":["ads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenantOAuthPlatformId":{"type":"integer","description":"The number of your LinkedIn connection the ad runs on."},"languageId":{"type":["integer","null"],"description":"The number of the language of the ad. Leave it out for the AI language of your company."},"format":{"anyOf":[{"$ref":"#/components/schemas/AdFormat"},{"type":"null"}],"description":"The look of the ad: only single_image."},"name":{"type":"string","maxLength":60,"description":"The name of the ad, at most 60 characters."},"type":{"type":"string","enum":["website_traffic","post_engagement"],"description":"The goal of the ad: website_traffic (visits to your website) or post_engagement (likes and comments)."},"body":{"type":"string","maxLength":125,"description":"The main text of the ad, at most 125 characters."},"headline":{"type":["string","null"],"maxLength":40,"description":"The headline of the ad, at most 40 characters."},"cta":{"type":"string","enum":["apply_now","book_now","download","get_offer","get_quote","learn_more","subscribe","sign_up"],"description":"The button of the ad: apply_now, book_now, download, get_offer, get_quote, learn_more, subscribe or sign_up."},"finalUrl":{"type":"string","format":"uri","maxLength":2048,"description":"The page the ad leads to, starting with http:// or https://, at most 2048 characters."},"imageFileId":{"type":["integer","null"],"description":"The number of an image in Files to show in the ad. Leave it out for none."},"targetingCountries":{"type":"array","items":{"type":"string","enum":["CZ","SK"]},"minItems":1,"uniqueItems":true,"description":"The countries where the ad shows: CZ, SK or both, at least one, each once."},"targetingInterests":{"type":["array","null"],"items":{"type":"string","maxLength":100},"maxItems":20,"uniqueItems":true,"description":"Interests of the people who should see the ad, at most 20, each at most 100 characters and once."},"targetingAgeMin":{"type":["integer","null"],"minimum":18,"maximum":65,"description":"The lowest age of the people, from 18 to 65. Send it together with targetingAgeMax."},"targetingAgeMax":{"type":["integer","null"],"minimum":18,"maximum":65,"description":"The highest age of the people, from 18 to 65 and not below targetingAgeMin. Send it together with targetingAgeMin."},"budget":{"type":"number","minimum":1,"maximum":9999999,"description":"How much the ad may spend, from 1 to 9999999."},"budgetType":{"type":"string","enum":["daily","lifetime"],"description":"daily (the budget is for each day) or lifetime (the budget is for the whole run; then endsAt is needed)."},"startsAt":{"type":["string","null"],"description":"When the ad starts, in the future, as a date and time with a time zone like 2026-12-01T09:00:00+01:00. Leave it out to start when it goes live."},"endsAt":{"type":["string","null"],"description":"When the ad ends, in the future and after startsAt, as a date and time with a time zone. Needed for a lifetime budget."}},"required":["tenantOAuthPlatformId","name","type","body","cta","finalUrl","targetingCountries","budget","budgetType"]},"example":{"tenantOAuthPlatformId":9,"languageId":2,"format":"single_image","name":"Jarní servis kol","type":"website_traffic","body":"Připrav kolo na sezónu. Servis hotový do 48 hodin, v Brně i s odvozem.","headline":"Jarní servis kola","cta":"book_now","finalUrl":"https://www.example.cz/servis","imageFileId":5120,"targetingCountries":["CZ"],"targetingInterests":["Cyklistika","Horská kola"],"targetingAgeMin":25,"targetingAgeMax":55,"budget":300,"budgetType":"daily","startsAt":"2026-12-01T09:00:00+01:00"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateAdData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Ad created successfully","payload":{"id":640,"userId":88,"tenantId":412,"tenantOAuthPlatformId":9,"languageId":2,"type":"website_traffic","body":"Připrav kolo na sezónu. Servis hotový do 48 hodin, v Brně i s odvozem.","headline":"Jarní servis kola","cta":"book_now","targeting":[],"budget":300,"state":"drafted","rejectReason":null,"name":"Jarní servis kol","format":"single_image","network":"linkedin","tenantOAuthPlatform":null,"publication":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","issue":null,"adAccountId":31,"finalUrl":"https://www.example.cz/servis","imageFileId":5120,"imageUrl":"https://cdn.example.cz/fusio/files/kolo-v-lese.jpg","targetingCountries":["CZ"],"targetingInterests":["Cyklistika","Horská kola"],"targetingAgeMin":25,"targetingAgeMax":55,"budgetType":"daily","startsAt":"2026-12-01T08:00:00Z","endsAt":null,"externalId":null,"isObjectiveLocked":false,"publishError":null,"publishedAt":null,"lastSyncedAt":null,"pendingNetworkChange":"none","last30Days":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Add an ad","description":"Adds an ad as a draft and returns it. Nothing goes to the ad network until you approve and start it with `ads.set-state`.\n\nOnly a LinkedIn connection works. Ads for Facebook and Instagram are made in Meta campaigns. You get 422 when you send `placement`.\n\nNeeds one of these permissions: ads.write."}},"/v1/ads/{ad}":{"get":{"operationId":"ads.show","tags":["ads"],"parameters":[{"name":"ad","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateAdData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Ad retrieved successfully","payload":{"id":640,"userId":88,"tenantId":412,"tenantOAuthPlatformId":9,"languageId":2,"type":"website_traffic","body":"Připrav kolo na sezónu. Servis hotový do 48 hodin, v Brně i s odvozem.","headline":"Jarní servis kola","cta":"book_now","targeting":[],"budget":300,"state":"published","rejectReason":null,"name":"Jarní servis kol","format":"single_image","network":"linkedin","tenantOAuthPlatform":null,"publication":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","issue":null,"adAccountId":31,"finalUrl":"https://www.example.cz/servis","imageFileId":5120,"imageUrl":"https://cdn.example.cz/fusio/files/kolo-v-lese.jpg","targetingCountries":["CZ"],"targetingInterests":["Cyklistika","Horská kola"],"targetingAgeMin":25,"targetingAgeMax":55,"budgetType":"daily","startsAt":"2026-12-01T08:00:00Z","endsAt":null,"externalId":"120214587700410","isObjectiveLocked":true,"publishError":null,"publishedAt":"2026-11-12T13:05:00Z","lastSyncedAt":"2026-11-12T13:05:00Z","pendingNetworkChange":"none","last30Days":{"spend":4210.5,"impressions":38120,"clicks":912,"conversions":41,"currencyCode":"CZK"}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Show an ad","description":"Returns one ad with its texts, targeting, budget, state and problems.\n\nNeeds one of these permissions: ads.read."},"put":{"operationId":"ads.update","tags":["ads"],"parameters":[{"name":"ad","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":60,"description":"The name of the ad, at most 60 characters."},"type":{"type":"string","enum":["website_traffic","post_engagement"],"description":"The goal of the ad: website_traffic (visits to your website) or post_engagement (likes and comments)."},"body":{"type":"string","maxLength":125,"description":"The main text of the ad, at most 125 characters."},"headline":{"type":["string","null"],"maxLength":40,"description":"The headline of the ad, at most 40 characters."},"cta":{"type":"string","enum":["apply_now","book_now","download","get_offer","get_quote","learn_more","subscribe","sign_up"],"description":"The button of the ad: apply_now, book_now, download, get_offer, get_quote, learn_more, subscribe or sign_up."},"finalUrl":{"type":"string","format":"uri","maxLength":2048,"description":"The page the ad leads to, starting with http:// or https://, at most 2048 characters."},"imageFileId":{"type":["integer","null"],"description":"The number of an image in Files to show in the ad. Leave it out for none."},"targetingCountries":{"type":"array","items":{"type":"string","enum":["CZ","SK"]},"minItems":1,"uniqueItems":true,"description":"The countries where the ad shows: CZ, SK or both, at least one, each once."},"targetingInterests":{"type":["array","null"],"items":{"type":"string","maxLength":100},"maxItems":20,"uniqueItems":true,"description":"Interests of the people who should see the ad, at most 20, each at most 100 characters and once."},"targetingAgeMin":{"type":["integer","null"],"minimum":18,"maximum":65,"description":"The lowest age of the people, from 18 to 65. Send it together with targetingAgeMax."},"targetingAgeMax":{"type":["integer","null"],"minimum":18,"maximum":65,"description":"The highest age of the people, from 18 to 65 and not below targetingAgeMin. Send it together with targetingAgeMin."},"budget":{"type":"number","minimum":1,"maximum":9999999,"description":"How much the ad may spend, from 1 to 9999999."},"budgetType":{"type":"string","enum":["daily","lifetime"],"description":"daily (the budget is for each day) or lifetime (the budget is for the whole run; then endsAt is needed)."},"startsAt":{"type":["string","null"],"description":"When the ad starts, in the future or the start the ad already has, as a date and time with a time zone like 2026-12-01T09:00:00+01:00. Leave it out to start when it goes live."},"endsAt":{"type":["string","null"],"description":"When the ad ends, in the future and after startsAt, as a date and time with a time zone. Needed for a lifetime budget."}},"required":["name","type","body","cta","finalUrl","targetingCountries","budget","budgetType"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateAdData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"x-fusio-opt-in-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Change an ad","description":"> [!WARNING]\n> Changing an ad that is approved or failed counts as running it again. Then a key needs the execute permission of its network: `ads.execute.google` or `ads.execute.linkedin`.\n\nSaves the whole ad and returns it. Send every field. When the ad is already in the network, the changes go there the next time you start it.\n\nA published or scheduled ad cannot change; move it to approved first. When the ad is already in the network, its goal and budget type cannot change; make a copy. Both get 422.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."},"delete":{"operationId":"ads.destroy","tags":["ads"],"parameters":[{"name":"ad","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"x-fusio-opt-in-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Remove an ad","description":"> [!WARNING]\n> This cannot be undone.\n\n> [!WARNING]\n> When the ad is in the ad network, this removes it there too. Then a key needs the execute permission of its network: `ads.execute.google` or `ads.execute.linkedin`.\n\nRemoves an ad.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."}},"/v1/ad-improvements":{"get":{"operationId":"ad-improvements.index","tags":["ads"],"parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","enum":["google","facebook","linkedin"]},"description":"The ad network: google, facebook or linkedin."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/AdImprovementOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List tips for your ads","description":"Returns the open tips Fusio found for your ads on one network, like a search term to exclude or a low click rate.\n\nTips for your Meta campaigns come with `platform=facebook`. They can be learning_limited, creative_fatigue, poor_performing_ad or rejected_ad. For them campaignId, adId and adSetId point to the campaign, ad and ad set in your Meta plan.\n\nFor learning_limited, amount is the daily budget to set. It is null when your budget is already high enough. It is also null without an estimate, a known budget, or the same currency. For poor_performing_ad, amount is the cost of one result. When results is 0, amount is what the ad spent.\n\nNeeds one of these permissions: ads.read."}},"/v1/ad-improvements/{improvement}/dismiss":{"post":{"operationId":"ad-improvements.dismiss","tags":["ads"],"parameters":[{"name":"improvement","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the tip, from `ad-improvements.index`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Hide a tip","description":"Hides a tip, so it is not in the list any more. Nothing changes in the ad network. When the tip is not open, you get 422.\n\nNeeds one of these permissions: ads.write."}},"/v1/ad-improvements/{improvement}/accept":{"post":{"operationId":"ad-improvements.accept","tags":["ads"],"parameters":[{"name":"improvement","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the tip, from `ad-improvements.index`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"x-fusio-opt-in-scopes":["ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Use a tip","description":"> [!WARNING]\n> This changes your live campaign in the ad network. For that a key needs the execute permission of its network: `ads.execute.google`, `ads.execute.facebook` or `ads.execute.linkedin`.\n\nDoes what the tip says. Now this works only for exclude_search_term: Fusio adds the search term as a negative keyword to the Google Ads campaign. Meta tips (learning_limited, creative_fatigue, poor_performing_ad, rejected_ad) cannot be used here, you get 422. Act on them in the Meta campaign instead.\n\nYou get 422 when the tip is not open, when it cannot be used this way, when the campaign is not running or paused in Google Ads from Fusio, and when Google Ads does not take the change.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."}},"/v1/tenant-ad-platforms/{tenantOAuthPlatform}/accounts/{accountId}/pages":{"get":{"operationId":"tenant-ad-platforms.account-pages","tags":["ads"],"parameters":[{"name":"tenantOAuthPlatform","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of your connection to the ad network."},{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"The number of the ad account in the ad network, from `externalId`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/ExternalAdAccountPageData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List pages of an ad account","description":"Asks the ad network for the pages ads can run for: Facebook pages for a Facebook account, company pages for LinkedIn.\n\nNeeds one of these permissions: ads.read."}},"/v1/tenant-ad-platforms/{tenantOAuthPlatform}/accounts/{accountId}/pixels":{"get":{"operationId":"tenant-ad-platforms.account-pixels","tags":["ads"],"parameters":[{"name":"tenantOAuthPlatform","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of your connection to the ad network."},{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"The number of the ad account in the ad network, from `externalId`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/ExternalAdAccountPixelData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List pixels of an ad account","description":"Asks the ad network for the pixels that count results on your website: Meta pixels for Facebook, Insight Tags for LinkedIn.\n\nNeeds one of these permissions: ads.read."}},"/v1/tenant-ad-platforms/{tenantOAuthPlatform}/accounts/{accountId}/instagram-accounts":{"get":{"operationId":"tenant-ad-platforms.account-instagram-accounts","tags":["ads"],"parameters":[{"name":"tenantOAuthPlatform","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of your connection to the ad network."},{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"The number of the ad account in the ad network, from `externalId`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/ExternalAdAccountInstagramData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List Instagram accounts of an ad account","description":"Asks Meta for the Instagram accounts that ads of this account can run from: accounts linked to its Facebook pages and accounts added to the ad account. Works only for a Meta connection.\n\nNeeds one of these permissions: ads.read."}},"/v1/tenant-ad-platforms/{tenantOAuthPlatform}/accounts/{accountId}/dsa-recommendations":{"get":{"operationId":"tenant-ad-platforms.account-dsa-recommendations","tags":["ads"],"parameters":[{"name":"tenantOAuthPlatform","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of your connection to the ad network."},{"name":"accountId","in":"path","required":true,"schema":{"type":"string"},"description":"The number of the ad account in the ad network, from `externalId`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/ExternalAdAccountDsaRecommendationsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List DSA suggestions of an ad account","description":"Asks Meta who usually benefits from and pays for the ads of this account, as the EU Digital Services Act requires. Works only for a Meta connection.\n\nNeeds one of these permissions: ads.read."}},"/v1/tenant-ad-platforms/{tenantOAuthPlatform}/ad-accounts":{"get":{"operationId":"tenant-ad-platforms.ad-accounts","tags":["ads"],"parameters":[{"name":"tenantOAuthPlatform","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of your connection to the ad network."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateAdAccountData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List ad accounts of a connection","description":"Returns the ad accounts of a connection that are added to Fusio, with their billing and status.\n\nNeeds one of these permissions: ads.read."}},"/v1/tenant-ad-platforms/{tenantOAuthPlatform}/linkedin/targeting-facets":{"get":{"operationId":"tenant-ad-platforms.linkedin.targeting-facets","tags":["ads"],"parameters":[{"name":"tenantOAuthPlatform","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of your connection to the ad network."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/LinkedInTargetingFacetCategoryOutputData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"LinkedIn targeting kinds loaded successfully","payload":[{"basic_demographics":[{"genders":"urn:li:adTargetingFacet:genders"},{"ageRanges":"urn:li:adTargetingFacet:ageRanges"},{"interfaceLocales":"urn:li:adTargetingFacet:interfaceLocales"}]},{"professional_information":[{"industries":"urn:li:adTargetingFacet:industries"},{"jobFunctions":"urn:li:adTargetingFacet:jobFunctions"},{"seniorities":"urn:li:adTargetingFacet:seniorities"},{"titles":"urn:li:adTargetingFacet:titles"},{"titlesPast":"urn:li:adTargetingFacet:titlesPast"},{"titlesAll":"urn:li:adTargetingFacet:titlesAll"},{"skills":"urn:li:adTargetingFacet:skills"},{"yearsOfExperienceRanges":"urn:li:adTargetingFacet:yearsOfExperienceRanges"}]},{"education":[{"schools":"urn:li:adTargetingFacet:schools"},{"degrees":"urn:li:adTargetingFacet:degrees"},{"fieldsOfStudy":"urn:li:adTargetingFacet:fieldsOfStudy"}]},{"company_information":[{"staffCountRanges":"urn:li:adTargetingFacet:staffCountRanges"},{"employers":"urn:li:adTargetingFacet:employers"},{"employersPast":"urn:li:adTargetingFacet:employersPast"},{"employersAll":"urn:li:adTargetingFacet:employersAll"},{"companyCategory":"urn:li:adTargetingFacet:companyCategory"},{"growthRate":"urn:li:adTargetingFacet:growthRate"},{"revenue":"urn:li:adTargetingFacet:revenue"}]},{"location":[{"locations":"urn:li:adTargetingFacet:locations"},{"profileLocations":"urn:li:adTargetingFacet:profileLocations"}]},{"social_behavioral":[{"groups":"urn:li:adTargetingFacet:groups"},{"interests":"urn:li:adTargetingFacet:interests"},{"memberBehaviors":"urn:li:adTargetingFacet:memberBehaviors"},{"followedCompanies":"urn:li:adTargetingFacet:followedCompanies"},{"firstDegreeConnectionCompanies":"urn:li:adTargetingFacet:firstDegreeConnectionCompanies"}]},{"advanced_targeting":[{"audienceMatchingSegments":"urn:li:adTargetingFacet:audienceMatchingSegments"},{"dynamicSegments":"urn:li:adTargetingFacet:dynamicSegments"}]}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List LinkedIn targeting kinds","description":"Returns the kinds of LinkedIn targeting, sorted into groups. Each item of the list has one group key; its value is a list of kinds, each a name with its LinkedIn URN.\n\nSend a URN to `tenant-ad-platforms.linkedin.targeting-entities` to get the values of that kind.\n\nNeeds one of these permissions: ads.read."}},"/v1/tenant-ad-platforms/{tenantOAuthPlatform}/linkedin/{facetUrn}/targeting-entities":{"get":{"operationId":"tenant-ad-platforms.linkedin.targeting-entities","tags":["ads"],"parameters":[{"name":"tenantOAuthPlatform","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of your connection to the ad network."},{"name":"facetUrn","in":"path","required":true,"schema":{"type":"string"},"description":"The LinkedIn URN of the kind, like urn:li:adTargetingFacet:industries."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/LinkedInAdTargetingEntityData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List values of a LinkedIn targeting kind","description":"Asks LinkedIn for the values of one targeting kind, like all industries.\n\nNeeds one of these permissions: ads.read."}},"/v1/tenant-ad-platforms/{tenantOAuthPlatform}/linkedin/geolocations/search/{searchQuery}":{"get":{"operationId":"tenant-ad-platforms.linkedin.geolocations.search","tags":["ads"],"parameters":[{"name":"tenantOAuthPlatform","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of your connection to the ad network."},{"name":"searchQuery","in":"path","required":true,"schema":{"type":"string"},"description":"The name of the place to look for."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/LinkedInGeoTypeaheadData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Find LinkedIn places","description":"Asks LinkedIn for places whose name fits your text, for the targeting of an ad.\n\nNeeds one of these permissions: ads.read."}},"/v1/ai/action-prices":{"get":{"operationId":"ai.action-prices.index","tags":["ai"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AiActionPricesOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"AI prices loaded.","payload":{"prices":{"article-generation":12,"social-post-generation":4,"image-generation":6,"campaign-ai-analyze":3,"campaign-ai-plan":25,"lead_firmographic_enrichment":1},"creditBalance":1840.5}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate"]}],"summary":"List AI prices","description":"Returns what each AI action costs your company in credits, and how many credits you have. The prices already hold the margin of your company.\n\nThe price of lead_firmographic_enrichment is for looking up one company of a lead. It is a fixed price, without the margin.\n\nNeeds one of these permissions: ai.generate."}},"/v1/ai/credit-estimate":{"get":{"operationId":"ai.credit-estimate.show","tags":["ai"],"parameters":[{"name":"kind","in":"query","required":true,"schema":{"$ref":"#/components/schemas/AiCreditEstimateKind"},"description":"The AI work to price: google_ad_group (a Google Ads ad group), google_texts (texts of a Google Ads ad), social_ad (a social ad), seo_audit_market (a market check of your website), seo_google_ads_search_refresh (a market check with new Google Ads ad groups), worker_instructions (instructions of an AI worker), meta_ads_campaign (a new Meta campaign with its pictures), meta_ads_texts (texts of a Meta ad), meta_ads_targets (who should see a Meta ad set), meta_ads_images (pictures of a Meta ad) or meta_ads_ad_set_ads (new ads of a Meta ad set)."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AiCreditEstimateOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Request processed successfully","payload":{"minimum":9,"maximum":14,"balance":1840.5,"sources":[{"scope":"product","isAvailable":true},{"scope":"brand_voice","isAvailable":true},{"scope":"customers","isAvailable":false}],"parts":[{"prompt":"generate-social-ad","maximum":14}]}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate"]}],"summary":"Guess the cost of AI work","description":"Tells you before you start how many credits a kind of AI work costs. Send the result as `maxCredits` with the real request.\n\nYou get 403 when you may not make that kind of thing.\n\nNeeds one of these permissions: ai.generate."}},"/v1/ai/image-models":{"get":{"operationId":"ai.image-models.index","tags":["ai"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/ImageModelOptionData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate"]}],"summary":"List AI image models","description":"Returns the AI models that can draw pictures for you, with the price of one picture.\n\nNeeds one of these permissions: ai.generate."}},"/v1/ai/generation-runs/{aiGenerationRun}":{"get":{"operationId":"ai.generation-runs.show","tags":["ai"],"parameters":[{"name":"aiGenerationRun","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the AI job, from `runId`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AiGenerationRunStatusOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Generation status loaded.","payload":{"id":5521,"kind":"article","status":"completed","step":"article-generation","label":"Jak vybrat horské kolo","entityType":"article","entityId":1284,"createdAt":"2026-11-03T08:30:00Z","startedAt":"2026-11-03T08:30:02Z","finishedAt":"2026-11-03T08:31:10Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate"]}],"summary":"Show an AI job","description":"Shows how an AI job goes. Ask again every few seconds until `status` is completed, failed or partial.\n\nOnly jobs of your company that write an article, an email, a social post or ads are here; others give 404. For ads, look in `ads.grid` when the job is done.\n\nNeeds one of these permissions: ai.generate."}},"/v1/ai/entity-generation/social/{platform}/clarify":{"post":{"operationId":"ai.entity-generation.social.clarify","tags":["ai"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string"},"description":"The kind of post: x_post, x_thread, facebook_post, instagram_post or linkedin_post. Another value gives 404."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":5,"maxLength":4000,"description":"What you want, in your own words. From 5 to 4000 characters."},"workerId":{"type":["integer","null"],"description":"The number of an active AI worker whose instructions AI follows. Leave it out for none."},"languageId":{"type":"integer","description":"The number of the language to write in."},"priorAnswers":{"type":["array","null"],"items":{"type":"string","maxLength":4000},"maxItems":50,"description":"Your answers to the questions you got before, as an object: the `key` of each question and your answer as text. At most 50 answers, each key at most 100 characters and each answer at most 4000 characters. Leave it out the first time."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["description","languageId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/ClarificationResultData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate"]}],"summary":"Ask AI about a social post","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAsks AI if it knows enough to write the social post. AI reads what you want and what it knows about your company.\n\nWhen AI knows enough, `proceed` is true and `contextBundle` holds the brief: send it to `ai.entity-generation.social.generate`. When AI needs more, `proceed` is false and you get `questions`. Answer them and ask again with the same text and your answers in `priorAnswers`.\n\nThe same question with the same answers gives the same result for 30 minutes.\n\nYou get 402 when you do not have enough credits.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate."}},"/v1/ai/entity-generation/social/{platform}/generate":{"post":{"operationId":"ai.entity-generation.social.generate","tags":["ai"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string"},"description":"The kind of post: x_post, x_thread, facebook_post, instagram_post or linkedin_post. Another value gives 404."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextBundle":{"type":"object","properties":{"origin":{"type":"string","enum":["standalone","campaign"],"description":"standalone (a piece on its own) or campaign (a piece for a campaign)."},"goal":{"type":"string","description":"What the piece should do."},"audience":{"type":"string","description":"Who the piece is for."},"topicOrAngle":{"type":"string","description":"The topic, or the side of it the piece looks at."},"hookCategory":{"type":"string","enum":["data_drop","contrarian","question","pattern_interrupt","personal_stake","curiosity","story","value","social_proof","observation","poll","vivid_story","data_led","prediction"],"description":"How the start grabs attention. Each network allows its own values: x_post data_drop, contrarian, question, pattern_interrupt or personal_stake; x_thread curiosity, story, value, contrarian or social_proof; facebook_post story, question, contrarian, observation or poll; instagram_post curiosity, vivid_story, contrarian, data_led or question; linkedin_post data_led, contrarian, story, question or prediction."},"formatHint":{"type":["string","null"],"description":"A hint about the shape, like a list or a story. Leave it out for none."},"contentAtom":{"type":"string","description":"The one main idea the piece carries."},"campaignSummary":{"type":["string","null"],"description":"A short summary of the campaign. Leave it out for none."},"sourceDigest":{"type":["string","null"],"description":"A short summary of the sources to write from. Leave it out for none."},"recentAssets":{"type":["string","null"],"description":"What you published lately, so AI does not repeat it. Leave it out for none."}},"required":["origin","goal","audience","topicOrAngle","hookCategory","contentAtom"],"description":"The brief for the post. The easiest way is to send the `contextBundle` you got from clarify; keys that are not listed here are not used."},"workerId":{"type":["integer","null"],"description":"The number of an active AI worker whose instructions AI follows. Leave it out for none."},"languageId":{"type":"integer","description":"The number of the language to write in."},"topicId":{"type":["integer","null"],"description":"The number of an active topic of yours the piece belongs to. Leave it out for none."},"campaignId":{"type":["integer","null"],"description":"The number of an active campaign to put the piece in. Then scheduledAt is needed too."},"scheduledAt":{"type":["string","null"],"description":"When the piece goes out, as a date and time with a time zone like 2026-12-01T09:00:00+01:00. Needed with campaignId."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."},"hashtagStrategy":{"type":["string","null"],"enum":["none","minimal","trending","branded",null],"description":"How hashtags are used: none, minimal (the default), trending or branded."},"generateFirstComment":{"type":"boolean","description":"true to let AI also write the first comment under the post. The default is false."},"firstCommentGuidance":{"type":["string","null"],"maxLength":2000,"description":"What the first comment should say, at most 2000 characters."},"imageMode":{"type":["string","null"],"enum":["none","ai","upload",null],"description":"Where the pictures come from: none (no pictures, the default), ai (AI draws them) or upload (your images from Files)."},"tenantImageProfileId":{"type":["integer","null"],"description":"The number of the image style preset AI draws with. Only with imageMode ai."},"fileIds":{"type":["array","null"],"items":{"type":"integer"},"maxItems":4,"uniqueItems":true,"description":"The numbers of your images in Files, at most 4, JPEG or PNG; WebP too for X, and only JPEG for Instagram. Needed with imageMode upload and not allowed with the others."}},"required":["contextBundle","languageId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DispatchedGenerationRunData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","social-posts.write"]}],"x-fusio-conditional-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"x-fusio-opt-in-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"summary":"Let AI write a social post","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\n> [!WARNING]\n> With campaignId or scheduledAt the piece goes out on its own at that time. For that a key needs the publish permission of its network: `social-posts.publish.x` for x_post and x_thread, `social-posts.publish.facebook` for facebook_post, `social-posts.publish.instagram` for instagram_post or `social-posts.publish.linkedin` for linkedin_post. Without that permission you get 403.\n\nStarts AI writing the social post in the background. The answer is the number of the job right away; ask `ai.generation-runs.show` with it until `status` is completed, then `entityId` is the new social post.\n\nWithout campaignId the piece is a draft. With campaignId it joins the campaign; a key then also needs `campaigns.write`, or you get 403.\n\nYou get 402 when you do not have enough credits and 422 when a field does not fit.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: social-posts.write. Some values also need: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram. You must tick these on purpose: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram."}},"/v1/ai/entity-generation/article/clarify":{"post":{"operationId":"ai.entity-generation.article.clarify","tags":["ai"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":5,"maxLength":4000,"description":"What you want, in your own words. From 5 to 4000 characters."},"workerId":{"type":["integer","null"],"description":"The number of an active AI worker whose instructions AI follows. Leave it out for none."},"languageId":{"type":"integer","description":"The number of the language to write in."},"priorAnswers":{"type":["array","null"],"items":{"type":"string","maxLength":4000},"maxItems":50,"description":"Your answers to the questions you got before, as an object: the `key` of each question and your answer as text. At most 50 answers, each key at most 100 characters and each answer at most 4000 characters. Leave it out the first time."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["description","languageId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/ClarificationResultData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"The questions about the content are ready.","payload":{"proceed":false,"contextBundle":null,"questions":[{"key":"audience","label":"Pro koho","question":"Pro koho článek píšeš?","inputType":"single_choice","options":[{"value":"families","label":"Rodiny s dětmi"},{"value":"riders","label":"Sportovní jezdci"},{"value":"commuters","label":"Lidé, co jezdí do práce"}],"allowSkip":false,"suggestedValue":"families"}]}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate"]}],"summary":"Ask AI about an article","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAsks AI if it knows enough to write the article. AI reads what you want and what it knows about your company.\n\nWhen AI knows enough, `proceed` is true and `contextBundle` holds the brief: send it to `ai.entity-generation.article.generate`. When AI needs more, `proceed` is false and you get `questions`. Answer them and ask again with the same text and your answers in `priorAnswers`.\n\nThe same question with the same answers gives the same result for 30 minutes.\n\nYou get 402 when you do not have enough credits.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate."}},"/v1/ai/entity-generation/article/generate":{"post":{"operationId":"ai.entity-generation.article.generate","tags":["ai"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextBundle":{"type":"object","properties":{"origin":{"type":"string","enum":["standalone","campaign"],"description":"standalone (a piece on its own) or campaign (a piece for a campaign)."},"goal":{"type":"string","description":"What the piece should do."},"audience":{"type":"string","description":"Who the piece is for."},"topicOrAngle":{"type":"string","description":"The topic, or the side of it the piece looks at."},"hookCategory":{"type":"string","enum":["curiosity","story","value","contrarian","social_proof"],"description":"How the start grabs attention: curiosity, story, value, contrarian or social_proof."},"formatHint":{"type":["string","null"],"description":"A hint about the shape, like a list or a story. Leave it out for none."},"contentAtom":{"type":"string","description":"The one main idea the piece carries."},"campaignSummary":{"type":["string","null"],"description":"A short summary of the campaign. Leave it out for none."},"sourceDigest":{"type":["string","null"],"description":"A short summary of the sources to write from. Leave it out for none."},"recentAssets":{"type":["string","null"],"description":"What you published lately, so AI does not repeat it. Leave it out for none."}},"required":["origin","goal","audience","topicOrAngle","hookCategory","contentAtom"],"description":"The brief for the article. The easiest way is to send the `contextBundle` you got from clarify; keys that are not listed here are not used."},"workerId":{"type":["integer","null"],"description":"The number of an active AI worker whose instructions AI follows. Leave it out for none."},"languageId":{"type":"integer","description":"The number of the language to write in."},"topicId":{"type":["integer","null"],"description":"The number of an active topic of yours the piece belongs to. Leave it out for none."},"campaignId":{"type":["integer","null"],"description":"The number of an active campaign to put the piece in. Then scheduledAt is needed too."},"scheduledAt":{"type":["string","null"],"description":"When the piece goes out, as a date and time with a time zone like 2026-12-01T09:00:00+01:00. Needed with campaignId."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."},"imageMode":{"type":["string","null"],"enum":["none","ai","upload",null],"description":"Where the pictures come from: none (no pictures, the default), ai (AI draws them) or upload (your images from Files)."},"tenantImageProfileId":{"type":["integer","null"],"description":"The number of the image style preset AI draws with. Only with imageMode ai."},"fileIds":{"type":["array","null"],"items":{"type":"integer"},"maxItems":2,"uniqueItems":true,"description":"The numbers of your images in Files, at most 2, JPEG, PNG or WebP, for the body of the article. Only with imageMode upload, which needs fileIds, bannerFileId or both."},"inContentImageCount":{"type":["integer","null"],"minimum":0,"maximum":2,"description":"How many pictures AI draws into the text, from 0 to 2. More than 0 only with imageMode ai."},"bannerFileId":{"type":["integer","null"],"description":"The number of your image in Files for the banner at the top. Only with imageMode upload. It must not be in fileIds too."},"bannerType":{"anyOf":[{"$ref":"#/components/schemas/ArticleBannerType"},{"type":"null"}],"description":"How AI makes the banner: photo, text (a banner with words) or cutout (a cut-out picture on a plain background). The default is photo."}},"required":["contextBundle","languageId"]},"example":{"contextBundle":{"origin":"standalone","goal":"Přivést lidi do servisu před sezónou.","audience":"Rodiny z Brna, které jezdí o víkendech.","topicOrAngle":"Co zkontrolovat na kole po zimě","hookCategory":"value","contentAtom":"Pět kontrol po zimě ušetří drahou opravu."},"languageId":2,"maxCredits":40,"imageMode":"ai","tenantImageProfileId":19,"inContentImageCount":1}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DispatchedGenerationRunData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Writing the content has started.","payload":{"runId":5521}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","articles.write"]}],"x-fusio-conditional-scopes":["articles.publish"],"x-fusio-opt-in-scopes":["articles.publish"],"summary":"Let AI write an article","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\n> [!WARNING]\n> With campaignId or scheduledAt the piece goes out on its own at that time. For that a key needs `articles.publish`. Without that permission you get 403.\n\nStarts AI writing the article in the background. The answer is the number of the job right away; ask `ai.generation-runs.show` with it until `status` is completed, then `entityId` is the new article.\n\nWithout campaignId the piece is a draft. With campaignId it joins the campaign; a key then also needs `campaigns.write`, or you get 403.\n\nYou get 402 when you do not have enough credits and 422 when a field does not fit.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: articles.write. Some values also need: articles.publish. You must tick these on purpose: articles.publish."}},"/v1/ai/entity-generation/email/clarify":{"post":{"operationId":"ai.entity-generation.email.clarify","tags":["ai"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":5,"maxLength":4000,"description":"What you want, in your own words. From 5 to 4000 characters."},"workerId":{"type":["integer","null"],"description":"The number of an active AI worker whose instructions AI follows. Leave it out for none."},"languageId":{"type":"integer","description":"The number of the language to write in."},"priorAnswers":{"type":["array","null"],"items":{"type":"string","maxLength":4000},"maxItems":50,"description":"Your answers to the questions you got before, as an object: the `key` of each question and your answer as text. At most 50 answers, each key at most 100 characters and each answer at most 4000 characters. Leave it out the first time."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."},"emailTemplateCategory":{"type":["string","null"],"enum":["article_newsletter","general_newsletter","promotion","re_engagement","warm_followup","lead_nurture","product_announcement","seasonal_campaign","survey","referral","event_invitation","welcome","onboarding","win_back","transactional","warm_announcement_cta","abandoned_action","general_update","sequence_opener","sequence_teach","sequence_proof","sequence_objection","sequence_close",null],"description":"The kind of email template: article_newsletter, general_newsletter, promotion, re_engagement, warm_followup, lead_nurture, product_announcement, seasonal_campaign, survey, referral, event_invitation, welcome, onboarding, win_back, transactional, warm_announcement_cta, abandoned_action, general_update, sequence_opener, sequence_teach, sequence_proof, sequence_objection or sequence_close. Leave it out to let AI pick."}},"required":["description","languageId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/ClarificationResultData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate"]}],"summary":"Ask AI about an email","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAsks AI if it knows enough to write the email. AI reads what you want and what it knows about your company.\n\nWhen AI knows enough, `proceed` is true and `contextBundle` holds the brief: send it to `ai.entity-generation.email.generate`. When AI needs more, `proceed` is false and you get `questions`. Answer them and ask again with the same text and your answers in `priorAnswers`.\n\nThe same question with the same answers gives the same result for 30 minutes.\n\nYou get 402 when you do not have enough credits.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate."}},"/v1/ai/entity-generation/email/generate":{"post":{"operationId":"ai.entity-generation.email.generate","tags":["ai"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contextBundle":{"type":"object","properties":{"origin":{"type":"string","enum":["standalone","campaign"],"description":"standalone (a piece on its own) or campaign (a piece for a campaign)."},"goal":{"type":"string","description":"What the piece should do."},"audience":{"type":"string","description":"Who the piece is for."},"topicOrAngle":{"type":"string","description":"The topic, or the side of it the piece looks at."},"hookCategory":{"type":"string","enum":["curiosity","story","value","contrarian","social_proof","trigger_event"],"description":"How the start grabs attention: curiosity, story, value, contrarian, social_proof or trigger_event."},"formatHint":{"type":["string","null"],"description":"A hint about the shape, like a list or a story. Leave it out for none."},"contentAtom":{"type":"string","description":"The one main idea the piece carries."},"campaignSummary":{"type":["string","null"],"description":"A short summary of the campaign. Leave it out for none."},"sourceDigest":{"type":["string","null"],"description":"A short summary of the sources to write from. Leave it out for none."},"recentAssets":{"type":["string","null"],"description":"What you published lately, so AI does not repeat it. Leave it out for none."},"audienceWarmth":{"type":"string","enum":["warm","owned"],"description":"Who gets the email: warm (people who know you a bit) or owned (people who signed up). It must fit the template."},"emailKind":{"type":"string","enum":["broadcast"],"description":"broadcast: one email to many people."},"ctaUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"The page the button of the email leads to, starting with http:// or https://, at most 2048 characters. Leave it out for none."}},"required":["origin","goal","audience","topicOrAngle","hookCategory","contentAtom","audienceWarmth","emailKind"],"description":"The brief for the email. The easiest way is to send the `contextBundle` you got from clarify; keys that are not listed here are not used."},"workerId":{"type":["integer","null"],"description":"The number of an active AI worker whose instructions AI follows. Leave it out for none."},"languageId":{"type":"integer","description":"The number of the language to write in."},"topicId":{"type":["integer","null"],"description":"The number of an active topic of yours the piece belongs to. Leave it out for none."},"campaignId":{"type":["integer","null"],"description":"The number of an active campaign to put the piece in. Then scheduledAt is needed too."},"scheduledAt":{"type":["string","null"],"description":"When the piece goes out, as a date and time with a time zone like 2026-12-01T09:00:00+01:00. Needed with campaignId."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."},"imageMode":{"type":["string","null"],"enum":["none","ai","upload",null],"description":"Where the pictures come from: none (no pictures, the default), ai (AI draws them) or upload (your images from Files)."},"tenantImageProfileId":{"type":["integer","null"],"description":"The number of the image style preset AI draws with. Only with imageMode ai."},"fileIds":{"type":["array","null"],"items":{"type":"integer"},"maxItems":12,"uniqueItems":true,"description":"The numbers of your images in Files, at most 12, JPEG, PNG or WebP. Send as many as the template has image places. Needed with imageMode upload and not allowed with the others."},"emailTemplateCategory":{"type":["string","null"],"enum":["article_newsletter","general_newsletter","promotion","re_engagement","warm_followup","lead_nurture","product_announcement","seasonal_campaign","survey","referral","event_invitation","welcome","onboarding","win_back","transactional","warm_announcement_cta","abandoned_action","general_update","sequence_opener","sequence_teach","sequence_proof","sequence_objection","sequence_close",null],"description":"The kind of email template: article_newsletter, general_newsletter, promotion, re_engagement, warm_followup, lead_nurture, product_announcement, seasonal_campaign, survey, referral, event_invitation, welcome, onboarding, win_back, transactional, warm_announcement_cta, abandoned_action, general_update, sequence_opener, sequence_teach, sequence_proof, sequence_objection or sequence_close. Needed with imageMode ai or upload, and it must fit audienceWarmth."},"aiImageCount":{"type":["integer","null"],"minimum":1,"maximum":12,"description":"How many pictures AI draws, from 1 to 12, as many as the template has image places. Needed with imageMode ai and not allowed with the others."}},"required":["contextBundle","languageId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DispatchedGenerationRunData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","emails.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Let AI write an email","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\n> [!WARNING]\n> With campaignId or scheduledAt the piece goes out on its own at that time. For that a key needs `emails.send`. Without that permission you get 403.\n\nStarts AI writing the email in the background. The answer is the number of the job right away; ask `ai.generation-runs.show` with it until `status` is completed, then `entityId` is the new email.\n\nWithout campaignId the piece is a draft. With campaignId it joins the campaign; a key then also needs `campaigns.write`, or you get 403.\n\nWith pictures you need emailTemplateCategory. The template of that kind for your language decides how many image places there are; a template with none gives 422.\n\nYou get 402 when you do not have enough credits and 422 when a field does not fit.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: emails.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v1/ai-image-generations":{"post":{"operationId":"ai-image-generations.store","tags":["ai"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","maxLength":2000,"description":"What to draw, at most 2000 characters."},"variantCount":{"type":"integer","minimum":1,"maximum":4,"description":"How many pictures to draw, from 1 to 4."},"format":{"type":"string","enum":["square","portrait","landscape","portrait_tall","story","widescreen","banner","wide"],"description":"The shape of the picture, for example square or landscape."},"tenantImageProfileId":{"type":["integer","null"],"description":"The number of the image style preset to draw in, or null."},"destination":{"type":["string","null"],"enum":["blog_article","facebook_post","instagram_post","x_post","linkedin_post","email_broadcast","email_sequence",null],"description":"Where the picture will be used, or null."},"purpose":{"anyOf":[{"$ref":"#/components/schemas/ArticleImagePurpose"},{"type":"null"}],"description":"What the picture is for. Only for blog articles."},"bannerType":{"anyOf":[{"$ref":"#/components/schemas/ArticleBannerType"},{"type":"null"}],"description":"The kind of banner. Only when purpose is banner."},"productId":{"type":["integer","null"],"description":"The number of the product in the picture. Only with purpose."},"campaignId":{"type":["integer","null"],"description":"The number of the campaign. Only with purpose."},"contextType":{"type":["string","null"],"enum":["article","social_post","email",null],"description":"The kind of record the picture is for: article, social_post or email. Send it with contextId."},"contextId":{"type":["integer","null"],"description":"The number of that record. Send it with contextType."},"aiProviderModelId":{"type":["integer","null"],"description":"The number of the image model, or null for the default."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["prompt","variantCount","format"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AiImageGenerationStatusData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.write","ai.generate"]},{"fusioToken":["emails.write","ai.generate"]},{"fusioToken":["social-posts.write","ai.generate"]}],"summary":"Draw images with AI","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI draws pictures in the background. The answer is 201 with the work; watch its status and progress. The price counts every picture.\n\nNeeds one of these permissions: articles.write, emails.write, social-posts.write. Also needs: ai.generate."}},"/v1/ai-image-generations/{generation}":{"get":{"operationId":"ai-image-generations.show","tags":["ai"],"parameters":[{"name":"generation","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AiImageGenerationStatusData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate"]}],"summary":"Show an AI image generation","description":"Ask again until the status is completed.\n\nNeeds one of these permissions: ai.generate."}},"/v1/ai-image-generations/{generation}/select":{"post":{"operationId":"ai-image-generations.select","tags":["ai"],"parameters":[{"name":"generation","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"variantId":{"type":"integer","description":"The number of the picture to pick."}},"required":["variantId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateFileData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.write","ai.generate"]},{"fusioToken":["emails.write","ai.generate"]},{"fusioToken":["social-posts.write","ai.generate"]}],"summary":"Pick one picture of an AI image generation","description":"The generation must be completed. When it was made for an article, social post or email, the picked picture is attached to it. The answer is the saved file.\n\nNeeds one of these permissions: articles.write, emails.write, social-posts.write. Also needs: ai.generate."}},"/v1/article-authors":{"get":{"operationId":"article-authors.index","tags":["article-authors"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/TenantArticleAuthorData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-authors.read"]}],"summary":"List authors","description":"Returns all authors, active or not, with all their texts and the number of their articles.\n\nNeeds one of these permissions: article-authors.read."},"post":{"operationId":"article-authors.store","tags":["article-authors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["person","organization"],"description":"person or organization."},"name":{"type":"string","minLength":2,"maxLength":100,"description":"The name shown with the articles, 2 to 100 characters."},"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","minLength":2,"maxLength":60,"description":"The last part of the author page address: small letters, numbers and dashes, 2 to 60 characters. It must be unique in your company."},"avatarFileId":{"type":["integer","null"],"description":"The number of a picture file with the photo or logo."},"websiteUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The website of the author, http or https, at most 255 characters."},"facebookUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The Facebook profile address."},"instagramUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The Instagram profile address."},"linkedinUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The LinkedIn profile address."},"xUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The X profile address."},"youtubeUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The YouTube channel address."},"tiktokUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The TikTok profile address."},"githubUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The GitHub profile address."},"email":{"type":["string","null"],"format":"email","maxLength":254,"description":"The email of the author."},"isEmailPublic":{"type":"boolean","description":"true shows the email on the website."},"sameAs":{"type":["array","null"],"items":{"type":"string","format":"uri","maxLength":2048},"maxItems":10,"uniqueItems":true,"description":"Other pages about the author, at most 10 web addresses."},"knowsAbout":{"type":["array","null"],"items":{"type":"string","minLength":2,"maxLength":60},"maxItems":10,"uniqueItems":true,"description":"What the author knows well, at most 10 words or phrases of 2 to 60 characters."},"isDefault":{"type":"boolean","description":"true makes this the author of new articles. The old default author stops being the default."},"isActive":{"type":"boolean","description":"false hides the author on your website."},"translation":{"type":"object","properties":{"locale":{"type":"string","maxLength":10,"description":"The language of the texts, like cs_CZ."},"jobTitle":{"type":["string","null"],"minLength":2,"maxLength":100,"description":"The job of the author, 2 to 100 characters."},"bio":{"type":["string","null"],"minLength":10,"maxLength":2000,"description":"A few sentences about the author, 10 to 2000 characters."},"metaDescription":{"type":["string","null"],"maxLength":160,"description":"The text in search results for the author page, at most 160 characters."}},"required":["locale"],"description":"The texts about the author in one language."}},"required":["type","name","slug","isEmailPublic","isDefault","isActive","translation"]},"example":{"type":"person","name":"Jana Nováková","slug":"jana-novakova","email":"jana.novakova@example.cz","isEmailPublic":false,"isDefault":true,"isActive":true,"translation":{"locale":"cs_CZ","jobTitle":"Vedoucí servisu","bio":"Jana opravuje kola přes deset let."}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantArticleAuthorData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Article author created successfully","payload":{"id":7,"tenantId":412,"type":"person","name":"Jana Nováková","slug":"jana-novakova","avatarFileId":null,"avatar":null,"websiteUrl":"https://www.example.cz/o-nas","facebookUrl":null,"instagramUrl":null,"linkedinUrl":"https://www.linkedin.com/in/jana-novakova-example","xUrl":null,"youtubeUrl":null,"tiktokUrl":null,"githubUrl":null,"email":"jana.novakova@example.cz","isEmailPublic":false,"sameAs":["https://www.linkedin.com/in/jana-novakova-example"],"knowsAbout":["horská kola","servis kol"],"isDefault":true,"isActive":true,"articleCount":0,"translations":[{"id":9,"tenantArticleAuthorId":7,"locale":"cs_CZ","isPrimary":true,"jobTitle":"Vedoucí servisu","bio":"Jana opravuje kola přes deset let.","metaDescription":"Články od Jany Novákové."}],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-authors.write"]}],"summary":"Create an author","description":"Creates an author with texts in one language. The first author of your company is always the default.\n\nNeeds one of these permissions: article-authors.write."}},"/v1/article-authors/{tenantArticleAuthor}":{"get":{"operationId":"article-authors.show","tags":["article-authors"],"parameters":[{"name":"tenantArticleAuthor","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the author."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantArticleAuthorData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Article author fetched successfully","payload":{"id":7,"tenantId":412,"type":"person","name":"Jana Nováková","slug":"jana-novakova","avatarFileId":null,"avatar":null,"websiteUrl":"https://www.example.cz/o-nas","facebookUrl":null,"instagramUrl":null,"linkedinUrl":"https://www.linkedin.com/in/jana-novakova-example","xUrl":null,"youtubeUrl":null,"tiktokUrl":null,"githubUrl":null,"email":"jana.novakova@example.cz","isEmailPublic":false,"sameAs":["https://www.linkedin.com/in/jana-novakova-example"],"knowsAbout":["horská kola","servis kol"],"isDefault":true,"isActive":true,"articleCount":12,"translations":[{"id":9,"tenantArticleAuthorId":7,"locale":"cs_CZ","isPrimary":true,"jobTitle":"Vedoucí servisu","bio":"Jana opravuje kola přes deset let.","metaDescription":"Články od Jany Novákové."}],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-authors.read"]}],"summary":"Show one author","description":"Returns one author with all their texts.\n\nNeeds one of these permissions: article-authors.read."},"put":{"operationId":"article-authors.update","tags":["article-authors"],"parameters":[{"name":"tenantArticleAuthor","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the author."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["person","organization"],"description":"person or organization."},"name":{"type":"string","minLength":2,"maxLength":100,"description":"The name shown with the articles, 2 to 100 characters."},"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","minLength":2,"maxLength":60,"description":"The last part of the author page address: small letters, numbers and dashes, 2 to 60 characters. It must be unique in your company."},"avatarFileId":{"type":["integer","null"],"description":"The number of a picture file with the photo or logo."},"websiteUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The website of the author, http or https, at most 255 characters."},"facebookUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The Facebook profile address."},"instagramUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The Instagram profile address."},"linkedinUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The LinkedIn profile address."},"xUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The X profile address."},"youtubeUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The YouTube channel address."},"tiktokUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The TikTok profile address."},"githubUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The GitHub profile address."},"email":{"type":["string","null"],"format":"email","maxLength":254,"description":"The email of the author."},"isEmailPublic":{"type":"boolean","description":"true shows the email on the website."},"sameAs":{"type":["array","null"],"items":{"type":"string","format":"uri","maxLength":2048},"maxItems":10,"uniqueItems":true,"description":"Other pages about the author, at most 10 web addresses."},"knowsAbout":{"type":["array","null"],"items":{"type":"string","minLength":2,"maxLength":60},"maxItems":10,"uniqueItems":true,"description":"What the author knows well, at most 10 words or phrases of 2 to 60 characters."},"isDefault":{"type":"boolean","description":"true makes this the author of new articles. The old default author stops being the default."},"isActive":{"type":"boolean","description":"false hides the author on your website."},"translation":{"type":"object","properties":{"locale":{"type":"string","maxLength":10,"description":"The language of the texts, like cs_CZ."},"jobTitle":{"type":["string","null"],"minLength":2,"maxLength":100,"description":"The job of the author, 2 to 100 characters."},"bio":{"type":["string","null"],"minLength":10,"maxLength":2000,"description":"A few sentences about the author, 10 to 2000 characters."},"metaDescription":{"type":["string","null"],"maxLength":160,"description":"The text in search results for the author page, at most 160 characters."}},"required":["locale"],"description":"The texts about the author in one language."}},"required":["type","name","slug","isEmailPublic","isDefault","isActive","translation"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantArticleAuthorData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-authors.write"]}],"summary":"Change an author","description":"Replaces the author and the texts in `translation.locale`. Send every field, not just the changed ones.\n\nNeeds one of these permissions: article-authors.write."},"delete":{"operationId":"article-authors.destroy","tags":["article-authors"],"parameters":[{"name":"tenantArticleAuthor","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the author."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-authors.write"]}],"summary":"Delete an author","description":"Deletes the author for good. Their articles move to the default author.\n\n> [!WARNING]\n> This cannot be undone.\n\nError: 422 when the author is the default one. Make another author the default first.\n\nNeeds one of these permissions: article-authors.write."}},"/v1/article-categories/public":{"get":{"operationId":"article-categories.public.index","tags":["article-categories"],"parameters":[{"name":"locale","in":"query","required":true,"schema":{"type":"string"},"description":"The language of the texts, like cs_CZ."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateArticleCategoryData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-categories.read"]}],"summary":"List categories for your website","description":"Returns the category tree with texts in `locale`, the number of published articles in each category and their average reading time.\n\nNeeds one of these permissions: article-categories.read."}},"/v1/article-categories/public/{slug}":{"get":{"operationId":"article-categories.public.show","tags":["article-categories"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The web address part of the category, in this language or the main one."},{"name":"locale","in":"query","required":true,"schema":{"type":"string"},"description":"The language of the texts, like cs_CZ."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateArticleCategoryData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-categories.read"]}],"summary":"Show one category for your website","description":"Returns one category with the categories under it and its numbers. Error: 404 when no category has this address.\n\nNeeds one of these permissions: article-categories.read."}},"/v1/article-categories":{"get":{"operationId":"article-categories.index","tags":["article-categories"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateArticleCategoryData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-categories.read"]}],"summary":"List categories","description":"Returns the top categories, each with the categories under it in `children`.\n\nNeeds one of these permissions: article-categories.read."},"post":{"operationId":"article-categories.store","tags":["article-categories"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","description":"You do not need to send it. Fusio always puts in the person the key acts as."},"name":{"type":"string","maxLength":255,"description":"The name of the category, at most 255 characters."},"slug":{"type":"string","maxLength":255,"description":"The last part of the web address. It must be unique in your company."},"parentId":{"type":["integer","null"],"description":"The number of the category above this one. Leave it empty for a top category."},"color":{"anyOf":[{"$ref":"#/components/schemas/ArticleCategoryColor"},{"type":"null"}],"description":"The color of the category label."},"icon":{"anyOf":[{"$ref":"#/components/schemas/ArticleCategoryIcon"},{"type":"null"}],"description":"The icon of the category."},"translation":{"type":"object","properties":{"locale":{"type":"string","description":"The language of the text, like cs_CZ."},"name":{"type":["string","null"],"maxLength":255,"description":"The name in this language, at most 255 characters."},"slug":{"type":["string","null"],"maxLength":255,"description":"The web address part in this language. It must be unique for the language."},"description":{"type":["string","null"],"description":"A text about the category, shown on its page."},"breadcrumbTitle":{"type":["string","null"],"description":"A short name for the row of links above the page."},"metaTitle":{"type":["string","null"],"maxLength":60,"description":"The title in search results, at most 60 characters."},"metaDescription":{"type":["string","null"],"maxLength":160,"description":"The text in search results, at most 160 characters."},"canonicalUrl":{"type":["string","null"],"format":"uri","description":"The main address of this page when it is also elsewhere."},"ogTitle":{"type":["string","null"],"description":"The title for sharing on Facebook or LinkedIn."},"ogDescription":{"type":["string","null"],"description":"The text for sharing on Facebook or LinkedIn."},"ogImageId":{"type":["string","null"],"description":"The number of the picture file for sharing."}},"required":["locale"],"description":"The text of the category in one language."}},"required":["name","slug","translation"]},"example":{"name":"Návody","slug":"navody","color":"navody","icon":"bookOpen","translation":{"locale":"cs_CZ","description":"Krátké návody na péči o kolo."}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateArticleCategoryData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Article category created successfully","payload":{"id":31,"tenantId":412,"userId":88,"parentId":null,"name":"Návody","slug":"navody","translation":{"id":57,"articleCategoryId":31,"locale":"cs_CZ","isPrimary":true,"name":"Návody","slug":"navody","description":"Krátké návody na péči o kolo.","breadcrumbTitle":null,"metaTitle":null,"metaDescription":null,"canonicalUrl":null,"ogTitle":null,"ogDescription":null,"ogImageId":null},"availableLocales":["cs_CZ"],"color":"navody","icon":"bookOpen","children":[]}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-categories.write"]}],"summary":"Create a category","description":"Creates a category with its first text. Error: 422 when the address part is taken.\n\nNeeds one of these permissions: article-categories.write."}},"/v1/article-categories/{articleCategory}":{"get":{"operationId":"article-categories.show","tags":["article-categories"],"parameters":[{"name":"articleCategory","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the category."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateArticleCategoryData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Article category 31 retrieved successfully","payload":{"id":31,"tenantId":412,"userId":88,"parentId":null,"name":"Návody","slug":"navody","translation":{"id":57,"articleCategoryId":31,"locale":"cs_CZ","isPrimary":true,"name":"Návody","slug":"navody","description":"Krátké návody na péči o kolo.","breadcrumbTitle":null,"metaTitle":null,"metaDescription":null,"canonicalUrl":null,"ogTitle":null,"ogDescription":null,"ogImageId":null},"availableLocales":["cs_CZ"],"color":"navody","icon":"bookOpen","children":[]}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-categories.read"]}],"summary":"Show one category","description":"Returns one category with its text and the categories under it.\n\nNeeds one of these permissions: article-categories.read."},"put":{"operationId":"article-categories.update","tags":["article-categories"],"parameters":[{"name":"articleCategory","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the category."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"You do not need to send it. Fusio always takes the number from the address."},"userId":{"type":"integer","description":"You do not need to send it. Fusio always puts in the person the key acts as."},"name":{"type":"string","maxLength":255,"description":"The name of the category, at most 255 characters."},"slug":{"type":"string","maxLength":255,"description":"The last part of the web address. It must be unique in your company."},"parentId":{"type":["integer","null"],"description":"The number of the category above this one. Leave it empty for a top category."},"color":{"anyOf":[{"$ref":"#/components/schemas/ArticleCategoryColor"},{"type":"null"}],"description":"The color of the category label."},"icon":{"anyOf":[{"$ref":"#/components/schemas/ArticleCategoryIcon"},{"type":"null"}],"description":"The icon of the category."},"translation":{"type":["object","null"],"properties":{"id":{"type":["integer","null"],"description":"The number of the text you change. Leave it out to add a language."},"locale":{"type":"string","description":"The language of the text, like cs_CZ. Needed when you send translation."},"name":{"type":["string","null"],"maxLength":255,"description":"The name in this language, at most 255 characters."},"slug":{"type":["string","null"],"maxLength":255,"description":"The web address part in this language. It must be unique for the language."},"description":{"type":["string","null"],"description":"A text about the category, shown on its page."},"breadcrumbTitle":{"type":["string","null"],"description":"A short name for the row of links above the page."},"metaTitle":{"type":["string","null"],"maxLength":60,"description":"The title in search results, at most 60 characters."},"metaDescription":{"type":["string","null"],"maxLength":160,"description":"The text in search results, at most 160 characters."},"canonicalUrl":{"type":["string","null"],"format":"uri","description":"The main address of this page when it is also elsewhere."},"ogTitle":{"type":["string","null"],"description":"The title for sharing on Facebook or LinkedIn."},"ogDescription":{"type":["string","null"],"description":"The text for sharing on Facebook or LinkedIn."},"ogImageId":{"type":["string","null"],"description":"The number of the picture file for sharing."}},"description":"The text in one language. Leave it out to keep the texts."}},"required":["name","slug"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateArticleCategoryData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-categories.write"]}],"summary":"Change a category","description":"Replaces the category. Send every field, not just the changed ones.\n\nNeeds one of these permissions: article-categories.write."},"delete":{"operationId":"article-categories.destroy","tags":["article-categories"],"parameters":[{"name":"articleCategory","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the category."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-categories.write"]}],"summary":"Delete a category","description":"Moves the category to the trash. Its articles stay.\n\nNeeds one of these permissions: article-categories.write."}},"/v1/articles/grid":{"get":{"operationId":"articles.grid","tags":["articles"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[campaign]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more campaign IDs, split by commas."},{"name":"filter[campaignRelation]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows rows in a campaign. without shows rows outside any campaign."},{"name":"filter[assignee]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of the team member it is given to."},{"name":"sort","in":"query","schema":{"type":"string","enum":["tenantSequence","state","isVisible","publishedAt","createdAt","updatedAt","-tenantSequence","-state","-isVisible","-publishedAt","-createdAt","-updatedAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexArticleData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]},"example":{"status":"success","message":"List retrieved successfully","payload":{"data":[{"id":1284,"tenantSequence":37,"name":"Jak vybrat horské kolo","slug":"jak-vybrat-horske-kolo","state":"approved","rejectReason":null,"campaign":null,"availableLocales":["cs_CZ"],"articleCategoryId":31,"categorySlug":"navody","isVisible":true,"isCornerstone":false,"publication":null,"publishedAt":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","wordCount":860,"readingTime":4,"ownerName":"Jana Nováková","helperNames":["Petr Malý"]}],"currentPage":1,"perPage":25,"lastPage":1,"total":1,"from":1,"to":1,"nextPageUrl":null,"previousPageUrl":null,"hasMorePages":false,"nextCursor":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]}],"summary":"List articles in a table","description":"Returns one page of articles with the filters and the sort you ask for. A person who may only change their own articles sees only those.\n\nNeeds one of these permissions: articles.read."}},"/v1/articles/options":{"get":{"operationId":"articles.options","tags":["articles"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name. At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionArticleData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]}],"summary":"List articles for a picker","description":"Returns short items with the number and the name of each article. Use it to fill a picker.\n\nNeeds one of these permissions: articles.read."}},"/v1/articles/board/summary":{"get":{"operationId":"articles.board.summary","tags":["articles"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[campaign]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more campaign IDs, split by commas."},{"name":"filter[campaignRelation]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows rows in a campaign. without shows rows outside any campaign."},{"name":"filter[assignee]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of the team member it is given to."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BoardSummaryData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]}],"summary":"Count articles in each state","description":"Returns how many articles there are in each column of the board. A column is one state.\n\nNeeds one of these permissions: articles.read."}},"/v1/articles/board/{status}":{"get":{"operationId":"articles.board.column","tags":["articles"],"parameters":[{"name":"status","in":"path","required":true,"schema":{"type":"string","enum":["drafted","approved","rejected","scheduled","published","failed"]},"description":"The column: drafted, approved, rejected, scheduled, published or failed."},{"name":"cursor","in":"query","schema":{"type":["string","null"],"maxLength":512},"description":"Where the next page starts. Take it from nextCursor of the page before."},{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[campaign]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more campaign IDs, split by commas."},{"name":"filter[campaignRelation]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows rows in a campaign. without shows rows outside any campaign."},{"name":"filter[assignee]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of the team member it is given to."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexArticleData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]}],"summary":"List the articles of one board column","description":"Returns the articles in one state, page by page. Send `nextCursor` back as `cursor` to get the next page.\n\nNeeds one of these permissions: articles.read."}},"/v1/articles/overview":{"get":{"operationId":"articles.overview","tags":["articles"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[categoryId]","in":"query","schema":{"type":["integer","null"]},"description":"Count only articles of this category."},{"name":"filter[locale]","in":"query","schema":{"type":["string","null"],"maxLength":16},"description":"Count only articles in this language, like cs_CZ."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/ArticleOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]}],"summary":"Show article numbers for a time range","description":"Returns the numbers of your articles for the days you pick: published articles, views, reads, clicks and leads, the best articles and the articles that lose readers.\n\nAsk again when `ready` is false. This address allows 120 requests a minute.\n\nNeeds one of these permissions: articles.read."}},"/v1/articles/{article}/visibility":{"patch":{"operationId":"articles.set-visibility","tags":["articles"],"parameters":[{"name":"article","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the article."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"isVisible":{"type":"boolean","description":"true shows the article on your website, false hides it."}},"required":["isVisible"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.write"]}],"summary":"Show or hide an article","description":"Shows or hides the article on your website. The state stays the same. A hidden article answers 404 on the website. When the article belongs to a campaign, a key also needs `campaigns.write`.\n\nNeeds one of these permissions: articles.write."}},"/v1/articles/{article}/state":{"patch":{"operationId":"articles.set-state","tags":["articles"],"parameters":[{"name":"article","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the article."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["drafted","approved","rejected","scheduled","published","failed"],"description":"The new state. Any state other than drafted or rejected needs articles.publish."}},"required":["state"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.write"]}],"x-fusio-conditional-scopes":["articles.publish"],"x-fusio-opt-in-scopes":["articles.publish"],"summary":"Move an article to another state","description":"Moves the article on. Allowed steps: from drafted to approved or rejected, from rejected to approved, and from approved to rejected. Other steps are refused with 422 and a message. A scheduled or published article cannot change here and you get 422 too; use publications.\n\nTo approve, the article needs a website, a main picture, an author and a full main text. Otherwise the answer is 422 with `payload.missingFields`.\n\n`approved` needs `articles.publish`. When the article belongs to a campaign, a key also needs `campaigns.write`.\n\nNeeds one of these permissions: articles.write. Some values also need: articles.publish. You must tick these on purpose: articles.publish."}},"/v1/articles/bulk-state":{"patch":{"operationId":"articles.bulk-set-state","tags":["articles"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"articleIds":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":100,"description":"The numbers of the articles, at most 100."},"state":{"type":"string","enum":["drafted","approved","rejected","scheduled","published","failed"],"description":"The new state for all of them. Any state other than drafted or rejected needs articles.publish."}},"required":["articleIds","state"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.write"]}],"x-fusio-conditional-scopes":["articles.publish"],"x-fusio-opt-in-scopes":["articles.publish"],"summary":"Move many articles to one state","description":"Moves each article like the single state change does, one after another. The same steps are allowed. When one article cannot move, because it is scheduled or published or the step is not allowed, the request stops with 422 and a message, and no article changes. When one of the articles belongs to a campaign, a key also needs `campaigns.write`.\n\nNeeds one of these permissions: articles.write. Some values also need: articles.publish. You must tick these on purpose: articles.publish."}},"/v1/articles/{article}/fields":{"patch":{"operationId":"articles.update-fields","tags":["articles"],"parameters":[{"name":"article","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the article."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The title of the article, at most 255 characters."},"content":{"type":"string","description":"The text in Markdown. Do not use a level 1 heading. Pictures may only use files your company can see."},"metaTitle":{"type":["string","null"],"maxLength":255,"description":"The title in search results, at most 255 characters."},"metaDescription":{"type":["string","null"],"maxLength":500,"description":"The text in search results, at most 500 characters."},"primaryFocusKeyword":{"type":["string","null"],"maxLength":255,"description":"The main search phrase the article is written for."},"secondaryKeywords":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":8,"description":"More search phrases, at most 8 texts of up to 255 characters."},"ogTitle":{"type":["string","null"],"maxLength":255,"description":"The title for sharing on Facebook or LinkedIn."},"ogDescription":{"type":["string","null"],"maxLength":500,"description":"The text for sharing on Facebook or LinkedIn, at most 500 characters."},"twitterTitle":{"type":["string","null"],"maxLength":255,"description":"The title for sharing on X."},"twitterDescription":{"type":["string","null"],"maxLength":500,"description":"The text for sharing on X, at most 500 characters."},"slug":{"type":"string","maxLength":255,"description":"The last part of the web address. A few words are kept for Fusio and are refused."},"bannerImageId":{"type":["integer","null"],"description":"The number of the file with the main picture."},"locale":{"type":"string","maxLength":10,"description":"The language of the text to change, like cs_CZ. Leave it out for the main language."},"breadcrumbTitle":{"type":["string","null"],"maxLength":30,"description":"A short title for the row of links above the article, at most 30 characters."},"summary":{"type":["string","null"],"description":"A short summary shown above the text."},"signature":{"type":["string","null"],"description":"A line shown at the end of the article."},"sources":{"type":["array","null"],"items":{"type":"object","properties":{"title":{"type":"string","description":"The name of the source."},"url":{"type":"string","format":"uri","description":"The web address of the source."}}},"description":"The sources of the article. Each one needs a title and a url."},"ogImageId":{"type":["integer","null"],"description":"The number of the picture file for sharing on Facebook or LinkedIn."},"twitterImageId":{"type":["integer","null"],"description":"The number of the picture file for sharing on X."},"articleCategoryId":{"type":["integer","null"],"description":"The number of the category."},"tenantArticleAuthorId":{"type":["integer","null"],"description":"The number of the author."},"articleIntegrationId":{"type":["integer","null"],"description":"The website the article goes to. null picks your main website."},"isCornerstone":{"type":"boolean","description":"true marks a main article that other articles link to."},"schemaType":{"anyOf":[{"$ref":"#/components/schemas/ArticleSchemaType"},{"type":"null"}],"description":"The kind of page for search engines: Article, NewsArticle or BlogPosting."},"seoIndex":{"type":"boolean","description":"true lets search engines show the page."},"seoFollow":{"type":"boolean","description":"true lets search engines follow the links on the page."},"robotsNoarchive":{"type":"boolean","description":"true asks search engines not to keep a copy of the page."},"robotsNosnippet":{"type":"boolean","description":"true asks search engines not to show a text preview."},"robotsMaxSnippet":{"type":["integer","null"],"minimum":-1,"maximum":1000,"description":"The longest text preview, from -1 to 1000 characters. -1 means no limit."},"robotsMaxImagePreview":{"anyOf":[{"$ref":"#/components/schemas/RobotsMaxImagePreview"},{"type":"null"}],"description":"How big a picture preview may be: none, standard or large."},"robotsMaxVideoPreview":{"type":["integer","null"],"minimum":-1,"maximum":60,"description":"The longest video preview, from -1 to 60 seconds. -1 means no limit."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.write"]}],"x-fusio-conditional-scopes":["articles.publish"],"x-fusio-opt-in-scopes":["articles.publish"],"summary":"Change some fields of an article","description":"Changes only the fields you send. Text fields change the text in `locale`, or the main text when you leave it out. The state does not change.\n\nOnly a drafted article can change; in any other state you get 422. When the article is approved, scheduled, published or failed, a key without `articles.publish` gets 403 `insufficient_scope` instead. When the article belongs to a campaign, a key also needs `campaigns.write`.\n\nError: 404 when the article has no text in that language.\n\nNeeds one of these permissions: articles.write. Some values also need: articles.publish. You must tick these on purpose: articles.publish."}},"/v1/articles":{"post":{"operationId":"articles.store","tags":["articles"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","description":"The person who owns the article. It must be an active member of your company."},"articleIntegrationId":{"type":["integer","null"],"description":"The website the article goes to. A scheduled or published article needs a website with a verified domain."},"state":{"$ref":"#/components/schemas/ArticleState","description":"drafted, approved, rejected, scheduled, published or failed. Any state other than drafted or rejected needs articles.publish."},"schemaType":{"anyOf":[{"$ref":"#/components/schemas/ArticleSchemaType"},{"type":"null"}],"description":"The kind of page for search engines: Article, NewsArticle or BlogPosting."},"seoIndex":{"type":"boolean","description":"true lets search engines show the page."},"seoFollow":{"type":"boolean","description":"true lets search engines follow the links on the page."},"robotsNoarchive":{"type":"boolean","description":"true asks search engines not to keep a copy of the page."},"robotsNosnippet":{"type":"boolean","description":"true asks search engines not to show a text preview."},"robotsMaxSnippet":{"type":["integer","null"],"minimum":-1,"description":"The longest text preview, in characters. -1 means no limit."},"robotsMaxImagePreview":{"anyOf":[{"$ref":"#/components/schemas/RobotsMaxImagePreview"},{"type":"null"}],"description":"How big a picture preview may be: none, standard or large."},"robotsMaxVideoPreview":{"type":["integer","null"],"minimum":-1,"description":"The longest video preview, in seconds. -1 means no limit."},"isVisible":{"type":"boolean","description":"false hides the article on your website but keeps its state."},"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags, at most 500. The list replaces the tags the article had."},"isCornerstone":{"type":"boolean","description":"true marks a main article that other articles link to."},"publishedAt":{"type":["string","null"],"description":"When the article goes out, like 2026-11-17T09:00:00+01:00. Always add the time zone."},"topicId":{"type":["integer","null"],"description":"The number of the topic the article is about."},"articleCategoryId":{"type":["integer","null"],"description":"The number of the category of the article."},"tenantArticleAuthorId":{"type":["integer","null"],"description":"The number of the author shown with the article."},"bannerImageId":{"type":["string","null"],"description":"The number of the file with the main picture."},"createdAt":{"type":["string","null"],"description":"When the article was made. You can leave it out."},"updatedAt":{"type":["string","null"],"description":"When the article last changed. You can leave it out."},"translation":{"type":"object","properties":{"id":{"type":["integer","null"],"description":"Leave it out when you create an article."},"articleId":{"type":["integer","null"],"description":"Leave it out when you create an article."},"locale":{"type":"string","description":"The language of the text, like cs_CZ. Leave it out for en_US."},"name":{"type":"string","description":"The title of the article."},"content":{"type":"string","description":"The text in Markdown. Do not use a level 1 heading; the title is that heading. Pictures may only use files your company can see."},"slug":{"type":["string","null"],"description":"The last part of the web address, like my-first-article. A few words are kept for Fusio and are refused."},"breadcrumbTitle":{"type":["string","null"],"description":"A short title for the row of links above the article."},"metaTitle":{"type":["string","null"],"maxLength":60,"description":"The title in search results, at most 60 characters."},"metaDescription":{"type":["string","null"],"maxLength":160,"description":"The text in search results, at most 160 characters."},"primaryFocusKeyword":{"type":["string","null"],"description":"The main search phrase the article is written for."},"secondaryKeywords":{"type":["array","null"],"items":{},"maxItems":8,"description":"More search phrases, a list of at most 8 texts."},"canonicalUrl":{"type":["string","null"],"format":"uri","description":"The main address of this text when it is also on another page."},"ogTitle":{"type":["string","null"],"description":"The title when someone shares the article on Facebook or LinkedIn."},"ogDescription":{"type":["string","null"],"description":"The text when someone shares the article on Facebook or LinkedIn."},"ogImageId":{"type":["string","null"],"description":"The number of the picture file for sharing on Facebook or LinkedIn."},"twitterTitle":{"type":["string","null"],"description":"The title when someone shares the article on X."},"twitterDescription":{"type":["string","null"],"description":"The text when someone shares the article on X."},"twitterImageId":{"type":["string","null"],"description":"The number of the picture file for sharing on X."},"summary":{"type":["string","null"],"description":"A short summary shown above the text."},"signature":{"type":["string","null"],"description":"A line shown at the end of the article."},"sources":{"type":["array","null"],"items":{"type":"object","properties":{"title":{"type":"string","description":"The name of the source."},"url":{"type":"string","format":"uri","description":"The web address of the source."}}},"description":"The sources of the article. Each one has a title and a url."}},"required":["locale","name","content"],"description":"The text of the article in one language."},"campaignId":{"type":["integer","null"],"description":"The number of the campaign the article belongs to. A key then also needs campaigns.write."}},"required":["userId","state","translation"]},"example":{"userId":88,"state":"drafted","articleCategoryId":31,"tenantArticleAuthorId":7,"tagIds":[64],"translation":{"locale":"cs_CZ","name":"Jak vybrat horské kolo","content":"## Na čem záleží\n\nVyber rám podle své výšky a terénu, kam jezdíš.","metaDescription":"Krátký návod, jak vybrat horské kolo podle výšky a terénu."}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateArticleData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Article created successfully","payload":{"id":1284,"publication":null,"campaign":null,"translation":{"id":2210,"articleId":1284,"locale":"cs_CZ","isPrimary":true,"name":"Jak vybrat horské kolo","content":"## Na čem záleží\n\nVyber rám podle své výšky a terénu, kam jezdíš.","contentHtml":"<h2>Na čem záleží</h2><p>Vyber rám podle své výšky a terénu, kam jezdíš.</p>","slug":"jak-vybrat-horske-kolo","breadcrumbTitle":"Výběr horského kola","metaTitle":"Jak vybrat horské kolo | Cyklo Novák","metaDescription":"Krátký návod, jak vybrat horské kolo podle výšky a terénu.","primaryFocusKeyword":"horské kolo","secondaryKeywords":["výběr kola","velikost rámu"],"canonicalUrl":"https://www.example.cz/blog/jak-vybrat-horske-kolo","ogTitle":"Jak vybrat horské kolo","ogDescription":"Návod na výběr horského kola.","ogImageId":null,"ogImage":null,"twitterTitle":null,"twitterDescription":null,"twitterImageId":null,"twitterImage":null,"wordCount":860,"readingTime":4,"summary":"Rám vyber podle výšky, kola podle terénu.","summaryHtml":"<p>Rám vyber podle výšky, kola podle terénu.</p>","signature":null,"sources":[],"tableOfContents":[]},"availableLocales":["cs_CZ"],"alternates":[{"locale":"cs_CZ","slug":"jak-vybrat-horske-kolo","languageTag":"cs-CZ","languageCode":"cs","categorySlug":"navody"}],"tenantId":412,"tenantSequence":37,"userId":88,"articleCategoryId":31,"categorySlug":"navody","tenantArticleAuthorId":7,"author":null,"bannerImageId":5120,"unsplashBannerImageUrl":null,"unsplashBannerCredit":null,"bannerImage":null,"articleIntegrationId":3,"externalReference":null,"tags":[{"id":64,"tenantId":412,"userId":88,"name":"Horská kola","slug":"horska-kola","color":"#2f855a","notes":null,"assignmentSource":"manual"}],"articleIntegration":null,"state":"drafted","schemaType":"BlogPosting","seoIndex":true,"seoFollow":true,"robotsNoarchive":false,"robotsNosnippet":false,"robotsMaxSnippet":null,"robotsMaxImagePreview":"large","robotsMaxVideoPreview":null,"isVisible":true,"isCornerstone":false,"publishedAt":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","blueprint":null,"campaignAsset":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.write"]}],"x-fusio-conditional-scopes":["articles.publish"],"x-fusio-opt-in-scopes":["articles.publish"],"summary":"Create an article","description":"Creates an article with its first text. You become one of the people assigned to it. When you send `campaignId`, the article joins that campaign.\n\nA state other than `drafted` or `rejected` needs `articles.publish`. A `scheduled` or `published` article needs a website whose domain is verified.\n\n> [!WARNING]\n> A `published` article goes live on your website at once.\n\nErrors: 403 `insufficient_scope` without `articles.publish`, 403 with `campaignId` without `campaigns.write`, 422 when a field is wrong or the website domain is not verified.\n\nNeeds one of these permissions: articles.write. Some values also need: articles.publish. You must tick these on purpose: articles.publish."}},"/v1/articles/{article}":{"get":{"operationId":"articles.show","tags":["articles"],"parameters":[{"name":"article","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the article."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateArticleData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Article [ 1284 ] fetched successfully","payload":{"id":1284,"publication":null,"campaign":null,"translation":{"id":2210,"articleId":1284,"locale":"cs_CZ","isPrimary":true,"name":"Jak vybrat horské kolo","content":"## Na čem záleží\n\nVyber rám podle své výšky a terénu, kam jezdíš.","contentHtml":"<h2>Na čem záleží</h2><p>Vyber rám podle své výšky a terénu, kam jezdíš.</p>","slug":"jak-vybrat-horske-kolo","breadcrumbTitle":"Výběr horského kola","metaTitle":"Jak vybrat horské kolo | Cyklo Novák","metaDescription":"Krátký návod, jak vybrat horské kolo podle výšky a terénu.","primaryFocusKeyword":"horské kolo","secondaryKeywords":["výběr kola","velikost rámu"],"canonicalUrl":"https://www.example.cz/blog/jak-vybrat-horske-kolo","ogTitle":"Jak vybrat horské kolo","ogDescription":"Návod na výběr horského kola.","ogImageId":null,"ogImage":null,"twitterTitle":null,"twitterDescription":null,"twitterImageId":null,"twitterImage":null,"wordCount":860,"readingTime":4,"summary":"Rám vyber podle výšky, kola podle terénu.","summaryHtml":"<p>Rám vyber podle výšky, kola podle terénu.</p>","signature":null,"sources":[],"tableOfContents":[]},"availableLocales":["cs_CZ"],"alternates":[{"locale":"cs_CZ","slug":"jak-vybrat-horske-kolo","languageTag":"cs-CZ","languageCode":"cs","categorySlug":"navody"}],"tenantId":412,"tenantSequence":37,"userId":88,"articleCategoryId":31,"categorySlug":"navody","tenantArticleAuthorId":7,"author":null,"bannerImageId":5120,"unsplashBannerImageUrl":null,"unsplashBannerCredit":null,"bannerImage":null,"articleIntegrationId":3,"externalReference":null,"tags":[{"id":64,"tenantId":412,"userId":88,"name":"Horská kola","slug":"horska-kola","color":"#2f855a","notes":null,"assignmentSource":"manual"}],"articleIntegration":null,"state":"approved","schemaType":"BlogPosting","seoIndex":true,"seoFollow":true,"robotsNoarchive":false,"robotsNosnippet":false,"robotsMaxSnippet":null,"robotsMaxImagePreview":"large","robotsMaxVideoPreview":null,"isVisible":true,"isCornerstone":false,"publishedAt":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","blueprint":null,"campaignAsset":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]}],"summary":"Show one article","description":"Returns the article with its main text, its tags, its category and its author.\n\nNeeds one of these permissions: articles.read."},"put":{"operationId":"articles.update","tags":["articles"],"parameters":[{"name":"article","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the article."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","description":"The person who owns the article. It must be an active member of your company."},"articleIntegrationId":{"type":["integer","null"],"description":"The website the article goes to. A scheduled or published article needs a website with a verified domain."},"state":{"$ref":"#/components/schemas/ArticleState","description":"drafted, approved, rejected, scheduled, published or failed. Any state other than drafted or rejected needs articles.publish."},"schemaType":{"anyOf":[{"$ref":"#/components/schemas/ArticleSchemaType"},{"type":"null"}],"description":"The kind of page for search engines: Article, NewsArticle or BlogPosting."},"seoIndex":{"type":"boolean","description":"true lets search engines show the page."},"seoFollow":{"type":"boolean","description":"true lets search engines follow the links on the page."},"robotsNoarchive":{"type":"boolean","description":"true asks search engines not to keep a copy of the page."},"robotsNosnippet":{"type":"boolean","description":"true asks search engines not to show a text preview."},"robotsMaxSnippet":{"type":["integer","null"],"minimum":-1,"description":"The longest text preview, in characters. -1 means no limit."},"robotsMaxImagePreview":{"anyOf":[{"$ref":"#/components/schemas/RobotsMaxImagePreview"},{"type":"null"}],"description":"How big a picture preview may be: none, standard or large."},"robotsMaxVideoPreview":{"type":["integer","null"],"minimum":-1,"description":"The longest video preview, in seconds. -1 means no limit."},"isVisible":{"type":"boolean","description":"false hides the article on your website but keeps its state."},"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags, at most 500. The list replaces the tags the article had."},"isCornerstone":{"type":"boolean","description":"true marks a main article that other articles link to."},"publishedAt":{"type":["string","null"],"description":"When the article goes out, like 2026-11-17T09:00:00+01:00. Always add the time zone."},"topicId":{"type":["integer","null"],"description":"The number of the topic the article is about."},"articleCategoryId":{"type":["integer","null"],"description":"The number of the category of the article."},"tenantArticleAuthorId":{"type":["integer","null"],"description":"The number of the author shown with the article."},"bannerImageId":{"type":["string","null"],"description":"The number of the file with the main picture."},"createdAt":{"type":["string","null"],"description":"When the article was made. You can leave it out."},"updatedAt":{"type":["string","null"],"description":"When the article last changed. You can leave it out."},"translation":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the text you change. It must belong to this article."},"articleId":{"type":"integer","description":"The number of this article."},"locale":{"type":"string","description":"The language of the text, like cs_CZ. Leave it out for en_US."},"name":{"type":"string","description":"The title of the article."},"content":{"type":"string","description":"The text in Markdown. Do not use a level 1 heading; the title is that heading. Pictures may only use files your company can see."},"slug":{"type":["string","null"],"description":"The last part of the web address, like my-first-article. A few words are kept for Fusio and are refused."},"breadcrumbTitle":{"type":["string","null"],"description":"A short title for the row of links above the article."},"metaTitle":{"type":["string","null"],"maxLength":60,"description":"The title in search results, at most 60 characters."},"metaDescription":{"type":["string","null"],"maxLength":160,"description":"The text in search results, at most 160 characters."},"primaryFocusKeyword":{"type":["string","null"],"description":"The main search phrase the article is written for."},"secondaryKeywords":{"type":["array","null"],"items":{},"maxItems":8,"description":"More search phrases, a list of at most 8 texts."},"canonicalUrl":{"type":["string","null"],"format":"uri","description":"The main address of this text when it is also on another page."},"ogTitle":{"type":["string","null"],"description":"The title when someone shares the article on Facebook or LinkedIn."},"ogDescription":{"type":["string","null"],"description":"The text when someone shares the article on Facebook or LinkedIn."},"ogImageId":{"type":["string","null"],"description":"The number of the picture file for sharing on Facebook or LinkedIn."},"twitterTitle":{"type":["string","null"],"description":"The title when someone shares the article on X."},"twitterDescription":{"type":["string","null"],"description":"The text when someone shares the article on X."},"twitterImageId":{"type":["string","null"],"description":"The number of the picture file for sharing on X."},"summary":{"type":["string","null"],"description":"A short summary shown above the text."},"signature":{"type":["string","null"],"description":"A line shown at the end of the article."},"sources":{"type":["array","null"],"items":{"type":"object","properties":{"title":{"type":"string","description":"The name of the source."},"url":{"type":"string","format":"uri","description":"The web address of the source."}}},"description":"The sources of the article. Each one has a title and a url."}},"required":["id","articleId","locale","name","content"],"description":"The text of the article in one language."},"id":{"type":"integer","description":"The number of the article. It must be the same as in the address."}},"required":["userId","state","translation","id"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.write"]}],"x-fusio-conditional-scopes":["articles.publish"],"x-fusio-opt-in-scopes":["articles.publish"],"summary":"Change a whole article","description":"Replaces the article and one of its texts. Send every field, not just the changed ones. `tagIds` replaces the tags only when you send it.\n\nChanging an article that is not `drafted` or `rejected` needs `articles.publish`, and so does moving it to such a state. Moving a scheduled article back cancels its publication. When the article belongs to a campaign, a key also needs `campaigns.write`.\n\n> [!WARNING]\n> Changing a published article changes your live website.\n\nErrors: 403 `insufficient_scope`, 422 when a field is wrong or the website domain is not verified.\n\nNeeds one of these permissions: articles.write. Some values also need: articles.publish. You must tick these on purpose: articles.publish."},"delete":{"operationId":"articles.destroy","tags":["articles"],"parameters":[{"name":"article","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the article."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.write"]}],"summary":"Delete an article","description":"Moves the article to the trash. Its page on your website answers 410 Gone from then on. When the article belongs to a campaign, a key also needs `campaigns.write`.\n\nNeeds one of these permissions: articles.write."}},"/v1/auth/me":{"get":{"operationId":"auth.me","tags":["auth"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AuthMeOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"User details retrieved","payload":{"user":{"id":88,"activeTenantId":412,"firstName":"Jana","lastName":"Nováková","email":"jana.novakova@example.cz","emailVerifiedAt":"2026-11-03T08:30:00Z","preferredLanguageId":2,"preferredTheme":"system","roles":["owner"],"permissions":[],"isAdmin":false},"tenant":{"id":412,"ownerId":88,"slug":"cyklo-novak","name":"Cyklo Novák","legalName":"Cyklo Novák s.r.o.","email":"info@example.cz","ownerEmail":"jana.novakova@example.cz","privacyPolicyUrl":"https://www.example.cz/ochrana-udaju","verifiedDomainName":"example.cz","hasAgencyWorkspace":false,"twoFactorRequired":false,"preferredAiLanguageId":2,"bio":"Prodej a servis kol v Brně.","website":"https://www.example.cz","timezone":"Europe/Prague","resolvedTimezone":"Europe/Prague","logoId":null,"logoBannerId":null,"logoUrl":null,"logoBannerUrl":null,"documents":[],"type":"company","teamSize":"2-10","registrationNumber":"12345678","vatNumber":"CZ12345678","industryCategoryIds":[],"completedAt":"2026-11-03T08:30:00Z","packageName":"Start","subscriptionId":77,"creditBalance":1840.5,"emailSendingBalance":4200,"socialPlatformLinkingBalance":3,"adPlatformLinkingBalance":1,"organizationMemberBalance":4,"crmRecordsUsed":312,"companyLookupsUsed":9,"resetLimitsAt":"2026-11-30T23:00:00Z","entitlements":{"status":"active","lane":"self","packageId":3,"packageType":"bundle","subscriptionId":77,"billingCycle":"monthly","periodStartsOn":"2026-11-01","periodEndsOn":"2026-11-30","usageResetsAt":"2026-11-30T23:00:00Z","moduleIds":[],"moduleKeys":[],"readOnlyModuleIds":[],"permissionNames":[],"limits":[],"shop":{"available":true,"newOrderOnly":false},"alerts":[],"lockedModules":[]},"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","deletedAt":null},"twoFactorSetupRequired":false,"membershipSuspension":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]},{"fusioToken":["articles.write"]},{"fusioToken":["article-categories.read"]},{"fusioToken":["article-categories.write"]},{"fusioToken":["article-authors.read"]},{"fusioToken":["article-authors.write"]},{"fusioToken":["topics.read"]},{"fusioToken":["topics.write"]},{"fusioToken":["emails.read"]},{"fusioToken":["emails.write"]},{"fusioToken":["social-posts.read"]},{"fusioToken":["social-posts.write"]},{"fusioToken":["campaigns.read"]},{"fusioToken":["campaigns.write"]},{"fusioToken":["leads.read"]},{"fusioToken":["leads.write"]},{"fusioToken":["deals.read"]},{"fusioToken":["deals.write"]},{"fusioToken":["articles.publish"]},{"fusioToken":["emails.send"]},{"fusioToken":["social-posts.publish.x"]},{"fusioToken":["social-posts.publish.facebook"]},{"fusioToken":["social-posts.publish.linkedin"]},{"fusioToken":["social-posts.publish.instagram"]},{"fusioToken":["campaigns.execute"]},{"fusioToken":["intelligence.read"]},{"fusioToken":["intelligence.write"]},{"fusioToken":["seo.read"]},{"fusioToken":["seo.write"]},{"fusioToken":["contacts.read"]},{"fusioToken":["contacts.write"]},{"fusioToken":["files.read"]},{"fusioToken":["files.write"]},{"fusioToken":["deals.execute"]},{"fusioToken":["ai.generate"]},{"fusioToken":["ads.read"]},{"fusioToken":["ads.write"]},{"fusioToken":["ads.execute.google"]},{"fusioToken":["ads.execute.facebook"]},{"fusioToken":["ads.execute.linkedin"]},{"fusioToken":["ads.execute.instagram"]}],"x-fusio-opt-in-scopes":["articles.publish","emails.send","social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram","campaigns.execute","intelligence.write","seo.write","deals.execute","ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Show who the key acts as","description":"Returns the person the key acts as (`user`) and the company (`tenant`). Any permission of the key is enough.\n\nFor a key without `subscription.read`, `tenant` leaves out billing and usage details. With it, they come only when the person may see the usage.\n\nNeeds one of these permissions: articles.read, articles.write, article-categories.read, article-categories.write, article-authors.read, article-authors.write, topics.read, topics.write, emails.read, emails.write, social-posts.read, social-posts.write, campaigns.read, campaigns.write, leads.read, leads.write, deals.read, deals.write, articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, intelligence.read, intelligence.write, seo.read, seo.write, contacts.read, contacts.write, files.read, files.write, deals.execute, ai.generate, ads.read, ads.write, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, intelligence.write, seo.write, deals.execute, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."}},"/v1/brand-voices/extract":{"post":{"operationId":"brand-voices.extract","tags":["brand-voices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"A name for the voice, from 1 to 255 characters."},"source_url":{"type":["string","null"],"format":"uri","description":"A web page to read the voice from. Send it or sample_content."},"sample_content":{"type":["string","null"],"maxLength":50000,"description":"A text to read the voice from, at most 50000 characters. Send it or source_url."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["name"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/ExtractedBrandVoiceData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate"]}],"summary":"Suggest a brand voice from a text","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI reads a web page or a text and suggests how your brand voice sounds. Nothing is saved: to keep it, send the suggestion to `brand-voices.store`.\n\nYou get 422 when you send neither source_url nor sample_content, or when the page is not safe to read, and 502 when the page cannot be loaded.\n\nYou get 402 when you do not have enough credits.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate."}},"/v1/brand-voices/{brandVoice}/set-default":{"patch":{"operationId":"brand-voices.set-default","tags":["brand-voices"],"parameters":[{"name":"brandVoice","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the brand voice."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BrandVoiceOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Make a brand voice the default","description":"Makes this voice the default one. The voice that was the default before stops being it. AI uses the default voice when you pick none.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/brand-voices":{"get":{"operationId":"brand-voices.index","tags":["brand-voices"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/BrandVoiceOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"List brand voices","description":"Returns all your brand voices with their phrases.\n\nNeeds one of these permissions: intelligence.read."},"post":{"operationId":"brand-voices.store","tags":["brand-voices"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the voice, from 1 to 255 characters."},"description":{"type":["string","null"],"maxLength":5000,"description":"How the voice sounds, in your words. At most 5000 characters."},"toneDescriptor":{"anyOf":[{"$ref":"#/components/schemas/TenantBrandVoiceTone"},{"type":"null"}],"description":"The tone: professional, friendly, authoritative, casual, playful, inspirational, empathetic, technical or custom."},"readingLevel":{"anyOf":[{"$ref":"#/components/schemas/TenantBrandVoiceReadingLevel"},{"type":"null"}],"description":"How hard the texts are to read: simple, standard or advanced."},"persona":{"type":["string","null"],"maxLength":255,"description":"Who speaks, like a friendly expert. At most 255 characters."},"sampleContent":{"type":["string","null"],"maxLength":10000,"description":"A sample text written in this voice. At most 10000 characters."},"derivedFromAnalysisId":{"type":["integer","null"],"description":"The number of the website analysis this came from. Leave it out when you write it yourself."},"phrases":{"type":["array","null"],"items":{"type":"object","properties":{"phrase":{"type":"string","minLength":1,"maxLength":255,"description":"The phrase, from 1 to 255 characters."},"mode":{"$ref":"#/components/schemas/TenantBrandVoicePhraseMode","description":"prefer to use it, avoid to keep it out."}}},"maxItems":200,"description":"Phrases to use or avoid, at most 200. They replace all old phrases."}},"required":["name"]},"example":{"name":"Přátelský odborník","description":"Mluvíme jako zkušený mechanik, který rád poradí. Krátké věty, žádná hantýrka.","toneDescriptor":"friendly","readingLevel":"simple","persona":"Zkušený mechanik z dílny","sampleContent":"Než vyrazíš na první jarní vyjížďku, zkontroluj brzdy a nafoukni pneumatiky. Zbytek rádi uděláme za tebe.","phrases":[{"phrase":"rádi poradíme","mode":"prefer"},{"phrase":"bezkonkurenční","mode":"avoid"}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BrandVoiceOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Brand voice created successfully","payload":{"id":23,"tenantId":412,"tenantSequence":2,"name":"Přátelský odborník","description":"Mluvíme jako zkušený mechanik, který rád poradí. Krátké věty, žádná hantýrka.","toneDescriptor":"friendly","readingLevel":"simple","persona":"Zkušený mechanik z dílny","sampleContent":"Než vyrazíš na první jarní vyjížďku, zkontroluj brzdy a nafoukni pneumatiky. Zbytek rádi uděláme za tebe.","isDefault":false,"derivedFromAnalysisId":null,"createdBy":88,"phrases":[{"id":301,"phrase":"rádi poradíme","mode":"prefer"},{"id":302,"phrase":"bezkonkurenční","mode":"avoid"}],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","deletedAt":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Create a brand voice","description":"Creates a brand voice. Only the name is needed. To make it the default one, call `brand-voices.set-default` afterwards.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/brand-voices/{brandVoice}":{"get":{"operationId":"brand-voices.show","tags":["brand-voices"],"parameters":[{"name":"brandVoice","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the brand voice."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BrandVoiceOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Brand voice retrieved successfully","payload":{"id":23,"tenantId":412,"tenantSequence":2,"name":"Přátelský odborník","description":"Mluvíme jako zkušený mechanik, který rád poradí. Krátké věty, žádná hantýrka.","toneDescriptor":"friendly","readingLevel":"simple","persona":"Zkušený mechanik z dílny","sampleContent":"Než vyrazíš na první jarní vyjížďku, zkontroluj brzdy a nafoukni pneumatiky. Zbytek rádi uděláme za tebe.","isDefault":true,"derivedFromAnalysisId":null,"createdBy":88,"phrases":[{"id":301,"phrase":"rádi poradíme","mode":"prefer"},{"id":302,"phrase":"bezkonkurenční","mode":"avoid"}],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","deletedAt":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"Show one brand voice","description":"Returns one brand voice with its phrases.\n\nNeeds one of these permissions: intelligence.read."},"put":{"operationId":"brand-voices.update","tags":["brand-voices"],"parameters":[{"name":"brandVoice","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the brand voice."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the voice, from 1 to 255 characters. Leave it out to keep it."},"description":{"type":["string","null"],"maxLength":5000,"description":"How the voice sounds, in your words. At most 5000 characters. Leave it out to keep it."},"toneDescriptor":{"anyOf":[{"$ref":"#/components/schemas/TenantBrandVoiceTone"},{"type":"null"}],"description":"The tone: professional, friendly, authoritative, casual, playful, inspirational, empathetic, technical or custom. Leave it out to keep it."},"readingLevel":{"anyOf":[{"$ref":"#/components/schemas/TenantBrandVoiceReadingLevel"},{"type":"null"}],"description":"How hard the texts are to read: simple, standard or advanced. Leave it out to keep it."},"persona":{"type":["string","null"],"maxLength":255,"description":"Who speaks, like a friendly expert. At most 255 characters. Leave it out to keep it."},"sampleContent":{"type":["string","null"],"maxLength":10000,"description":"A sample text written in this voice. At most 10000 characters. Leave it out to keep it."},"derivedFromAnalysisId":{"type":["integer","null"],"description":"The number of the website analysis this came from. Leave it out to keep it."},"phrases":{"type":"array","items":{"type":"object","properties":{"phrase":{"type":"string","minLength":1,"maxLength":255,"description":"The phrase, from 1 to 255 characters."},"mode":{"$ref":"#/components/schemas/TenantBrandVoicePhraseMode","description":"prefer to use it, avoid to keep it out."}}},"maxItems":200,"description":"Phrases to use or avoid, at most 200. They replace all old phrases."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BrandVoiceOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Change a brand voice","description":"Changes a brand voice. Send only what you want to change. A field you leave out stays as it is; null clears it. When you send phrases, they replace all old phrases.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."},"delete":{"operationId":"brand-voices.destroy","tags":["brand-voices"],"parameters":[{"name":"brandVoice","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the brand voice."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Remove a brand voice","description":"Removes a brand voice. Texts written with it stay as they are. The default brand voice cannot be removed; you get 422, so make another voice the default first with `brand-voices.set-default`.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/campaigns/grid":{"get":{"operationId":"campaigns.grid","tags":["campaigns"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[search]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Words to look for in names, emails and other main fields."},{"name":"filter[standaloneEntity]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"developer_docs.listing.filter.standaloneEntity"},{"name":"filter[status]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The status. One or more values, split by commas."},{"name":"filter[mode]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How the campaign runs. One or more values, split by commas."},{"name":"filter[goal]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"What the campaign aims for. One or more values, split by commas."},{"name":"filter[origin]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Where it came from. One or more values, split by commas."},{"name":"filter[autonomyLevel]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How much the campaign may do alone. One or more values, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["tenantSequence","name","status","mode","goal","origin","autonomyLevel","startAt","endsOn","createdAt","updatedAt","-tenantSequence","-name","-status","-mode","-goal","-origin","-autonomyLevel","-startAt","-endsOn","-createdAt","-updatedAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexCampaignData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.read"]}],"summary":"List campaigns in a table","description":"Returns one page of campaigns with the filters and the sort you ask for.\n\nNeeds one of these permissions: campaigns.read."}},"/v1/campaigns/options":{"get":{"operationId":"campaigns.options","tags":["campaigns"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name. At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[status]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The status. One or more values, split by commas."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionCampaignData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.read"]}],"summary":"List campaigns for a picker","description":"Returns short items with the number and the name of each campaign. Use it to fill a picker.\n\nNeeds one of these permissions: campaigns.read."}},"/v1/campaigns/board/summary":{"get":{"operationId":"campaigns.board.summary","tags":["campaigns"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[search]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Words to look for in names, emails and other main fields."},{"name":"filter[standaloneEntity]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"developer_docs.listing.filter.standaloneEntity"},{"name":"filter[status]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The status. One or more values, split by commas."},{"name":"filter[mode]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How the campaign runs. One or more values, split by commas."},{"name":"filter[goal]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"What the campaign aims for. One or more values, split by commas."},{"name":"filter[origin]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Where it came from. One or more values, split by commas."},{"name":"filter[autonomyLevel]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How much the campaign may do alone. One or more values, split by commas."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BoardSummaryData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.read"]}],"summary":"Count campaigns in each status","description":"Returns how many campaigns there are in each column of the board. A column is one status.\n\nNeeds one of these permissions: campaigns.read."}},"/v1/campaigns/board/{status}":{"get":{"operationId":"campaigns.board.column","tags":["campaigns"],"parameters":[{"name":"status","in":"path","required":true,"schema":{"type":"string","enum":["draft","approved","scheduled","active","paused","completed","cancelled","archived"]},"description":"The column: draft, approved, scheduled, active, paused, completed, cancelled or archived."},{"name":"cursor","in":"query","schema":{"type":["string","null"],"maxLength":512},"description":"Where the next page starts. Take it from nextCursor of the page before."},{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[search]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Words to look for in names, emails and other main fields."},{"name":"filter[standaloneEntity]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"developer_docs.listing.filter.standaloneEntity"},{"name":"filter[status]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The status. One or more values, split by commas."},{"name":"filter[mode]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How the campaign runs. One or more values, split by commas."},{"name":"filter[goal]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"What the campaign aims for. One or more values, split by commas."},{"name":"filter[origin]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Where it came from. One or more values, split by commas."},{"name":"filter[autonomyLevel]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How much the campaign may do alone. One or more values, split by commas."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexCampaignData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.read"]}],"summary":"List campaigns of one status","description":"Returns the campaigns of one board column, page by page. Pass `nextCursor` as `cursor` to get the next page.\n\nNeeds one of these permissions: campaigns.read."}},"/v1/campaigns/overview":{"get":{"operationId":"campaigns.overview","tags":["campaigns"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[status]","in":"query","schema":{"anyOf":[{"$ref":"#/components/schemas/CampaignStatus"},{"type":"null"}]},"description":"Count only campaigns with this status."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CampaignOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.read"]}],"summary":"Show campaign numbers for a time range","description":"Returns the numbers of your campaigns for the days you pick. Reach and clicks need read access to articles, emails and social posts, leads need `leads.read`, and deals and money need `deals.read`; without it, that part is null.\n\nAsk again when `ready` is false.\n\nNeeds one of these permissions: campaigns.read."}},"/v1/campaigns/overview/timeline":{"get":{"operationId":"campaigns.overview.timeline","tags":["campaigns"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[status]","in":"query","schema":{"anyOf":[{"$ref":"#/components/schemas/CampaignStatus"},{"type":"null"}]},"description":"Show only campaigns with this status. Without it, draft, cancelled and archived campaigns are left out."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CampaignOverviewTimelineData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.read"]}],"summary":"Show campaigns on a timeline","description":"Returns the campaigns that run during the range, so you can draw them on a timeline.\n\nNeeds one of these permissions: campaigns.read."}},"/v1/campaigns/ai-analyze":{"post":{"operationId":"campaigns.ai-analyze","tags":["campaigns"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"type":"string","minLength":20,"maxLength":5000,"description":"The brief to analyse, from 20 to 5000 characters."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["brief"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CampaignBriefAnalysisResponseData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write","ai.generate"]}],"summary":"Analyse a campaign brief with AI","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI reads your campaign brief and tells you the goal, the channels, the timing, the calls to action and the details that are still missing. Nothing is saved as a campaign; you can use the answer to fill in a new campaign.\n\nA key also needs a write permission for content: `articles.write`, `emails.write` or `social-posts.write`. Without it you get 422 and nothing is spent.\n\nNeeds one of these permissions: campaigns.write. Also needs: ai.generate."}},"/v1/campaigns/ai-plan":{"post":{"operationId":"campaigns.ai-plan","tags":["campaigns"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"type":"string","minLength":20,"maxLength":5000,"description":"What the campaign is about, from 20 to 5000 characters."},"overrides":{"type":["object","null"],"properties":{"name":{"type":["string","null"],"maxLength":120},"goal":{"anyOf":[{"$ref":"#/components/schemas/CampaignGoal"},{"type":"null"}]},"audienceWarmth":{"anyOf":[{"$ref":"#/components/schemas/CampaignAudienceWarmth"},{"type":"null"}]},"goalMetricType":{"anyOf":[{"$ref":"#/components/schemas/CampaignGoalMetricType"},{"type":"null"}]},"goalMetricTarget":{"type":["number","null"],"minimum":0,"maximum":1000000000},"goalMetricLabel":{"type":["string","null"],"maxLength":255},"mode":{"anyOf":[{"$ref":"#/components/schemas/CampaignMode"},{"type":"null"}]},"languageId":{"type":["integer","null"]},"tone":{"type":["string","null"],"maxLength":2000},"brandVoiceId":{"type":["integer","null"]},"articleIntegrationId":{"type":["integer","null"]},"sendFromTenantDomainEmailId":{"type":["integer","null"]},"replyToTenantDomainEmailId":{"type":["integer","null"]},"channels":{"type":["array","null"],"items":{"type":"string","enum":["blog","facebook","instagram","x","linkedin","email_broadcast","email_sequence"]},"maxItems":10,"uniqueItems":true},"destinations":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CampaignDestination"},"uniqueItems":true},"product":{"type":["string","null"],"maxLength":2000},"audience":{"type":["string","null"],"maxLength":2000},"startAt":{"type":["string","null"]},"endsOn":{"type":["string","null"],"format":"date"},"timing":{"type":["object","null"],"properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"],"format":"date"},"inferredDurationDays":{"type":["integer","null"],"minimum":1}}},"askRatio":{"type":["number","null"],"minimum":0,"maximum":0.4},"suggestedCtas":{"type":["array","null"],"items":{"type":"object","properties":{"label":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":1000}},"required":["label"]},"maxItems":5}},"description":"Your own choices that replace what AI would decide. Through a key, overrides.destinations is required."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["brief"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CampaignAiPlanDispatchOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write","ai.generate"]}],"summary":"Plan a campaign with AI","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI plans a campaign from your short brief, in the background. The answer is 202 with the number of a draft campaign; read it later to see the plan.\n\nNeeds one of these permissions: campaigns.write. Also needs: ai.generate."}},"/v1/campaigns/ai-plan/estimate":{"post":{"operationId":"campaigns.ai-plan.estimate","tags":["campaigns"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destinations":{"type":"array","items":{"$ref":"#/components/schemas/CampaignDestination"},"minItems":1,"description":"The places where the content goes, for example blog_article."},"audienceWarmth":{"anyOf":[{"$ref":"#/components/schemas/CampaignAudienceWarmth"},{"type":"null"}],"description":"How well people know the brand: cold, warm or owned. When it is left out, owned is used."}},"required":["destinations"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CampaignPrePlanEstimateData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.read"]}],"summary":"Show what AI planning of a campaign costs","description":"This only tells the price. It spends nothing.\n\nNeeds one of these permissions: campaigns.read."}},"/v1/campaigns/{campaign}/ai-plan/retry":{"post":{"operationId":"campaigns.ai-plan-retry","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CampaignAiPlanDispatchOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write","ai.generate"]}],"summary":"Plan a campaign with AI again","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI plans the campaign again in the background. The answer is 202.\n\nIt works only for a draft that AI planned. The plan was never made, or it failed. Otherwise you get 409. When the draft already has channels, you get 409. A plan step may be running or just started. Then you get 409. A 409 costs no credits.\n\nNeeds one of these permissions: campaigns.write. Also needs: ai.generate."}},"/v1/campaigns/{campaign}/ai-adjust":{"post":{"operationId":"campaigns.ai-adjust","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign to change."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"instruction":{"type":"string","minLength":5,"maxLength":2000,"description":"What to change, in plain words, from 5 to 2000 characters."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["instruction"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AiAdjustResponseData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write","ai.generate"]}],"summary":"Change a campaign with AI from an instruction","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI changes the campaign in place from your instruction. Through a key it can add generation slots or sources, move the schedule, pause the campaign and change approval. The answer lists what was applied and what was skipped.\n\nResuming the campaign and removing human approval need `campaigns.execute`; without it those operations are skipped and listed in the answer. In the app AI can also regenerate pieces of content; through a key that step is skipped because it is a separate paid step.\n\nA key also needs the write permission of each kind of content in the campaign, like `campaigns.update`: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403 before any credits are spent. A generation slot for a new kind of content needs that permission too; without it the operation is skipped.\n\nNeeds one of these permissions: campaigns.write. Also needs: ai.generate."}},"/v1/campaigns/{campaign}/pause":{"post":{"operationId":"campaigns.pause","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateCampaignData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Campaign paused successfully","payload":{"id":58,"tenantId":412,"tenantSequence":6,"tenantName":"Cyklo Novák s.r.o.","userId":88,"timezone":"Europe/Prague","name":"Jarní servis 2027","description":"Pozvi zákazníky na jarní servis kol.","origin":"manual","mode":"burst","audienceWarmth":"warm","autonomyLevel":"l1_approval","goal":"leads","goalMetricType":"leads","goalMetricTarget":"40.00","goalMetricLabel":null,"askRatio":null,"effectiveAskRatio":0.3,"contentMix":{"give":3,"softAsk":2,"ask":1},"brief":"Jaro začíná, kola potřebují servis.","aiPlan":null,"aiPlanGenerationStage":null,"aiPlanFailureMessage":null,"aiPlanStepOutputs":[],"brandVoiceId":null,"approvalWindowHours":24,"approvalTimeoutAction":"skip","generationBudgetCredits":500,"generationSpentCredits":120,"similarityCheckEnabled":true,"similarityThreshold":"0.850","similarityAction":"require_approval","similarityWindowDays":30,"status":"paused","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","deletedAt":null,"startAt":"2027-03-01T07:00:00Z","endsOn":"2027-04-30","startedAt":"2027-03-01T07:00:00Z","publishedAt":"2027-03-01T07:00:00Z","endedAt":null,"brandVoice":null,"sources":[{"id":120,"tenantId":412,"campaignId":58,"sourceType":"brief","name":"Zadání","brief":null,"seedAngles":[],"angleType":null,"nicheTopic":null,"feedUrl":null,"pollingIntervalMinutes":null,"topicId":null,"topicFeedId":null,"topicPickMode":null,"topicPickWindowSize":null,"lastPolledAt":null,"lastItemHash":null,"keywords":[],"urls":[],"documents":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}],"generationSlots":[{"id":301,"tenantId":412,"campaignId":58,"destination":"facebook_post","recurrenceRule":"FREQ=WEEKLY;BYDAY=TU","oneOffAt":null,"startOffsetDays":0,"sourceSelectionStrategy":"newest","itemsPerGeneration":1,"active":true,"angle":"educational","buyerStage":"consideration","preferredFormat":"single_post","lastGeneratedAt":null,"nextScheduledAt":null,"sources":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","remainingBlueprints":0,"usedBlueprints":0,"depletionRatio":0,"exhaustedAt":null,"estimatedDryAt":null,"publishingOffAngle":false,"blueprintConsumptionMode":"mix"}],"alerts":[],"destinationsCount":1,"destinations":[],"ctas":[],"leadForms":[],"linkedTrackingEvents":[],"publication":null,"languageId":2,"language":null,"conversionActions":[],"goalTargets":{"operator":"and","targets":[],"groups":[]}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write"]}],"summary":"Pause a campaign","description":"Pauses an `active` campaign. Fusio stops making new content for it. The answer is the campaign in the same shape as `campaigns.show`.\n\nA key also needs the write permission of each kind of content in the campaign: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403.\n\nError: 422 when the campaign is not active.\n\nNeeds one of these permissions: campaigns.write."}},"/v1/campaigns/{campaign}/resume":{"post":{"operationId":"campaigns.resume","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateCampaignData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Campaign resumed successfully","payload":{"id":58,"tenantId":412,"tenantSequence":6,"tenantName":"Cyklo Novák s.r.o.","userId":88,"timezone":"Europe/Prague","name":"Jarní servis 2027","description":"Pozvi zákazníky na jarní servis kol.","origin":"manual","mode":"burst","audienceWarmth":"warm","autonomyLevel":"l1_approval","goal":"leads","goalMetricType":"leads","goalMetricTarget":"40.00","goalMetricLabel":null,"askRatio":null,"effectiveAskRatio":0.3,"contentMix":{"give":3,"softAsk":2,"ask":1},"brief":"Jaro začíná, kola potřebují servis.","aiPlan":null,"aiPlanGenerationStage":null,"aiPlanFailureMessage":null,"aiPlanStepOutputs":[],"brandVoiceId":null,"approvalWindowHours":24,"approvalTimeoutAction":"skip","generationBudgetCredits":500,"generationSpentCredits":120,"similarityCheckEnabled":true,"similarityThreshold":"0.850","similarityAction":"require_approval","similarityWindowDays":30,"status":"active","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","deletedAt":null,"startAt":"2027-03-01T07:00:00Z","endsOn":"2027-04-30","startedAt":"2027-03-01T07:00:00Z","publishedAt":"2027-03-01T07:00:00Z","endedAt":null,"brandVoice":null,"sources":[{"id":120,"tenantId":412,"campaignId":58,"sourceType":"brief","name":"Zadání","brief":null,"seedAngles":[],"angleType":null,"nicheTopic":null,"feedUrl":null,"pollingIntervalMinutes":null,"topicId":null,"topicFeedId":null,"topicPickMode":null,"topicPickWindowSize":null,"lastPolledAt":null,"lastItemHash":null,"keywords":[],"urls":[],"documents":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}],"generationSlots":[{"id":301,"tenantId":412,"campaignId":58,"destination":"facebook_post","recurrenceRule":"FREQ=WEEKLY;BYDAY=TU","oneOffAt":null,"startOffsetDays":0,"sourceSelectionStrategy":"newest","itemsPerGeneration":1,"active":true,"angle":"educational","buyerStage":"consideration","preferredFormat":"single_post","lastGeneratedAt":null,"nextScheduledAt":null,"sources":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","remainingBlueprints":0,"usedBlueprints":0,"depletionRatio":0,"exhaustedAt":null,"estimatedDryAt":null,"publishingOffAngle":false,"blueprintConsumptionMode":"mix"}],"alerts":[],"destinationsCount":1,"destinations":[],"ctas":[],"leadForms":[],"linkedTrackingEvents":[],"publication":null,"languageId":2,"language":null,"conversionActions":[],"goalTargets":{"operator":"and","targets":[],"groups":[]}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write","campaigns.execute"]}],"x-fusio-opt-in-scopes":["campaigns.execute"],"summary":"Resume a paused campaign","description":"Moves a `paused` campaign back to `active`. A campaign that Fusio paused before it ever started goes back to `scheduled`. Content planned for a time that passed during the pause is skipped.\n\nThe answer is the campaign in the same shape as `campaigns.show`.\n\n> [!WARNING]\n> Fusio goes on making and publishing content.\n\nA key also needs the write permission of each kind of content in the campaign: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403.\n\nErrors: 403 `insufficient_scope`, 422 when the campaign is not paused.\n\nNeeds one of these permissions: campaigns.write. Also needs: campaigns.execute. You must tick these on purpose: campaigns.execute."}},"/v1/campaigns/{campaign}/archive":{"post":{"operationId":"campaigns.archive","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateCampaignData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Campaign archived successfully","payload":{"id":58,"tenantId":412,"tenantSequence":6,"tenantName":"Cyklo Novák s.r.o.","userId":88,"timezone":"Europe/Prague","name":"Jarní servis 2027","description":"Pozvi zákazníky na jarní servis kol.","origin":"manual","mode":"burst","audienceWarmth":"warm","autonomyLevel":"l1_approval","goal":"leads","goalMetricType":"leads","goalMetricTarget":"40.00","goalMetricLabel":null,"askRatio":null,"effectiveAskRatio":0.3,"contentMix":{"give":3,"softAsk":2,"ask":1},"brief":"Jaro začíná, kola potřebují servis.","aiPlan":null,"aiPlanGenerationStage":null,"aiPlanFailureMessage":null,"aiPlanStepOutputs":[],"brandVoiceId":null,"approvalWindowHours":24,"approvalTimeoutAction":"skip","generationBudgetCredits":500,"generationSpentCredits":120,"similarityCheckEnabled":true,"similarityThreshold":"0.850","similarityAction":"require_approval","similarityWindowDays":30,"status":"archived","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","deletedAt":null,"startAt":"2027-03-01T07:00:00Z","endsOn":"2027-04-30","startedAt":"2027-03-01T07:00:00Z","publishedAt":"2027-03-01T07:00:00Z","endedAt":null,"brandVoice":null,"sources":[{"id":120,"tenantId":412,"campaignId":58,"sourceType":"brief","name":"Zadání","brief":null,"seedAngles":[],"angleType":null,"nicheTopic":null,"feedUrl":null,"pollingIntervalMinutes":null,"topicId":null,"topicFeedId":null,"topicPickMode":null,"topicPickWindowSize":null,"lastPolledAt":null,"lastItemHash":null,"keywords":[],"urls":[],"documents":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}],"generationSlots":[{"id":301,"tenantId":412,"campaignId":58,"destination":"facebook_post","recurrenceRule":"FREQ=WEEKLY;BYDAY=TU","oneOffAt":null,"startOffsetDays":0,"sourceSelectionStrategy":"newest","itemsPerGeneration":1,"active":true,"angle":"educational","buyerStage":"consideration","preferredFormat":"single_post","lastGeneratedAt":null,"nextScheduledAt":null,"sources":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","remainingBlueprints":0,"usedBlueprints":0,"depletionRatio":0,"exhaustedAt":null,"estimatedDryAt":null,"publishingOffAngle":false,"blueprintConsumptionMode":"mix"}],"alerts":[],"destinationsCount":1,"destinations":[],"ctas":[],"leadForms":[],"linkedTrackingEvents":[],"publication":null,"languageId":2,"language":null,"conversionActions":[],"goalTargets":{"operator":"and","targets":[],"groups":[]}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write"]}],"summary":"Archive a campaign","description":"Moves the campaign to `archived`. It stops for good. When content still waits for approval, the people who approve get a message. The answer is the campaign in the same shape as `campaigns.show`.\n\nA key also needs the write permission of each kind of content in the campaign: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403.\n\nError: 422 when the campaign is already archived.\n\nNeeds one of these permissions: campaigns.write."}},"/v1/campaigns/{campaign}/duplicate":{"post":{"operationId":"campaigns.duplicate","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign to copy."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":"string","format":"date","description":"The day the new campaign starts, as YYYY-MM-DD. It cannot be before today in the time zone of the original campaign, nor more than 5 years ahead."}},"required":["startDate"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateCampaignData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Campaign copied as a new draft","payload":{"id":59,"tenantId":412,"tenantSequence":7,"tenantName":"Cyklo Novák s.r.o.","userId":88,"timezone":"Europe/Prague","name":"Jarní servis 2027 (copy)","description":"Pozvi zákazníky na jarní servis kol.","origin":"manual","mode":"burst","audienceWarmth":"warm","autonomyLevel":"l1_approval","goal":"leads","goalMetricType":"leads","goalMetricTarget":"40.00","goalMetricLabel":null,"askRatio":null,"effectiveAskRatio":0.3,"contentMix":{"give":3,"softAsk":2,"ask":1},"brief":"Jaro začíná, kola potřebují servis.","aiPlan":null,"aiPlanGenerationStage":null,"aiPlanFailureMessage":null,"aiPlanStepOutputs":[],"brandVoiceId":null,"approvalWindowHours":24,"approvalTimeoutAction":"skip","generationBudgetCredits":500,"generationSpentCredits":0,"similarityCheckEnabled":true,"similarityThreshold":"0.850","similarityAction":"require_approval","similarityWindowDays":30,"status":"draft","createdAt":"2026-11-19T09:00:00Z","updatedAt":"2026-11-19T09:00:00Z","deletedAt":null,"startAt":"2027-06-01T07:00:00Z","endsOn":"2027-06-30","startedAt":null,"publishedAt":null,"endedAt":null,"brandVoice":null,"sources":[{"id":121,"tenantId":412,"campaignId":59,"sourceType":"brief","name":"Zadání","brief":null,"seedAngles":[],"angleType":null,"nicheTopic":null,"feedUrl":null,"pollingIntervalMinutes":null,"topicId":null,"topicFeedId":null,"topicPickMode":null,"topicPickWindowSize":null,"lastPolledAt":null,"lastItemHash":null,"keywords":[],"urls":[],"documents":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}],"generationSlots":[{"id":301,"tenantId":412,"campaignId":58,"destination":"facebook_post","recurrenceRule":"FREQ=WEEKLY;BYDAY=TU","oneOffAt":null,"startOffsetDays":0,"sourceSelectionStrategy":"newest","itemsPerGeneration":1,"active":true,"angle":"educational","buyerStage":"consideration","preferredFormat":"single_post","lastGeneratedAt":null,"nextScheduledAt":null,"sources":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","remainingBlueprints":0,"usedBlueprints":0,"depletionRatio":0,"exhaustedAt":null,"estimatedDryAt":null,"publishingOffAngle":false,"blueprintConsumptionMode":"mix"}],"alerts":[],"destinationsCount":1,"destinations":[],"ctas":[],"leadForms":[],"linkedTrackingEvents":[],"publication":null,"languageId":2,"language":null,"conversionActions":[],"goalTargets":{"operator":"and","targets":[],"groups":[]},"derivedFromCampaignId":58}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write"]}],"summary":"Copy a campaign","description":"Copies the campaign into a new draft that starts on `startDate`. The copy keeps the goal, channels, generation slots, audience, settings and approval rules. Every date moves by the difference between `startDate` and the start of the original.\n\nContent, publications, metrics, A/B results and lead forms are not copied, and approvers who left the company are dropped. A copy of an AI-planned campaign becomes a regular draft, because the plan itself is not copied. The new campaign keeps a link to the original in `derivedFromCampaignId`. The answer is the new campaign in the same shape as `campaigns.show`, with status 201.\n\nA key also needs the write permission of each kind of content in the campaign: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403.\n\nErrors: 422 when `startDate` is missing, is not a date like 2026-10-20, is in the past or more than 5 years ahead, when the start time on today's date has already passed, or when the original campaign has no start date.\n\nNeeds one of these permissions: campaigns.write."}},"/v1/campaigns/{campaign}/activate":{"post":{"operationId":"campaigns.activate","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateCampaignData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Campaign activated successfully","payload":{"id":58,"tenantId":412,"tenantSequence":6,"tenantName":"Cyklo Novák s.r.o.","userId":88,"timezone":"Europe/Prague","name":"Jarní servis 2027","description":"Pozvi zákazníky na jarní servis kol.","origin":"manual","mode":"burst","audienceWarmth":"warm","autonomyLevel":"l1_approval","goal":"leads","goalMetricType":"leads","goalMetricTarget":"40.00","goalMetricLabel":null,"askRatio":null,"effectiveAskRatio":0.3,"contentMix":{"give":3,"softAsk":2,"ask":1},"brief":"Jaro začíná, kola potřebují servis.","aiPlan":null,"aiPlanGenerationStage":null,"aiPlanFailureMessage":null,"aiPlanStepOutputs":[],"brandVoiceId":null,"approvalWindowHours":24,"approvalTimeoutAction":"skip","generationBudgetCredits":500,"generationSpentCredits":120,"similarityCheckEnabled":true,"similarityThreshold":"0.850","similarityAction":"require_approval","similarityWindowDays":30,"status":"active","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","deletedAt":null,"startAt":"2027-03-01T07:00:00Z","endsOn":"2027-04-30","startedAt":"2027-03-01T07:00:00Z","publishedAt":"2027-03-01T07:00:00Z","endedAt":null,"brandVoice":null,"sources":[{"id":120,"tenantId":412,"campaignId":58,"sourceType":"brief","name":"Zadání","brief":null,"seedAngles":[],"angleType":null,"nicheTopic":null,"feedUrl":null,"pollingIntervalMinutes":null,"topicId":null,"topicFeedId":null,"topicPickMode":null,"topicPickWindowSize":null,"lastPolledAt":null,"lastItemHash":null,"keywords":[],"urls":[],"documents":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}],"generationSlots":[{"id":301,"tenantId":412,"campaignId":58,"destination":"facebook_post","recurrenceRule":"FREQ=WEEKLY;BYDAY=TU","oneOffAt":null,"startOffsetDays":0,"sourceSelectionStrategy":"newest","itemsPerGeneration":1,"active":true,"angle":"educational","buyerStage":"consideration","preferredFormat":"single_post","lastGeneratedAt":null,"nextScheduledAt":null,"sources":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","remainingBlueprints":0,"usedBlueprints":0,"depletionRatio":0,"exhaustedAt":null,"estimatedDryAt":null,"publishingOffAngle":false,"blueprintConsumptionMode":"mix"}],"alerts":[],"destinationsCount":1,"destinations":[],"ctas":[],"leadForms":[],"linkedTrackingEvents":[],"publication":null,"languageId":2,"language":null,"conversionActions":[],"goalTargets":{"operator":"and","targets":[],"groups":[]}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write","campaigns.execute"]}],"x-fusio-opt-in-scopes":["campaigns.execute"],"summary":"Start a campaign","description":"Starts a `draft` or `scheduled` campaign. Fusio first checks that the campaign is ready. When it is not, the answer is 422 with the list of problems in `payload.issues`.\n\nThe answer is the campaign in the same shape as `campaigns.show`.\n\n> [!WARNING]\n> From now on, Fusio makes and publishes content as the campaign says.\n\nA key also needs the write permission of each kind of content in the campaign: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403.\n\nErrors: 403 `insufficient_scope`, 422 when the campaign is not ready or not in a status that can start.\n\nNeeds one of these permissions: campaigns.write. Also needs: campaigns.execute. You must tick these on purpose: campaigns.execute."}},"/v1/campaigns/{campaign}/approve":{"post":{"operationId":"campaigns.approve","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CampaignApproveResultData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write","campaigns.execute"]}],"x-fusio-opt-in-scopes":["campaigns.execute"],"summary":"Approve a campaign and its content","description":"Approves all content of the campaign that waits for approval and moves the campaign from `draft` to `approved`. It works only for a `draft` campaign; otherwise nothing changes. You must be one of the people who may approve.\n\n> [!WARNING]\n> Approved content can be published without another check.\n\nA key also needs the write permission of each kind of content in the campaign: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403.\n\nErrors: 403 `insufficient_scope` or when you may not approve, 422 when the campaign is not `draft`.\n\nNeeds one of these permissions: campaigns.write. Also needs: campaigns.execute. You must tick these on purpose: campaigns.execute."}},"/v1/campaigns":{"post":{"operationId":"campaigns.store","tags":["campaigns"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the campaign, at most 255 characters."},"description":{"type":["string","null"],"description":"A short note about the campaign for your team."},"origin":{"anyOf":[{"$ref":"#/components/schemas/CampaignOrigin"},{"type":"null"}],"description":"Where the campaign comes from. Leave it out for a campaign you make yourself."},"mode":{"$ref":"#/components/schemas/CampaignMode","description":"burst runs between two dates and needs endsOn. evergreen runs with no end. nurture follows people over time."},"audienceWarmth":{"anyOf":[{"$ref":"#/components/schemas/CampaignAudienceWarmth"},{"type":"null"}],"description":"How well the people know you: cold, warm or owned (your own contacts)."},"autonomyLevel":{"$ref":"#/components/schemas/CampaignAutonomyLevel","description":"How much Fusio does alone: l0_manual nothing, l1_approval makes content you approve, l2_auto_publish publishes without you, l3_autopilot runs the whole campaign."},"goal":{"$ref":"#/components/schemas/CampaignGoal","description":"What the campaign is for: awareness, traffic, leads, sales, retention or custom."},"goalMetricType":{"anyOf":[{"$ref":"#/components/schemas/CampaignGoalMetricType"},{"type":"null"}],"description":"The main number you watch, like leads or revenue."},"goalMetricTarget":{"type":["number","null"],"description":"How much of that number you want to reach."},"goalMetricLabel":{"type":["string","null"],"maxLength":255,"description":"Your own name for the number, at most 255 characters."},"brief":{"type":["string","null"],"description":"What the campaign is about, in your own words. Fusio writes the content from it."},"brandVoiceId":{"type":["integer","null"],"description":"The number of the brand voice the content uses."},"languageId":{"type":["integer","null"],"description":"The number of the language of the content."},"approvalWindowHours":{"type":["integer","null"],"minimum":1,"maximum":72,"description":"How many hours you have to approve new content, 1 to 72."},"approvalTimeoutAction":{"anyOf":[{"$ref":"#/components/schemas/CampaignApprovalTimeoutAction"},{"type":"null"}],"description":"What happens when nobody approves in time: skip drops the content, publish publishes it."},"generationBudgetCredits":{"type":["integer","null"],"minimum":0,"description":"The most credits Fusio may spend on writing content, 0 or more."},"similarityCheckEnabled":{"type":["boolean","null"],"description":"true to check that new content is not too close to older content."},"similarityThreshold":{"type":["number","null"],"minimum":0,"maximum":1,"description":"How alike content may be, from 0 to 1. Higher allows more alike content."},"similarityAction":{"anyOf":[{"$ref":"#/components/schemas/CampaignSimilarityAction"},{"type":"null"}],"description":"What to do with content that is too alike: skip drops it, require_approval asks you."},"similarityWindowDays":{"type":["integer","null"],"minimum":1,"description":"How many days back to compare, 1 or more."},"timezone":{"type":"string","maxLength":64,"description":"The time zone of the campaign, like Europe/Prague."},"startAt":{"type":"string","description":"When the campaign starts: date and time with a time zone, like 2026-12-01T09:00:00+01:00."},"endsOn":{"type":["string","null"],"format":"date","description":"The last day, as YYYY-MM-DD. It cannot be before the start."},"status":{"anyOf":[{"$ref":"#/components/schemas/CampaignStatus"},{"type":"null"}],"description":"Ignored here: a new campaign always starts as draft."},"askRatio":{"type":["number","null"],"minimum":0,"maximum":0.4,"description":"How much of the content asks people to act, from 0 to 0.4. Leave it out for the default mix."},"slots":{"type":"array","items":{"type":"object","properties":{"destination":{"$ref":"#/components/schemas/CampaignDestination","description":"Where the content goes, like blog_article or a social network. It must fit the audienceWarmth: a cold audience gets no email_broadcast or email_sequence."},"recurrenceRule":{"type":["string","null"],"maxLength":500,"description":"How often new content comes, as a repeat rule (RRULE), at most 500 characters."},"angle":{"anyOf":[{"$ref":"#/components/schemas/CampaignAngle"},{"type":"null"}],"description":"The kind of view the content takes."},"buyerStage":{"anyOf":[{"$ref":"#/components/schemas/CampaignBuyerStage"},{"type":"null"}],"description":"Which step of buying the content is for, like awareness or decision."},"preferredFormat":{"anyOf":[{"$ref":"#/components/schemas/CampaignAssetFormat"},{"type":"null"}],"description":"The form you like best, like a carousel."},"itemsPerGeneration":{"type":["integer","null"],"minimum":1,"description":"How many pieces Fusio makes each time, 1 or more."},"copyFramework":{"anyOf":[{"$ref":"#/components/schemas/CampaignCopyFramework"},{"type":"null"}],"description":"The way the text is built, like AIDA or PAS."},"painToAddress":{"type":["string","null"],"maxLength":300,"description":"The problem of your readers the content talks about, at most 300 characters."},"proofToCite":{"type":["string","null"],"maxLength":300,"description":"The proof the content shows, like a number or a result, at most 300 characters."},"sources":{"type":"array","items":{"type":"object","properties":{"sourceIndex":{"type":"integer","minimum":0,"description":"The place of the source in the sources list, from 0."},"sortOrder":{"type":["integer","null"],"minimum":0,"description":"The order of the source in this slot, from 0."}},"required":["sourceIndex"]},"minItems":1,"description":"Which sources this slot uses, at least one."}}},"description":"What Fusio makes and how often: one slot per kind of content."},"customerIds":{"type":["array","null"],"items":{"type":"integer"},"description":"The numbers of the customers the campaign is about."},"sources":{"type":"array","items":{"type":"object","properties":{"sourceType":{"type":"string","enum":["brief","url_list","knowledge_base","topic_ref","topic_feed_ref","article_ref"],"description":"brief is your own text, url_list web pages, knowledge_base your documents, topic_ref a topic, topic_feed_ref a topic feed. article_ref uses the articles of this campaign, for social posts and emails, and takes no other material."},"name":{"type":"string","maxLength":120,"description":"The name of the source, at most 120 characters."},"seedAngles":{"type":["array","null"],"items":{"type":"string","maxLength":500},"maxItems":15,"description":"Ideas to write about, at most 15, each up to 500 characters."},"angleType":{"anyOf":[{"$ref":"#/components/schemas/CampaignAngle"},{"type":"null"}],"description":"The kind of view the content takes, like educational or case_study."},"brief":{"type":["object","null"],"properties":{"text":{"type":["string","null"],"minLength":80,"maxLength":20000,"description":"The text, 80 to 20000 characters."}},"description":"Your own text, for sourceType brief."},"urls":{"type":["array","null"],"items":{"type":"string","format":"uri","maxLength":2048},"maxItems":100,"description":"Web addresses, for url_list. At most 100, each up to 2048 characters."},"documentFileIds":{"type":["array","null"],"items":{"type":"integer"},"maxItems":50,"description":"The numbers of your documents, for knowledge_base. At most 50."},"topicId":{"type":["integer","null"],"description":"The number of the topic, for topic_ref."},"topicFeedId":{"type":["integer","null"],"description":"The number of the topic feed, for topic_feed_ref."},"topicPickMode":{"type":["string","null"],"enum":["latest_relevant","newest_unused",null],"description":"How to pick news: latest_relevant takes the best fresh news, newest_unused the newest news not used yet."},"topicPickWindowSize":{"type":["integer","null"],"minimum":1,"maximum":50,"description":"From how many newest items to pick, 1 to 50."}},"required":["sourceType"]},"description":"The material Fusio writes from. Slots point to these by their place in the list, from 0."},"trackingEventIds":{"type":"array","items":{"type":"integer"},"description":"The numbers of your tracking events the campaign uses."},"events":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"description":"The name of the event, at most 100 characters. It must be new."},"description":{"type":["string","null"],"description":"What the event means."},"isActive":{"type":"boolean","description":"false when Fusio should ignore the event for now."},"createsLead":{"type":"boolean","description":"true when the event makes a new lead."},"fields":{"type":["array","null"],"items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]+$","maxLength":60,"description":"The key of the value: small letters, numbers and _, starting with a letter, at most 60 characters."},"label":{"type":"string","maxLength":120,"description":"The name people see, at most 120 characters."},"type":{"$ref":"#/components/schemas/TenantTrackingEventFieldType","description":"The kind of value: string, number, boolean, enum or date."},"isRequired":{"type":"boolean","description":"true when the event must carry this value."},"sortOrder":{"type":"integer","minimum":0,"description":"The order of the value."},"enumOptions":{"type":["array","null"],"items":{"type":"object","properties":{"value":{"type":"string","maxLength":191,"description":"The saved value, at most 191 characters."},"label":{"type":"string","maxLength":191,"description":"The name people see, at most 191 characters."}},"required":["value","label"]},"description":"The allowed choices, for a choice value."},"bindings":{"type":["array","null"],"items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/TrackingEventFieldBindingKind","description":"none saves nothing. native fills a field of the lead or contact. custom fills a custom field. create_custom makes a new custom field."},"entity":{"type":"string","enum":["lead","contact"],"description":"Where the value goes: lead or contact."},"attribute":{"type":["string","null"],"maxLength":191,"description":"The field to fill, for kind native, like email."},"customFieldId":{"type":["integer","null"],"description":"The number of the custom field, for kind custom."},"isMatchKey":{"type":"boolean","description":"true to find an existing lead or contact by this value."}},"required":["entity"]},"description":"Where Fusio saves the value."}},"required":["key","label","type"]},"description":"The values the event carries."}}},"description":"New tracking events made with the campaign. Lead forms point to these by their place, from 0."},"leadForms":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":120,"description":"The name of the form, at most 120 characters."},"description":{"type":["string","null"],"maxLength":1000,"description":"The text above the form, at most 1000 characters."},"successMessage":{"type":["string","null"],"maxLength":500,"description":"What people see after they send the form, at most 500 characters."},"successRedirectUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"The page people go to after they send the form."},"confirmationEmailTemplateId":{"type":["integer","null"],"description":"The email design of the thank-you email."},"isActive":{"type":"boolean","description":"false turns the form off."},"tagIds":{"type":["array","null"],"items":{"type":"integer","minimum":1},"maxItems":500,"description":"Tags new leads get, at most 500."},"segmentIds":{"type":["array","null"],"items":{"type":"integer","minimum":1},"maxItems":500,"description":"Segments new leads join, at most 500."},"assigneeUserIds":{"type":["array","null"],"items":{"type":"integer"},"description":"The people who get new leads."},"additionalAssigneeUserIds":{"type":["array","null"],"items":{"type":"integer"},"description":"More people who also work on new leads."},"eventIndex":{"type":["integer","null"],"minimum":0,"description":"The place of a new event in the events list, from 0. The form sends that event. Send eventIndex or tenantTrackingEventId, exactly one."},"tenantTrackingEventId":{"type":["integer","null"],"description":"The number of one of your tracking events the form sends. Send eventIndex or tenantTrackingEventId, exactly one."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z_][a-z0-9_]*$","maxLength":60,"description":"The key of the field: small letters, numbers and _, at most 60 characters."},"label":{"type":"string","maxLength":120,"description":"The name people see, at most 120 characters."},"type":{"type":"string","enum":["text","email","tel","url","textarea","number","select","multi_select","checkbox","hidden"],"description":"The kind of field, like text, email or select."},"isRequired":{"type":"boolean","description":"true when people must fill it."},"isLeadName":{"type":"boolean","description":"true when this field gives the name of the new lead."},"sortOrder":{"type":"integer","minimum":0,"description":"The order of the field."},"options":{"type":["array","null"],"items":{"type":"string","maxLength":500},"maxItems":100,"description":"The choices of a select field."},"validationRules":{"type":["object","null"],"properties":{"minLength":{"type":["integer","null"],"minimum":0,"description":"The fewest characters."},"maxLength":{"type":["integer","null"],"minimum":0,"description":"The most characters."},"pattern":{"type":["string","null"],"maxLength":500,"description":"A pattern (regular expression) the value must match."},"min":{"type":["integer","null"],"description":"The smallest number."},"max":{"type":["integer","null"],"description":"The biggest number."}},"description":"Extra checks of the value."},"bindings":{"type":["array","null"],"items":{},"maxItems":4,"description":"Where Fusio saves the value: kind, entity, attribute, customFieldId and isMatchKey, like event fields. At most 4."}},"required":["name","label","type"]},"minItems":1,"maxItems":100,"description":"The fields of the form, at least 1 and at most 100."}}},"description":"New lead forms made with the campaign. CTAs point to these by their place, from 0."},"ctas":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":120,"description":"The text of the button or link, at most 120 characters."},"description":{"type":["string","null"],"maxLength":1000,"description":"More about the offer, at most 1000 characters."},"destinationUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"The page the call to action opens. Send destinationUrl or leadFormIndex, exactly one."},"leadFormIndex":{"type":["integer","null"],"minimum":0,"description":"The place of a new lead form in the leadForms list, from 0. Send destinationUrl or leadFormIndex, exactly one."},"isPrimary":{"type":"boolean","description":"true for the main call to action."},"offerRole":{"anyOf":[{"$ref":"#/components/schemas/CampaignCtaOfferRole"},{"type":"null"}],"description":"The part the offer plays: attraction, upsell, downsell or continuity."}}},"description":"Calls to action: what the content asks people to do."},"conversionActions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"The number of one of your conversion actions."},"countsTowardGoal":{"type":"boolean","description":"true when this action counts toward the goal."}},"required":["id","countsTowardGoal"]},"uniqueItems":true,"description":"The conversion actions the campaign tracks, at most 20. The list replaces the old one."},"goalTargets":{"type":"object","properties":{"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and: every target must be met. or: one is enough."},"targets":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the target, from 0."},"metric":{"$ref":"#/components/schemas/CampaignGoalTargetMetric","description":"What to count, like reach, visits or money. conversion_action counts one conversion action."},"conversionActionId":{"type":["integer","null"],"description":"The number of the conversion action. Only and always with metric conversion_action. It must be one of conversionActions."},"operator":{"$ref":"#/components/schemas/CampaignGoalTargetOperator","description":"gte: at least the value. lte: at most the value."},"value":{"type":"number","maximum":1000000000000000000,"description":"The number to reach, 0 or more. With gte it must be more than 0."}},"required":["position","metric","operator","value"]},"description":"The targets at the top level."},"groups":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the group, from 0."},"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and or or, for the targets in this group."},"targets":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the target, from 0."},"metric":{"$ref":"#/components/schemas/CampaignGoalTargetMetric","description":"What to count, like reach, visits or money. conversion_action counts one conversion action."},"conversionActionId":{"type":["integer","null"],"description":"The number of the conversion action. Only and always with metric conversion_action. It must be one of conversionActions."},"operator":{"$ref":"#/components/schemas/CampaignGoalTargetOperator","description":"gte: at least the value. lte: at most the value."},"value":{"type":"number","maximum":1000000000000000000,"description":"The number to reach, 0 or more. With gte it must be more than 0."}},"required":["position","metric","operator","value"]},"description":"The targets of the group, at least one."}},"required":["position","operator","targets"]},"description":"Groups of targets. A group cannot hold more groups."}},"description":"The numbers that mean the campaign reached its goal. At most 20 targets in all."}},"required":["name","mode","autonomyLevel","goal","timezone","startAt"]},"example":{"name":"Jarní servis 2027","description":"Pozvi zákazníky na jarní servis kol.","mode":"burst","audienceWarmth":"warm","autonomyLevel":"l1_approval","goal":"leads","goalMetricType":"leads","goalMetricTarget":40,"languageId":2,"approvalWindowHours":24,"approvalTimeoutAction":"skip","generationBudgetCredits":500,"timezone":"Europe/Prague","startAt":"2027-03-01T08:00:00+01:00","endsOn":"2027-04-30","sources":[{"sourceType":"brief","name":"Zadání","brief":{"text":"Jaro začíná, kola potřebují servis."}}],"slots":[{"destination":"facebook_post","recurrenceRule":"FREQ=WEEKLY;BYDAY=TU","angle":"educational","buyerStage":"consideration","preferredFormat":"single_post","itemsPerGeneration":1,"sources":[{"sourceIndex":0}]}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateCampaignData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Campaign created successfully","payload":{"id":58,"tenantId":412,"tenantSequence":6,"tenantName":"Cyklo Novák s.r.o.","userId":88,"timezone":"Europe/Prague","name":"Jarní servis 2027","description":"Pozvi zákazníky na jarní servis kol.","origin":"manual","mode":"burst","audienceWarmth":"warm","autonomyLevel":"l1_approval","goal":"leads","goalMetricType":"leads","goalMetricTarget":"40.00","goalMetricLabel":null,"askRatio":null,"effectiveAskRatio":0.3,"contentMix":{"give":0,"softAsk":0,"ask":0},"brief":"Jaro začíná, kola potřebují servis.","aiPlan":null,"aiPlanGenerationStage":null,"aiPlanFailureMessage":null,"aiPlanStepOutputs":[],"brandVoiceId":null,"approvalWindowHours":24,"approvalTimeoutAction":"skip","generationBudgetCredits":500,"generationSpentCredits":0,"similarityCheckEnabled":true,"similarityThreshold":"0.850","similarityAction":"require_approval","similarityWindowDays":30,"status":"draft","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","deletedAt":null,"startAt":"2027-03-01T07:00:00Z","endsOn":"2027-04-30","startedAt":null,"publishedAt":null,"endedAt":null,"brandVoice":null,"sources":[{"id":120,"tenantId":412,"campaignId":58,"sourceType":"brief","name":"Zadání","brief":null,"seedAngles":[],"angleType":null,"nicheTopic":null,"feedUrl":null,"pollingIntervalMinutes":null,"topicId":null,"topicFeedId":null,"topicPickMode":null,"topicPickWindowSize":null,"lastPolledAt":null,"lastItemHash":null,"keywords":[],"urls":[],"documents":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}],"generationSlots":[{"id":301,"tenantId":412,"campaignId":58,"destination":"facebook_post","recurrenceRule":"FREQ=WEEKLY;BYDAY=TU","oneOffAt":null,"startOffsetDays":0,"sourceSelectionStrategy":"newest","itemsPerGeneration":1,"active":true,"angle":"educational","buyerStage":"consideration","preferredFormat":"single_post","lastGeneratedAt":null,"nextScheduledAt":null,"sources":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","remainingBlueprints":0,"usedBlueprints":0,"depletionRatio":0,"exhaustedAt":null,"estimatedDryAt":null,"publishingOffAngle":false,"blueprintConsumptionMode":"mix"}],"alerts":[],"destinationsCount":1,"destinations":[],"ctas":[],"leadForms":[],"linkedTrackingEvents":[],"publication":null,"languageId":2,"language":null,"conversionActions":[],"goalTargets":{"operator":"and","targets":[],"groups":[]}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write"]}],"summary":"Create a campaign","description":"Creates a campaign with everything in one request: its sources, slots, tracking events, lead forms and calls to action. A new campaign is always `draft`; it does nothing until you activate it.\n\nItems point to each other by their place in the list, from 0: a slot to a source, a lead form to an event, a call to action to a lead form.\n\nAn `evergreen` campaign takes no `endsOn`. A campaign from autopilot cannot use `autonomyLevel` l0_manual and may only use the destinations of its origin.\n\nA key also needs the write permission of each kind of content in the campaign: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403.\n\nErrors: 422 when a field is wrong, a destination does not fit the audience, or a place points to nothing.\n\nNeeds one of these permissions: campaigns.write."}},"/v1/campaigns/{campaign}":{"get":{"operationId":"campaigns.show","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateCampaignData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Campaign retrieved successfully","payload":{"id":58,"tenantId":412,"tenantSequence":6,"tenantName":"Cyklo Novák s.r.o.","userId":88,"timezone":"Europe/Prague","name":"Jarní servis 2027","description":"Pozvi zákazníky na jarní servis kol.","origin":"manual","mode":"burst","audienceWarmth":"warm","autonomyLevel":"l1_approval","goal":"leads","goalMetricType":"leads","goalMetricTarget":"40.00","goalMetricLabel":null,"askRatio":null,"effectiveAskRatio":0.3,"contentMix":{"give":3,"softAsk":2,"ask":1},"brief":"Jaro začíná, kola potřebují servis.","aiPlan":null,"aiPlanGenerationStage":null,"aiPlanFailureMessage":null,"aiPlanStepOutputs":[],"brandVoiceId":null,"approvalWindowHours":24,"approvalTimeoutAction":"skip","generationBudgetCredits":500,"generationSpentCredits":120,"similarityCheckEnabled":true,"similarityThreshold":"0.850","similarityAction":"require_approval","similarityWindowDays":30,"status":"active","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","deletedAt":null,"startAt":"2027-03-01T07:00:00Z","endsOn":"2027-04-30","startedAt":"2027-03-01T07:00:00Z","publishedAt":"2027-03-01T07:00:00Z","endedAt":null,"brandVoice":null,"sources":[{"id":120,"tenantId":412,"campaignId":58,"sourceType":"brief","name":"Zadání","brief":null,"seedAngles":[],"angleType":null,"nicheTopic":null,"feedUrl":null,"pollingIntervalMinutes":null,"topicId":null,"topicFeedId":null,"topicPickMode":null,"topicPickWindowSize":null,"lastPolledAt":null,"lastItemHash":null,"keywords":[],"urls":[],"documents":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}],"generationSlots":[{"id":301,"tenantId":412,"campaignId":58,"destination":"facebook_post","recurrenceRule":"FREQ=WEEKLY;BYDAY=TU","oneOffAt":null,"startOffsetDays":0,"sourceSelectionStrategy":"newest","itemsPerGeneration":1,"active":true,"angle":"educational","buyerStage":"consideration","preferredFormat":"single_post","lastGeneratedAt":null,"nextScheduledAt":null,"sources":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","remainingBlueprints":0,"usedBlueprints":0,"depletionRatio":0,"exhaustedAt":null,"estimatedDryAt":null,"publishingOffAngle":false,"blueprintConsumptionMode":"mix"}],"alerts":[],"destinationsCount":1,"destinations":[],"ctas":[],"leadForms":[],"linkedTrackingEvents":[],"publication":null,"languageId":2,"language":null,"conversionActions":[],"goalTargets":{"operator":"and","targets":[],"groups":[]}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.read"]}],"summary":"Show one campaign","description":"Returns the campaign with its sources, slots, destinations, calls to action, lead forms, tracking events and goal.\n\nNeeds one of these permissions: campaigns.read."},"put":{"operationId":"campaigns.update","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the campaign, at most 255 characters."},"description":{"type":["string","null"],"description":"A short note about the campaign for your team."},"mode":{"$ref":"#/components/schemas/CampaignMode","description":"burst runs between two dates and needs endsOn. evergreen runs with no end. nurture follows people over time."},"autonomyLevel":{"$ref":"#/components/schemas/CampaignAutonomyLevel","description":"How much Fusio does alone: l0_manual nothing, l1_approval makes content you approve, l2_auto_publish publishes without you, l3_autopilot runs the whole campaign."},"goal":{"$ref":"#/components/schemas/CampaignGoal","description":"What the campaign is for: awareness, traffic, leads, sales, retention or custom."},"goalMetricType":{"anyOf":[{"$ref":"#/components/schemas/CampaignGoalMetricType"},{"type":"null"}],"description":"The main number you watch, like leads or revenue."},"goalMetricTarget":{"type":["number","null"],"description":"How much of that number you want to reach."},"goalMetricLabel":{"type":["string","null"],"maxLength":255,"description":"Your own name for the number, at most 255 characters."},"askRatio":{"type":["number","null"],"minimum":0,"maximum":0.4,"description":"How much of the content asks people to act, from 0 to 0.4. Leave it out for the default mix."},"brief":{"type":["string","null"],"description":"What the campaign is about, in your own words. Fusio writes the content from it."},"brandVoiceId":{"type":["integer","null"],"description":"The number of the brand voice the content uses."},"approvalWindowHours":{"type":["integer","null"],"minimum":1,"maximum":72,"description":"How many hours you have to approve new content, 1 to 72."},"approvalTimeoutAction":{"anyOf":[{"$ref":"#/components/schemas/CampaignApprovalTimeoutAction"},{"type":"null"}],"description":"What happens when nobody approves in time: skip drops the content, publish publishes it."},"generationBudgetCredits":{"type":["integer","null"],"minimum":0,"description":"The most credits Fusio may spend on writing content, 0 or more."},"similarityCheckEnabled":{"type":["boolean","null"],"description":"true to check that new content is not too close to older content."},"similarityThreshold":{"type":["number","null"],"minimum":0,"maximum":1,"description":"How alike content may be, from 0 to 1. Higher allows more alike content."},"similarityAction":{"anyOf":[{"$ref":"#/components/schemas/CampaignSimilarityAction"},{"type":"null"}],"description":"What to do with content that is too alike: skip drops it, require_approval asks you."},"similarityWindowDays":{"type":["integer","null"],"minimum":1,"description":"How many days back to compare, 1 or more."},"timezone":{"type":"string","maxLength":64,"description":"The time zone of the campaign, like Europe/Prague."},"startAt":{"type":"string","description":"When the campaign starts: date and time with a time zone. You can change it only while the campaign is draft or approved."},"endsOn":{"type":["string","null"],"format":"date","description":"The last day, as YYYY-MM-DD. It cannot be before the start."},"status":{"anyOf":[{"$ref":"#/components/schemas/CampaignStatus"},{"type":"null"}],"description":"The new status. approved, scheduled, active and completed need campaigns.execute; use activate instead when you can."},"destinations":{"type":"array","items":{"$ref":"#/components/schemas/CampaignDestination"},"description":"Where the campaign publishes, like blog_article or linkedin_post. The list replaces the old one."},"conversionActions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"The number of one of your conversion actions."},"countsTowardGoal":{"type":"boolean","description":"true when this action counts toward the goal."}},"required":["id","countsTowardGoal"]},"uniqueItems":true,"description":"The conversion actions the campaign tracks, at most 20. The list replaces the old one."},"goalTargets":{"type":"object","properties":{"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and: every target must be met. or: one is enough."},"targets":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the target, from 0."},"metric":{"$ref":"#/components/schemas/CampaignGoalTargetMetric","description":"What to count, like reach, visits or money. conversion_action counts one conversion action."},"conversionActionId":{"type":["integer","null"],"description":"The number of the conversion action. Only and always with metric conversion_action."},"operator":{"$ref":"#/components/schemas/CampaignGoalTargetOperator","description":"gte: at least the value. lte: at most the value."},"value":{"type":"number","maximum":1000000000000000000,"description":"The number to reach, 0 or more."}},"required":["position","metric","operator","value"]},"description":"The targets at the top level."},"groups":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the group, from 0."},"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and or or, for the targets in this group."},"targets":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the target, from 0."},"metric":{"$ref":"#/components/schemas/CampaignGoalTargetMetric","description":"What to count, like reach, visits or money. conversion_action counts one conversion action."},"conversionActionId":{"type":["integer","null"],"description":"The number of the conversion action. Only and always with metric conversion_action."},"operator":{"$ref":"#/components/schemas/CampaignGoalTargetOperator","description":"gte: at least the value. lte: at most the value."},"value":{"type":"number","maximum":1000000000000000000,"description":"The number to reach, 0 or more."}},"required":["position","metric","operator","value"]},"description":"The targets of the group, at least one."}},"required":["position","operator","targets"]},"description":"Groups of targets. A group cannot hold more groups."}},"description":"The numbers that mean the campaign reached its goal. At most 20 targets in all."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write"]}],"x-fusio-conditional-scopes":["campaigns.execute"],"x-fusio-opt-in-scopes":["campaigns.execute"],"summary":"Change a campaign","description":"Changes only the fields you send.\n\nA change that lets the campaign act without a person needs `campaigns.execute`: the status approved, scheduled, active or completed, `approvalTimeoutAction` publish, `autonomyLevel` l2_auto_publish or l3_autopilot, or a new destination on a campaign that already runs.\n\n> [!WARNING]\n> With such a change, Fusio may publish content without asking you.\n\nA key also needs the write permission of each kind of content in the campaign: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403.\n\nErrors: 403 `insufficient_scope` without `campaigns.execute`, 422 when a field is wrong, when you send `startAt` and the campaign is no longer draft or approved, or when you send `brief` while Fusio still makes the AI plan.\n\nNeeds one of these permissions: campaigns.write. Some values also need: campaigns.execute. You must tick these on purpose: campaigns.execute."},"delete":{"operationId":"campaigns.destroy","tags":["campaigns"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["campaigns.write"]}],"summary":"Delete a campaign","description":"Moves the campaign to the trash.\n\nA key also needs the write permission of each kind of content in the campaign: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. Without it you get 403.\n\nNeeds one of these permissions: campaigns.write."}},"/v1/competitors/grid":{"get":{"operationId":"competitors.grid","tags":["competitors"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[websiteUrl]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the web address."},{"name":"filter[competitorType]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The kind of rival. One or more values, split by commas."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[analyzedAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was checked. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[ids]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Up to 100 IDs, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","competitorType","websiteUrl","analyzedAt","createdAt","-name","-competitorType","-websiteUrl","-analyzedAt","-createdAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexTenantCompetitorData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"List competitors in a table","description":"Returns your competitors page by page, ready for a table. Use `filter`, `sort`, `page` and `perPage` as the shape of the list says.\n\nNeeds one of these permissions: intelligence.read."}},"/v1/competitors":{"post":{"operationId":"competitors.store","tags":["competitors"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the competitor, from 1 to 255 characters."},"tenantProductId":{"type":["integer","null"],"description":"The number of your product this belongs to. Leave it out for your main product."},"websiteUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The web address of the competitor, at most 255 characters."},"logoUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The web address of its logo, at most 255 characters."},"competitorType":{"anyOf":[{"$ref":"#/components/schemas/TenantCompetitorType"},{"type":"null"}],"description":"direct (sells the same to the same people), secondary, indirect (solves the same problem another way) or aspirational (a company you look up to)."},"tagline":{"type":["string","null"],"maxLength":5000,"description":"Its slogan. At most 5000 characters."},"valueProposition":{"type":["string","null"],"maxLength":5000,"description":"What it promises customers. At most 5000 characters."},"positioningAngle":{"type":["string","null"],"maxLength":5000,"description":"How it wants people to see it. At most 5000 characters."},"targetAudienceSummary":{"type":["string","null"],"maxLength":5000,"description":"Who it sells to. At most 5000 characters."},"hasFreeTrial":{"type":["boolean","null"],"description":"true when it offers a free trial."},"freeTrialSummary":{"type":["string","null"],"maxLength":5000,"description":"What its free trial gives. At most 5000 characters."},"theirAdvantageOverUs":{"type":["string","null"],"maxLength":5000,"description":"Where it is better than you. At most 5000 characters."},"ourAdvantageOverThem":{"type":["string","null"],"maxLength":5000,"description":"Where you are better than it. At most 5000 characters."},"opportunities":{"type":["string","null"],"maxLength":5000,"description":"Chances it leaves open for you. At most 5000 characters."},"threats":{"type":["string","null"],"maxLength":5000,"description":"Risks it brings for you. At most 5000 characters."},"derivedFromAnalysisId":{"type":["integer","null"],"description":"The number of the website analysis this came from. Leave it out when you write it yourself."},"industriesServed":{"type":["array","null"],"items":{"type":"string"},"maxItems":10,"uniqueItems":true,"description":"Field codes (NACE) of the companies it sells to, like 47, at most 10, each once."},"strengths":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of its strong points, at most 50. Each at most 255 characters."},"weaknesses":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of its weak points, at most 50. Each at most 255 characters."},"messagingThemes":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of topics it talks about, at most 50. Each at most 255 characters."},"notableDifferentiators":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of things that make it different, at most 50. Each at most 255 characters."},"caseStudyThemes":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of topics of its customer stories, at most 50. Each at most 255 characters."},"namedCustomers":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of its known customers, at most 50. Each at most 255 characters."}},"required":["name"]},"example":{"name":"Kola Horák","websiteUrl":"https://www.example.cz","competitorType":"direct","tagline":"Kola pro celou rodinu","valueProposition":"Velký výběr dětských kol a půjčovna.","theirAdvantageOverUs":"Větší prodejna a půjčovna kol.","ourAdvantageOverThem":"Rychlejší servis a odvoz kola zdarma.","strengths":["Velký výběr","Půjčovna"],"weaknesses":["Dlouhé čekání na servis"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantCompetitorData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Competitor created successfully","payload":{"id":77,"tenantId":412,"tenantProductId":null,"derivedFromAnalysisId":null,"createdBy":88,"name":"Kola Horák","websiteUrl":"https://www.example.cz","logoUrl":null,"competitorType":"direct","tagline":"Kola pro celou rodinu","valueProposition":"Velký výběr dětských kol a půjčovna.","positioningAngle":null,"targetAudienceSummary":null,"freeTrialSummary":null,"contentStrategySignals":null,"theirAdvantageOverUs":"Větší prodejna a půjčovna kol.","ourAdvantageOverThem":"Rychlejší servis a odvoz kola zdarma.","opportunities":null,"threats":null,"hasFreeTrial":false,"estimatedDomainAuthority":null,"messagingThemes":[],"coreCapabilities":null,"notableDifferentiators":[],"integrations":null,"pricingTiers":null,"namedCustomers":[],"industriesServed":[],"caseStudyThemes":[],"strengths":["Velký výběr","Půjčovna"],"weaknesses":["Dlouhé čekání na servis"],"rawSources":[],"analyzedAt":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Create a competitor","description":"Writes down a competitor. Only the name is needed; fill in what you know.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/competitors/{competitor}":{"get":{"operationId":"competitors.show","tags":["competitors"],"parameters":[{"name":"competitor","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the competitor."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantCompetitorData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Competitor fetched successfully","payload":{"id":77,"tenantId":412,"tenantProductId":null,"derivedFromAnalysisId":null,"createdBy":88,"name":"Kola Horák","websiteUrl":"https://www.example.cz","logoUrl":null,"competitorType":"direct","tagline":"Kola pro celou rodinu","valueProposition":"Velký výběr dětských kol a půjčovna.","positioningAngle":null,"targetAudienceSummary":null,"freeTrialSummary":null,"contentStrategySignals":null,"theirAdvantageOverUs":"Větší prodejna a půjčovna kol.","ourAdvantageOverThem":"Rychlejší servis a odvoz kola zdarma.","opportunities":null,"threats":null,"hasFreeTrial":false,"estimatedDomainAuthority":null,"messagingThemes":[],"coreCapabilities":null,"notableDifferentiators":[],"integrations":null,"pricingTiers":null,"namedCustomers":[],"industriesServed":[],"caseStudyThemes":[],"strengths":["Velký výběr","Půjčovna"],"weaknesses":["Dlouhé čekání na servis"],"rawSources":[],"analyzedAt":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"Show a competitor","description":"Returns everything you know about one competitor.\n\nNeeds one of these permissions: intelligence.read."},"put":{"operationId":"competitors.update","tags":["competitors"],"parameters":[{"name":"competitor","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the competitor."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the competitor, from 1 to 255 characters."},"tenantProductId":{"type":["integer","null"],"description":"The number of your product this belongs to. Send null for your main product. Leave it out to keep it."},"websiteUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The web address of the competitor, at most 255 characters. Leave it out to keep it."},"logoUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The web address of its logo, at most 255 characters. Leave it out to keep it."},"competitorType":{"anyOf":[{"$ref":"#/components/schemas/TenantCompetitorType"},{"type":"null"}],"description":"direct (sells the same to the same people), secondary, indirect (solves the same problem another way) or aspirational (a company you look up to). Leave it out to keep it."},"tagline":{"type":["string","null"],"maxLength":5000,"description":"Its slogan. At most 5000 characters. Leave it out to keep it."},"valueProposition":{"type":["string","null"],"maxLength":5000,"description":"What it promises customers. At most 5000 characters. Leave it out to keep it."},"positioningAngle":{"type":["string","null"],"maxLength":5000,"description":"How it wants people to see it. At most 5000 characters. Leave it out to keep it."},"targetAudienceSummary":{"type":["string","null"],"maxLength":5000,"description":"Who it sells to. At most 5000 characters. Leave it out to keep it."},"hasFreeTrial":{"type":["boolean","null"],"description":"true when it offers a free trial. Leave it out or send null to keep it."},"freeTrialSummary":{"type":["string","null"],"maxLength":5000,"description":"What its free trial gives. At most 5000 characters. Leave it out to keep it."},"theirAdvantageOverUs":{"type":["string","null"],"maxLength":5000,"description":"Where it is better than you. At most 5000 characters. Leave it out to keep it."},"ourAdvantageOverThem":{"type":["string","null"],"maxLength":5000,"description":"Where you are better than it. At most 5000 characters. Leave it out to keep it."},"opportunities":{"type":["string","null"],"maxLength":5000,"description":"Chances it leaves open for you. At most 5000 characters. Leave it out to keep it."},"threats":{"type":["string","null"],"maxLength":5000,"description":"Risks it brings for you. At most 5000 characters. Leave it out to keep it."},"derivedFromAnalysisId":{"type":["integer","null"],"description":"The number of the website analysis this came from. Send null when you write it yourself. Leave it out to keep it."},"industriesServed":{"type":["array","null"],"items":{"type":"string"},"maxItems":10,"uniqueItems":true,"description":"Field codes (NACE) of the companies it sells to, like 47, at most 10, each once. Leave it out to keep it."},"strengths":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of its strong points, at most 50. Each at most 255 characters. Leave it out to keep it."},"weaknesses":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of its weak points, at most 50. Each at most 255 characters. Leave it out to keep it."},"messagingThemes":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of topics it talks about, at most 50. Each at most 255 characters. Leave it out to keep it."},"notableDifferentiators":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of things that make it different, at most 50. Each at most 255 characters. Leave it out to keep it."},"caseStudyThemes":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of topics of its customer stories, at most 50. Each at most 255 characters. Leave it out to keep it."},"namedCustomers":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":50,"description":"A list of its known customers, at most 50. Each at most 255 characters. Leave it out to keep it."}},"required":["name"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantCompetitorData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Change a competitor","description":"Changes a competitor. Always send the name. Other fields you leave out stay as they are; null clears them, except hasFreeTrial. A list you send replaces the whole old list.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."},"delete":{"operationId":"competitors.destroy","tags":["competitors"],"parameters":[{"name":"competitor","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the competitor."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Remove a competitor","description":"Removes a competitor.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/contacts/options":{"get":{"operationId":"contacts.options","tags":["contacts"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name, email, phone or the name of the lead. At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[availableForLead]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"A prospect ID: shows contacts with no prospect or with this prospect. The word none shows contacts with no prospect."},{"name":"filter[hasPhone]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows contacts that have a phone number."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionContactData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read"]}],"summary":"List contacts for a picker","description":"Returns contacts as short items for a picker, with the email, phone and lead of each. Use it to find a contact before you link it to a lead or a deal.\n\nNeeds one of these permissions: contacts.read."}},"/v1/contacts/{contact}/segments":{"get":{"operationId":"contacts.segments","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateSegmentData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read"]}],"summary":"List the segments of a contact","description":"Returns the segments the contact is in.\n\nNeeds one of these permissions: contacts.read."}},"/v1/contacts/{contact}/tags":{"get":{"operationId":"contacts.tags","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateTagData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read"]}],"summary":"List the tags of a contact","description":"Returns the tags the contact has.\n\nNeeds one of these permissions: contacts.read."}},"/v1/contacts/{contact}/sync-segments":{"post":{"operationId":"contacts.sync-segments","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"segmentIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the segments, at most 500. The list replaces the segments it had. Numbers that are not from your company are skipped."}},"required":["segmentIds"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.write"]}],"summary":"Set the segments of a contact","description":"Puts the contact in exactly these segments. An empty list takes it out of all segments. The answer has no data.\n\nNeeds one of these permissions: contacts.write."}},"/v1/contacts/{contact}/sync-tags":{"post":{"operationId":"contacts.sync-tags","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags, at most 500. The list replaces the tags it had. Numbers that are not from your company are skipped."}},"required":["tagIds"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.write"]}],"summary":"Set the tags of a contact","description":"Gives the contact exactly these tags. An empty list takes all tags off. The answer has no data.\n\nNeeds one of these permissions: contacts.write."}},"/v1/contacts/{contact}/custom-fields":{"get":{"operationId":"contacts.custom-fields","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateContactCustomFieldData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read"]}],"summary":"List the custom fields of a contact","description":"Returns the values of your custom fields on the contact, each with the field it belongs to.\n\nNeeds one of these permissions: contacts.read."}},"/v1/contacts/{contact}/sync-custom-fields":{"post":{"operationId":"contacts.sync-custom-fields","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactCustomFields":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"integer","description":"The number of the custom field. It must be a field of your company."},"value":{"type":["string","null"],"maxLength":65535,"description":"The value as text, at most 65535 characters. null clears it. When the field is a unique key, no other record may have the same value."}},"required":["customFieldId"]},"description":"The values of your custom fields. The list replaces all values: a field you leave out loses its value."}},"required":["contactCustomFields"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.write"]}],"summary":"Set the custom fields of a contact","description":"Sets the values of your custom fields on the contact. The list replaces all values: a field you leave out loses its value. The answer has no data.\n\nA custom field that is a unique key may not have the same value on two contacts. Then you get 422 on `contactCustomFields`.\n\nNeeds one of these permissions: contacts.write."}},"/v1/contacts/{contact}/analytics":{"get":{"operationId":"contacts.analytics","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/ContactAnalyticsOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Contact analytics fetched successfully","payload":{"stats":{"totalSent":6,"totalOpens":4,"totalClicks":2,"lastOpenAt":"2026-11-12T13:05:00Z","lastClickAt":"2026-11-12T13:06:00Z","engagementScore":62,"heatStatus":"warm","frequencyRatio":0.67,"respondedCampaigns":1,"totalCampaigns":2},"history":[{"channel":"campaign","eventName":null,"campaignName":"Podzimní kontrola kol","trackableType":"email_campaign","trackableId":1840,"date":"2026-11-12T13:06:00Z","context":"button","url":"https://www.example.cz/servis","country":"CZ","deviceType":"mobile","leadFormId":null,"leadFormName":null,"submissionId":null,"browser":"Safari","operatingSystem":"iOS","locale":"cs-CZ","referer":null,"path":null,"hostname":null,"origin":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"utmTerm":null,"utmContent":"hlavni-tlacitko","clickIdSource":null,"clickIdValue":null,"consentState":null,"ingestSource":null,"result":null,"visitorSessionId":null,"payload":null,"recipientEmail":null,"deliveryStatus":null,"deliveredAt":null,"bouncedAt":null,"bounceReason":null,"bounceType":null,"bounceCode":null,"smtpCode":null,"unsubscribedAt":null,"unsubscribeReason":null,"spamComplaintAt":null,"envelopeId":null,"type":"click","source":"email","sourceId":99231},{"channel":"campaign","eventName":null,"campaignName":"Podzimní kontrola kol","trackableType":"email_campaign","trackableId":1840,"date":"2026-11-12T13:05:00Z","context":null,"url":null,"country":"CZ","deviceType":"mobile","leadFormId":null,"leadFormName":null,"submissionId":null,"browser":"Safari","operatingSystem":"iOS","locale":"cs-CZ","referer":null,"path":null,"hostname":null,"origin":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"utmTerm":null,"utmContent":null,"clickIdSource":null,"clickIdValue":null,"consentState":null,"ingestSource":null,"result":null,"visitorSessionId":null,"payload":null,"recipientEmail":null,"deliveryStatus":null,"deliveredAt":null,"bouncedAt":null,"bounceReason":null,"bounceType":null,"bounceCode":null,"smtpCode":null,"unsubscribedAt":null,"unsubscribeReason":null,"spamComplaintAt":null,"envelopeId":null,"type":"open","source":"email","sourceId":55410},{"channel":"campaign","eventName":null,"campaignName":"Podzimní kontrola kol","trackableType":"email_campaign","trackableId":1840,"date":"2026-11-12T07:00:00Z","context":null,"url":null,"country":null,"deviceType":null,"leadFormId":null,"leadFormName":null,"submissionId":null,"browser":null,"operatingSystem":null,"locale":null,"referer":null,"path":null,"hostname":null,"origin":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"utmTerm":null,"utmContent":null,"clickIdSource":null,"clickIdValue":null,"consentState":null,"ingestSource":null,"result":null,"visitorSessionId":null,"payload":null,"recipientEmail":"petr.svoboda@example.cz","deliveryStatus":"delivered","deliveredAt":"2026-11-12T07:00:04Z","bouncedAt":null,"bounceReason":null,"bounceType":null,"bounceCode":null,"smtpCode":null,"unsubscribedAt":null,"unsubscribeReason":null,"spamComplaintAt":null,"envelopeId":null,"type":"sent","source":"email","sourceId":30877}]}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read"]}],"summary":"Show how a contact reacts to emails","description":"Returns the numbers and the history of the contact: sent, opened and clicked emails and web visits. The person behind the key needs the right to see analytics of contacts.\n\nNeeds one of these permissions: contacts.read."}},"/v1/contacts/{contact}/analytics/history":{"get":{"operationId":"contacts.analytics.history","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."},{"name":"campaign_id","in":"query","schema":{"type":["integer","null"]},"description":"Not used here. Fusio checks that the campaign is yours, then shows all campaigns."},{"name":"cursor","in":"query","schema":{"type":["string","null"]},"description":"Where the next page starts. Take it from next_cursor of the page before."},{"name":"per_page","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":100},"description":"How many events one page has, from 1 to 100. Leave it out for 20."},{"name":"type","in":"query","schema":{"type":["string","null"],"enum":["click","open","sent","web",null]},"description":"Show only one kind: click, open, sent or web."},{"name":"search","in":"query","schema":{"type":["string","null"],"maxLength":255},"description":"Text to look for in the events, at most 255 characters."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/ContactHistoryPageOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Contact history fetched successfully","payload":{"data":[{"channel":"campaign","eventName":null,"campaignName":"Podzimní kontrola kol","trackableType":"email_campaign","trackableId":1840,"date":"2026-11-12T13:06:00Z","context":"button","url":"https://www.example.cz/servis","country":"CZ","deviceType":"mobile","leadFormId":null,"leadFormName":null,"submissionId":null,"browser":"Safari","operatingSystem":"iOS","locale":"cs-CZ","referer":null,"path":null,"hostname":null,"origin":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"utmTerm":null,"utmContent":"hlavni-tlacitko","clickIdSource":null,"clickIdValue":null,"consentState":null,"ingestSource":null,"result":null,"visitorSessionId":null,"payload":null,"recipientEmail":null,"deliveryStatus":null,"deliveredAt":null,"bouncedAt":null,"bounceReason":null,"bounceType":null,"bounceCode":null,"smtpCode":null,"unsubscribedAt":null,"unsubscribeReason":null,"spamComplaintAt":null,"envelopeId":null,"type":"click","source":"email","sourceId":99231,"submission":null,"record":null,"cadenceStep":null,"session":null},{"channel":"campaign","eventName":null,"campaignName":"Podzimní kontrola kol","trackableType":"email_campaign","trackableId":1840,"date":"2026-11-12T13:05:00Z","context":null,"url":null,"country":"CZ","deviceType":"mobile","leadFormId":null,"leadFormName":null,"submissionId":null,"browser":"Safari","operatingSystem":"iOS","locale":"cs-CZ","referer":null,"path":null,"hostname":null,"origin":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"utmTerm":null,"utmContent":null,"clickIdSource":null,"clickIdValue":null,"consentState":null,"ingestSource":null,"result":null,"visitorSessionId":null,"payload":null,"recipientEmail":null,"deliveryStatus":null,"deliveredAt":null,"bouncedAt":null,"bounceReason":null,"bounceType":null,"bounceCode":null,"smtpCode":null,"unsubscribedAt":null,"unsubscribeReason":null,"spamComplaintAt":null,"envelopeId":null,"type":"open","source":"email","sourceId":55410,"submission":null,"record":null,"cadenceStep":null,"session":null},{"channel":"campaign","eventName":null,"campaignName":"Podzimní kontrola kol","trackableType":"email_campaign","trackableId":1840,"date":"2026-11-12T07:00:00Z","context":null,"url":null,"country":null,"deviceType":null,"leadFormId":null,"leadFormName":null,"submissionId":null,"browser":null,"operatingSystem":null,"locale":null,"referer":null,"path":null,"hostname":null,"origin":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"utmTerm":null,"utmContent":null,"clickIdSource":null,"clickIdValue":null,"consentState":null,"ingestSource":null,"result":null,"visitorSessionId":null,"payload":null,"recipientEmail":"petr.svoboda@example.cz","deliveryStatus":"delivered","deliveredAt":"2026-11-12T07:00:04Z","bouncedAt":null,"bounceReason":null,"bounceType":null,"bounceCode":null,"smtpCode":null,"unsubscribedAt":null,"unsubscribeReason":null,"spamComplaintAt":null,"envelopeId":null,"type":"sent","source":"email","sourceId":30877,"submission":null,"record":null,"cadenceStep":null,"session":null}],"path":"https://api.example.cz/api/v1/contacts/7720/analytics/history","per_page":3,"next_cursor":"eyJkYXRlIjoiMjAyNi0xMS0xMiAwNzowMDowMCIsInNvdXJjZUlkIjozMDg3N30","next_page_url":"https://api.example.cz/api/v1/contacts/7720/analytics/history?per_page=3&cursor=eyJkYXRlIjoiMjAyNi0xMS0xMiAwNzowMDowMCIsInNvdXJjZUlkIjozMDg3N30","prev_cursor":null,"prev_page_url":null,"typeCounts":{"click":2,"open":4,"sent":6,"web":0,"booking":0,"deal":0,"note":0,"task":0,"inquiry":0,"email":0,"form":0,"ad":0}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read"]}],"summary":"List the history of a contact page by page","description":"Returns the events of the contact, newest first, one page at a time. Send `next_cursor` back as `cursor` to get the next page. The person behind the key needs the right to see analytics of contacts.\n\nNeeds one of these permissions: contacts.read."}},"/v1/contacts/{contact}/analytics/timeseries":{"get":{"operationId":"contacts.analytics.timeseries","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."},{"name":"campaign_id","in":"query","schema":{"type":["integer","null"]},"description":"Not used here. Fusio checks that the campaign is yours, then counts all campaigns."},{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The first day, like 2026-11-01. Leave it out to start 30 days ago."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The last day, like 2026-11-30. Leave it out for today."},{"name":"compare_from","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"Not used here. When you send it, also send compare_to."},{"name":"compare_to","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"Not used here. When you send it, also send compare_from."},{"name":"locale","in":"query","schema":{"type":["string","null"]},"description":"Not used here. When you send it, it must be a language of Fusio, like cs_CZ."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/ContactTimeSeriesItemOutputData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"Contact time series fetched successfully","payload":[{"date":"2026-10-06","sent":1,"opens":1,"clicks":0},{"date":"2026-10-20","sent":1,"opens":0,"clicks":0},{"date":"2026-11-12","sent":1,"opens":2,"clicks":1}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read"]}],"summary":"Count the emails of a contact by day","description":"Returns one item for each day with the sent, opened and clicked emails of the contact. The person behind the key needs the right to see analytics of contacts.\n\nNeeds one of these permissions: contacts.read."}},"/v1/contacts/{contact}/campaigns":{"get":{"operationId":"contacts.campaigns","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsCampaignOutputData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"Contact campaigns fetched successfully","payload":[{"id":52,"name":"Podzimní kontrola kol","mode":"burst","sentAt":"2026-11-12T07:00:00Z"},{"id":47,"name":"Tipy pro firemní flotily","mode":"nurture","sentAt":"2026-10-06T07:00:00Z"}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read","campaigns.read"]}],"summary":"List the campaigns that emailed a contact","description":"Returns the campaigns that sent an email to the contact, newest first. The person behind the key needs the right to see analytics of contacts.\n\nNeeds one of these permissions: contacts.read. Also needs: campaigns.read."}},"/v1/contacts/{contact}/emails":{"get":{"operationId":"contacts.emails","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."},{"name":"limit","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":100},"description":"How many items each part has, from 1 to 100. Leave it out for 20."},{"name":"sequencesCursor","in":"query","schema":{"type":["integer","null"],"minimum":1},"description":"Where the next page of sequences starts. Take it from nextCursor.sequences."},{"name":"scheduledEmailsCursor","in":"query","schema":{"type":["integer","null"],"minimum":1},"description":"Where the next page of planned emails starts. Take it from nextCursor.scheduledEmails."},{"name":"draftsCursor","in":"query","schema":{"type":["integer","null"],"minimum":1},"description":"Where the next page of drafts starts. Take it from nextCursor.drafts."},{"name":"conversationsCursor","in":"query","schema":{"type":["integer","null"],"minimum":1},"description":"Where the next page of conversations starts. Take it from nextCursor.conversations."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/ContactEmailsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read","emails.read"]}],"summary":"List the personal emails of a contact","description":"Returns the personal emails of the contact in four parts: sequences, planned emails, drafts and conversations. Each part has its own page. To read more of one part, send its value from `nextCursor` back as the matching cursor.\n\nNeeds one of these permissions: contacts.read. Also needs: emails.read."}},"/v1/contacts":{"post":{"operationId":"contacts.store","tags":["contacts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ContactType","description":"company for a work contact of a company, personal for a private person."},"email":{"type":["string","null"],"format":"email","maxLength":255,"description":"The email, at most 255 characters. You need an email or a phone."},"firstName":{"type":["string","null"],"maxLength":255,"description":"The first name, at most 255 characters."},"lastName":{"type":["string","null"],"maxLength":255,"description":"The last name, at most 255 characters."},"name":{"type":["string","null"],"maxLength":255,"description":"A name to show when you do not split it into first and last name, at most 255 characters."},"phone":{"type":["string","null"],"pattern":"^(?:\\+|00)?[0-9][0-9 ().-]*$","maxLength":20,"description":"The phone number, like +420 601 234 567. A number without a country code counts as Czech. At most 20 characters. You need an email or a phone."},"position":{"type":["string","null"],"maxLength":255,"description":"The job of the person, like Owner, at most 255 characters."},"preferredContactChannel":{"anyOf":[{"$ref":"#/components/schemas/PreferredContactChannel"},{"type":"null"}],"description":"How the person likes to be reached: email, phone or whatsapp."},"lastActivityAt":{"type":["string","null"],"description":"When you were last in touch with the person, as a date and time with a time zone, like 2026-11-03T09:30:00+01:00."},"emailVerifiedAt":{"type":["string","null"],"description":"When the email was checked as real, as a date and time with a time zone, like 2026-11-03T09:30:00+01:00."},"userId":{"type":"integer","description":"You do not need to send it. Fusio always puts in the person the key acts as."},"leadId":{"type":"integer","description":"The number of the lead the person works for. Send leadId or lead, not both."},"segmentIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the segments, at most 500. The list replaces the segments it had. Numbers that are not from your company are skipped."},"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags, at most 500. The list replaces the tags it had. Numbers that are not from your company are skipped."},"contactCustomFields":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"integer","description":"The number of the custom field. It must be a field of your company."},"value":{"type":["string","null"],"maxLength":65535,"description":"The value as text, at most 65535 characters. null clears it. When the field is a unique key, no other record may have the same value."}},"required":["customFieldId"]},"description":"The values of your custom fields. The list replaces all values: a field you leave out loses its value."},"isGloballyUnsubscribed":{"type":"boolean","description":"true stops all emails to this person."},"channelEmailEnabled":{"type":"boolean","description":"false turns emails to this person off."},"channelSmsEnabled":{"type":"boolean","description":"false turns text messages to this person off."},"emailConsentStatus":{"anyOf":[{"$ref":"#/components/schemas/ConsentStatus"},{"type":"null"}],"description":"Consent to emails: subscribed, unsubscribed or not_specified."},"smsConsentStatus":{"anyOf":[{"$ref":"#/components/schemas/ConsentStatus"},{"type":"null"}],"description":"Consent to text messages: subscribed, unsubscribed or not_specified."},"callConsentStatus":{"anyOf":[{"$ref":"#/components/schemas/ConsentStatus"},{"type":"null"}],"description":"Consent to phone calls: subscribed, unsubscribed or not_specified."},"lead":{"type":"object","properties":{"billingAddressSameAsLegal":{"type":"boolean","description":"true means invoices go to the main address. false needs billingAddress. Leave it out to keep true."},"billingAddress":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name on invoices, when it is not the name of the lead."},"street":{"type":"string","maxLength":255,"description":"The street and house number for invoices."},"city":{"type":"string","maxLength":255,"description":"The city for invoices."},"zip":{"type":["string","null"],"maxLength":20,"description":"The postal code for invoices, at most 20 characters."},"countryIso":{"type":"string","minLength":2,"maxLength":2,"description":"The country for invoices as two letters, like CZ."}},"required":["street","city","countryIso"],"description":"The address for invoices. Fusio reads it only when billingAddressSameAsLegal is false; then street, city and countryIso are needed."},"name":{"type":["string","null"],"maxLength":255,"description":"The name of the company or the person, at most 255 characters."},"registrationNumber":{"type":["string","null"],"maxLength":50,"description":"The company number (IČO), at most 50 characters. Ask leads.check-duplicate first, so you do not make the same company twice."},"vatNumber":{"type":["string","null"],"maxLength":50,"description":"The VAT number (DIČ), like CZ12345678, at most 50 characters."},"street":{"type":["string","null"],"maxLength":255,"description":"The street and house number."},"city":{"type":["string","null"],"maxLength":255,"description":"The city."},"zip":{"type":["string","null"],"maxLength":20,"description":"The postal code, at most 20 characters."},"countryIso":{"type":["string","null"],"minLength":2,"maxLength":2,"description":"The country as two letters, like CZ."},"stage":{"$ref":"#/components/schemas/LeadStage","description":"Where the new lead is: cold, warm, qualified, client or lost. You must send it."},"lostReason":{"anyOf":[{"$ref":"#/components/schemas/LeadLostReason"},{"type":"null"}],"description":"Why the lead is lost, like not_interested, no_budget or duplicate. other needs lostReasonNote."},"lostReasonNote":{"type":["string","null"],"maxLength":1000,"description":"Your own words about why the lead is lost, at most 1000 characters. Needed when lostReason is other."},"personType":{"anyOf":[{"$ref":"#/components/schemas/LeadPersonType"},{"type":"null"}],"description":"legal for a company, physical for a person."},"source":{"type":["string","null"],"enum":["web","cold_call","referral","campaign","event","partner","import","social_discovery",null],"description":"Where the lead came from: web, cold_call, referral, campaign, event, partner, social_discovery or import. A source that Fusio set itself, like lead_form, cannot be changed."},"website":{"type":["string","null"],"format":"uri","pattern":"^https?:\\/\\/(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?::[0-9]{1,5})?$","maxLength":255,"description":"The website. Fusio keeps only the start, like https://example.cz, unless preserveWebsitePath is true. Without http, Fusio adds https://."},"preserveWebsitePath":{"type":"boolean","description":"true keeps the whole web address, with the path after the domain."},"segmentIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the segments the new lead joins, at most 500. Numbers that are not from your company are skipped."},"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags the new lead gets, at most 500. Numbers that are not from your company are skipped."},"leadCustomFields":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"integer","description":"The number of the custom field. It must be a field of your company."},"value":{"type":["string","null"],"maxLength":65535,"description":"The value as text, at most 65535 characters. null clears it. When the field is a unique key, no other record may have the same value."}},"required":["customFieldId"]},"description":"The values of your custom fields for the new lead. A field you leave out stays empty."}},"required":["stage"],"description":"A new lead to make for this person, when the company is not in Fusio yet. Send leadId or lead, not both."}},"required":["type"]},"example":{"type":"company","email":"petr.svoboda@example.cz","firstName":"Petr","lastName":"Svoboda","phone":"+420 601 234 567","position":"Jednatel","preferredContactChannel":"email","leadId":3051,"segmentIds":[21],"tagIds":[71]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateContactData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Contact created successfully","payload":{"id":"7720","userId":88,"tenantId":412,"segments":[{"id":21,"tenantId":412,"userId":88,"name":"Pekárny","slug":"pekarny","description":"Pekárny a cukrárny v Brně a okolí."}],"tags":[{"id":71,"tenantId":412,"userId":88,"name":"Firemní flotila","slug":"firemni-flotila","color":"#2b6cb0","notes":null,"assignmentSource":"api"}],"contactCustomFields":[],"communicationPreference":null,"lead":{"id":"3051","countryId":58,"countryIso":"CZ","name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","vatNumber":"CZ87654321","unattestedIdentity":null,"street":"Mlýnská 8","city":"Brno","zip":"60200","stage":"warm","lostReason":null,"lostReasonNote":null,"personType":"legal","source":"referral","website":"https://www.example.cz","hasResearchProfile":false,"originatingLeadFormId":null,"outreachStatus":"not_contacted","contactsCount":0,"countryName":"Česko","billingAddressSameAsLegal":true,"billingAddress":null,"registerLookupStatus":"completed","registerLookupLocked":false},"type":"company","email":"petr.svoboda@example.cz","firstName":"Petr","lastName":"Svoboda","name":null,"phone":"+420601234567","position":"Jednatel","preferredContactChannel":"email","lastActivityAt":null,"emailVerifiedAt":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.write"]}],"x-fusio-conditional-scopes":["leads.write","emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Add a contact","description":"Adds a person and links them to a lead. Send `leadId` for a company you already have, or `lead` to make a new lead too. Sending `lead` needs `leads.write`.\n\nFusio does not stop a second contact with the same email. Ask `leads.check-duplicate` with the email first: it tells you if a lead already has a contact with it.\n\n`segmentIds`, `tagIds` and `contactCustomFields` replace what the contact had. Leave a list out to keep it as it is. A custom field that is a unique key may not have the same value on two contacts; then you get 422 on `contactCustomFields`.\n\nA key may only make consent narrower: it may unsubscribe and turn channels off, never the other way. A change the other way answers 403 `route_outside_surface`.\n\n> [!WARNING]\n> While your company has an active email sequence, a new lead you make with `lead` can start it. A key then needs `emails.send`.\n\nErrors: 422 with `payload.metric` crm_records when your plan has no room for more records. Adding a contact with a new lead counts as 2 records, with `leadId` as 1.\n\nNeeds one of these permissions: contacts.write. Some values also need: leads.write, emails.send. You must tick these on purpose: emails.send."}},"/v1/contacts/{contact}":{"get":{"operationId":"contacts.show","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateContactData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Contact fetched successfully","payload":{"id":"7720","userId":88,"tenantId":412,"segments":[{"id":21,"tenantId":412,"userId":88,"name":"Pekárny","slug":"pekarny","description":"Pekárny a cukrárny v Brně a okolí."}],"tags":[{"id":71,"tenantId":412,"userId":88,"name":"Firemní flotila","slug":"firemni-flotila","color":"#2b6cb0","notes":null,"assignmentSource":"api"}],"contactCustomFields":[{"id":1503,"contactId":7720,"customField":{"id":9,"userId":88,"tenantId":412,"name":"preferred_visit_day","label":"Den návštěvy","description":null,"type":"text","isRequired":false,"isActive":true,"isUniqueIdentifier":false,"options":null,"deletedAt":null},"value":"úterý"}],"communicationPreference":{"id":6610,"hashToken":"b7f3c2a9e4d14f0c9a1e5d77","prefersId":7720,"prefersType":"contact","isGloballyUnsubscribed":false,"unsubscriptionReason":null,"unsubscriptionReasonDescription":null,"languageId":2,"emailFormat":"html","channelEmailEnabled":true,"channelSmsEnabled":false,"emailConsentStatus":"subscribed","smsConsentStatus":"not_specified","callConsentStatus":"not_specified","consentUpdatedAt":"2026-11-03T08:30:00Z","consentIp":null,"consentUserAgent":null,"consentSource":"api","recipientName":"Petr Svoboda","recipientEmail":"petr.svoboda@example.cz","senderName":"Cyklo Novák s.r.o."},"lead":{"id":"3051","countryId":58,"countryIso":"CZ","name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","vatNumber":"CZ87654321","unattestedIdentity":null,"street":"Mlýnská 8","city":"Brno","zip":"60200","stage":"warm","lostReason":null,"lostReasonNote":null,"personType":"legal","source":"referral","website":"https://www.example.cz","hasResearchProfile":false,"originatingLeadFormId":null,"outreachStatus":"not_contacted","contactsCount":0,"countryName":"Česko","billingAddressSameAsLegal":true,"billingAddress":null,"registerLookupStatus":"completed","registerLookupLocked":false},"type":"company","email":"petr.svoboda@example.cz","firstName":"Petr","lastName":"Svoboda","name":null,"phone":"+420601234567","position":"Jednatel","preferredContactChannel":"email","lastActivityAt":"2026-11-12T13:05:00Z","emailVerifiedAt":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.read"]}],"summary":"Show a contact","description":"Returns the contact with its lead, segments, tags, custom fields and consent.\n\nNeeds one of these permissions: contacts.read."},"put":{"operationId":"contacts.update","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ContactType","description":"company for a work contact of a company, personal for a private person."},"email":{"type":["string","null"],"format":"email","maxLength":255,"description":"The email, at most 255 characters. You need an email or a phone."},"firstName":{"type":["string","null"],"maxLength":255,"description":"The first name, at most 255 characters."},"lastName":{"type":["string","null"],"maxLength":255,"description":"The last name, at most 255 characters."},"name":{"type":["string","null"],"maxLength":255,"description":"A name to show when you do not split it into first and last name, at most 255 characters."},"phone":{"type":["string","null"],"pattern":"^(?:\\+|00)?[0-9][0-9 ().-]*$","maxLength":20,"description":"The phone number, like +420 601 234 567. A number without a country code counts as Czech. At most 20 characters. You need an email or a phone."},"position":{"type":["string","null"],"maxLength":255,"description":"The job of the person, like Owner, at most 255 characters."},"preferredContactChannel":{"anyOf":[{"$ref":"#/components/schemas/PreferredContactChannel"},{"type":"null"}],"description":"How the person likes to be reached: email, phone or whatsapp."},"lastActivityAt":{"type":["string","null"],"description":"When you were last in touch with the person, as a date and time with a time zone, like 2026-11-03T09:30:00+01:00."},"emailVerifiedAt":{"type":["string","null"],"description":"When the email was checked as real, as a date and time with a time zone, like 2026-11-03T09:30:00+01:00."},"userId":{"type":"integer","description":"You do not need to send it. Fusio always puts in the person the key acts as."},"leadId":{"type":"integer","description":"The number of a lead to move the person to. Leave it out to keep the lead. Send leadId or lead, not both."},"segmentIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the segments, at most 500. The list replaces the segments it had. Numbers that are not from your company are skipped."},"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags, at most 500. The list replaces the tags it had. Numbers that are not from your company are skipped."},"contactCustomFields":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"integer","description":"The number of the custom field. It must be a field of your company."},"value":{"type":["string","null"],"maxLength":65535,"description":"The value as text, at most 65535 characters. null clears it. When the field is a unique key, no other record may have the same value."}},"required":["customFieldId"]},"description":"The values of your custom fields. The list replaces all values: a field you leave out loses its value."},"isGloballyUnsubscribed":{"type":"boolean","description":"true stops all emails to this person."},"channelEmailEnabled":{"type":"boolean","description":"false turns emails to this person off."},"channelSmsEnabled":{"type":"boolean","description":"false turns text messages to this person off."},"emailConsentStatus":{"anyOf":[{"$ref":"#/components/schemas/ConsentStatus"},{"type":"null"}],"description":"Consent to emails: subscribed, unsubscribed or not_specified."},"smsConsentStatus":{"anyOf":[{"$ref":"#/components/schemas/ConsentStatus"},{"type":"null"}],"description":"Consent to text messages: subscribed, unsubscribed or not_specified."},"callConsentStatus":{"anyOf":[{"$ref":"#/components/schemas/ConsentStatus"},{"type":"null"}],"description":"Consent to phone calls: subscribed, unsubscribed or not_specified."},"id":{"type":"integer","description":"The number of the contact again. Send the same number as in the address."},"lead":{"type":"object","properties":{"billingAddressSameAsLegal":{"type":"boolean","description":"true means invoices go to the main address. false needs billingAddress. Leave it out to keep true."},"billingAddress":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name on invoices, when it is not the name of the lead."},"street":{"type":"string","maxLength":255,"description":"The street and house number for invoices."},"city":{"type":"string","maxLength":255,"description":"The city for invoices."},"zip":{"type":["string","null"],"maxLength":20,"description":"The postal code for invoices, at most 20 characters."},"countryIso":{"type":"string","minLength":2,"maxLength":2,"description":"The country for invoices as two letters, like CZ."}},"required":["street","city","countryIso"],"description":"The address for invoices. Fusio reads it only when billingAddressSameAsLegal is false; then street, city and countryIso are needed."},"name":{"type":["string","null"],"maxLength":255,"description":"The name of the company or the person, at most 255 characters."},"registrationNumber":{"type":["string","null"],"maxLength":50,"description":"The company number (IČO), at most 50 characters. Ask leads.check-duplicate first, so you do not make the same company twice."},"vatNumber":{"type":["string","null"],"maxLength":50,"description":"The VAT number (DIČ), like CZ12345678, at most 50 characters."},"street":{"type":["string","null"],"maxLength":255,"description":"The street and house number."},"city":{"type":["string","null"],"maxLength":255,"description":"The city."},"zip":{"type":["string","null"],"maxLength":20,"description":"The postal code, at most 20 characters."},"countryIso":{"type":["string","null"],"minLength":2,"maxLength":2,"description":"The country as two letters, like CZ."},"stage":{"$ref":"#/components/schemas/LeadStage","description":"Where the new lead is: cold, warm, qualified, client or lost. You must send it when you send lead."},"lostReason":{"anyOf":[{"$ref":"#/components/schemas/LeadLostReason"},{"type":"null"}],"description":"Why the lead is lost, like not_interested, no_budget or duplicate. other needs lostReasonNote."},"lostReasonNote":{"type":["string","null"],"maxLength":1000,"description":"Your own words about why the lead is lost, at most 1000 characters. Needed when lostReason is other."},"personType":{"anyOf":[{"$ref":"#/components/schemas/LeadPersonType"},{"type":"null"}],"description":"legal for a company, physical for a person."},"source":{"type":["string","null"],"enum":["web","cold_call","referral","campaign","event","partner","import","social_discovery",null],"description":"Where the lead came from: web, cold_call, referral, campaign, event, partner, social_discovery or import. A source that Fusio set itself, like lead_form, cannot be changed."},"website":{"type":["string","null"],"format":"uri","pattern":"^https?:\\/\\/(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?::[0-9]{1,5})?$","maxLength":255,"description":"The website. Fusio keeps only the start, like https://example.cz, unless preserveWebsitePath is true. Without http, Fusio adds https://."},"preserveWebsitePath":{"type":"boolean","description":"true keeps the whole web address, with the path after the domain."},"segmentIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the segments the new lead joins, at most 500. Numbers that are not from your company are skipped."},"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags the new lead gets, at most 500. Numbers that are not from your company are skipped."},"leadCustomFields":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"integer","description":"The number of the custom field. It must be a field of your company."},"value":{"type":["string","null"],"maxLength":65535,"description":"The value as text, at most 65535 characters. null clears it. When the field is a unique key, no other record may have the same value."}},"required":["customFieldId"]},"description":"The values of your custom fields for the new lead. A field you leave out stays empty."}},"required":["stage"],"description":"A new lead to make and move the person to. Send leadId or lead, not both."}},"required":["type","id"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateContactData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.write"]}],"x-fusio-conditional-scopes":["leads.write","emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Change a contact","description":"Changes the contact and returns it. Always send `id`, `type` and an email or a phone. Other fields you leave out keep their value.\n\nSend `leadId` to move the person to another lead, or `lead` to make a new lead and move them there. Sending `lead` needs `leads.write`. A contact belongs to one lead only.\n\n`segmentIds`, `tagIds` and `contactCustomFields` replace what the contact had. Leave a list out to keep it as it is. A custom field that is a unique key may not have the same value on two contacts; then you get 422 on `contactCustomFields`.\n\nA key may only make consent narrower: it may unsubscribe and turn channels off, never the other way. A change the other way answers 403 `route_outside_surface`.\n\n> [!WARNING]\n> While your company has an active email sequence, a new lead you make with `lead` can start it. A key then needs `emails.send`.\n\nErrors: 422 on `contactCustomFields` when a unique value is taken, and 422 with `payload.metric` crm_records when you send `lead` and your plan has no room for more records. The new lead counts as 1 record.\n\nNeeds one of these permissions: contacts.write. Some values also need: leads.write, emails.send. You must tick these on purpose: emails.send."},"delete":{"operationId":"contacts.destroy","tags":["contacts"],"parameters":[{"name":"contact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the contact."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["contacts.write"]}],"summary":"Delete a contact","description":"Deletes the contact and takes it off its lead. When it was the main contact, the oldest other contact of the lead becomes the main one. The answer has no data.\n\n> [!CAUTION]\n> The API cannot bring the contact back. Fusio keeps it hidden for at least 30 days and then removes it for good.\n\nNeeds one of these permissions: contacts.write."}},"/v1/customers/grid":{"get":{"operationId":"customers.grid","tags":["customers"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[personaTitle]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the job title of the typical customer."},{"name":"filter[employeeBand]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How many people the company has. One or more values, split by commas."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[analyzedAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was checked. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[ids]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Up to 100 IDs, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","personaTitle","employeeBand","analyzedAt","createdAt","-name","-personaTitle","-employeeBand","-analyzedAt","-createdAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexTenantCustomerData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"List customer profiles in a table","description":"Returns your customer profiles page by page, ready for a table. Use `filter`, `sort`, `page` and `perPage` as the shape of the list says.\n\nNeeds one of these permissions: intelligence.read."}},"/v1/customers":{"post":{"operationId":"customers.store","tags":["customers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the customer profile, from 1 to 255 characters."},"tenantProductId":{"type":["integer","null"],"description":"The number of your product this belongs to. Leave it out for your main product."},"personaTitle":{"type":["string","null"],"maxLength":255,"description":"The job title of the person, like Marketing manager. At most 255 characters."},"segmentSummary":{"type":["string","null"],"maxLength":5000,"description":"Who these customers are, in a few sentences. At most 5000 characters."},"titleRange":{"type":["string","null"],"maxLength":255,"description":"Other job titles they may have. At most 255 characters."},"reportsTo":{"type":["string","null"],"maxLength":255,"description":"Who their boss is. At most 255 characters."},"teamSizeManaged":{"type":["string","null"],"maxLength":255,"description":"How big a team they lead. At most 255 characters."},"primaryJobToBeDone":{"type":["string","null"],"maxLength":5000,"description":"The main thing they want to get done. At most 5000 characters."},"confidenceLevel":{"anyOf":[{"$ref":"#/components/schemas/TenantCustomerConfidenceLevel"},{"type":"null"}],"description":"How sure you are about this profile: high, medium or low."},"derivedFromAnalysisId":{"type":["integer","null"],"description":"The number of the website analysis this came from. Leave it out when you write it yourself."},"adsTargetingProfile":{"type":["object","null"],"properties":{"schemaVersion":{"type":"integer","enum":["1"],"description":"The version of this shape. Send 1."},"canonical":{"type":"object","properties":{"locations":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of places, at most 50. Each at most 500 characters."},"languages":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of languages, at most 50. Each at most 500 characters."},"ageRanges":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of age ranges, at most 50. Each at most 500 characters."},"genders":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of genders, at most 50. Each at most 500 characters."},"interests":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of interests, at most 50. Each at most 500 characters."},"behaviors":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of behaviors, at most 50. Each at most 500 characters."},"jobTitles":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of job titles, at most 50. Each at most 500 characters."},"seniorities":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of job levels, at most 50. Each at most 500 characters."},"industries":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of fields, at most 50. Each at most 500 characters."},"companySizes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of company sizes, at most 50. Each at most 500 characters."},"purchaseSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signs that they want to buy, at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics they search for, at most 50. Each at most 500 characters."},"exclusions":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of people to leave out, at most 50. Each at most 500 characters."}},"description":"Who to target, the same for all platforms."},"googleAds":{"type":"object","properties":{"recommendedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to target on Google Ads, at most 50. Each at most 500 characters."},"excludedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to leave out on Google Ads, at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics to target on Google Ads, at most 50. Each at most 500 characters."},"notes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of notes on Google Ads, at most 50. Each at most 500 characters."}},"description":"Targeting tips for Google Ads."},"metaAds":{"type":"object","properties":{"recommendedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to target on Meta (Facebook and Instagram), at most 50. Each at most 500 characters."},"excludedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to leave out on Meta (Facebook and Instagram), at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics to target on Meta (Facebook and Instagram), at most 50. Each at most 500 characters."},"notes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of notes on Meta (Facebook and Instagram), at most 50. Each at most 500 characters."}},"description":"Targeting tips for Meta (Facebook and Instagram)."},"linkedInAds":{"type":"object","properties":{"recommendedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to target on LinkedIn, at most 50. Each at most 500 characters."},"excludedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to leave out on LinkedIn, at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics to target on LinkedIn, at most 50. Each at most 500 characters."},"notes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of notes on LinkedIn, at most 50. Each at most 500 characters."}},"description":"Targeting tips for LinkedIn."},"tikTokAds":{"type":"object","properties":{"recommendedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to target on TikTok, at most 50. Each at most 500 characters."},"excludedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to leave out on TikTok, at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics to target on TikTok, at most 50. Each at most 500 characters."},"notes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of notes on TikTok, at most 50. Each at most 500 characters."}},"description":"Targeting tips for TikTok."}},"description":"Who to show ads to, in general and per ad platform. null clears it."},"topPains":{"type":["array","null"],"items":{"type":"object","properties":{"pain":{"type":"string","maxLength":255,"description":"The problem, at most 255 characters."},"verbatimQuote":{"type":["string","null"],"maxLength":500,"description":"What a customer said about it, word for word, at most 500 characters."}},"required":["pain"]},"maxItems":10,"description":"Their biggest problems, at most 10."},"naceCodes":{"type":["array","null"],"items":{"type":"string"},"maxItems":6,"uniqueItems":true,"description":"Field codes (NACE) of their companies, like 47910, at most 6, each once."},"employeeBand":{"anyOf":[{"$ref":"#/components/schemas/EmployeeBand"},{"type":"null"}],"description":"How many people their companies have: micro, small, medium, large or enterprise."},"legalForms":{"type":["array","null"],"items":{"type":"string","enum":["101","112","121","111","113","205"]},"uniqueItems":true,"description":"Legal forms of their companies as Czech codes: 101 (sole trader), 111 (general partnership), 112 (limited company), 113 (limited partnership), 121 (joint-stock company) or 205 (cooperative)."},"eshopPlatforms":{"type":["array","null"],"items":{"type":"string","enum":["shoptet","shopify","woocommerce","prestashop","upgates","fastcentrik","other"]},"uniqueItems":true,"description":"Online shop platforms they use: shoptet, shopify, woocommerce, prestashop, upgates, fastcentrik or other."},"companyAgeBands":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CompanyAgeBand"},"uniqueItems":true,"description":"How old their companies are. Pick from new (under 2 years), young (2 to 5 years), established (5 to 10 years) or mature (over 10 years)."},"municipalityLevel":{"anyOf":[{"$ref":"#/components/schemas/MunicipalityLevel"},{"type":"null"}]},"municipalityCode":{"type":["integer","null"]},"triggerEvents":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of events that make them start looking, at most 30. Each at most 255 characters."},"desiredOutcomes":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of results they want, at most 30. Each at most 255 characters."},"successMetrics":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of numbers they judge success by, at most 30. Each at most 255 characters."},"objections":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of doubts they have before buying, at most 30. Each at most 255 characters."},"fears":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of things they fear, at most 30. Each at most 255 characters."},"alternativesConsidered":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of other choices they think about, at most 30. Each at most 255 characters."},"keyVocabulary":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of words they use, at most 30. Each at most 255 characters."},"functionalJobs":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of tasks they want done, at most 30. Each at most 255 characters."},"emotionalJobs":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of feelings they want, at most 30. Each at most 255 characters."},"socialJobs":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of how they want others to see them, at most 30. Each at most 255 characters."},"channels":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of places where you can reach them, at most 30. Each at most 255 characters."},"contentConsumed":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of things they read, watch or listen to, at most 30. Each at most 255 characters."},"trustedCommunities":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of groups they trust, at most 30. Each at most 255 characters."}},"required":["name"]},"example":{"name":"Víkendový cyklista","personaTitle":"Rodič, který jezdí o víkendech","segmentSummary":"Lidé 30–50 let z Brna, jezdí s rodinou na výlety.","primaryJobToBeDone":"Mít kolo připravené na víkend bez starostí.","confidenceLevel":"medium","topPains":[{"pain":"Servis trvá týden a víkend je pryč.","verbatimQuote":"Kolo jsem dal do servisu a v sobotu jsem nejel."}],"desiredOutcomes":["Kolo hotové do pátku"],"objections":["Servis je drahý"],"channels":["Facebook","Instagram"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantCustomerData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Customer created successfully","payload":{"id":58,"tenantId":412,"tenantProductId":null,"derivedFromAnalysisId":null,"createdBy":88,"name":"Víkendový cyklista","personaTitle":"Rodič, který jezdí o víkendech","segmentSummary":"Lidé 30–50 let z Brna, jezdí s rodinou na výlety.","titleRange":null,"reportsTo":null,"teamSizeManaged":null,"primaryJobToBeDone":"Mít kolo připravené na víkend bez starostí.","confidenceLevel":"medium","triggerEvents":[],"topPains":[{"pain":"Servis trvá týden a víkend je pryč.","verbatimQuote":"Kolo jsem dal do servisu a v sobotu jsem nejel."}],"desiredOutcomes":["Kolo hotové do pátku"],"successMetrics":[],"objections":["Servis je drahý"],"fears":[],"alternativesConsidered":[],"keyVocabulary":[],"functionalJobs":[],"emotionalJobs":[],"socialJobs":[],"channels":["Facebook","Instagram"],"contentConsumed":[],"trustedCommunities":[],"sampleQuotes":null,"adsTargetingProfile":null,"naceCodes":[],"employeeBand":null,"legalForms":[],"eshopPlatforms":[],"companyAgeBands":[],"municipality":null,"targetingClassifiedAt":null,"analyzedAt":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Create a customer profile","description":"Creates a profile of one kind of customer. Only the name is needed; fill in what you know.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/customers/{customer}":{"get":{"operationId":"customers.show","tags":["customers"],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the customer profile."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantCustomerData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Customer fetched successfully","payload":{"id":58,"tenantId":412,"tenantProductId":null,"derivedFromAnalysisId":null,"createdBy":88,"name":"Víkendový cyklista","personaTitle":"Rodič, který jezdí o víkendech","segmentSummary":"Lidé 30–50 let z Brna, jezdí s rodinou na výlety.","titleRange":null,"reportsTo":null,"teamSizeManaged":null,"primaryJobToBeDone":"Mít kolo připravené na víkend bez starostí.","confidenceLevel":"medium","triggerEvents":[],"topPains":[{"pain":"Servis trvá týden a víkend je pryč.","verbatimQuote":"Kolo jsem dal do servisu a v sobotu jsem nejel."}],"desiredOutcomes":["Kolo hotové do pátku"],"successMetrics":[],"objections":["Servis je drahý"],"fears":[],"alternativesConsidered":[],"keyVocabulary":[],"functionalJobs":[],"emotionalJobs":[],"socialJobs":[],"channels":["Facebook","Instagram"],"contentConsumed":[],"trustedCommunities":[],"sampleQuotes":null,"adsTargetingProfile":null,"naceCodes":[],"employeeBand":null,"legalForms":[],"eshopPlatforms":[],"companyAgeBands":[],"municipality":null,"targetingClassifiedAt":null,"analyzedAt":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"Show a customer profile","description":"Returns one customer profile.\n\nNeeds one of these permissions: intelligence.read."},"put":{"operationId":"customers.update","tags":["customers"],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the customer profile."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the customer profile, from 1 to 255 characters."},"tenantProductId":{"type":["integer","null"],"description":"The number of your product this belongs to. Send null for your main product. Leave it out to keep it."},"personaTitle":{"type":["string","null"],"maxLength":255,"description":"The job title of the person, like Marketing manager. At most 255 characters. Leave it out to keep it."},"segmentSummary":{"type":["string","null"],"maxLength":5000,"description":"Who these customers are, in a few sentences. At most 5000 characters. Leave it out to keep it."},"titleRange":{"type":["string","null"],"maxLength":255,"description":"Other job titles they may have. At most 255 characters. Leave it out to keep it."},"reportsTo":{"type":["string","null"],"maxLength":255,"description":"Who their boss is. At most 255 characters. Leave it out to keep it."},"teamSizeManaged":{"type":["string","null"],"maxLength":255,"description":"How big a team they lead. At most 255 characters. Leave it out to keep it."},"primaryJobToBeDone":{"type":["string","null"],"maxLength":5000,"description":"The main thing they want to get done. At most 5000 characters. Leave it out to keep it."},"confidenceLevel":{"anyOf":[{"$ref":"#/components/schemas/TenantCustomerConfidenceLevel"},{"type":"null"}],"description":"How sure you are about this profile: high, medium or low. Leave it out to keep it."},"derivedFromAnalysisId":{"type":["integer","null"],"description":"The number of the website analysis this came from. Send null when you write it yourself. Leave it out to keep it."},"adsTargetingProfile":{"type":["object","null"],"properties":{"schemaVersion":{"type":"integer","enum":["1"],"description":"The version of this shape. Send 1."},"canonical":{"type":"object","properties":{"locations":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of places, at most 50. Each at most 500 characters."},"languages":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of languages, at most 50. Each at most 500 characters."},"ageRanges":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of age ranges, at most 50. Each at most 500 characters."},"genders":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of genders, at most 50. Each at most 500 characters."},"interests":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of interests, at most 50. Each at most 500 characters."},"behaviors":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of behaviors, at most 50. Each at most 500 characters."},"jobTitles":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of job titles, at most 50. Each at most 500 characters."},"seniorities":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of job levels, at most 50. Each at most 500 characters."},"industries":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of fields, at most 50. Each at most 500 characters."},"companySizes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of company sizes, at most 50. Each at most 500 characters."},"purchaseSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signs that they want to buy, at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics they search for, at most 50. Each at most 500 characters."},"exclusions":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of people to leave out, at most 50. Each at most 500 characters."}},"description":"Who to target, the same for all platforms."},"googleAds":{"type":"object","properties":{"recommendedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to target on Google Ads, at most 50. Each at most 500 characters."},"excludedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to leave out on Google Ads, at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics to target on Google Ads, at most 50. Each at most 500 characters."},"notes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of notes on Google Ads, at most 50. Each at most 500 characters."}},"description":"Targeting tips for Google Ads."},"metaAds":{"type":"object","properties":{"recommendedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to target on Meta (Facebook and Instagram), at most 50. Each at most 500 characters."},"excludedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to leave out on Meta (Facebook and Instagram), at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics to target on Meta (Facebook and Instagram), at most 50. Each at most 500 characters."},"notes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of notes on Meta (Facebook and Instagram), at most 50. Each at most 500 characters."}},"description":"Targeting tips for Meta (Facebook and Instagram)."},"linkedInAds":{"type":"object","properties":{"recommendedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to target on LinkedIn, at most 50. Each at most 500 characters."},"excludedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to leave out on LinkedIn, at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics to target on LinkedIn, at most 50. Each at most 500 characters."},"notes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of notes on LinkedIn, at most 50. Each at most 500 characters."}},"description":"Targeting tips for LinkedIn."},"tikTokAds":{"type":"object","properties":{"recommendedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to target on TikTok, at most 50. Each at most 500 characters."},"excludedSignals":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of signals to leave out on TikTok, at most 50. Each at most 500 characters."},"searchThemes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of topics to target on TikTok, at most 50. Each at most 500 characters."},"notes":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":50,"description":"A list of notes on TikTok, at most 50. Each at most 500 characters."}},"description":"Targeting tips for TikTok."}},"description":"Who to show ads to, in general and per ad platform. A profile you send replaces the whole old one. null clears it. Leave it out to keep it."},"topPains":{"type":["array","null"],"items":{"type":"object","properties":{"pain":{"type":"string","maxLength":255,"description":"The problem, at most 255 characters."},"verbatimQuote":{"type":["string","null"],"maxLength":500,"description":"What a customer said about it, word for word, at most 500 characters."}},"required":["pain"]},"maxItems":10,"description":"Their biggest problems, at most 10. Leave it out to keep it."},"naceCodes":{"type":["array","null"],"items":{"type":"string"},"maxItems":6,"uniqueItems":true,"description":"Field codes (NACE) of their companies, like 47910, at most 6, each once. Leave it out to keep it."},"employeeBand":{"anyOf":[{"$ref":"#/components/schemas/EmployeeBand"},{"type":"null"}],"description":"How many people their companies have: micro, small, medium, large or enterprise. Leave it out to keep it."},"legalForms":{"type":["array","null"],"items":{"type":"string","enum":["101","112","121","111","113","205"]},"uniqueItems":true,"description":"Legal forms of their companies as Czech codes: 101 (sole trader), 111 (general partnership), 112 (limited company), 113 (limited partnership), 121 (joint-stock company) or 205 (cooperative). Leave it out to keep it."},"eshopPlatforms":{"type":["array","null"],"items":{"type":"string","enum":["shoptet","shopify","woocommerce","prestashop","upgates","fastcentrik","other"]},"uniqueItems":true,"description":"Online shop platforms they use: shoptet, shopify, woocommerce, prestashop, upgates, fastcentrik or other. Leave it out to keep it."},"companyAgeBands":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CompanyAgeBand"},"uniqueItems":true,"description":"How old their companies are. Pick from new (under 2 years), young (2 to 5 years), established (5 to 10 years) or mature (over 10 years). Leave it out to keep it."},"municipalityLevel":{"anyOf":[{"$ref":"#/components/schemas/MunicipalityLevel"},{"type":"null"}]},"municipalityCode":{"type":["integer","null"]},"triggerEvents":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of events that make them start looking, at most 30. Each at most 255 characters. Leave it out to keep it."},"desiredOutcomes":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of results they want, at most 30. Each at most 255 characters. Leave it out to keep it."},"successMetrics":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of numbers they judge success by, at most 30. Each at most 255 characters. Leave it out to keep it."},"objections":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of doubts they have before buying, at most 30. Each at most 255 characters. Leave it out to keep it."},"fears":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of things they fear, at most 30. Each at most 255 characters. Leave it out to keep it."},"alternativesConsidered":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of other choices they think about, at most 30. Each at most 255 characters. Leave it out to keep it."},"keyVocabulary":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of words they use, at most 30. Each at most 255 characters. Leave it out to keep it."},"functionalJobs":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of tasks they want done, at most 30. Each at most 255 characters. Leave it out to keep it."},"emotionalJobs":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of feelings they want, at most 30. Each at most 255 characters. Leave it out to keep it."},"socialJobs":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of how they want others to see them, at most 30. Each at most 255 characters. Leave it out to keep it."},"channels":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of places where you can reach them, at most 30. Each at most 255 characters. Leave it out to keep it."},"contentConsumed":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of things they read, watch or listen to, at most 30. Each at most 255 characters. Leave it out to keep it."},"trustedCommunities":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":30,"description":"A list of groups they trust, at most 30. Each at most 255 characters. Leave it out to keep it."}},"required":["name"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantCustomerData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Change a customer profile","description":"Changes a customer profile. Always send the name. Other fields you leave out stay as they are; null clears them. A list you send replaces the whole old list.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."},"delete":{"operationId":"customers.destroy","tags":["customers"],"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the customer profile."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Remove a customer profile","description":"Removes a customer profile.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/deal-products/grid":{"get":{"operationId":"deal-products.grid","tags":["deal-products"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[sku]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the product code."},{"name":"filter[unit]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the unit name, like hour or piece."},{"name":"filter[billingInterval]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How often it is billed. One or more values, split by commas."},{"name":"filter[unitPrice]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The price of one unit. Two numbers as from,to. Leave one side empty for no limit."},{"name":"filter[defaultQuantity]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The usual amount. Two numbers as from,to. Leave one side empty for no limit."},{"name":"filter[defaultDiscountPercent]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The usual discount in percent. Two numbers as from,to. Leave one side empty for no limit."},{"name":"filter[vatRate]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The tax rate in percent. Two numbers as from,to. Leave one side empty for no limit."},{"name":"filter[isActive]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows active rows. 0 shows the rest."},{"name":"filter[ids]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Up to 100 IDs, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","sku","unit","unitPrice","vatRate","billingInterval","defaultQuantity","defaultDiscountPercent","isActive","dealsCount","createdAt","-name","-sku","-unit","-unitPrice","-vatRate","-billingInterval","-defaultQuantity","-defaultDiscountPercent","-isActive","-dealsCount","-createdAt"],"default":"name"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexDealProductData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"List products in a table","description":"Returns your products page by page, ready for a table, with how many deals use each. Use `filter`, `sort`, `page` and `perPage` as the shape of the list says.\n\nNeeds one of these permissions: deals.read."}},"/v1/deal-products/options":{"get":{"operationId":"deal-products.options","tags":["deal-products"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name or your code (sku). At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[isActive]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows active rows. 0 shows the rest."},{"name":"filter[billingInterval]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How often it is billed. One or more values, split by commas."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionDealProductData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"List products for a picker","description":"Returns products as short items for a picker, with the price, unit and VAT of each. Use it when you add items to a deal.\n\nNeeds one of these permissions: deals.read."}},"/v1/deal-products/{dealProduct}/deals":{"get":{"operationId":"deal-products.deals","tags":["deal-products"],"parameters":[{"name":"dealProduct","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the product."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/DealProductDealOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"List the deals that use a product","description":"Returns at most 50 newest deals that have the product as an item. You see only deals you may see.\n\nNeeds one of these permissions: deals.read."}},"/v1/deal-products":{"post":{"operationId":"deal-products.store","tags":["deal-products"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"billingInterval":{"$ref":"#/components/schemas/DealBillingInterval","description":"How often the client pays: one_time, monthly or yearly. Leave it out for one_time."},"defaultQuantity":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,13})(?:\\.\\d{1,6})?$","description":"The quantity a new item gets, more than 0. A number as text, like 12500.50, with up to 6 decimals. Leave it out for 1."},"defaultDiscountPercent":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,2})(?:\\.\\d{1,2})?$","minLength":0,"maxLength":100,"description":"The discount a new item gets. A percent as text, like 21 or 12.5, from 0 to 100. Leave it out for 0."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the product, at most 255 characters."},"sku":{"type":["string","null"],"maxLength":255,"description":"Your own code of the product, at most 255 characters. No other product may have the same one. Send null when you have none."},"description":{"type":["string","null"],"maxLength":10000,"description":"A longer text about the product, at most 10000 characters. Send null when you have none."},"unit":{"type":"string","minLength":1,"maxLength":64,"description":"The unit, like pcs or hour, at most 64 characters."},"unitPrice":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,13})(?:\\.\\d{1,6})?$","description":"The price of one unit. A number as text, like 12500.50, with up to 6 decimals."},"currency":{"type":"string","description":"The currency as three letters, like CZK."},"vatRate":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,2})(?:\\.\\d{1,2})?$","description":"The VAT. A percent as text, like 21 or 12.5, from 0 to 100."},"isActive":{"type":"boolean","description":"false hides the product when people pick products for a deal."},"contractTemplates":{"type":"array","items":{"type":"object","properties":{"documentTemplateId":{"type":"integer"},"scope":{"$ref":"#/components/schemas/DealProductContractScope"}},"required":["documentTemplateId","scope"]},"maxItems":10,"uniqueItems":true}},"required":["name","sku","description","unit","unitPrice","currency","vatRate","isActive"]},"example":{"name":"Roční servis kola","sku":"SRV-ROK","description":"Prohlídka, seřízení brzd a řazení, mazání řetězu.","unit":"ks","unitPrice":"2490","currency":"CZK","vatRate":"21","isActive":true,"billingInterval":"yearly","defaultQuantity":"1","defaultDiscountPercent":"0"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealProductData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Catalogue product created successfully.","payload":{"id":140,"tenantId":412,"name":"Roční servis kola","sku":"SRV-ROK","description":"Prohlídka, seřízení brzd a řazení, mazání řetězu.","unit":"ks","unitPrice":"2490.000000","currency":"CZK","vatRate":"21.00","isActive":true,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","billingInterval":"yearly","defaultQuantity":"1.000000","defaultDiscountPercent":"0.00"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"summary":"Add a product","description":"Adds a product and returns it. Always send `sku` and `description`, even as null.\n\nNeeds one of these permissions: deals.write."}},"/v1/deal-products/{dealProduct}":{"get":{"operationId":"deal-products.show","tags":["deal-products"],"parameters":[{"name":"dealProduct","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the product."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealProductData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Catalogue product retrieved successfully.","payload":{"id":140,"tenantId":412,"name":"Roční servis kola","sku":"SRV-ROK","description":"Prohlídka, seřízení brzd a řazení, mazání řetězu.","unit":"ks","unitPrice":"2490.000000","currency":"CZK","vatRate":"21.00","isActive":true,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","billingInterval":"yearly","defaultQuantity":"1.000000","defaultDiscountPercent":"0.00","dealsCount":4,"activeBillingPlansCount":3}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"Show a product","description":"Returns the product with how many deals and payment plans use it.\n\nNeeds one of these permissions: deals.read."},"put":{"operationId":"deal-products.update","tags":["deal-products"],"parameters":[{"name":"dealProduct","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the product."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"billingInterval":{"$ref":"#/components/schemas/DealBillingInterval","description":"How often the client pays: one_time, monthly or yearly. Leave it out to keep it."},"defaultQuantity":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,13})(?:\\.\\d{1,6})?$","description":"The quantity a new item gets, more than 0. A number as text, like 12500.50, with up to 6 decimals. Leave it out to keep it."},"defaultDiscountPercent":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,2})(?:\\.\\d{1,2})?$","minLength":0,"maxLength":100,"description":"The discount a new item gets. A percent as text, like 21 or 12.5, from 0 to 100. Leave it out to keep it."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the product, at most 255 characters."},"sku":{"type":["string","null"],"maxLength":255,"description":"Your own code of the product, at most 255 characters. No other product may have the same one. Send null when you have none."},"description":{"type":["string","null"],"maxLength":10000,"description":"A longer text about the product, at most 10000 characters. Send null when you have none."},"unit":{"type":"string","minLength":1,"maxLength":64,"description":"The unit, like pcs or hour, at most 64 characters."},"unitPrice":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,13})(?:\\.\\d{1,6})?$","description":"The price of one unit. A number as text, like 12500.50, with up to 6 decimals."},"currency":{"type":"string","description":"The currency as three letters, like CZK."},"vatRate":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,2})(?:\\.\\d{1,2})?$","description":"The VAT. A percent as text, like 21 or 12.5, from 0 to 100."},"isActive":{"type":"boolean","description":"false hides the product when people pick products for a deal."},"contractTemplates":{"type":"array","items":{"type":"object","properties":{"documentTemplateId":{"type":"integer"},"scope":{"$ref":"#/components/schemas/DealProductContractScope"}},"required":["documentTemplateId","scope"]},"maxItems":10,"uniqueItems":true}},"required":["name","sku","description","unit","unitPrice","currency","vatRate","isActive"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealProductData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"summary":"Change a product","description":"Changes the product and returns it. Send all required fields, also `sku` and `description`, as for a new product.\n\nDeals that already have the product as an item keep their prices.\n\nNeeds one of these permissions: deals.write."},"delete":{"operationId":"deal-products.destroy","tags":["deal-products"],"parameters":[{"name":"dealProduct","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the product."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"summary":"Delete a product","description":"Deletes the product. The answer has no data. You get 422 on `dealProduct` when a deal uses the product; set `isActive` to false instead.\n\nNeeds one of these permissions: deals.write."}},"/v1/deals/{deal}/stage":{"put":{"operationId":"deals.stage.update","tags":["deals"],"parameters":[{"name":"deal","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deal."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/DealStage","description":"The new stage: discovery, qualification, proposal, negotiation, won or lost."},"winProbability":{"type":"integer","minimum":0,"maximum":100,"description":"The chance to win in percent, from 0 to 100. Only for an open stage. Leave it out to keep it, or to get the chance of the new stage."},"lostReason":{"$ref":"#/components/schemas/DealLostReason","description":"Why the deal is lost: budget, timing, competitor, no_decision, poor_fit or other. Needed for lost; not allowed for other stages."},"lostReasonNote":{"type":["string","null"],"maxLength":1000,"description":"Your own words about why, at most 1000 characters. Needed when lostReason is other. Only for lost."}},"required":["stage"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"x-fusio-conditional-scopes":["emails.send","deals.execute"],"x-fusio-opt-in-scopes":["emails.send","deals.execute"],"summary":"Move a deal to another stage","description":"Moves the deal to the new stage and returns it. Each stage has its own chance: discovery 20, qualification 35, proposal 50, negotiation 80.\n\nTo win a deal (`won`), it needs a real currency, at least one item with a total above 0, exactly one main contact and all needed documents signed. Otherwise you get 422 on `currency`, `lineItems`, `contacts` or `documents`. A won deal makes its lead a client and needs `deals.execute` on a key.\n\n> [!WARNING]\n> Winning a deal can start email sequences of your company. A key then also needs `emails.send`.\n\nErrors: 422 on `deal` when the deal is won or lost already. A won or lost deal is closed. To change it, reopen it first with `deals.reopen`.\n\nNeeds one of these permissions: deals.write. Some values also need: emails.send, deals.execute. You must tick these on purpose: emails.send, deals.execute."}},"/v1/deals/{deal}/reopen":{"post":{"operationId":"deals.reopen","tags":["deals"],"parameters":[{"name":"deal","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deal."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"type":"string","enum":["discovery","qualification","proposal","negotiation"],"description":"The open stage to go back to: discovery, qualification, proposal or negotiation."},"winProbability":{"type":"integer","minimum":0,"maximum":100,"description":"The chance to win in percent, from 0 to 100. Leave it out for the chance of the stage."}},"required":["stage"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"x-fusio-conditional-scopes":["emails.send","deals.execute"],"x-fusio-opt-in-scopes":["emails.send","deals.execute"],"summary":"Reopen a won or lost deal","description":"Opens a won or lost deal again and returns it. The close date and the reason of the loss are cleared.\n\nWhen you reopen a won deal and its lead has no other won deal, the lead goes back from client to qualified. Reopening a won deal needs `deals.execute` on a key.\n\n> [!WARNING]\n> Changing the stage of the lead can start email sequences of your company. A key then also needs `emails.send`.\n\nErrors: 422 on `deal` when the deal is still open.\n\nNeeds one of these permissions: deals.write. Some values also need: emails.send, deals.execute. You must tick these on purpose: emails.send, deals.execute."}},"/v1/deals/{deal}/line-items":{"put":{"operationId":"deals.line-items.replace","tags":["deals"],"parameters":[{"name":"deal","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deal."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["integer","null"],"description":"The number of one of your products. It only links the item to the product; Fusio copies nothing, so send all values yourself."},"billingInterval":{"$ref":"#/components/schemas/DealBillingInterval","description":"How often the client pays: one_time, monthly or yearly. Leave it out for one_time."},"giftPeriods":{"type":["integer","null"],"minimum":1,"maximum":120,"description":"How many billing cycles the item is free, from 1 to 120. Only for a package or a recurring product of the Fusio catalog, for at most 20 products. Leave it out for no gift."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the item, at most 255 characters."},"description":{"type":["string","null"],"maxLength":10000,"description":"A longer text, at most 10000 characters."},"quantity":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,13})(?:\\.\\d{1,6})?$","description":"How many, more than 0. A number as text, like 12500.50, with up to 6 decimals."},"unit":{"type":"string","minLength":1,"maxLength":64,"description":"The unit, like pcs or hour, at most 64 characters."},"unitPrice":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,13})(?:\\.\\d{1,6})?$","description":"The price of one unit, with or without VAT as priceInputMode of the deal says. A number as text, like 12500.50, with up to 6 decimals."},"listUnitPrice":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d{0,13})(?:\\.\\d{1,6})?$"},"discountPercent":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,2})(?:\\.\\d{1,2})?$","description":"The discount. A percent as text, like 21 or 12.5, from 0 to 100. Leave it out for 0."},"vatRate":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,2})(?:\\.\\d{1,2})?$","description":"The VAT. A percent as text, like 21 or 12.5, from 0 to 100. Leave it out for defaultVatRate of the deal."}},"required":["name","quantity","unit","unitPrice"]},"maxItems":100,"description":"All items of the deal, at most 100. The list replaces the items it had. An empty list removes all."}},"required":["items"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"x-fusio-conditional-scopes":["deals.execute"],"x-fusio-opt-in-scopes":["deals.execute"],"summary":"Set the items of a deal","description":"Replaces all items of the deal and returns the deal with new totals. Fusio counts the totals itself, so do not send `net`, `tax`, `gross` or `sortOrder`. The items keep the order of the list.\n\nErrors: 422 on `deal` when the deal is won or lost. For a won deal, a key without `deals.execute` gets 403 instead.\n\nNeeds one of these permissions: deals.write. Some values also need: deals.execute. You must tick these on purpose: deals.execute."}},"/v1/deals/{deal}/contacts":{"put":{"operationId":"deals.contacts.replace","tags":["deals"],"parameters":[{"name":"deal","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deal."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"type":"object","properties":{"leadContactId":{"type":"integer","description":"The number of a link between the lead of the deal and a contact, from lead-contacts.index. Each one only once."},"roles":{"type":"array","items":{"$ref":"#/components/schemas/DealContactRole"},"minItems":1,"description":"What the person does in the deal, at least one: primary, decision_maker, billing, technical, legal or other. Only one contact of the deal may be primary."}},"required":["leadContactId","roles"]},"maxItems":50,"uniqueItems":true,"description":"All contacts of the deal, at most 50. The list replaces the contacts it had. An empty list removes all."}},"required":["contacts"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"x-fusio-conditional-scopes":["deals.execute"],"x-fusio-opt-in-scopes":["deals.execute"],"summary":"Set the contacts of a deal","description":"Replaces all contacts of the deal and returns the deal. You can use only contacts of the lead of the deal; otherwise you get 422 on that `leadContactId`.\n\nTo win the deal later, exactly one contact must have the role `primary`.\n\nErrors: 422 on `deal` when the deal is won or lost. For a won deal, a key without `deals.execute` gets 403 instead.\n\nNeeds one of these permissions: deals.write. Some values also need: deals.execute. You must tick these on purpose: deals.execute."}},"/v1/deals/overview":{"get":{"operationId":"deals.overview","tags":["deals"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[owner]","in":"query","schema":{"anyOf":[{"$ref":"#/components/schemas/DealOwnerScope"},{"type":"null"}]},"description":"all for all deals you may see, mine for only your own."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"Show the numbers of your deals","description":"Returns the numbers of your deals for a range of days: what is open, won and lost, and what you may win. Money is always per currency. Send `compare=true` to also get the range just before.\n\nNeeds one of these permissions: deals.read."}},"/v1/deals/grid":{"get":{"operationId":"deals.grid","tags":["deals"],"parameters":[{"name":"filter[search]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Words to look for in names, emails and other main fields."},{"name":"filter[stale]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows deals with no news for a long time. 0 shows the rest."},{"name":"filter[owner]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"mine shows only your own deals. all shows every deal."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[lead]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of one prospect."},{"name":"filter[stage]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The step it is at. One or more values, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","stage","expectedCloseDate","winProbability","createdAt","updatedAt","-name","-stage","-expectedCloseDate","-winProbability","-createdAt","-updatedAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridDealData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"List deals in a table","description":"Returns deals page by page, ready for a table. Use `filter`, `sort`, `page` and `perPage` as the shape of the list says.\n\nNeeds one of these permissions: deals.read."}},"/v1/deals/options":{"get":{"operationId":"deals.options","tags":["deals"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name. At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[lead]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of one prospect."},{"name":"filter[stage]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The step it is at. One or more values, split by commas."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionDealData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"List deals for a picker","description":"Returns deals as short items for a picker.\n\nNeeds one of these permissions: deals.read."}},"/v1/deals/board/summary":{"get":{"operationId":"deals.board.summary","tags":["deals"],"parameters":[{"name":"filter[search]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Words to look for in names, emails and other main fields."},{"name":"filter[stale]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows deals with no news for a long time. 0 shows the rest."},{"name":"filter[owner]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"mine shows only your own deals. all shows every deal."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[lead]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of one prospect."},{"name":"filter[stage]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The step it is at. One or more values, split by commas."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BoardSummaryData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"Count the deals on the board","description":"Returns how many deals are in each column (stage) of the board. Use the same `filter` as for the columns.\n\nNeeds one of these permissions: deals.read."}},"/v1/deals/board/{status}":{"get":{"operationId":"deals.board.column","tags":["deals"],"parameters":[{"name":"status","in":"path","required":true,"schema":{"type":"string","enum":["discovery","qualification","proposal","negotiation","won","lost"]},"description":"The column: discovery, qualification, proposal, negotiation, won or lost."},{"name":"cursor","in":"query","schema":{"type":["string","null"],"maxLength":512},"description":"Where the next page starts. Take it from nextCursor of the page before."},{"name":"filter[search]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Words to look for in names, emails and other main fields."},{"name":"filter[stale]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows deals with no news for a long time. 0 shows the rest."},{"name":"filter[owner]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"mine shows only your own deals. all shows every deal."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[lead]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of one prospect."},{"name":"filter[stage]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The step it is at. One or more values, split by commas."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridDealData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"List the deals of one board column","description":"Returns the deals of one stage, page by page. Send `nextCursor` back as `cursor` to load more.\n\nNeeds one of these permissions: deals.read."}},"/v1/deals":{"post":{"operationId":"deals.store","tags":["deals"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the deal, at most 255 characters."},"estimatedValue":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d{0,13})(?:\\.\\d{1,6})?$","description":"How much the deal may be worth, before you add items. A number as text, like 12500.50, with up to 6 decimals. null clears it."},"currency":{"type":"string","description":"The currency as three letters, like CZK or EUR. Leave it out on a new deal to take it from your invoice settings."},"priceInputMode":{"$ref":"#/components/schemas/PriceInputMode","description":"net when you type prices without VAT, gross when with VAT. A new deal uses net."},"defaultVatRate":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,2})(?:\\.\\d{1,2})?$","description":"The VAT for new items. A percent as text, like 21 or 12.5, from 0 to 100. Leave it out on a new deal to take it from your invoice settings."},"expectedCloseDate":{"type":["string","null"],"format":"date","description":"The day you expect to close the deal, like 2026-12-15. null clears it."},"closingMode":{"$ref":"#/components/schemas/DealClosingMode"},"closingRequiresPayment":{"type":"boolean"},"closingBankAccountId":{"type":["integer","null"]},"leadId":{"type":"integer","description":"The number of the lead you sell to. The lead may not be lost."},"stage":{"type":"string","enum":["discovery","qualification","proposal","negotiation"],"description":"The stage to start in: discovery, qualification, proposal or negotiation. Leave it out for discovery."},"winProbability":{"type":"integer","minimum":0,"maximum":100,"description":"The chance to win in percent, from 0 to 100. Leave it out for the chance of the stage."},"inquiryId":{"type":"integer","description":"The number of an inquiry of the same lead that the deal comes from. It may not be disqualified or have a deal yet."}},"required":["name","leadId"]},"example":{"name":"Servis firemních kol 2027","leadId":3051,"stage":"proposal","estimatedValue":"30000","currency":"CZK","priceInputMode":"net","defaultVatRate":"21","expectedCloseDate":"2026-12-15","winProbability":50}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Deal created successfully.","payload":{"id":615,"leadId":3051,"userId":88,"tenantId":412,"name":"Servis firemních kol 2027","stage":"proposal","estimatedValue":"30000.00","winProbability":50,"currency":"CZK","priceInputMode":"net","defaultVatRate":"21.00","totals":{"net":"0.00","tax":"0.00","gross":"0.00"},"value":"30000.00","lineItems":[],"contacts":[],"documents":[],"requiredDocuments":[],"expectedCloseDate":"2026-12-15","closedAt":null,"lostReason":null,"lostReasonNote":null,"lead":{"id":"3051","countryId":58,"countryIso":"CZ","name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","vatNumber":"CZ87654321","unattestedIdentity":null,"street":"Mlýnská 8","city":"Brno","zip":"60200","stage":"qualified","lostReason":null,"lostReasonNote":null,"personType":"legal","source":"referral","website":"https://www.example.cz","hasResearchProfile":false,"originatingLeadFormId":null,"outreachStatus":"not_contacted","contactsCount":1,"countryName":"Česko","billingAddressSameAsLegal":true,"billingAddress":null,"registerLookupStatus":"completed","registerLookupLocked":false},"tasks":[],"notes":[],"createdAt":"2026-11-12T13:05:00Z","updatedAt":"2026-11-12T13:05:00Z","activityCount":null,"documentsCount":0,"documentKinds":[],"billingDetailsComplete":true,"hasSubscriptionOrder":false,"closing":{"mode":"confirm","effectiveMode":"sign","isSignForced":true,"requiresPayment":true,"bankAccountId":null,"paymentAccount":{"id":3,"label":"Main account","accountNumber":"2801234567","bankCode":"2010","iban":null,"swift":null,"currency":"CZK","isDefault":true,"isFromFakturoid":false,"paymentPairing":null},"paymentIban":"CZ1120100000002801234567","isReady":false,"missingCount":1,"checks":[{"key":"items","isOk":true,"issues":[],"documentId":null,"title":null,"isSigned":false,"missingFields":[],"templateId":null,"productName":null,"contractScope":null},{"key":"contact","isOk":true,"issues":[],"documentId":null,"title":null,"isSigned":false,"missingFields":[],"templateId":null,"productName":null,"contractScope":null},{"key":"document","isOk":false,"issues":["missing_fields"],"documentId":41,"title":"Website care contract","isSigned":false,"missingFields":[],"templateId":null,"productName":null,"contractScope":null},{"key":"account","isOk":true,"issues":[],"documentId":null,"title":null,"isSigned":false,"missingFields":[],"templateId":null,"productName":null,"contractScope":null}],"recipient":{"leadContactId":12,"name":"Jan Novák","email":"jan@pekarna-novak.cz","phone":"+420 602 123 456"},"clientLink":null,"hasFakturoid":false},"userName":"Tomáš Malý","invoicesCount":0}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Add a deal","description":"Adds a deal for a lead and returns it. Each stage has its own chance: discovery 20, qualification 35, proposal 50, negotiation 80. Add items with `deals.line-items.replace` and contacts with `deals.contacts.replace`.\n\nA cold or warm lead becomes qualified.\n\n> [!WARNING]\n> Changing the stage of the lead can start email sequences of your company. A key then also needs `emails.send`.\n\nErrors: 422 with `payload.metric` crm_records when your plan has no room for more records. A deal counts as 1 record.\n\nNeeds one of these permissions: deals.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v1/deals/{deal}":{"get":{"operationId":"deals.show","tags":["deals"],"parameters":[{"name":"deal","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deal."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Deal retrieved successfully.","payload":{"id":615,"leadId":3051,"userId":88,"tenantId":412,"name":"Servis firemních kol 2027","stage":"proposal","estimatedValue":"30000.00","winProbability":50,"currency":"CZK","priceInputMode":"net","defaultVatRate":"21.00","totals":{"net":"26892.00","tax":"5647.32","gross":"32539.32"},"value":"32539.32","lineItems":[{"id":2201,"sortOrder":0,"name":"Roční servis kola","description":"Prohlídka, seřízení brzd a řazení, mazání řetězu.","quantity":"12.000000","unit":"ks","unitPrice":"2490.000000","discountPercent":"10.00","vatRate":"21.00","net":"26892.00","tax":"5647.32","gross":"32539.32","productId":140,"billingInterval":"yearly","giftPeriods":null,"listUnitPrice":null}],"contacts":[{"leadContactId":9120,"roles":["primary","decision_maker"],"leadContact":{"id":9120,"leadId":3051,"contactId":7720,"isPrimary":true,"contactName":"Petr Svoboda","contactEmail":"petr.svoboda@example.cz","contactType":"company"}}],"documents":[],"requiredDocuments":[],"expectedCloseDate":"2026-12-15","closedAt":null,"lostReason":null,"lostReasonNote":null,"lead":{"id":"3051","countryId":58,"countryIso":"CZ","name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","vatNumber":"CZ87654321","unattestedIdentity":null,"street":"Mlýnská 8","city":"Brno","zip":"60200","stage":"qualified","lostReason":null,"lostReasonNote":null,"personType":"legal","source":"referral","website":"https://www.example.cz","hasResearchProfile":false,"originatingLeadFormId":null,"outreachStatus":"not_contacted","contactsCount":1,"countryName":"Česko","billingAddressSameAsLegal":true,"billingAddress":null,"registerLookupStatus":"completed","registerLookupLocked":false},"tasks":[],"notes":[{"id":4418,"tenantId":412,"userId":88,"user":{"id":88,"firstName":"Jana","lastName":"Nováková"},"noteableType":"deal","noteableId":615,"body":"Poslala jsem nabídku. Rozhodnou se do konce listopadu.","leadOutreachTouchId":null,"outreachTouch":null,"createdAt":"2026-11-12T13:05:00Z","updatedAt":"2026-11-12T13:05:00Z","pinnedAt":null}],"createdAt":"2026-11-12T13:05:00Z","updatedAt":"2026-11-14T10:20:00Z","activityCount":6,"documentsCount":0,"documentKinds":[],"billingDetailsComplete":true,"hasSubscriptionOrder":false,"closing":{"mode":"confirm","effectiveMode":"sign","isSignForced":true,"requiresPayment":true,"bankAccountId":null,"paymentAccount":{"id":3,"label":"Main account","accountNumber":"2801234567","bankCode":"2010","iban":null,"swift":null,"currency":"CZK","isDefault":true,"isFromFakturoid":false,"paymentPairing":null},"paymentIban":"CZ1120100000002801234567","isReady":false,"missingCount":1,"checks":[{"key":"items","isOk":true,"issues":[],"documentId":null,"title":null,"isSigned":false,"missingFields":[],"templateId":null,"productName":null,"contractScope":null},{"key":"contact","isOk":true,"issues":[],"documentId":null,"title":null,"isSigned":false,"missingFields":[],"templateId":null,"productName":null,"contractScope":null},{"key":"document","isOk":false,"issues":["missing_fields"],"documentId":41,"title":"Website care contract","isSigned":false,"missingFields":[],"templateId":null,"productName":null,"contractScope":null},{"key":"account","isOk":true,"issues":[],"documentId":null,"title":null,"isSigned":false,"missingFields":[],"templateId":null,"productName":null,"contractScope":null}],"recipient":{"leadContactId":12,"name":"Jan Novák","email":"jan@pekarna-novak.cz","phone":"+420 602 123 456"},"clientLink":null,"hasFakturoid":false},"userName":"Tomáš Malý","invoicesCount":0}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.read"]}],"summary":"Show a deal","description":"Returns the deal with its items, totals, contacts, documents, tasks and notes. Money is text, like 12500.00, so no cents get lost.\n\nNeeds one of these permissions: deals.read."},"put":{"operationId":"deals.update","tags":["deals"],"parameters":[{"name":"deal","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deal."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the deal, at most 255 characters. You must send it."},"estimatedValue":{"type":["string","null"],"pattern":"^(?:0|[1-9]\\d{0,13})(?:\\.\\d{1,6})?$","description":"How much the deal may be worth, before you add items. A number as text, like 12500.50, with up to 6 decimals. null clears it."},"currency":{"type":"string","description":"The currency as three letters, like CZK or EUR. Leave it out to keep it."},"priceInputMode":{"$ref":"#/components/schemas/PriceInputMode","description":"net when you type prices without VAT, gross when with VAT. Leave it out to keep it."},"defaultVatRate":{"type":"string","pattern":"^(?:0|[1-9]\\d{0,2})(?:\\.\\d{1,2})?$","description":"The VAT for new items. A percent as text, like 21 or 12.5, from 0 to 100. Leave it out to keep it."},"expectedCloseDate":{"type":["string","null"],"format":"date","description":"The day you expect to close the deal, like 2026-12-15. null clears it."},"closingMode":{"$ref":"#/components/schemas/DealClosingMode"},"closingRequiresPayment":{"type":"boolean"},"closingBankAccountId":{"type":["integer","null"]}},"required":["name"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DealOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"x-fusio-conditional-scopes":["deals.execute"],"x-fusio-opt-in-scopes":["deals.execute"],"summary":"Change a deal","description":"Changes the deal and returns it. Fields you leave out keep their value, but `name` is always needed.\n\nTo change the stage use `deals.stage.update`; the lead of a deal cannot change.\n\nErrors: 422 on `deal` when the deal is won or lost. For a won deal, a key without `deals.execute` gets 403 instead. A won or lost deal is closed. To change it, reopen it first with `deals.reopen`.\n\nNeeds one of these permissions: deals.write. Some values also need: deals.execute. You must tick these on purpose: deals.execute."},"delete":{"operationId":"deals.destroy","tags":["deals"],"parameters":[{"name":"deal","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deal."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"x-fusio-conditional-scopes":["deals.execute"],"x-fusio-opt-in-scopes":["deals.execute"],"summary":"Delete a deal","description":"Deletes an open deal. The answer has no data.\n\nYou get 422 when the deal is won or lost, or while one of its documents waits for signatures. For a won deal, a key without `deals.execute` gets 403 instead.\n\n> [!CAUTION]\n> The API cannot bring the deal back.\n\nNeeds one of these permissions: deals.write. Some values also need: deals.execute. You must tick these on purpose: deals.execute."}},"/v1/emails/grid":{"get":{"operationId":"emails.grid","tags":["emails"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[campaign]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more campaign IDs, split by commas."},{"name":"filter[campaignRelation]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows rows in a campaign. without shows rows outside any campaign."},{"name":"sort","in":"query","schema":{"type":"string","enum":["tenantSequence","name","subject","state","publishedAt","createdAt","updatedAt","-tenantSequence","-name","-subject","-state","-publishedAt","-createdAt","-updatedAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexEmailData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.read"]}],"summary":"List emails in a table","description":"Returns one page of emails with the filters and the sort you ask for.\n\nNeeds one of these permissions: emails.read."}},"/v1/emails/options":{"get":{"operationId":"emails.options","tags":["emails"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name. At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionEmailData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.read"]}],"summary":"List emails for a picker","description":"Returns short items with the number and the name of each email.\n\nNeeds one of these permissions: emails.read."}},"/v1/emails/board/summary":{"get":{"operationId":"emails.board.summary","tags":["emails"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[campaign]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more campaign IDs, split by commas."},{"name":"filter[campaignRelation]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows rows in a campaign. without shows rows outside any campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BoardSummaryData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.read"]}],"summary":"Count emails in each state","description":"Returns how many emails there are in each column of the board.\n\nNeeds one of these permissions: emails.read."}},"/v1/emails/board/{status}":{"get":{"operationId":"emails.board.column","tags":["emails"],"parameters":[{"name":"status","in":"path","required":true,"schema":{"type":"string","enum":["drafted","approved","rejected","scheduled","published","failed"]},"description":"The column: drafted, approved, rejected, scheduled, published or failed."},{"name":"cursor","in":"query","schema":{"type":["string","null"],"maxLength":512},"description":"Where the next page starts. Take it from nextCursor of the page before."},{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[campaign]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more campaign IDs, split by commas."},{"name":"filter[campaignRelation]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows rows in a campaign. without shows rows outside any campaign."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexEmailData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.read"]}],"summary":"List the emails of one board column","description":"Returns the emails in one state, page by page. Send `nextCursor` back as `cursor` for the next page.\n\nNeeds one of these permissions: emails.read."}},"/v1/emails/bulk-state":{"patch":{"operationId":"emails.bulk-set-state","tags":["emails"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emailIds":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":100,"description":"The numbers of the emails, at most 100."},"state":{"$ref":"#/components/schemas/EmailState","description":"The new state for all of them. Any state other than drafted or rejected needs emails.send."}},"required":["emailIds","state"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Move many emails to one state","description":"Moves each email like the single state change does. It is all or nothing: when one email cannot move, because it is locked or the step is not allowed, none moves and you get 422. When one of the emails belongs to a campaign, a key also needs `campaigns.write`.\n\nNeeds one of these permissions: emails.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v1/emails/{email}/state":{"patch":{"operationId":"emails.set-state","tags":["emails"],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the email."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/EmailState","description":"The new state. Any state other than drafted or rejected needs emails.send."}},"required":["state"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Move an email to another state","description":"Allowed steps: from drafted to approved or rejected, from approved to rejected and from rejected to approved. Other steps are refused with 422. A scheduled or published email is locked and you get 422 too; change it through publications.\n\n`approved` needs `emails.send`. When the email belongs to a campaign, a key also needs `campaigns.write`.\n\n> [!WARNING]\n> An approved email can go out on its own when a running sequence uses it.\n\nNeeds one of these permissions: emails.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v1/emails/{email}/fields":{"patch":{"operationId":"emails.update-fields","tags":["emails"],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the email."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the email, at most 255 characters."},"subject":{"type":"string","maxLength":255,"description":"The subject line, at most 255 characters."},"preheaderText":{"type":["string","null"],"maxLength":255,"description":"The short text after the subject, at most 255 characters."},"signatureSource":{"type":"string","enum":["organization","user"],"description":"organization uses the signature of your company, user the signature of the owner."},"sendFromTenantDomainEmailId":{"type":["integer","null"],"description":"The address the email comes from, one of the addresses of your domain."},"replyToTenantDomainEmailId":{"type":["integer","null"],"description":"The address that gets the replies."},"configuration":{"type":"array","items":{},"description":"The blocks of the email from the email editor. Fusio builds the HTML from them. Pictures may only use files your company can see."},"conditions":{"type":"object","properties":{"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and: a lead must match every rule. or: one rule is enough."},"conditions":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the rule, from 0."},"property":{"$ref":"#/components/schemas/ConditionProperty","description":"What the rule looks at, like stage, tags or custom_field."},"customFieldId":{"type":["integer","null"],"description":"The number of the custom field, when property is custom_field."},"operator":{"$ref":"#/components/schemas/ConditionOperator","description":"How to compare, like equals, in or within_days."},"values":{"type":"array","items":{"type":"string","maxLength":255},"minItems":1,"description":"The values to compare with, at most 50. Write dates as YYYY-MM-DD."}},"required":["position","property","operator","values"]},"description":"The rules at the top level."},"groups":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the group, from 0."},"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and or or, for the rules in this group."},"conditions":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the rule, from 0."},"property":{"$ref":"#/components/schemas/ConditionProperty","description":"What the rule looks at, like stage, tags or custom_field."},"customFieldId":{"type":["integer","null"],"description":"The number of the custom field, when property is custom_field."},"operator":{"$ref":"#/components/schemas/ConditionOperator","description":"How to compare, like equals, in or within_days."},"values":{"type":"array","items":{"type":"string","maxLength":255},"minItems":1,"description":"The values to compare with, at most 50. Write dates as YYYY-MM-DD."}},"required":["position","property","operator","values"]},"minItems":1,"description":"The rules of the group, at least one."}},"required":["position","operator","conditions"]},"description":"Groups of rules. A group cannot hold more groups."}},"description":"Who gets the email: rules about leads. At least 1 and at most 20 rules in all."},"contactScope":{"$ref":"#/components/schemas/EmailRecipientContactScope","description":"primary sends to the main contact of each lead, all to every contact."},"contactOverrides":{"type":"array","items":{"type":"object","properties":{"contactId":{"type":"integer","description":"The number of the contact."},"isExcluded":{"type":"boolean","description":"true leaves the contact out, false adds it."}},"required":["contactId","isExcluded"]},"maxItems":500,"uniqueItems":true,"description":"Contacts you add or leave out by hand, at most 500."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Change some fields of an email","description":"Changes only the fields you send. The state does not change. Only a drafted email can change here; otherwise you get 422.\n\nChanging an email that a running sequence sends on its own needs `emails.send`. When the email belongs to a campaign, a key also needs `campaigns.write`.\n\nNeeds one of these permissions: emails.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v1/emails":{"post":{"operationId":"emails.store","tags":["emails"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":["string","null"],"enum":["standalone","campaign-broadcast","campaign-sequence",null],"description":"standalone (the default) lets you pick the sender and the people. campaign-broadcast and campaign-sequence leave that to the campaign; then do not send the sender, conditions or contactScope."},"userId":{"type":"integer","description":"The person who owns the email. It must be an active member of your company."},"emailTemplateId":{"type":["integer","null"],"description":"The design the email is built on, yours or one from Fusio. Send null for none; do not leave it out."},"topicId":{"type":["integer","null"],"description":"The number of the topic the email is about."},"languageId":{"type":"integer","description":"The number of the language of the email."},"name":{"type":"string","description":"The name of the email. Only your team sees it."},"subject":{"type":"string","description":"The subject line people see in their inbox."},"sendFromTenantDomainEmailId":{"type":"integer","description":"The address the email comes from, one of the addresses of your domain. Leave it out for your default sender."},"replyToTenantDomainEmailId":{"type":"integer","description":"The address that gets the replies. Leave it out for your default one."},"preheaderText":{"type":["string","null"],"description":"The short text mail apps show after the subject."},"configuration":{"type":"array","items":{},"minItems":1,"description":"The blocks of the email from the email editor. Fusio builds the HTML from them. Pictures may only use files your company can see."},"placeholders":{"type":["array","null"],"items":{},"description":"The placeholders of the text, like the first name, as the email editor saves them."},"state":{"$ref":"#/components/schemas/EmailState","description":"drafted, approved, rejected, scheduled, published or failed. Any state other than drafted or rejected needs emails.send."},"rejectReason":{"type":["string","null"],"description":"Why the email was rejected."},"conditions":{"type":"object","properties":{"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and: a lead must match every rule. or: one rule is enough."},"conditions":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the rule, from 0."},"property":{"$ref":"#/components/schemas/ConditionProperty","description":"What the rule looks at, like stage, tags or custom_field."},"customFieldId":{"type":["integer","null"],"description":"The number of the custom field, when property is custom_field."},"operator":{"$ref":"#/components/schemas/ConditionOperator","description":"How to compare, like equals, in or within_days."},"values":{"type":"array","items":{"type":"string","maxLength":255},"minItems":1,"description":"The values to compare with, at most 50. Write dates as YYYY-MM-DD."}},"required":["position","property","operator","values"]},"description":"The rules at the top level."},"groups":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the group, from 0."},"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and or or, for the rules in this group."},"conditions":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the rule, from 0."},"property":{"$ref":"#/components/schemas/ConditionProperty","description":"What the rule looks at, like stage, tags or custom_field."},"customFieldId":{"type":["integer","null"],"description":"The number of the custom field, when property is custom_field."},"operator":{"$ref":"#/components/schemas/ConditionOperator","description":"How to compare, like equals, in or within_days."},"values":{"type":"array","items":{"type":"string","maxLength":255},"minItems":1,"description":"The values to compare with, at most 50. Write dates as YYYY-MM-DD."}},"required":["position","property","operator","values"]},"minItems":1,"description":"The rules of the group, at least one."}},"required":["position","operator","conditions"]},"description":"Groups of rules. A group cannot hold more groups."}},"description":"Who gets the email: rules about leads. At least 1 and at most 20 rules in all."},"contactScope":{"$ref":"#/components/schemas/EmailRecipientContactScope","description":"primary sends to the main contact of each lead, all to every contact."},"contactOverrides":{"type":"array","items":{"type":"object","properties":{"contactId":{"type":"integer","description":"The number of the contact."},"isExcluded":{"type":"boolean","description":"true leaves the contact out, false adds it."}},"required":["contactId","isExcluded"]},"maxItems":500,"uniqueItems":true,"description":"Contacts you add or leave out by hand, at most 500."},"campaignId":{"type":["integer","null"],"description":"The number of the campaign the email belongs to. A key then also needs campaigns.write."}},"required":["userId","emailTemplateId","languageId","name","subject","sendFromTenantDomainEmailId","replyToTenantDomainEmailId","configuration","state","conditions"]},"example":{"userId":88,"emailTemplateId":12,"languageId":2,"name":"Jarní servis kol","subject":"Připrav kolo na jaro","sendFromTenantDomainEmailId":4,"replyToTenantDomainEmailId":4,"preheaderText":"Objednej se na servis ještě tento měsíc.","configuration":[],"state":"drafted","conditions":{"operator":"and","conditions":[{"position":0,"property":"stage","operator":"in","values":["warm","client"]}],"groups":[]},"contactScope":"primary"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateEmailData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Email created successfully","payload":{"id":731,"publication":null,"campaign":null,"userId":88,"tenantId":412,"tenantSequence":19,"emailTemplateId":12,"topicId":null,"languageId":2,"name":"Jarní servis kol","subject":"Připrav kolo na jaro","signatureSource":"organization","creatorHasSenderIdentity":true,"sendFromTenantDomainEmailId":4,"replyToTenantDomainEmailId":4,"fromEmail":"servis@example.cz","replyTo":"servis@example.cz","preheaderText":"Objednej se na servis ještě tento měsíc.","html":"<p>Ahoj, jaro je tady. Objednej se na servis.</p>","configuration":[],"placeholders":[],"unresolvedPlaceholders":[],"state":"drafted","conditions":null,"contactScope":"primary","contactOverrides":[],"rejectReason":null,"updatedAt":"2026-11-12T13:05:00Z","createdAt":"2026-11-03T08:30:00Z","deletedAt":null,"blueprint":null,"emailTemplate":null,"topic":null,"language":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Create an email","description":"Creates an email and builds its HTML. When you send `campaignId`, the email joins that campaign. The answer is the new email in the same shape as `emails.show`.\n\nA state other than `drafted` or `rejected` needs `emails.send`.\n\n> [!WARNING]\n> An approved email can go out on its own when a running sequence uses it.\n\nErrors: 403 `insufficient_scope` without `emails.send`, 403 with `campaignId` without `campaigns.write`, 422 when a field is wrong.\n\nNeeds one of these permissions: emails.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v1/emails/{email}":{"get":{"operationId":"emails.show","tags":["emails"],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the email."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateEmailData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Email 731 retrieved successfully","payload":{"id":731,"publication":null,"campaign":null,"userId":88,"tenantId":412,"tenantSequence":19,"emailTemplateId":12,"topicId":null,"languageId":2,"name":"Jarní servis kol","subject":"Připrav kolo na jaro","signatureSource":"organization","creatorHasSenderIdentity":true,"sendFromTenantDomainEmailId":4,"replyToTenantDomainEmailId":4,"fromEmail":"servis@example.cz","replyTo":"servis@example.cz","preheaderText":"Objednej se na servis ještě tento měsíc.","html":"<p>Ahoj, jaro je tady. Objednej se na servis.</p>","configuration":[],"placeholders":[],"unresolvedPlaceholders":[],"state":"drafted","conditions":null,"contactScope":"primary","contactOverrides":[],"rejectReason":null,"updatedAt":"2026-11-12T13:05:00Z","createdAt":"2026-11-03T08:30:00Z","deletedAt":null,"blueprint":null,"emailTemplate":null,"topic":null,"language":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.read"]}],"summary":"Show one email","description":"Returns one email with its content, its sender and the rules for who gets it.\n\nNeeds one of these permissions: emails.read."},"put":{"operationId":"emails.update","tags":["emails"],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the email."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":["string","null"],"enum":["standalone","campaign-broadcast","campaign-sequence",null],"description":"standalone (the default) lets you pick the sender and the people. campaign-broadcast and campaign-sequence leave that to the campaign; then do not send the sender, conditions or contactScope."},"userId":{"type":"integer","description":"The person who owns the email. It must be an active member of your company."},"emailTemplateId":{"type":["integer","null"],"description":"The design the email is built on, yours or one from Fusio. Send null for none; do not leave it out."},"topicId":{"type":["integer","null"],"description":"The number of the topic the email is about."},"languageId":{"type":"integer","description":"The number of the language of the email."},"name":{"type":"string","description":"The name of the email. Only your team sees it."},"subject":{"type":"string","description":"The subject line people see in their inbox."},"sendFromTenantDomainEmailId":{"type":"integer","description":"The address the email comes from, one of the addresses of your domain. Leave it out for your default sender."},"replyToTenantDomainEmailId":{"type":"integer","description":"The address that gets the replies. Leave it out for your default one."},"preheaderText":{"type":["string","null"],"description":"The short text mail apps show after the subject."},"configuration":{"type":"array","items":{},"minItems":1,"description":"The blocks of the email from the email editor. Fusio builds the HTML from them. Pictures may only use files your company can see."},"placeholders":{"type":["array","null"],"items":{},"description":"The placeholders of the text, like the first name, as the email editor saves them."},"state":{"$ref":"#/components/schemas/EmailState","description":"drafted, approved, rejected, scheduled, published or failed. Any state other than drafted or rejected needs emails.send."},"rejectReason":{"type":["string","null"],"description":"Why the email was rejected."},"conditions":{"type":"object","properties":{"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and: a lead must match every rule. or: one rule is enough."},"conditions":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the rule, from 0."},"property":{"$ref":"#/components/schemas/ConditionProperty","description":"What the rule looks at, like stage, tags or custom_field."},"customFieldId":{"type":["integer","null"],"description":"The number of the custom field, when property is custom_field."},"operator":{"$ref":"#/components/schemas/ConditionOperator","description":"How to compare, like equals, in or within_days."},"values":{"type":"array","items":{"type":"string","maxLength":255},"minItems":1,"description":"The values to compare with, at most 50. Write dates as YYYY-MM-DD."}},"required":["position","property","operator","values"]},"description":"The rules at the top level."},"groups":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the group, from 0."},"operator":{"$ref":"#/components/schemas/ConditionGroupOperator","description":"and or or, for the rules in this group."},"conditions":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the rule, from 0."},"property":{"$ref":"#/components/schemas/ConditionProperty","description":"What the rule looks at, like stage, tags or custom_field."},"customFieldId":{"type":["integer","null"],"description":"The number of the custom field, when property is custom_field."},"operator":{"$ref":"#/components/schemas/ConditionOperator","description":"How to compare, like equals, in or within_days."},"values":{"type":"array","items":{"type":"string","maxLength":255},"minItems":1,"description":"The values to compare with, at most 50. Write dates as YYYY-MM-DD."}},"required":["position","property","operator","values"]},"minItems":1,"description":"The rules of the group, at least one."}},"required":["position","operator","conditions"]},"description":"Groups of rules. A group cannot hold more groups."}},"description":"Who gets the email: rules about leads. At least 1 and at most 20 rules in all."},"contactScope":{"$ref":"#/components/schemas/EmailRecipientContactScope","description":"primary sends to the main contact of each lead, all to every contact."},"contactOverrides":{"type":"array","items":{"type":"object","properties":{"contactId":{"type":"integer","description":"The number of the contact."},"isExcluded":{"type":"boolean","description":"true leaves the contact out, false adds it."}},"required":["contactId","isExcluded"]},"maxItems":500,"uniqueItems":true,"description":"Contacts you add or leave out by hand, at most 500."},"id":{"type":"integer","description":"The number of the email. It must be the same as in the address."},"signatureSource":{"type":"string","enum":["organization","user"],"description":"organization uses the signature of your company, user the signature of the owner."}},"required":["userId","emailTemplateId","languageId","name","subject","sendFromTenantDomainEmailId","replyToTenantDomainEmailId","configuration","state","conditions","id"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Change a whole email","description":"Replaces the email. Send every field, not just the changed ones.\n\nChanging an email that is not `drafted` or `rejected` needs `emails.send`, and so does moving it to such a state or changing an email that a running sequence sends on its own. Moving a scheduled email back cancels its publication. When the email belongs to a campaign, a key also needs `campaigns.write`.\n\n> [!WARNING]\n> An approved email can go out on its own when a running sequence uses it.\n\nNeeds one of these permissions: emails.write. Some values also need: emails.send. You must tick these on purpose: emails.send."},"delete":{"operationId":"emails.destroy","tags":["emails"],"parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the email."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["emails.write"]}],"summary":"Delete an email","description":"Moves the email to the trash. When the email belongs to a campaign, a key also needs `campaigns.write`.\n\nError: 422 when a sequence step uses the email; take it out of the sequence first.\n\nNeeds one of these permissions: emails.write."}},"/v1/files/grid":{"get":{"operationId":"files.grid","tags":["files"],"parameters":[{"name":"filter[original]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows only files that were uploaded, not their smaller copies. This is the default. Any other value shows both."},{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[mimeType]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The file type, like image/png."},{"name":"filter[extension]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The file ending, like pdf or png."},{"name":"filter[size]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The file size in bytes. Two numbers as from,to. Leave one side empty for no limit."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[isAiGenerated]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows files made by AI. 0 shows the rest."},{"name":"filter[ids]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Up to 100 IDs, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","size","createdAt","-name","-size","-createdAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexFileData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["files.read"]}],"summary":"List files in a table","description":"Returns one page of files with the filters and the sort you ask for. A key sees only public files.\n\nNeeds one of these permissions: files.read."}},"/v1/files/options":{"get":{"operationId":"files.options","tags":["files"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name. At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[original]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows only files that were uploaded, not their smaller copies. This is the default. Any other value shows both."},{"name":"filter[mimeType]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The file type, like image/png."},{"name":"filter[extension]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The file ending, like pdf or png."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionFileData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["files.read"]}],"summary":"List files for a picker","description":"Returns short items with the number and the name of each file. Use it to fill a picker. A key sees only public files.\n\nNeeds one of these permissions: files.read."}},"/v1/files/extensions":{"get":{"operationId":"files.extensions","tags":["files"],"parameters":[{"name":"sort","in":"query","schema":{"type":["string","null"],"maxLength":200},"description":"Not used: the list is always sorted from A to Z."},{"name":"filter[]","in":"query","schema":{"type":"array","items":{"type":["string","null"],"maxLength":500},"maxItems":20},"description":"Narrow the files: filter[original] looks in the file name, filter[mimeType] picks a type like image/png. Other filters are refused."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/FileExtensionsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["files.read"]}],"summary":"List the file types in use","description":"Returns the file endings your files have. Use it to fill a type filter. A key sees only the types of public files.\n\nNeeds one of these permissions: files.read."}},"/v1/files/from-url":{"post":{"operationId":"files.store-from-url","tags":["files"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"The web address of the picture, http or https, at most 2048 characters."},"alt":{"type":["string","null"],"maxLength":255,"description":"A short text that says what is in the picture, at most 255 characters."}},"required":["url"]},"example":{"url":"https://www.example.cz/obrazky/kolo-v-lese.jpg","alt":"Horské kolo na lesní cestě"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateFileData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"File created successfully.","payload":[{"id":5120,"name":"kolo-v-lese.jpg","alt":"Horské kolo na lesní cestě","slug":"kolo-v-lese","extension":"jpg","mimeType":"image/jpeg","size":348211,"width":1600,"height":900,"ratio":1.78,"path":"tenants/412/files/kolo-v-lese.jpg","url":"https://cdn.example.cz/fusio/files/kolo-v-lese.jpg","hash":"9f2c4e1a7b5d3c8e","isAiGenerated":false,"isImageEdited":false,"isCroppable":true,"createdAt":"2026-11-03T08:30:00Z","usageCount":0,"isInUse":false,"canDelete":true}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["files.write"]}],"summary":"Upload a picture from a web address","description":"Fusio downloads the picture and saves it to your library. It must be jpg, png, gif or webp and at most 2 MB. Addresses inside private networks are refused.\n\nThis address allows 20 requests a minute.\n\nError: 422 when the address is not allowed, cannot be read, or is not a picture.\n\nNeeds one of these permissions: files.write."}},"/v1/files/{file}/download":{"get":{"operationId":"files.download","tags":["files"],"parameters":[{"name":"file","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the file."}],"responses":{"200":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","contentMediaType":"application/octet-stream"}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["files.read"]}],"summary":"Download a file","description":"Returns the content of the file itself, with its own type, not JSON.\n\nError: 404 when the file does not exist, is private or has no content.\n\nNeeds one of these permissions: files.read."}},"/v1/files":{"post":{"operationId":"files.store","tags":["files"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["images"],"description":"Always images for a key."},"images":{"type":"array","items":{"type":"object","properties":{"file":{"type":"string","format":"binary","contentMediaType":"application/octet-stream","description":"The picture: jpg, jpeg, png or gif, at most 2 MB. SVG is refused."},"alt":{"type":["string","null"],"description":"A short text that says what is in the picture."}},"required":["file"]},"minItems":1,"description":"The pictures to upload, at least one."}},"required":["action","images"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateFileData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"File created successfully.","payload":[{"id":5120,"name":"kolo-v-lese.jpg","alt":"Horské kolo na lesní cestě","slug":"kolo-v-lese","extension":"jpg","mimeType":"image/jpeg","size":348211,"width":1600,"height":900,"ratio":1.78,"path":"tenants/412/files/kolo-v-lese.jpg","url":"https://cdn.example.cz/fusio/files/kolo-v-lese.jpg","hash":"9f2c4e1a7b5d3c8e","isAiGenerated":false,"isImageEdited":false,"isCroppable":true,"createdAt":"2026-11-03T08:30:00Z","usageCount":0,"isInUse":false,"canDelete":true}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["files.write"]}],"summary":"Upload pictures","description":"Uploads pictures to your library. Send the request as multipart/form-data, with fields like `images[0][file]` and `images[0][alt]`.\n\nA key may only send `action` images; any other action gives 403 `route_outside_surface`.\n\nErrors: 403, 422 when a picture is too big or not an allowed type.\n\nNeeds one of these permissions: files.write."}},"/v1/files/{file}":{"get":{"operationId":"files.show","tags":["files"],"parameters":[{"name":"file","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the file."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/FileDetailData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"File retrieved successfully.","payload":{"file":{"id":5120,"name":"kolo-v-lese.jpg","alt":"Horské kolo na lesní cestě","slug":"kolo-v-lese","extension":"jpg","mimeType":"image/jpeg","size":348211,"width":1600,"height":900,"ratio":1.78,"path":"tenants/412/files/kolo-v-lese.jpg","url":"https://cdn.example.cz/fusio/files/kolo-v-lese.jpg","hash":"9f2c4e1a7b5d3c8e","isAiGenerated":false,"isImageEdited":false,"isCroppable":true,"createdAt":"2026-11-03T08:30:00Z","usageCount":2,"isInUse":true,"canDelete":false},"usageCount":2,"isInUse":true,"canDelete":false,"canReplace":true,"usage":[{"fileId":5120,"entityType":"article","entityId":1284,"entityName":"Jak vybrat horské kolo","role":"banner"},{"fileId":5120,"entityType":"social_post","entityId":902,"entityName":"Tip na jarní servis","role":"attachment"}],"derivatives":[]}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["files.read"]}],"summary":"Show one file","description":"Returns the file with its details and where it is used.\n\nError: 404 when the file does not exist or is private.\n\nNeeds one of these permissions: files.read."}},"/v1/google-ads-search-geo-targets":{"get":{"operationId":"google-ads-search-geo-targets.index","tags":["google-ads-search"],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":100},"description":"The name of the place to look for, from 2 to 100 characters."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/GoogleGeoTargetData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Find places for targeting","description":"Asks Google for cities, regions and countries whose name fits your text. Put the places you pick into `targeting.geoTargets` or `targeting.excludedGeoTargets` of a campaign. When Google Ads is not connected, you get 409.\n\nThis address allows 60 requests a minute.\n\nNeeds one of these permissions: ads.read."}},"/v1/google-ads-search-campaigns":{"get":{"operationId":"google-ads-search-campaigns.index","tags":["google-ads-search"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchTreeData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List Google Ads search campaigns","description":"Returns everything about your Google Ads search campaigns at once: your settings and budget, all campaigns with their ad groups, keywords and ads, the keywords your SEO audit recommends, and the job that runs now.\n\nThis route takes no filters.\n\nNeeds one of these permissions: ads.read."},"post":{"operationId":"google-ads-search-campaigns.store","tags":["google-ads-search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name of the campaign, at most 255 characters. No other campaign may have it. Leave it out and Fusio makes one from the kind and the places."},"campaignKind":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignKind","description":"brand (people search for your name), non_brand (they search for what you sell) or competitor (they search for a competitor)."},"competitorId":{"type":["integer","null"],"description":"The number of the competitor. Send it only when campaignKind is competitor; then you must."},"conversionGoalMode":{"$ref":"#/components/schemas/GoogleAdsSearchConversionGoalMode","description":"What Google counts as success: account (the goals of your Google Ads account) or own (your Fusio events from ownTrackingEventIds)."},"ownTrackingEventIds":{"type":"array","items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"The numbers of your Fusio events that count as success, at most 20, each once. Send an empty list for none."},"budgetAllocationMode":{"$ref":"#/components/schemas/GoogleAdsSearchBudgetAllocationMode","description":"auto (Fusio splits your monthly Google Search budget between campaigns) or manual (you set monthlyBudgetAmount)."},"monthlyBudgetAmount":{"type":["number","null"],"minimum":0,"maximum":9999999999999.99,"description":"How much the campaign may spend in a month, like 15000.00, with at most 2 decimals. Send it only when budgetAllocationMode is manual; then you must."},"biddingStrategy":{"$ref":"#/components/schemas/GoogleAdsSearchBiddingStrategy","description":"How Google bids for clicks: manual_cpc (you set the most for a click), maximize_clicks, maximize_conversions or target_cpa."},"bidLimitAmount":{"type":["number","null"],"minimum":0.01,"maximum":100000,"description":"The most Google may pay for one click, from 0.01 to 100000, with at most 2 decimals. Leave it out for no limit."},"startsOn":{"type":["string","null"],"format":"date","description":"The first day the ads may show, as YYYY-MM-DD, today or later. Leave it out to start right away."},"endsOn":{"type":["string","null"],"format":"date","description":"The last day the ads may show, as YYYY-MM-DD, today or later and not before startsOn. Leave it out to run with no end."},"adSchedule":{"$ref":"#/components/schemas/GoogleAdsSearchAdSchedule","description":"When the ads show: always or business_hours (only in your opening hours)."},"targetsSearchPartners":{"type":"boolean","description":"true to show the ads also on sites that work with Google Search."},"trackingUrlTemplate":{"type":["string","null"],"maxLength":2048,"description":"A Google Ads tracking template for the links, at most 2048 characters. Leave it out for none."},"businessName":{"type":["string","null"],"maxLength":25,"description":"Your company name shown in the ads, at most 25 characters."},"businessLogoFileId":{"type":["integer","null"],"description":"The number of your square logo in Files. Leave it out for none."},"businessLandscapeLogoFileId":{"type":["integer","null"],"description":"The number of your wide logo in Files. Leave it out for none."},"callPhoneNumber":{"type":["string","null"],"description":"A phone number people can call from the ad, in international form like +420 123 456 789, or a Czech number."},"imageFileIds":{"type":"array","items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"The numbers of images in Files to show with the ads, at most 20, each once."},"targeting":{"type":"object","properties":{"schemaVersion":{"type":"integer","enum":["1"],"description":"The version of this shape. Send 1 or leave it out."},"scope":{"$ref":"#/components/schemas/GoogleAdsSearchTargetingScope","description":"countries (whole countries from countryCodes), global (the whole world) or locations (the places from geoTargets)."},"countryCodes":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"},"maxItems":10,"uniqueItems":true,"description":"The countries, each as two capital letters like CZ, at most 10. Send an empty list when you do not pick countries."},"geoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads show, at most 10. Find them with `google-ads-search-geo-targets.index`. Needed when scope is locations, and only then."},"excludedGeoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads must not show, at most 10. A place cannot be in both lists."},"locationMatching":{"type":"string","enum":["presence","presence_or_interest"],"description":"presence (people who are in the place) or presence_or_interest (also people who look for the place). Leave it out for presence_or_interest."},"languageCode":{"type":"string","pattern":"^[a-z]{2,3}$","description":"The language of the people, as 2 or 3 small letters like cs."}},"required":["scope","countryCodes","languageCode"],"description":"Where the ads show and in what language."},"adGroup":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name of the ad group, at most 255 characters. Leave it out to use the campaign name."},"landingPageDecision":{"type":"string","enum":["homepage","existing_page","new_landing_page"],"description":"Where the ad leads: homepage, existing_page (a page you have) or new_landing_page (a page you still need to make)."},"destinationUrl":{"type":["string","null"],"maxLength":2048,"description":"The page of your website the ad leads to, at most 2048 characters."},"mobileFinalUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"Another address for phones, starting with https://, at most 2048 characters. Leave it out to use destinationUrl."},"landingPageBrief":{"type":["string","null"],"maxLength":4000,"description":"What the new landing page should say, at most 4000 characters. Use it with new_landing_page."},"keywords":{"type":"array","items":{"type":"object","properties":{"keyword":{"type":["string","null"],"maxLength":80,"description":"The keyword, at most 80 characters."},"matchType":{"type":"string","enum":["exact","phrase"],"description":"exact (only this search) or phrase (searches that hold these words in this order)."}},"required":["matchType"]},"maxItems":200,"description":"The keywords people search for, at most 200."},"negativeKeywords":{"type":"array","items":{"type":"object","properties":{"keyword":{"type":["string","null"],"maxLength":80,"description":"The negative keyword, at most 80 characters."},"matchType":{"$ref":"#/components/schemas/GoogleAdsSearchKeywordMatchType","description":"exact, phrase or broad (any search with these words, in any order)."}},"required":["matchType"]},"maxItems":200,"description":"Keywords for which the ads must not show, at most 200."},"searchAd":{"type":["object","null"],"properties":{"headlines":{"type":"array","items":{"type":["string","null"],"maxLength":30},"maxItems":15,"description":"Headlines of the ad, at most 15, each at most 30 characters."},"descriptions":{"type":"array","items":{"type":["string","null"],"maxLength":90},"maxItems":4,"description":"Descriptions of the ad, at most 4, each at most 90 characters."},"path1":{"type":["string","null"],"maxLength":15,"description":"The first word of the path shown after your domain in the ad, at most 15 characters."},"path2":{"type":["string","null"],"maxLength":15,"description":"The second word of that path, at most 15 characters."},"sitelinks":{"type":"array","items":{"type":"object","properties":{"text":{"type":["string","null"],"maxLength":25,"description":"The text of the link, at most 25 characters."},"description1":{"type":["string","null"],"maxLength":35,"description":"The first line under the link, at most 35 characters."},"description2":{"type":["string","null"],"maxLength":35,"description":"The second line under the link, at most 35 characters."},"finalUrl":{"type":["string","null"],"maxLength":2048,"description":"The page of your website the link leads to, at most 2048 characters."}}},"maxItems":6,"description":"Extra links under the ad, at most 6."},"callouts":{"type":"array","items":{"type":["string","null"],"maxLength":25},"maxItems":10,"description":"Short extra texts under the ad, at most 10, each at most 25 characters."},"headlinePins":{"type":"array","items":{"type":["integer","null"],"minimum":1,"maximum":3},"maxItems":15,"description":"Where each headline must stay: one entry for each headline, in the same order. 1, 2 or 3 pins it to that place; null lets Google choose."},"descriptionPins":{"type":"array","items":{"type":["integer","null"],"minimum":1,"maximum":2},"maxItems":4,"description":"Where each description must stay: one entry for each description, in the same order. 1 or 2 pins it to that place; null lets Google choose."},"snippetHeader":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchSnippetHeader"},{"type":"null"}],"description":"The heading of a list of things you offer. One of: brands, amenities, styles, types, destinations, services, courses, neighborhoods, shows, insurance_coverage, degree_programs, featured_hotels, models. null for no list."},"snippets":{"type":"array","items":{"type":"string","maxLength":25},"maxItems":10,"description":"The items of that list, at most 10, each at most 25 characters. Needed when you send snippetHeader."}},"description":"The texts of the search ad. Leave it out when you write them later."}},"required":["landingPageDecision","keywords","negativeKeywords"],"description":"The one ad group of the campaign: its landing page, keywords and ad."}},"required":["campaignKind","conversionGoalMode","ownTrackingEventIds","budgetAllocationMode","biddingStrategy","adSchedule","targetsSearchPartners","targeting","adGroup"]},"example":{"name":"Servis kol Brno","campaignKind":"non_brand","conversionGoalMode":"account","ownTrackingEventIds":[],"budgetAllocationMode":"auto","biddingStrategy":"maximize_clicks","adSchedule":"always","targetsSearchPartners":false,"targeting":{"scope":"countries","countryCodes":["CZ"],"languageCode":"cs"},"adGroup":{"name":"Servis kol","landingPageDecision":"existing_page","destinationUrl":"https://www.example.cz/servis","keywords":[{"keyword":"servis kol brno","matchType":"phrase"},{"keyword":"oprava kola","matchType":"phrase"}],"negativeKeywords":[{"keyword":"zdarma","matchType":"broad"}]}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Request processed successfully","payload":{"id":96,"sourceSeoAuditId":null,"name":"Servis kol Brno","utmSlug":"servis-kol-brno","campaignKind":"non_brand","origin":"manual","status":"draft","isDetachedFromAccount":false,"adAccountId":31,"adAccountName":"Cyklo Novák","viability":"recommended","monthlyBudgetAmount":"6000.00","budgetCurrencyCode":"CZK","budgetAllocationMode":"auto","biddingStrategy":"maximize_clicks","bidLimitAmount":null,"startsOn":null,"endsOn":null,"adSchedule":"always","targetsSearchPartners":false,"trackingUrlTemplate":null,"businessName":null,"businessLogo":null,"businessLandscapeLogo":null,"callPhoneNumber":null,"images":[],"skippedOptionalAssets":[],"createOnlySettingsLocked":false,"targeting":{"schemaVersion":1,"scope":"countries","countryCodes":["CZ"],"languageCode":"cs","geoTargets":[],"excludedGeoTargets":[],"locationMatching":"presence"},"targetingResearchCurrent":true,"rationale":null,"googleFinalUrlSuffix":"utm_source=google&utm_medium=cpc&utm_campaign=servis-kol-brno","googleUrlSuffixState":"pending","googleUrlSuffixError":null,"usesOwnConversionGoals":false,"generationStage":null,"generationBrief":null,"generationError":null,"competitorId":null,"conversionGoalMode":"account","ownTrackingEventIds":[],"conversionGoalReason":null,"adScheduleReason":null,"isAiGenerated":false,"adGroups":[{"id":210,"googleAdsSearchCampaignId":96,"name":"Servis kol","description":null,"searchIntent":null,"status":"draft","priorityScore":null,"rationale":null,"researchQuality":null,"researchQualityReason":null,"researchDiagnostics":null,"landingPageDecision":"existing_page","destinationUrl":"https://www.example.cz/servis","mobileFinalUrl":null,"verifiedUrls":["https://www.example.cz/servis"],"searchAd":null,"searchAdGenerationStatus":"idle","searchAdGenerationError":null,"searchAdGeneratedAt":null,"landingPageFitScore":null,"landingPageReason":null,"landingPageBrief":null,"forecastImpressions":null,"forecastClicks":null,"forecastCost":null,"forecastAverageCpc":null,"forecastedAt":null,"sortOrder":0,"updatedAt":"2026-11-03T08:30:00Z","revision":"1","keywords":[],"excludedSearchAdTexts":{"headlines":[],"descriptions":[],"sitelinks":[],"callouts":[]}}],"latestDeployment":null,"approvalBlockers":["search_ad_missing"],"issue":null,"tenantSequence":12,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Make a Google Ads search campaign","description":"Makes a draft search campaign with one ad group from what you send and answers 201. Nothing goes to Google Ads yet.\n\nYou may leave the ad texts for later and write them with `google-ads-search-ad-groups.search-ad.generate`. When the budget does not fit into your monthly Google Search budget, you get 422. Then approve the campaign with `google-ads-search-campaigns.approve`.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search/overview":{"get":{"operationId":"google-ads-search.overview","tags":["google-ads-search"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[campaignId]","in":"query","schema":{"type":["integer","null"]},"description":"Only this campaign of yours. Leave it out for all."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Show the Google Ads search overview","description":"Returns how your search campaigns did in a range of days: impressions, clicks and spend from Google Ads, and the visits, leads and clients Fusio saw from them.\n\nThis address allows 120 requests a minute.\n\nNeeds one of these permissions: ads.read."}},"/v1/google-ads-search-campaigns/{campaign}":{"put":{"operationId":"google-ads-search-campaigns.update","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the campaign, at most 255 characters. No other campaign may have it. Leave it out to keep it."},"campaignKind":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignKind","description":"brand, non_brand or competitor. Leave it out to keep it."},"viability":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignViability","description":"How much people search for it: recommended, limited or insufficient_demand. Leave it out to keep it."},"monthlyBudgetAmount":{"type":"number","minimum":0,"maximum":9999999999999.99,"description":"How much the campaign may spend in a month, with at most 2 decimals. When you send it, the budget becomes manual. Leave it out to keep it."},"budgetAllocationMode":{"$ref":"#/components/schemas/GoogleAdsSearchBudgetAllocationMode","description":"auto (Fusio splits the budget) or manual (you do). Leave it out to keep it."},"rationale":{"type":["string","null"],"maxLength":65535,"description":"Why the campaign exists, at most 65535 characters. Leave it out to keep it."},"sourceSeoAuditId":{"type":["integer","null"],"description":"The number of the SEO audit the campaign came from, or null. Leave it out to keep it."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Change a Google Ads search campaign","description":"Changes the basic data of a draft campaign and returns it. A change of the budget splits your monthly budget between campaigns again. Only a draft can change; otherwise you get 403.\n\nNeeds one of these permissions: ads.write."},"delete":{"operationId":"google-ads-search-campaigns.destroy","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Remove a Google Ads search campaign","description":"> [!WARNING]\n> This cannot be undone.\n\nRemoves a draft campaign with its ad group and keywords, and splits your monthly budget between the other campaigns again. Only a draft can go; otherwise you get 403.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-campaigns/{campaign}/draft":{"put":{"operationId":"google-ads-search-campaigns.draft.update","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name of the campaign, at most 255 characters. No other campaign may have it. Leave it out and Fusio makes one from the kind and the places."},"campaignKind":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignKind","description":"brand (people search for your name), non_brand (they search for what you sell) or competitor (they search for a competitor)."},"competitorId":{"type":["integer","null"],"description":"The number of the competitor. Send it only when campaignKind is competitor; then you must."},"conversionGoalMode":{"$ref":"#/components/schemas/GoogleAdsSearchConversionGoalMode","description":"What Google counts as success: account (the goals of your Google Ads account) or own (your Fusio events from ownTrackingEventIds)."},"ownTrackingEventIds":{"type":"array","items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"The numbers of your Fusio events that count as success, at most 20, each once. Send an empty list for none."},"budgetAllocationMode":{"$ref":"#/components/schemas/GoogleAdsSearchBudgetAllocationMode","description":"auto (Fusio splits your monthly Google Search budget between campaigns) or manual (you set monthlyBudgetAmount)."},"monthlyBudgetAmount":{"type":["number","null"],"minimum":0,"maximum":9999999999999.99,"description":"How much the campaign may spend in a month, like 15000.00, with at most 2 decimals. Send it only when budgetAllocationMode is manual; then you must."},"biddingStrategy":{"$ref":"#/components/schemas/GoogleAdsSearchBiddingStrategy","description":"How Google bids for clicks: manual_cpc (you set the most for a click), maximize_clicks, maximize_conversions or target_cpa."},"bidLimitAmount":{"type":["number","null"],"minimum":0.01,"maximum":100000,"description":"The most Google may pay for one click, from 0.01 to 100000, with at most 2 decimals. Leave it out for no limit."},"startsOn":{"type":["string","null"],"format":"date","description":"The first day the ads may show, as YYYY-MM-DD, today or later. Leave it out to start right away."},"endsOn":{"type":["string","null"],"format":"date","description":"The last day the ads may show, as YYYY-MM-DD, today or later and not before startsOn. Leave it out to run with no end."},"adSchedule":{"$ref":"#/components/schemas/GoogleAdsSearchAdSchedule","description":"When the ads show: always or business_hours (only in your opening hours)."},"targetsSearchPartners":{"type":"boolean","description":"true to show the ads also on sites that work with Google Search."},"trackingUrlTemplate":{"type":["string","null"],"maxLength":2048,"description":"A Google Ads tracking template for the links, at most 2048 characters. Leave it out for none."},"businessName":{"type":["string","null"],"maxLength":25,"description":"Your company name shown in the ads, at most 25 characters."},"businessLogoFileId":{"type":["integer","null"],"description":"The number of your square logo in Files. Leave it out for none."},"businessLandscapeLogoFileId":{"type":["integer","null"],"description":"The number of your wide logo in Files. Leave it out for none."},"callPhoneNumber":{"type":["string","null"],"description":"A phone number people can call from the ad, in international form like +420 123 456 789, or a Czech number."},"imageFileIds":{"type":"array","items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"The numbers of images in Files to show with the ads, at most 20, each once."},"targeting":{"type":"object","properties":{"schemaVersion":{"type":"integer","enum":["1"],"description":"The version of this shape. Send 1 or leave it out."},"scope":{"$ref":"#/components/schemas/GoogleAdsSearchTargetingScope","description":"countries (whole countries from countryCodes), global (the whole world) or locations (the places from geoTargets)."},"countryCodes":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"},"maxItems":10,"uniqueItems":true,"description":"The countries, each as two capital letters like CZ, at most 10. Send an empty list when you do not pick countries."},"geoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads show, at most 10. Find them with `google-ads-search-geo-targets.index`. Needed when scope is locations, and only then."},"excludedGeoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads must not show, at most 10. A place cannot be in both lists."},"locationMatching":{"type":"string","enum":["presence","presence_or_interest"],"description":"presence (people who are in the place) or presence_or_interest (also people who look for the place). Leave it out for presence_or_interest."},"languageCode":{"type":"string","pattern":"^[a-z]{2,3}$","description":"The language of the people, as 2 or 3 small letters like cs."}},"required":["scope","countryCodes","languageCode"],"description":"Where the ads show and in what language."},"adGroup":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name of the ad group, at most 255 characters. Leave it out to use the campaign name."},"landingPageDecision":{"type":"string","enum":["homepage","existing_page","new_landing_page"],"description":"Where the ad leads: homepage, existing_page (a page you have) or new_landing_page (a page you still need to make)."},"destinationUrl":{"type":["string","null"],"maxLength":2048,"description":"The page of your website the ad leads to, at most 2048 characters."},"mobileFinalUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"Another address for phones, starting with https://, at most 2048 characters. Leave it out to use destinationUrl."},"landingPageBrief":{"type":["string","null"],"maxLength":4000,"description":"What the new landing page should say, at most 4000 characters. Use it with new_landing_page."},"keywords":{"type":"array","items":{"type":"object","properties":{"keyword":{"type":["string","null"],"maxLength":80,"description":"The keyword, at most 80 characters."},"matchType":{"type":"string","enum":["exact","phrase"],"description":"exact (only this search) or phrase (searches that hold these words in this order)."}},"required":["matchType"]},"maxItems":200,"description":"The keywords people search for, at most 200."},"negativeKeywords":{"type":"array","items":{"type":"object","properties":{"keyword":{"type":["string","null"],"maxLength":80,"description":"The negative keyword, at most 80 characters."},"matchType":{"$ref":"#/components/schemas/GoogleAdsSearchKeywordMatchType","description":"exact, phrase or broad (any search with these words, in any order)."}},"required":["matchType"]},"maxItems":200,"description":"Keywords for which the ads must not show, at most 200."},"searchAd":{"type":["object","null"],"properties":{"headlines":{"type":"array","items":{"type":["string","null"],"maxLength":30},"maxItems":15,"description":"Headlines of the ad, at most 15, each at most 30 characters."},"descriptions":{"type":"array","items":{"type":["string","null"],"maxLength":90},"maxItems":4,"description":"Descriptions of the ad, at most 4, each at most 90 characters."},"path1":{"type":["string","null"],"maxLength":15,"description":"The first word of the path shown after your domain in the ad, at most 15 characters."},"path2":{"type":["string","null"],"maxLength":15,"description":"The second word of that path, at most 15 characters."},"sitelinks":{"type":"array","items":{"type":"object","properties":{"text":{"type":["string","null"],"maxLength":25,"description":"The text of the link, at most 25 characters."},"description1":{"type":["string","null"],"maxLength":35,"description":"The first line under the link, at most 35 characters."},"description2":{"type":["string","null"],"maxLength":35,"description":"The second line under the link, at most 35 characters."},"finalUrl":{"type":["string","null"],"maxLength":2048,"description":"The page of your website the link leads to, at most 2048 characters."}}},"maxItems":6,"description":"Extra links under the ad, at most 6."},"callouts":{"type":"array","items":{"type":["string","null"],"maxLength":25},"maxItems":10,"description":"Short extra texts under the ad, at most 10, each at most 25 characters."},"headlinePins":{"type":"array","items":{"type":["integer","null"],"minimum":1,"maximum":3},"maxItems":15,"description":"Where each headline must stay: one entry for each headline, in the same order. 1, 2 or 3 pins it to that place; null lets Google choose."},"descriptionPins":{"type":"array","items":{"type":["integer","null"],"minimum":1,"maximum":2},"maxItems":4,"description":"Where each description must stay: one entry for each description, in the same order. 1 or 2 pins it to that place; null lets Google choose."},"snippetHeader":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchSnippetHeader"},{"type":"null"}],"description":"The heading of a list of things you offer. One of: brands, amenities, styles, types, destinations, services, courses, neighborhoods, shows, insurance_coverage, degree_programs, featured_hotels, models. null for no list."},"snippets":{"type":"array","items":{"type":"string","maxLength":25},"maxItems":10,"description":"The items of that list, at most 10, each at most 25 characters. Needed when you send snippetHeader."}},"description":"The texts of the search ad. Leave it out when you write them later."}},"required":["landingPageDecision","keywords","negativeKeywords"],"description":"The one ad group of the campaign: its landing page, keywords and ad."}},"required":["campaignKind","conversionGoalMode","ownTrackingEventIds","budgetAllocationMode","biddingStrategy","adSchedule","targetsSearchPartners","targeting","adGroup"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google"],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Save a whole campaign draft","description":"> [!WARNING]\n> When you pick own Fusio events that already send results to Google Ads, this starts sending them again. Then a key needs `ads.execute.google`.\n\nSaves the whole plan of a campaign at once, the same fields as `google-ads-search-campaigns.store`, and returns it.\n\nYou get 409 while AI still builds the campaign or writes its ad, and when the campaign has more than one ad group. Some settings go to Google Ads only when the campaign is made there; after that, changing them gets 422.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/google-ads-search-campaigns/{campaign}/targeting":{"put":{"operationId":"google-ads-search-campaigns.targeting.update","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targeting":{"type":"object","properties":{"schemaVersion":{"type":"integer","enum":["1"],"description":"The version of this shape. Send 1."},"scope":{"$ref":"#/components/schemas/GoogleAdsSearchTargetingScope","description":"countries (whole countries from countryCodes), global (the whole world) or locations (the places from geoTargets)."},"countryCodes":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"},"maxItems":10,"uniqueItems":true,"description":"The countries, each as two capital letters like CZ, at most 10. Send an empty list when you do not pick countries."},"geoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads show, at most 10. Find them with `google-ads-search-geo-targets.index`. Needed when scope is locations, and only then."},"excludedGeoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads must not show, at most 10. A place cannot be in both lists."},"locationMatching":{"type":"string","enum":["presence","presence_or_interest"],"description":"presence (people who are in the place) or presence_or_interest (also people who look for the place). Leave it out for presence_or_interest."},"languageCode":{"type":"string","pattern":"^[a-z]{2,3}$","description":"The language of the people, as 2 or 3 small letters like cs."}},"required":["schemaVersion","scope","countryCodes","languageCode"],"description":"Where the ads show and in what language."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["targeting"]}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchOperationData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Change where a campaign shows","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nSaves new places and language for a draft campaign and starts a job in the background. In it, AI researches the keywords again for the new places. The answer is 202 with the job; follow it with `google-ads-search-operations.show`.\n\nYou get 409 when you must connect Google Ads again or another job already runs, and 422 when Google Ads is not fully connected or the campaign cannot change its places now.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/google-ads-search-campaigns/{campaign}/assets":{"put":{"operationId":"google-ads-search-campaigns.assets.update","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"businessName":{"type":["string","null"],"maxLength":25,"description":"Your company name shown in the ads, at most 25 characters. null removes it."},"businessLogoFileId":{"type":["integer","null"],"description":"The number of your square logo in Files. null removes it."},"businessLandscapeLogoFileId":{"type":["integer","null"],"description":"The number of your wide logo in Files. null removes it."},"callPhoneNumber":{"type":["string","null"],"description":"A phone number people can call from the ad, in international form or as a Czech number. null removes it."},"imageFileIds":{"type":"array","items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"The numbers of images in Files to show with the ads, at most 20, each once. This list replaces the old one; send an empty list for none."},"expectedUpdatedAt":{"type":"string","maxLength":64,"description":"The `updatedAt` of the campaign you read before. When someone changed the campaign since, nothing is saved and you get 409."}},"required":["imageFileIds","expectedUpdatedAt"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google"],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Change the extras of a campaign","description":"> [!WARNING]\n> On a campaign that is not a draft, this changes the live campaign in Google Ads. Then a key needs `ads.execute.google`.\n\nSaves the company name, logos, phone number and images shown with the ads, and returns the campaign.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/google-ads-search-campaigns/{campaign}/approve":{"post":{"operationId":"google-ads-search-campaigns.approve","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.google"]}],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Approve a Google Ads search campaign","description":"> [!WARNING]\n> This makes the campaign ready to go to Google Ads. For that a key needs `ads.execute.google`.\n\nApproves a draft campaign and returns it. Then send it with `google-ads-search-campaigns.google-ads.deploy`.\n\nWhen something must be fixed first, you get 422 with the list in `payload.blockers`. Only a draft can be approved; otherwise you get 403.\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.google. You must tick these on purpose: ads.execute.google."},"delete":{"operationId":"google-ads-search-campaigns.unapprove","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Return a campaign to draft","description":"Turns an approved campaign back into a draft, so you can change it, and returns it. Only an approved campaign can go back; otherwise you get 403. When the campaign runs in Google Ads, pause it first; otherwise you get 422. You also get 422 while another change is being sent to Google Ads; wait a moment and try again.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-campaigns/{campaign}/google-ads/preflight":{"get":{"operationId":"google-ads-search-campaigns.google-ads.preflight","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsDeploymentPreflightData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Check a campaign before sending","description":"Tells you if the campaign can go to Google Ads now, what stops it, and what it would spend in a day. Nothing is sent. Take `planRevision` from here and send it to `google-ads-search-campaigns.google-ads.deploy`.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-campaigns/{campaign}/google-ads/deploy":{"post":{"operationId":"google-ads-search-campaigns.google-ads.deploy","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planRevision":{"type":"string","pattern":"^[a-f0-9]{64}$","minLength":64,"maxLength":64,"description":"The `planRevision` from `google-ads-search-campaigns.google-ads.preflight`: 64 small letters and digits. When the plan changed since, you get 422."},"idempotencyKey":{"type":"string","format":"uuid","description":"A UUID you make for this sending. Send the same one when you try again, so the campaign is not made twice."}},"required":["planRevision","idempotencyKey"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdDeploymentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.google"]}],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Send a campaign to Google Ads","description":"> [!WARNING]\n> This makes the campaign in your Google Ads account. For that a key needs `ads.execute.google`.\n\nSends an approved campaign to Google Ads and returns the deployment. The campaign arrives paused, so nothing is spent until you start it with `ad-deployments.google-ads.status`.\n\nThe same `idempotencyKey` returns the same deployment. The same key with another plan gets 409. You get 422 when the campaign is not ready, and 409 when you must connect Google Ads again. A campaign that stops being approved just before it is sent gets 422 on `deployment`.\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/google-ads-search-campaigns/{campaign}/conversion-goal-mode":{"put":{"operationId":"google-ads-search-campaigns.conversion-goal-mode.update","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/GoogleAdsSearchConversionGoalMode","description":"account (the goals of your Google Ads account) or own (your own Fusio events)."}},"required":["mode"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignConversionGoalModeData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google"],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Pick what counts as success","description":"> [!WARNING]\n> On a campaign that is not a draft, this changes the live campaign in Google Ads. Then a key needs `ads.execute.google`.\n\nSets which results Google counts as success for the campaign.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/google-ads-search-campaigns/reforecast":{"post":{"operationId":"google-ads-search-campaigns.reforecast","tags":["google-ads-search"],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchOperationData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Forecast all campaigns again","description":"Starts a job in the background that asks Google again how many impressions, clicks and costs your campaigns may get. The answer is 202 with the job; follow it with `google-ads-search-operations.show`.\n\nYou get 422 when Google Ads cannot forecast yet, like when its account is not set up for it, and 409 when you must connect Google Ads again or another job already runs.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-campaigns/brief-picks":{"post":{"operationId":"google-ads-search-campaigns.brief-picks","tags":["google-ads-search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignKind":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignKind","description":"brand, non_brand or competitor."},"brief":{"type":"string","minLength":20,"maxLength":4000,"description":"What the campaign should be about, from 20 to 4000 characters."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["campaignKind","brief"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchBriefPicksOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI pick a page and goal","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nReads your brief and picks with AI the best landing page from your website and what should count as success. Nothing is saved; use the picks when you call `google-ads-search-campaigns.generate`.\n\nYou get 402 when you do not have enough credits.\n\nThis address allows 10 requests a minute.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/google-ads-search-campaigns/generate":{"post":{"operationId":"google-ads-search-campaigns.generate","tags":["google-ads-search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignKind":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignKind","description":"brand, non_brand or competitor."},"competitorId":{"type":["integer","null"],"description":"The number of the competitor. Send it only when campaignKind is competitor; then you must."},"brief":{"type":"string","minLength":20,"maxLength":4000,"description":"What the campaign should be about, from 20 to 4000 characters."},"landingPageUrl":{"type":["string","null"],"maxLength":2048,"description":"The page of your website the ads should lead to, at most 2048 characters. Leave it out and AI picks one."},"conversionGoalMode":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchConversionGoalMode"},{"type":"null"}],"description":"account or own. Leave it out and AI picks."},"ownTrackingEventIds":{"type":"array","items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"The numbers of your Fusio events that count as success, at most 20, each once. Needed when conversionGoalMode is own."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["campaignKind","brief"]}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdCampaignGenerationOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI build a campaign","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nMakes a draft campaign and lets AI build it in the background: it researches keywords, picks the landing page, sets the budget and writes the ad. The answer is 202 with the campaign and the job; follow the job with `google-ads-search-operations.show`.\n\nYou get 422 when you have no monthly Google Search budget yet or Google Ads is not fully connected, and 409 when you must connect Google Ads again or another job already runs.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/google-ads-search-campaigns/{campaign}/generate/retry":{"post":{"operationId":"google-ads-search-campaigns.generate.retry","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdCampaignGenerationOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI try a failed campaign again","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nStarts the AI building of a campaign again after it failed. The answer is 202 with the campaign and the new job. When the building did not fail, when you must connect Google Ads again, or when another job already runs, you get 409. You get 422 for the same reasons as with `google-ads-search-campaigns.generate`.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/google-ads-search-campaigns/bulk-delete":{"post":{"operationId":"google-ads-search-campaigns.bulk-delete","tags":["google-ads-search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignIds":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":100,"uniqueItems":true,"description":"The numbers of the campaigns to remove, from 1 to 100, each once."}},"required":["campaignIds"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Remove many campaigns at once","description":"> [!WARNING]\n> This cannot be undone.\n\nRemoves draft campaigns with their ad groups and keywords. All of them must be drafts; when one is not, nothing is removed and you get 403.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-campaigns/{campaign}/duplicate":{"post":{"operationId":"google-ads-search-campaigns.duplicate","tags":["google-ads-search"],"parameters":[{"name":"campaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the copy, at most 255 characters. No other campaign may have it."}},"required":["name"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Copy a Google Ads search campaign","description":"Makes a draft copy of a campaign with its ad groups, keywords and ads, and answers 201 with the copy. Nothing goes to Google Ads.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-landing-pages":{"get":{"operationId":"google-ads-search-landing-pages.index","tags":["google-ads-search"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchLandingPageOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List pages ads may lead to","description":"Returns the pages of your website that ads may lead to. They come from your verified domain and website analysis.\n\nNeeds one of these permissions: ads.read."}},"/v1/google-ads-search-landing-pages/check":{"post":{"operationId":"google-ads-search-landing-pages.check","tags":["google-ads-search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"description":"The address of the page, at most 2048 characters."}},"required":["url"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchLandingPageCheckOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Check a landing page","description":"Opens the page and tells you if an ad may lead there. The page must be on your website and must work.\n\nThis address allows 30 requests a minute.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-keyword-metrics":{"post":{"operationId":"google-ads-search-keyword-metrics.store","tags":["google-ads-search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"integer","description":"The number of the campaign the keywords are for."},"keywords":{"type":"array","items":{"type":"string","maxLength":80},"minItems":1,"maxItems":50,"description":"The keywords, from 1 to 50, each at most 80 characters."},"targeting":{"type":"object","properties":{"schemaVersion":{"type":"integer","enum":["1"],"description":"The version of this shape. Send 1 or leave it out."},"scope":{"$ref":"#/components/schemas/GoogleAdsSearchTargetingScope","description":"countries (whole countries from countryCodes), global (the whole world) or locations (the places from geoTargets)."},"countryCodes":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"},"maxItems":10,"uniqueItems":true,"description":"The countries, each as two capital letters like CZ, at most 10. Send an empty list when you do not pick countries."},"geoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads show, at most 10. Find them with `google-ads-search-geo-targets.index`. Needed when scope is locations, and only then."},"excludedGeoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads must not show, at most 10. A place cannot be in both lists."},"locationMatching":{"type":"string","enum":["presence","presence_or_interest"],"description":"presence (people who are in the place) or presence_or_interest (also people who look for the place). Leave it out for presence_or_interest."},"languageCode":{"type":"string","pattern":"^[a-z]{2,3}$","description":"The language of the people, as 2 or 3 small letters like cs."}},"required":["scope","countryCodes","languageCode"],"description":"Where the ads show and in what language."}},"required":["campaignId","keywords","targeting"]},"example":{"campaignId":96,"keywords":["servis kol brno","oprava kola"],"targeting":{"scope":"countries","countryCodes":["CZ"],"languageCode":"cs"}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchKeywordMetricOutputData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"Request processed successfully","payload":[{"keyword":"servis kol brno","avgMonthlySearches":390,"cpcLow":4.2,"cpcHigh":11.8,"competition":38},{"keyword":"oprava kola","avgMonthlySearches":1300,"cpcLow":3.1,"cpcHigh":9.4,"competition":45}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Show search numbers for keywords","description":"Asks Google how many people search for these keywords in the places you send, and what a click costs. Nothing is saved. When Google Ads is not connected, you get 409 or 422.\n\nThis address allows 30 requests a minute.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-forecast-previews":{"post":{"operationId":"google-ads-search-forecast-previews.store","tags":["google-ads-search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"integer","description":"The number of the campaign the forecast is for."},"monthlyBudgetAmount":{"type":"number","minimum":0,"maximum":9999999999999.99,"description":"The monthly budget to test, with at most 2 decimals."},"biddingStrategy":{"$ref":"#/components/schemas/GoogleAdsSearchBiddingStrategy","description":"manual_cpc, maximize_clicks, maximize_conversions or target_cpa."},"bidLimitAmount":{"type":["number","null"],"minimum":0.01,"maximum":100000,"description":"The most Google may pay for one click, from 0.01 to 100000. Leave it out for no limit."},"startsOn":{"type":["string","null"],"format":"date","description":"The first day, as YYYY-MM-DD, today or later. Leave it out for today."},"keywords":{"type":"array","items":{"type":"object","properties":{"keyword":{"type":"string","maxLength":80,"description":"The keyword, at most 80 characters."},"matchType":{"type":"string","enum":["exact","phrase"],"description":"exact or phrase."}},"required":["keyword","matchType"]},"maxItems":200,"description":"The keywords to test, at most 200."},"targeting":{"type":"object","properties":{"schemaVersion":{"type":"integer","enum":["1"],"description":"The version of this shape. Send 1 or leave it out."},"scope":{"$ref":"#/components/schemas/GoogleAdsSearchTargetingScope","description":"countries (whole countries from countryCodes), global (the whole world) or locations (the places from geoTargets)."},"countryCodes":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"},"maxItems":10,"uniqueItems":true,"description":"The countries, each as two capital letters like CZ, at most 10. Send an empty list when you do not pick countries."},"geoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads show, at most 10. Find them with `google-ads-search-geo-targets.index`. Needed when scope is locations, and only then."},"excludedGeoTargets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9][0-9]*$","description":"The Google number of the place, as text like \"1003854\". Each place once."},"name":{"type":"string","maxLength":300,"description":"The name of the place, at most 300 characters."},"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country of the place, as two capital letters like CZ."},"targetType":{"type":"string","maxLength":50,"description":"What kind of place it is, like City or Region, at most 50 characters."}},"required":["id","name","countryCode","targetType"]},"maxItems":10,"uniqueItems":true,"description":"Places where the ads must not show, at most 10. A place cannot be in both lists."},"locationMatching":{"type":"string","enum":["presence","presence_or_interest"],"description":"presence (people who are in the place) or presence_or_interest (also people who look for the place). Leave it out for presence_or_interest."},"languageCode":{"type":"string","pattern":"^[a-z]{2,3}$","description":"The language of the people, as 2 or 3 small letters like cs."}},"required":["scope","countryCodes","languageCode"],"description":"Where the ads show and in what language."}},"required":["campaignId","monthlyBudgetAmount","biddingStrategy","keywords","targeting"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchForecastPreviewOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Preview a forecast","description":"Asks Google what a budget and keywords may bring in a month: impressions, clicks and costs. Nothing is saved, so you can try budgets before you set one.\n\nThis address allows 30 requests a minute.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-seo-keyword-sets":{"get":{"operationId":"google-ads-search-seo-keyword-sets.index","tags":["google-ads-search"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchSeoKeywordSetOutputData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"Request processed successfully","payload":[{"key":"finding-2-servis","name":"Servis kol v Brně","status":"now","keywords":["servis kol brno","oprava kola brno"],"matchType":"phrase","landingUrl":"https://www.example.cz/servis","landingState":"ready","findingPriority":2,"rationale":"Lidé to hledají a stránka servisu na to odpovídá, ale ve vyhledávání jsi až na druhé straně.","negativeKeywords":["zdarma","návod"]}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["seo.read"]}],"summary":"List keyword sets from SEO","description":"Returns the keyword sets your newest SEO audit recommends for Google Ads. The list is empty when you have no audit.\n\nNeeds one of these permissions: seo.read."}},"/v1/google-ads-search-shared-negative-keywords":{"get":{"operationId":"google-ads-search-shared-negative-keywords.index","tags":["google-ads-search"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchSharedNegativeKeywordsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List shared negative keywords","description":"Returns the negative keywords that all your search campaigns share. The ads never show for these searches.\n\nNeeds one of these permissions: ads.read."},"put":{"operationId":"google-ads-search-shared-negative-keywords.update","tags":["google-ads-search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keywords":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","pattern":"^\\s*\\S+(?:\\s+\\S+){0,9}\\s*$","maxLength":80,"description":"The keyword: 1 to 10 words, at most 80 characters, without signs like , ! @ % ^ ( ) = { } ; ~ ` < > ? \\ |."},"matchType":{"$ref":"#/components/schemas/GoogleAdsSearchKeywordMatchType","description":"exact, phrase or broad."}},"required":["text","matchType"]},"maxItems":1000,"description":"The whole new list, at most 1000. Send an empty list to remove all."}},"required":["keywords"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchSharedNegativeKeywordsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.google"]}],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Replace shared negative keywords","description":"> [!WARNING]\n> This changes your live campaigns in Google Ads too. For that a key needs `ads.execute.google`.\n\nReplaces the whole list of negative keywords shared by all your search campaigns, and returns the new list.\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/google-ads-search-operations/{operation}":{"get":{"operationId":"google-ads-search-operations.show","tags":["google-ads-search"],"parameters":[{"name":"operation","in":"path","required":true,"schema":{"type":"string"},"description":"The code of the job, from `id` or `operationId` of the answer that started it."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchOperationData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Request processed successfully","payload":{"id":"9d1c6c7e-4f0b-4a51-9a3e-2c1f0b7d5e21","type":"google_ads_search_manual_generation","status":"completed","outcomeCode":"created","outcomeMessage":null,"failureCode":null,"failureMessage":null,"startedAt":"2026-11-03T08:30:00Z","finishedAt":"2026-11-12T13:05:00Z","targeting":{"schemaVersion":1,"scope":"countries","countryCodes":["CZ"],"languageCode":"cs","geoTargets":[],"excludedGeoTargets":[],"locationMatching":"presence"},"adAccountId":31,"plannerCustomerId":"1234567890","budgetCurrencyCode":"CZK"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Show a Google Ads search job","description":"Returns how a background job goes. Ask again until `status` is completed or failed.\n\nNeeds one of these permissions: ads.read."}},"/v1/google-ads-search-ad-groups/{adGroup}":{"put":{"operationId":"google-ads-search-ad-groups.update","tags":["google-ads-search"],"parameters":[{"name":"adGroup","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad group. Find it in `adGroups` of the campaign."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the ad group, at most 255 characters. Leave it out to keep it."},"description":{"type":["string","null"],"description":"A note about the ad group. Leave it out to keep it."},"searchIntent":{"type":["string","null"],"maxLength":255,"description":"What people want when they search for these keywords, at most 255 characters. Leave it out to keep it."},"priorityScore":{"type":["number","null"],"minimum":0,"maximum":999.99,"description":"How important the ad group is, from 0 to 999.99. Leave it out to keep it."},"rationale":{"type":["string","null"],"maxLength":65535,"description":"Why the ad group is in the campaign, at most 65535 characters. Leave it out to keep it."},"landingPageDecision":{"$ref":"#/components/schemas/GoogleAdsSearchLandingPageDecision","description":"homepage, existing_page, new_landing_page or insufficient_data. Leave it out to keep it."},"destinationUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"The page the ad leads to, a full address of at most 2048 characters. Leave it out to keep it."},"landingPageFitScore":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"How well the page fits the keywords, from 0 to 100. Leave it out to keep it."},"landingPageReason":{"type":["string","null"],"description":"Why this page was picked. Leave it out to keep it."},"landingPageBrief":{"type":["string","null"],"description":"What a new landing page should say. Leave it out to keep it."},"sortOrder":{"type":"integer","minimum":0,"description":"Its place in the campaign, from 0. Leave it out to keep it."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchAdGroupData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Change an ad group","description":"Changes an ad group of a draft campaign and returns it with its keywords and ad. Only a draft campaign can change; otherwise you get 403.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-ad-groups/{adGroup}/search-ad":{"put":{"operationId":"google-ads-search-ad-groups.search-ad.update","tags":["google-ads-search"],"parameters":[{"name":"adGroup","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad group. Find it in `adGroups` of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destinationUrl":{"type":"string","maxLength":2048,"description":"The page of your website the ad leads to, at most 2048 characters."},"expectedRevision":{"type":"string","maxLength":64,"description":"The `revision` of the ad group you read before. When someone changed the ad group since, nothing is saved and you get 409."},"searchAd":{"type":"object","properties":{"headlines":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Headlines of the ad, from 10 to 15, each at most 30 characters."},"descriptions":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Descriptions of the ad, exactly 4, each at most 90 characters."},"path1":{"type":"string","description":"The first word of the path shown after your domain in the ad, at most 15 characters."},"path2":{"type":"string","description":"The second word of that path, at most 15 characters."},"sitelinks":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"The text of the link, at most 25 characters."},"description1":{"type":"string","description":"The first line under the link, at most 35 characters."},"description2":{"type":"string","description":"The second line under the link, at most 35 characters."},"finalUrl":{"type":"string","maxLength":2048,"description":"The page of your website the link leads to, at most 2048 characters."}},"required":["text","description1","description2","finalUrl"]},"minItems":1,"description":"Extra links under the ad, from 4 to 6."},"callouts":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Short extra texts under the ad, from 4 to 10, each at most 25 characters."},"headlinePins":{"type":"array","items":{"type":["integer","null"],"minimum":1,"maximum":3},"minItems":0,"maxItems":0,"description":"Where each headline must stay: one entry for each headline, in the same order. 1, 2 or 3 pins it to that place; null lets Google choose."},"descriptionPins":{"type":"array","items":{"type":["integer","null"],"minimum":1,"maximum":2},"minItems":0,"maxItems":0,"description":"Where each description must stay: one entry for each description, in the same order. 1 or 2 pins it to that place; null lets Google choose."},"snippetHeader":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchSnippetHeader"},{"type":"null"}],"description":"The heading of a list of things you offer. One of: brands, amenities, styles, types, destinations, services, courses, neighborhoods, shows, insurance_coverage, degree_programs, featured_hotels, models. null for no list."},"snippets":{"type":"array","items":{"type":"string","maxLength":25},"maxItems":10,"description":"The items of that list, at most 10, each at most 25 characters. Needed when you send snippetHeader."}},"required":["headlines","descriptions","path1","path2","sitelinks","callouts","headlinePins","descriptionPins","snippetHeader","snippets"],"description":"All texts of the ad. Send every field."},"excludedTexts":{"type":"object","properties":{"headlines":{"type":"array","items":{"type":"string","maxLength":255},"maxItems":30,"description":"Headlines AI must not write, at most 30, each at most 255 characters."},"descriptions":{"type":"array","items":{"type":"string","maxLength":255},"maxItems":30,"description":"Descriptions AI must not write, at most 30, each at most 255 characters."},"sitelinks":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":255,"description":"The text of the link, at most 255 characters."},"description1":{"type":["string","null"],"maxLength":255,"description":"The first line under the link, at most 255 characters, or null."},"description2":{"type":["string","null"],"maxLength":255,"description":"The second line under the link, at most 255 characters, or null."},"finalUrl":{"type":"string","maxLength":2048,"description":"The page of your website the link leads to, at most 2048 characters."}},"required":["text","description1","description2","finalUrl"]},"maxItems":30,"description":"Links AI must not write, at most 30."},"callouts":{"type":"array","items":{"type":"string","maxLength":255},"maxItems":30,"description":"Short texts AI must not write, at most 30, each at most 255 characters."}},"description":"Texts you do not want AI to write again. When you send it, send all four lists."}},"required":["destinationUrl","expectedRevision","searchAd"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchAdGroupData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google"],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Save the search ad","description":"> [!WARNING]\n> On a campaign that is not a draft, this changes the live ad in Google Ads. Then a key needs `ads.execute.google`.\n\nSaves all texts of the search ad of an ad group, and returns the ad group.\n\nThe ad must be complete: 10 to 15 headlines, 4 descriptions, 4 to 6 links and 4 to 10 short texts. Every link and destinationUrl must be a page of your website; see `verifiedUrls` of the ad group. Wrong texts get 422 with the field that is wrong.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/google-ads-search-ad-groups/{adGroup}/search-ad/generate":{"post":{"operationId":"google-ads-search-ad-groups.search-ad.generate","tags":["google-ads-search"],"parameters":[{"name":"adGroup","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad group. Find it in `adGroups` of the campaign."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchAdSuggestionData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI write a search ad","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nWrites a whole search ad for the ad group with AI and returns it. Nothing is saved; save it with `google-ads-search-ad-groups.search-ad.update`.\n\nThe ad group needs a landing page; otherwise you get 422. While AI already writes this ad, you get 409.\n\nYou get 402 when you do not have enough credits.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/google-ads-search-ad-groups/{adGroup}/search-ad/suggestions":{"post":{"operationId":"google-ads-search-ad-groups.search-ad.suggestions","tags":["google-ads-search"],"parameters":[{"name":"adGroup","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad group. Find it in `adGroups` of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/GoogleAdsSearchSuggestionField","description":"What to suggest: headlines, descriptions, sitelinks, callouts, snippets, name, keywords or negativeKeywords."},"existingTexts":{"type":"array","items":{"type":"string","maxLength":90},"maxItems":45,"description":"Texts you already have, so AI writes new ones, at most 45, each at most 90 characters."},"instruction":{"type":["string","null"],"maxLength":500,"description":"What AI should keep in mind, at most 500 characters."},"snippetHeader":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchSnippetHeader"},{"type":"null"}],"description":"For snippets: the heading of the list. One of: brands, amenities, styles, types, destinations, services, courses, neighborhoods, shows, insurance_coverage, degree_programs, featured_hotels, models."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["field"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchAdTextSuggestionsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI suggest ad texts","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAsks AI for new texts of one kind for the ad group, like more headlines or keywords. Nothing is saved; add the texts you like to the ad yourself.\n\nYou get 402 when you do not have enough credits.\n\nThis address allows 10 requests a minute.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/google-ads-search-ad-groups/{adGroup}/search-ad/texts":{"post":{"operationId":"google-ads-search-ad-groups.search-ad.texts","tags":["google-ads-search"],"parameters":[{"name":"adGroup","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad group. Find it in `adGroups` of the campaign."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"type":["string","null"],"maxLength":1000,"description":"What the ad should say, at most 1000 characters. Leave it out and AI uses what it knows."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchAdGroupData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.google"],"x-fusio-opt-in-scopes":["ads.execute.google"],"summary":"Let AI write and save ad texts","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\n> [!WARNING]\n> On a campaign that is not a draft, the new texts change the live ad in Google Ads. Then a key needs `ads.execute.google`.\n\nStarts AI writing the search ad texts of the ad group in the background and saves them there. It returns the ad group; `searchAdGenerationStatus` shows how the writing goes.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write. Some values also need: ads.execute.google. You must tick these on purpose: ads.execute.google."}},"/v1/google-ads-search-ad-groups/{adGroup}/keywords":{"post":{"operationId":"google-ads-search-ad-groups.keywords.store","tags":["google-ads-search"],"parameters":[{"name":"adGroup","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad group. Find it in `adGroups` of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keyword":{"type":"string","maxLength":80,"description":"The keyword, at most 80 characters."},"matchType":{"$ref":"#/components/schemas/GoogleAdsSearchKeywordMatchType","description":"exact, phrase or broad. A positive keyword may be only exact or phrase."},"keywordRole":{"$ref":"#/components/schemas/GoogleAdsSearchKeywordRole","description":"positive (the ads show for it) or negative (the ads never show for it)."},"tenantKeywordOpportunityId":{"type":["integer","null"],"description":"The number of the SEO keyword chance it comes from. Not for a negative keyword."}},"required":["keyword","matchType","keywordRole"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchAdGroupKeywordData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Add a keyword to an ad group","description":"Adds a keyword to an ad group of a draft campaign and answers 201 with it. Only a draft campaign can change; otherwise you get 403.\n\nNeeds one of these permissions: ads.write."}},"/v1/google-ads-search-ad-group-keywords/{adGroupKeyword}":{"put":{"operationId":"google-ads-search-ad-group-keywords.update","tags":["google-ads-search"],"parameters":[{"name":"adGroupKeyword","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the keyword. Find it in `keywords` of the ad group."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tenantKeywordOpportunityId":{"type":["integer","null"],"description":"The number of the SEO keyword chance it comes from, or null. Leave it out to keep it."},"keyword":{"type":"string","maxLength":80,"description":"The new words of the keyword, at most 80 characters. Leave it out to keep them."},"keywordRole":{"$ref":"#/components/schemas/GoogleAdsSearchKeywordRole","description":"positive or negative. A broad keyword cannot become positive. Leave it out to keep it."},"intent":{"type":["string","null"],"maxLength":255,"description":"What people want when they search for it, at most 255 characters. Leave it out to keep it."},"priorityScore":{"type":["number","null"],"minimum":0,"maximum":999.99,"description":"How important it is, from 0 to 999.99. Leave it out to keep it."},"rationale":{"type":["string","null"],"maxLength":65535,"description":"Why it is in the ad group, at most 65535 characters. Leave it out to keep it."},"sortOrder":{"type":"integer","minimum":0,"description":"Its place in the list, from 0. Leave it out to keep it."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchAdGroupKeywordData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Change a keyword","description":"Changes a keyword of a draft campaign and returns it. To change the words themselves, send `keyword` in the body as text of at most 80 characters, the same limit as when you add a keyword. The match type cannot change; remove the keyword and add a new one.\n\nIn brand and competitor campaigns, a positive keyword cannot change its words or role; you get 403. Only a draft campaign can change; otherwise you get 403 too.\n\nNeeds one of these permissions: ads.write."},"delete":{"operationId":"google-ads-search-ad-group-keywords.destroy","tags":["google-ads-search"],"parameters":[{"name":"adGroupKeyword","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the keyword. Find it in `keywords` of the ad group."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Remove a keyword","description":"> [!WARNING]\n> This cannot be undone.\n\nRemoves a keyword from an ad group of a draft campaign. In brand and competitor campaigns, positive keywords cannot be removed; you get 403.\n\nNeeds one of these permissions: ads.write."}},"/v1/image-profiles":{"get":{"operationId":"image-profiles.index","tags":["image-profiles"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/TenantImageProfileOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"List image style presets","description":"Returns all your image style presets.\n\nNeeds one of these permissions: intelligence.read."},"post":{"operationId":"image-profiles.store","tags":["image-profiles"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the preset, at most 255 characters."},"type":{"type":"string","enum":["generic","branded","personal","style_reference"],"description":"generic (any pictures), branded (with your brand), personal (with a person, needs reference images) or style_reference (copies the style of your sample images, needs them)."},"style":{"type":["string","null"],"enum":["realistic","photographic","illustration","digital_art","3d_render","flat","minimalist","sketch","custom",null],"description":"The look: realistic, photographic, illustration, digital_art, 3d_render, flat, minimalist, sketch or custom. Needed unless the type is style_reference."},"styleAnalysis":{"type":["string","null"],"maxLength":4000,"description":"The description of the style. AI writes it from your samples, and you can change it. At most 4000 characters."},"styleCustomValue":{"type":["string","null"],"maxLength":500,"description":"Your own look, in words. Needed when style is custom. At most 500 characters."},"instructions":{"type":["string","null"],"maxLength":2000,"description":"What AI should always keep in mind. At most 2000 characters."},"isPrimary":{"type":"boolean","description":"true makes it the main preset, used when you pick none."},"referenceFileIds":{"type":"array","items":{"type":"integer"},"maxItems":8,"description":"Numbers of your files to use as samples, at most 8. For style_reference they must be pictures."},"mascotIds":{"type":"array","items":{"type":"integer"},"maxItems":3,"uniqueItems":true,"description":"Numbers of the mascots to draw with this preset, at most 3."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it when the change starts AI work."}},"required":["name","type"]},"example":{"name":"Fotky z dílny","type":"branded","style":"photographic","instructions":"Denní světlo, dílna s nářadím, kola v detailu. Žádné texty v obrázku.","isPrimary":true}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantImageProfileOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Style preset created successfully","payload":{"id":19,"tenantId":412,"name":"Fotky z dílny","type":"branded","style":"photographic","styleCustomValue":null,"instructions":"Denní světlo, dílna s nářadím, kola v detailu. Žádné texty v obrázku.","styleAnalysis":null,"styleAnalysisStatus":null,"styleAnalysisFailureReason":null,"styleAnalyzedAt":null,"styleAnalysisEditedAt":null,"styleAnalysisRequestedAt":null,"mascots":[],"detectedAvatar":null,"detectedAvatarDismissedAt":null,"isPrimary":true,"referenceImages":[],"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-conditional-scopes":["ai.generate"],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Create an image style preset","description":"> [!WARNING]\n> This can spend AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nCreates an image style preset. A style_reference preset starts AI describing the style of your samples in the background, and that spends credits. For that a key needs `ai.generate`.\n\nYou get 422 when a style_reference or personal preset has no sample pictures, when a style_reference sample is not a picture, when you link more than 3 mascots or a mascot of another company, or when style is custom without styleCustomValue.\n\nNeeds one of these permissions: intelligence.write. Some values also need: ai.generate. You must tick these on purpose: intelligence.write."}},"/v1/image-profiles/destination-preferences":{"get":{"operationId":"image-profiles.destination-preferences.index","tags":["image-profiles"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/ImageDestinationPreferenceOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"List presets for each place","description":"Returns which image style preset each place uses, like blog articles or Instagram posts. A place that is not listed uses the main preset.\n\nNeeds one of these permissions: intelligence.read."},"put":{"operationId":"image-profiles.destination-preferences.update","tags":["image-profiles"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"array","items":{"type":"object","properties":{"destination":{"type":"string","enum":["blog_article","facebook_post","instagram_post","x_post","linkedin_post","email_broadcast","email_sequence"],"description":"The place: blog_article, facebook_post, instagram_post, x_post, linkedin_post, email_broadcast or email_sequence. Each place at most once."},"profileId":{"type":["integer","null"],"description":"The number of the preset for that place."},"imageShape":{"anyOf":[{"$ref":"#/components/schemas/ImageShape"},{"type":"null"}]},"mascotPresence":{"anyOf":[{"$ref":"#/components/schemas/MascotPresence"},{"type":"null"}]},"mascotBackground":{"anyOf":[{"$ref":"#/components/schemas/MascotBackground"},{"type":"null"}]},"imageOverlay":{"anyOf":[{"$ref":"#/components/schemas/ImageOverlay"},{"type":"null"}]},"imageOverlayPresetId":{"type":["integer","null"]},"groups":{"type":"array","items":{"type":"object","properties":{"goal":{"$ref":"#/components/schemas/ImageOverlayGoal"},"mascotPresence":{"anyOf":[{"$ref":"#/components/schemas/MascotPresence"},{"type":"null"}]},"captionVoice":{"anyOf":[{"$ref":"#/components/schemas/CaptionVoice"},{"type":"null"}]},"mascotBackground":{"anyOf":[{"$ref":"#/components/schemas/MascotBackground"},{"type":"null"}]},"mascotPlace":{"type":["string","null"],"maxLength":120},"mascotFriend":{"type":["string","null"],"maxLength":120},"isMascotAlone":{"type":"boolean"},"imageOverlay":{"anyOf":[{"$ref":"#/components/schemas/ImageOverlay"},{"type":"null"}]},"imageOverlayPresetId":{"type":["integer","null"]},"instruction":{"type":["string","null"],"maxLength":300}},"required":["goal"]}}},"required":["destination","profileId"]},"uniqueItems":true,"description":"The list of places with their preset. It replaces the whole old list."}},"required":["preferences"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/ImageDestinationPreferenceOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Set presets for each place","description":"Sets which image style preset each place uses. The list replaces the old one; places you leave out use the main preset. Send an empty list to clear all.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/image-profiles/{imageProfile}":{"put":{"operationId":"image-profiles.update","tags":["image-profiles"],"parameters":[{"name":"imageProfile","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the image style preset."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the preset, at most 255 characters. Leave it out to keep it."},"type":{"type":"string","enum":["generic","branded","personal","style_reference"],"description":"generic (any pictures), branded (with your brand), personal (with a person, needs reference images) or style_reference (copies the style of your sample images, needs them). Leave it out to keep it."},"style":{"type":["string","null"],"enum":["realistic","photographic","illustration","digital_art","3d_render","flat","minimalist","sketch","custom",null],"description":"The look: realistic, photographic, illustration, digital_art, 3d_render, flat, minimalist, sketch or custom. Needed unless the type is style_reference. Leave it out to keep it."},"styleAnalysis":{"type":["string","null"],"maxLength":4000,"description":"The description of the style. AI writes it from your samples, and you can change it. At most 4000 characters. Leave it out to keep it."},"styleCustomValue":{"type":["string","null"],"maxLength":500,"description":"Your own look, in words. Needed when style is custom. At most 500 characters."},"instructions":{"type":["string","null"],"maxLength":2000,"description":"What AI should always keep in mind. At most 2000 characters. Leave it out to keep it."},"isPrimary":{"type":"boolean","description":"true makes it the main preset, used when you pick none. Leave it out to keep it."},"referenceFileIds":{"type":"array","items":{"type":"integer"},"maxItems":8,"description":"Numbers of your files to use as samples, at most 8. For style_reference they must be pictures. Leave it out to keep it."},"mascotIds":{"type":"array","items":{"type":"integer"},"maxItems":3,"uniqueItems":true,"description":"Numbers of the mascots to draw with this preset, at most 3."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it when the change starts AI work."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantImageProfileOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-conditional-scopes":["ai.generate"],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Change an image style preset","description":"> [!WARNING]\n> This can spend AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nChanges an image style preset. Send only what you want to change. A field you leave out stays as it is; null clears it.\n\nWhen the preset becomes style_reference, or its sample pictures change, AI describes the style again in the background, and that spends credits. For that a key needs `ai.generate`. You get 422 when a style_reference or personal preset has no sample pictures, when a style_reference sample is not a picture, when you link more than 3 mascots or a mascot of another company, or when style is custom without styleCustomValue.\n\nNeeds one of these permissions: intelligence.write. Some values also need: ai.generate. You must tick these on purpose: intelligence.write."},"delete":{"operationId":"image-profiles.destroy","tags":["image-profiles"],"parameters":[{"name":"imageProfile","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the image style preset."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Remove an image style preset","description":"Removes an image style preset. Places that used it go back to the main preset. When you remove the main preset, another one becomes the main.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/image-profiles/{imageProfile}/analyze-style":{"post":{"operationId":"image-profiles.analyze-style","tags":["image-profiles"],"parameters":[{"name":"imageProfile","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the image style preset."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantImageProfileOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Describe the style again","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI describes the style of your sample pictures again, in the background. Watch `styleAnalysisStatus` in the answer.\n\nIt works only for a style_reference preset with sample pictures; otherwise you get 422. When a description already runs, nothing new starts.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/image-profiles/{imageProfile}/dismiss-detected-avatar":{"post":{"operationId":"image-profiles.dismiss-detected-avatar","tags":["image-profiles"],"parameters":[{"name":"imageProfile","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the image style preset."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantImageProfileOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Hide the detected mascot tip","description":"Hides the tip about a person or mascot AI saw in your samples. When there is no open tip, nothing changes.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/discovery-leads/claim":{"post":{"operationId":"discovery-leads.claim","tags":["leads"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":["integer","null"],"minimum":1,"maximum":20,"description":"How many leads to take, from 1 to 20. Leave it out for 20."},"source":{"anyOf":[{"$ref":"#/components/schemas/LeadDiscoverySource"},{"type":"null"}],"description":"Take only new leads from this source: ares, eshopy_cz or browser. Leave it out for any source."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/DiscoveryLeadClaimItemData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Take discovery leads to review","description":"Gives you discovery leads to review, up to 20 at once. You get your own leads that are still in review first, the oldest first. New leads without an owner fill the rest, the best fit first. You become the owner of every lead you take, so nobody else gets it. Call it again to see the same leads. The answer is 200 and a list. The list is empty when there is nothing to take.\n\nA lead that you still review and do not touch for 48 hours goes back to the queue as new, and you lose it. Saving a research source for the lead, saving its company data, or sending your recommendation restarts the 48 hours.\n\nErrors: 403 when you may not review discovery leads, 422 when `limit` or `source` is wrong.\n\nNeeds one of these permissions: leads.write."}},"/v1/discovery-leads":{"post":{"operationId":"discovery-leads.store","tags":["leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"Required. The name of the business, at most 255 characters."},"browserSource":{"$ref":"#/components/schemas/LeadDiscoveryBrowserSource","description":"Required. Where you found it: instagram, facebook, linkedin, x, google_maps, firmy_cz or web."},"profileUrl":{"type":"string","format":"uri","maxLength":2048,"description":"Required. The address of the profile where you found it, at most 2048 characters. Fusio uses it to spot a business it already has."},"website":{"type":["string","null"],"format":"uri","pattern":"^https?:\\/\\/(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?::[0-9]{1,5})?$","maxLength":255,"description":"Optional. The own website of the business, at most 255 characters. It must not be a social network, a map or a directory. Fusio keeps only the start, like https://example.cz."},"city":{"type":["string","null"],"maxLength":255,"description":"Optional. The city, at most 255 characters."},"businessEmail":{"type":["string","null"],"format":"email","maxLength":255,"description":"Optional. The email of the business, at most 255 characters. It needs contacts.write."},"businessPhone":{"type":["string","null"],"pattern":"^(?:\\+|00)?[0-9][0-9 ().-]*$","maxLength":20,"description":"Optional. The phone of the business, at most 20 characters. It needs contacts.write."},"fitReason":{"type":"string","maxLength":1000,"description":"Required. Why the business fits, at most 1000 characters. Fusio saves it in a note."},"foundOnProfile":{"type":"string","maxLength":5000,"description":"Required. What you read on the profile, at most 5000 characters. Fusio saves it in a note."}},"required":["name","browserSource","profileUrl","fitReason","foundOnProfile"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BrowserDiscoveryLeadData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"x-fusio-conditional-scopes":["contacts.write"],"summary":"Save a business found in the browser as a discovery lead","description":"Saves a business that you found in the browser as a lead that waits for review. The lead is not in your CRM until a user approves it in Fusio. The answer is 200.\n\nIf Fusio already has the same profile address or the same website, nothing is saved and you get 409 `discovery_lead_duplicate`, with `existingLeadId`. If another save of your company is still running, you get 409 `discovery_lead_create_busy`. Wait a moment and try again.\n\nErrors: 403 `insufficient_scope` when you send `businessEmail` or `businessPhone` without `contacts.write`, 422 when a field is wrong or the website is a social network, a map or a directory.\n\nNeeds one of these permissions: leads.write. Some values also need: contacts.write."}},"/v1/discovery-leads/{lead}/ares-lookup":{"post":{"operationId":"discovery-leads.ares-lookup","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ico":{"type":"string","pattern":"^\\d{8}$","description":"The company number (IČO), 8 digits. Spaces are removed."}},"required":["ico"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DiscoveryAresLookupData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Save the business register data of a discovery lead","description":"Looks the company up in ARES, the public business register, and saves its data on the lead. It saves the company number, the VAT number when the lead has none, and the company facts. Then Fusio rates the fit of the lead again. It costs no credits, but it counts as one company lookup of your plan. The answer is 200.\n\nThe lead must be one that you took with the claim endpoint and still review, or you get 409 `discovery_lead_not_claimed`. When another lead of your company already has this IČO, you get 409 `duplicate_registration_number` with `existingLeadId`. When another save of the same IČO is still running, you get 409 `discovery_ares_lookup_busy`; wait a moment and try again. When ARES does not know the IČO, you get 422 `ares_not_found`. When ARES does not answer, you get 503; try again later.\n\nErrors: 403 when you may not review discovery leads, 422 when `ico` is not 8 digits, 422 with `payload.metric` `company_lookups` when your plan has no company lookups left. This address allows 10 requests a minute; more gives 429.\n\nNeeds one of these permissions: leads.write."}},"/v1/discovery-leads/{lead}/mark-ready":{"post":{"operationId":"discovery-leads.mark-ready","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recommendation":{"$ref":"#/components/schemas/LeadDiscoveryRecommendation","description":"What you advise: approve or dismiss."},"reason":{"type":"string","minLength":10,"maxLength":1000,"description":"Why you advise it, from 10 to 1000 characters. The user reads it."}},"required":["recommendation","reason"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/DiscoveryLeadReviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Recommend what to do with a discovery lead","description":"Finishes your review of a discovery lead. Fusio rates the fit of the lead again, saves your advice and your reason, and moves the lead to `ready_for_approval`. The answer is 200.\n\nThis only recommends. It does not approve or dismiss the lead. The user decides in Fusio: they approve it into the CRM or dismiss it. While the lead waits, you may call this again to change your advice.\n\nThe lead must be one that you took with the claim endpoint and still review, or you get 409 `discovery_lead_not_claimed`.\n\nErrors: 403 when you may not review discovery leads, 422 when `recommendation` is not approve or dismiss or `reason` is too short or too long.\n\nNeeds one of these permissions: leads.write."}},"/v1/inbox-triages/queue":{"get":{"operationId":"inbox-triages.queue","tags":["leads"],"parameters":[{"name":"limit","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":20},"description":"How many threads to return, from 1 to 20. The default is 10."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/InboxTriageQueueData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read","emails.read"]}],"summary":"List email threads where a lead wrote back and nobody has triaged the answer yet","description":"You get the email threads of your own mailbox, and of the shared mailboxes, where a contact linked to a lead wrote back and you did not triage the new message yet. Only the last 30 days count. Newsletters and automatic mail are left out, and so are threads that already have a reply waiting for approval.\n\nRead the `thread`, decide what the lead needs, then call `POST /inbox-triages` for each thread. Marking a thread removes it from this list until the contact writes again. A contact can be linked to more than one lead; the queue lists each one in `leads`, and you pick one with `leadId` when you mark the thread.\n\nA key also needs `leads.read` and `emails.read`.\n\nNeeds one of these permissions: leads.read. Also needs: emails.read."}},"/v1/inbox-triages":{"post":{"operationId":"inbox-triages.store","tags":["leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversationId":{"type":"integer","minimum":1,"description":"The email thread you triage. Take it from the queue."},"leadId":{"type":"integer","minimum":1,"description":"The lead the answer belongs to. It must be one of the `leads` of that thread."},"inboundMessageId":{"type":"integer","minimum":1,"description":"The message you answer, `latestInboundMessageId` from the queue. A newer message makes the request fail."},"replyGoal":{"type":["string","null"],"enum":["book_meeting","revive_conversation","followup_new_value","followup_proof","objection_response","breakup_email","meeting_recap","negotiation","upsell",null],"description":"What the reply should achieve. Any goal except an initial outreach. Send it together with `replyBrief`."},"replyBrief":{"type":["string","null"],"minLength":10,"maxLength":1000,"description":"One or two sentences about what the reply should say, from 10 to 1000 characters. Required with `replyGoal`."},"messageFrameworkId":{"type":["integer","null"],"description":"A message framework of your company that the reply should follow."},"recommendation":{"type":["object","null"],"properties":{"stage":{"type":"string","enum":["cold","warm","qualified","lost"],"description":"The suggested stage: cold, warm, qualified or lost."},"lostReason":{"type":["string","null"],"enum":["spam","test_submission","duplicate","wrong_contact","job_seeker","vendor_pitch","existing_customer","outside_target_segment","company_too_small","outside_service_area","service_not_offered","no_real_need","not_interested","no_response","no_budget","price_too_high","chose_competitor","already_has_supplier","bad_timing","no_decision_maker",null],"description":"Why the lead is lost. Only with the stage lost. The reason other is not allowed."},"reason":{"type":"string","minLength":5,"maxLength":500,"description":"Why you suggest it, from 5 to 500 characters. The person who approves reads it."}},"description":"A suggestion to change the stage of the lead. Only the person who approves decides whether it applies."}},"required":["conversationId","leadId","inboundMessageId"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/InboxTriageData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write","emails.write"]}],"summary":"Mark an email thread as triaged, with an optional reply goal and a stage suggestion","description":"This marks the thread as triaged. It leaves the queue and comes back only when the contact writes again. Marking the same thread again updates the record. While a reply for the thread waits for approval, you get 409 `inbox_reply_pending`.\n\nThe suggestion is only advice. It waits in the approval package of the lead, and the person decides there. A newer suggestion for the same lead replaces an older one that is still waiting.\n\nWhen a new message arrived after the one you triaged, you get 409 `inbox_triage_outdated`; read the queue again. To write the reply, call `POST /inbox-triages/{inboxTriage}/reply/generate`, or submit your own reply for approval.\n\nA key also needs `leads.write` and `emails.write`.\n\nNeeds one of these permissions: leads.write. Also needs: emails.write."}},"/v1/inbox-triages/{inboxTriage}/reply/generate":{"post":{"operationId":"inbox-triages.reply.generate","tags":["leads"],"parameters":[{"name":"inboxTriage","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/InboxReplyResultData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","leads.write","emails.write"]}],"summary":"Write the reply to a triaged email thread with AI","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nFusio writes the answer to the message you triaged, using the reply goal and brief you sent to `POST /inbox-triages`. The answer is 201 with the saved reply. It is an email in the same thread, and it waits for approval in Fusio; nothing is sent until someone approves it.\n\nA triage that has a reply waiting gives 409 `inbox_reply_pending`; change the waiting reply in the approval package instead. When a new message arrived after the triage, you get 409 `inbox_triage_outdated`. A triage without a reply goal gives 422 `inbox_triage_goal_missing`. Credits are charged only when the reply is saved.\n\nA key also needs `leads.write` and `emails.write`.\n\nNeeds one of these permissions: ai.generate. Also needs: leads.write, emails.write."}},"/v1/message-frameworks":{"get":{"operationId":"message-frameworks.index","tags":["leads"],"parameters":[{"name":"goal","in":"query","schema":{"type":["string","null"],"enum":["initial_outreach","book_meeting","revive_conversation","followup_new_value","followup_proof","objection_response","breakup_email","meeting_recap","negotiation","upsell",null]},"description":"Keep only frameworks usable for this outreach goal, such as `initial_outreach`. Every framework when left out."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/MessageFrameworkOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List message frameworks","description":"Returns the message frameworks the tenant can write outreach with: its own and the system ones. A framework describes how a message is built, step by step, with rules and examples.\n\nWhen you enroll a lead into a plan with `POST /leads/{lead}/cadence-enrollments`, pass the framework's `id` as `messageFrameworkId`. It must be usable for the enrollment's `outreachAction`.\n\nNeeds one of these permissions: leads.read."}},"/v1/lead-cadence-templates":{"get":{"operationId":"lead-cadence-templates.index","tags":["leads"],"parameters":[{"name":"purpose","in":"query","schema":{"anyOf":[{"$ref":"#/components/schemas/LeadCadenceTemplatePurpose"},{"type":"null"}]},"description":"Keep only plans with this purpose. `outreach` is for a first contact, `follow_up` for later contact. Every purpose when left out."},{"name":"active","in":"query","schema":{"type":["boolean","null"]},"description":"'`1` for active plans only, `0` for inactive ones only. Both when left out.'"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceTemplateData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List outreach plans","description":"Returns the tenant's outreach plans (cadences): plans of steps, like emails, LinkedIn messages and calls, that run for a lead one after another.\n\nFor the first contact with new prospects use `purpose=outreach&active=1`. Only an active plan can be started with `POST /leads/{lead}/cadence-enrollments`.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/overview":{"get":{"operationId":"leads.overview","tags":["leads"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[platform]","in":"query","schema":{"type":["string","null"],"enum":["google","facebook","linkedin","none",null]},"description":"Count only leads from one ad network: google, facebook or linkedin; none for leads without ads."},{"name":"filter[source]","in":"query","schema":{"anyOf":[{"$ref":"#/components/schemas/LeadSource"},{"type":"null"}]},"description":"Count only leads from one source, like web, referral or lead_form."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Show the numbers of your leads","description":"Returns the numbers of your leads for a range of days: how many there are, where they came from and how they move from stage to stage. Send `compare=true` to also get the range just before.\n\nThis address allows 120 requests a minute.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/prediction-visibility":{"get":{"operationId":"leads.prediction-visibility","tags":["leads"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadPredictionVisibilityOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Find out if lead predictions are on","description":"Tells you if Fusio shows predictions of which leads will become clients.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/grid":{"get":{"operationId":"leads.grid","tags":["leads"],"parameters":[{"name":"filter[search]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Words to look for in names, emails and other main fields."},{"name":"filter[hasPendingChanges]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows prospects with changes still waiting for a yes."},{"name":"filter[researchProfile]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows prospects that have a research profile. without shows the rest."},{"name":"filter[outreachStatus]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Where writing to the prospect stands. One or more values, split by commas."},{"name":"filter[assignee]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of the team member it is given to."},{"name":"filter[googleAdsClickedAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When the prospect clicked a Google ad. One date (YYYY-MM-DD), or two dates as from,to."},{"name":"filter[awaitingContact]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"1 shows prospects nobody has written to yet. 0 shows the rest."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[source]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Where the prospect came from. One or more values, split by commas."},{"name":"filter[platform]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The network, like google or facebook. For prospects it means the ads they came from. Social posts take several, split by commas."},{"name":"filter[fitGrade]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How well the prospect fits you. One or more values, split by commas."},{"name":"filter[heatStatus]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How warm the prospect is. One or more values, split by commas."},{"name":"filter[ids]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Up to 100 IDs, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["createdAt","predictedConversion","-createdAt","-predictedConversion"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order. Sorting by predictedConversion works only while that feature is turned on."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexLeadData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List leads in a table","description":"Returns leads page by page, ready for a table. Use `filter`, `sort`, `page` and `perPage` as the shape of the list says.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/options":{"get":{"operationId":"leads.options","tags":["leads"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name or the company number (IČO). At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[fitGrade]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How well the prospect fits you. One or more values, split by commas."},{"name":"filter[heatStatus]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How warm the prospect is. One or more values, split by commas."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionLeadData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List leads for a picker","description":"Returns leads as short items for a picker. Use it to find a lead before you link a contact or make a deal.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/check-duplicate":{"post":{"operationId":"leads.check-duplicate","tags":["leads"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"registrationNumber":{"type":["string","null"],"maxLength":50,"description":"The company number (IČO) to look for, at most 50 characters. Send it, an email, or both."},"email":{"type":["string","null"],"format":"email","maxLength":255,"description":"An email to look for among the contacts of your leads, at most 255 characters. Send it, the company number, or both."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadDuplicateCheckOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Duplicate check completed.","payload":{"duplicate":{"id":3051,"name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","stage":"warm","createdAt":"2026-11-16T08:30:00Z"},"field":"registrationNumber"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Find out if a lead exists already","description":"Looks for a lead with the same company number first, then for a lead with a contact that has the same email. Call it before you add a lead or a contact.\n\nNothing is saved. When `duplicate` is null, the lead is new.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/segments":{"get":{"operationId":"leads.segments","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateSegmentData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List the segments of a lead","description":"Returns the segments the lead is in.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/tags":{"get":{"operationId":"leads.tags","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateTagData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List the tags of a lead","description":"Returns the tags the lead has.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/custom-fields":{"get":{"operationId":"leads.custom-fields","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/UpdateLeadCustomFieldData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List the custom fields of a lead","description":"Returns the values of your custom fields on the lead, each with the field it belongs to.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/assignments":{"get":{"operationId":"leads.assignments.index","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/EntityAssignmentOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List the members who look after a lead","description":"Returns the members of your team who look after the lead.\n\nNeeds one of these permissions: leads.read."},"post":{"operationId":"leads.assignments.store","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"integer","description":"The member to add. They must be an active member of your company."}},"required":["userId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/EntityAssignmentOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Add a member to a lead","description":"Adds a member who looks after the lead, next to the ones it has. Fusio lets the member know. Returns the new link.\n\nNeeds one of these permissions: leads.write."}},"/v1/leads/{lead}/assignments/{user}":{"delete":{"operationId":"leads.assignments.destroy","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."},{"name":"user","in":"path","required":true,"schema":{"type":"string"},"description":"The number of the member to take off."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Take a member off a lead","description":"Takes the member off the lead. The answer has no data. You get 422 on `userId` when the member still runs an open cadence on this lead.\n\nNeeds one of these permissions: leads.write."}},"/v1/leads/{lead}/owner":{"put":{"operationId":"leads.owner.replace","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":["integer","null"],"description":"The member who will look after the lead alone. null takes all members off."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"anyOf":[{"$ref":"#/components/schemas/EntityAssignmentOutputData"},{"type":"null"}]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Set the one member of a lead","description":"Makes `userId` the only member of the lead and takes the others off. Returns the link, or null when you sent `userId: null`.\n\nYou get 422 on `userId` when the member still runs an open cadence on this lead.\n\nNeeds one of these permissions: leads.write."}},"/v1/leads/{lead}/outreach-touches":{"get":{"operationId":"leads.outreach-touches.index","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/LeadOutreachTouchOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List the touches with a lead","description":"Returns each time your team reached out to the lead or the lead answered: calls, emails and other touches, with how they went.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/cadence-enrollments":{"get":{"operationId":"leads.cadence-enrollments.index","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceEnrollmentData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List the cadences of a lead","description":"Returns the cadences the lead goes or went through. A cadence is a plan of steps, like calls and emails, that your team follows.\n\nNeeds one of these permissions: leads.read."},"post":{"operationId":"leads.cadence-enrollments.store","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadCadenceTemplateId":{"type":"integer","description":"The active plan to start."},"leadAssigneeId":{"type":["integer","null"],"description":"The user who runs the plan. They must be assigned to the lead. Left out, the lead's only owner runs it."},"outreachAction":{"anyOf":[{"$ref":"#/components/schemas/PrivateOutreachAction"},{"type":"null"}],"description":"The goal of the outreach, such as `initial_outreach` for a first contact. Optional."},"messageFrameworkId":{"type":["integer","null"],"description":"The message framework the plan's messages follow. It must be usable for `outreachAction`, or for `initial_outreach` when that is left out. Optional."},"startAt":{"type":["string","null"],"description":"When the plan starts, as an ISO 8601 date and time with a time zone. Now when left out."}},"required":["leadCadenceTemplateId"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadCadenceEnrollmentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Enroll a lead into an outreach plan","description":"Starts the plan for the lead: its steps become tasks with due dates, counted from `startAt`. A lead can be in one running or paused plan at a time.\n\nWithout `leadAssigneeId`, the lead's owner runs the plan. A lead with no owner, or with more than one, is refused; name the user then. Show the leads and the plan to the person you work for before you enroll them, and enroll one lead per call.\n\nNeeds one of these permissions: leads.write."}},"/v1/leads/{lead}/sync-segments":{"post":{"operationId":"leads.sync-segments","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"segmentIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the segments, at most 500. The list replaces the segments it had. Numbers that are not from your company are skipped."}},"required":["segmentIds"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Set the segments of a lead","description":"Puts the lead in exactly these segments. An empty list takes it out of all segments. The answer has no data.\n\n> [!WARNING]\n> While your company has an active email sequence, this change can start it for the lead. A key then needs `emails.send`.\n\nNeeds one of these permissions: leads.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v1/leads/{lead}/sync-tags":{"post":{"operationId":"leads.sync-tags","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags, at most 500. The list replaces the tags it had. Numbers that are not from your company are skipped."}},"required":["tagIds"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Set the tags of a lead","description":"Gives the lead exactly these tags. An empty list takes all tags off. The answer has no data.\n\n> [!WARNING]\n> While your company has an active email sequence, this change can start it for the lead. A key then needs `emails.send`.\n\nNeeds one of these permissions: leads.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v1/leads/{lead}/sync-custom-fields":{"post":{"operationId":"leads.sync-custom-fields","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadCustomFields":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"integer","description":"The number of the custom field. It must be a field of your company."},"value":{"type":["string","null"],"description":"The value as text, at most 65535 characters. null clears it. When the field is a unique key, no other record may have the same value."}},"required":["customFieldId"]},"description":"The values of your custom fields. The list replaces all values: a field you leave out loses its value."}},"required":["leadCustomFields"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Set the custom fields of a lead","description":"Sets the values of your custom fields on the lead. The list replaces all values: a field you leave out loses its value. The answer has no data.\n\nA custom field that is a unique key may not have the same value on two leads. Then you get 422 on `leadCustomFields`.\n\n> [!WARNING]\n> While your company has an active email sequence, this change can start it for the lead. A key then needs `emails.send`.\n\nNeeds one of these permissions: leads.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v1/leads/{lead}/firmographics/enrich":{"post":{"operationId":"leads.firmographics.enrich","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadFirmographicEnrichmentEligibilityData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Fill the company facts of a lead","description":"> [!WARNING]\n> This spends 1 AI credit of your company. A key must send `maxCredits`, and it must be at least 1. A smaller number fails validation with 422 and nothing happens.\n\nFusio looks up the company facts of the lead in public sources, in the background. The answer is 202.\n\nNeeds one of these permissions: leads.write."}},"/v1/leads/{lead}/emails":{"get":{"operationId":"leads.emails","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."},{"name":"limit","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":100},"description":"How many sequences and planned emails each contact shows, from 1 to 100. Leave it out for 20."},{"name":"sequencesCursor","in":"query","schema":{"type":["integer","null"],"minimum":1},"description":"Not used here, but Fusio still checks it. Use contacts.emails to read more of one contact."},{"name":"scheduledEmailsCursor","in":"query","schema":{"type":["integer","null"],"minimum":1},"description":"Not used here, but Fusio still checks it. Use contacts.emails to read more of one contact."},{"name":"draftsCursor","in":"query","schema":{"type":["integer","null"],"minimum":1},"description":"Not used here, but Fusio still checks it. Use contacts.emails to read more of one contact."},{"name":"conversationsCursor","in":"query","schema":{"type":["integer","null"],"minimum":1},"description":"Not used here, but Fusio still checks it. Use contacts.emails to read more of one contact."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadEmailsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read","emails.read"]}],"summary":"List the personal emails of a lead","description":"Returns the personal emails of all contacts of the lead in one answer. To page through the emails of one contact, use `contacts.emails`.\n\nNeeds one of these permissions: leads.read. Also needs: emails.read."}},"/v1/leads/{lead}/research-profile":{"post":{"operationId":"leads.research-profile.store","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/IndexLeadResearchProfileData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write","ai.generate"]}],"summary":"Create the research profile of a lead","description":"A research profile keeps what research found about the lead. Creating it also starts AI research on the lead in the background. To run the research again later, use the research endpoint. The answer is 201.\n\n> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nNeeds one of these permissions: leads.write. Also needs: ai.generate."}},"/v1/leads/{lead}/research-profile/prepare":{"post":{"operationId":"leads.research-profile.prepare","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"The own website of the company, at most 2048 characters. It must not be a social network, a map or a directory. Fusio keeps only the start, like https://example.cz."}},"required":["url"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/IndexLeadResearchProfileData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Create the research profile of a lead without research","description":"Creates the research profile of a lead but starts no research and spends no credits. Use it before you save website text with the source endpoint. When the lead has no website yet, it gets this one. The answer is 200.\n\nWhen the lead already has a profile for the same website, you get that profile back and nothing changes. When it has a profile for another website, you get 409.\n\nErrors: 403 when you may not change the lead or it is not in your company, 404 when the lead does not exist, 409 when the profile is for another website, 422 when the lead is lost or `url` is wrong or is a social network, a map or a directory.\n\nNeeds one of these permissions: leads.write."}},"/v1/leads/{lead}/research-profile/source":{"post":{"operationId":"leads.research-profile.source","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"The address of the page, at most 2048 characters. It must be on the website of the research profile. www is ignored, other subdomains are refused. A social network, a map or a directory is refused."},"markdown":{"type":"string","minLength":1,"maxLength":50000,"description":"The text of the page in markdown, from 1 to 50000 characters."}},"required":["url","markdown"]},"minItems":1,"maxItems":20,"description":"The pages you read, from 1 to 20."}},"required":["pages"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadResearchSourceSubmitData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Save website text as the research source of a lead","description":"Saves website text that you read yourself as the source of the research of a lead. It spends no credits. The step that reads the website counts as done. The answer is 200. The answer lists the steps that are done and the steps that are still missing.\n\nThe lead needs a research profile first: make it with the prepare endpoint. Every page must be on the website of that profile, or you get 422 `research_source_off_domain`. When the research is already complete, you get 409 `research_already_complete` and nothing changes. When a paid research of the lead still runs, you get 409; wait until it ends. Saving the source again replaces the earlier pages. When the lead is a discovery lead that you review, this restarts its 48 hours.\n\nErrors: 403 when you may not change the lead, 404 when the lead or its profile is missing, 409 when the research is complete, a paid research still runs, the research profile is linked to another organization or the lead was already promoted, 422 when a page is wrong, off the website or the lead is lost.\n\nNeeds one of these permissions: leads.write."}},"/v1/leads/{lead}/research-profile/research":{"post":{"operationId":"leads.research-profile.research","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","leads.write"]}],"summary":"Start AI research on a lead","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI researches the lead in the background. The answer is 202. Read the result with the dossier.\n\nNeeds one of these permissions: ai.generate. Also needs: leads.write."}},"/v1/leads/{lead}/research-profile/dossier":{"get":{"operationId":"leads.research-profile.dossier","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadResearchProfileResearchDossierData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Show the research dossier of a lead","description":"The dossier holds what research found: products, customers, competitors, strategies and brand voice. When the research still runs, ask again later.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads":{"post":{"operationId":"leads.store","tags":["leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"billingAddressSameAsLegal":{"type":"boolean","description":"true means invoices go to the main address. false needs billingAddress. Leave it out for true."},"billingAddress":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name on invoices, when it is not the name of the lead."},"street":{"type":"string","maxLength":255,"description":"The street and house number for invoices."},"city":{"type":"string","maxLength":255,"description":"The city for invoices."},"zip":{"type":["string","null"],"maxLength":20,"description":"The postal code for invoices, at most 20 characters."},"countryIso":{"type":"string","minLength":2,"maxLength":2,"description":"The country for invoices as two letters, like CZ."}},"required":["street","city","countryIso"],"description":"The address for invoices. Fusio reads it only when billingAddressSameAsLegal is false; then street, city and countryIso are needed."},"name":{"type":["string","null"],"maxLength":255,"description":"The name of the company or the person, at most 255 characters."},"registrationNumber":{"type":["string","null"],"maxLength":50,"description":"The company number (IČO), at most 50 characters. Ask leads.check-duplicate first, so you do not make the same company twice."},"vatNumber":{"type":["string","null"],"maxLength":50,"description":"The VAT number (DIČ), like CZ12345678, at most 50 characters."},"street":{"type":["string","null"],"maxLength":255,"description":"The street and house number."},"city":{"type":["string","null"],"maxLength":255,"description":"The city."},"zip":{"type":["string","null"],"maxLength":20,"description":"The postal code, at most 20 characters."},"countryIso":{"type":["string","null"],"minLength":2,"maxLength":2,"description":"The country as two letters, like CZ."},"stage":{"$ref":"#/components/schemas/LeadStage","description":"Where the lead is: cold, warm, qualified, client or lost. You must send it."},"lostReason":{"anyOf":[{"$ref":"#/components/schemas/LeadLostReason"},{"type":"null"}],"description":"Why the lead is lost, like not_interested, no_budget or duplicate. other needs lostReasonNote."},"lostReasonNote":{"type":["string","null"],"maxLength":1000,"description":"Your own words about why the lead is lost, at most 1000 characters. Needed when lostReason is other."},"personType":{"anyOf":[{"$ref":"#/components/schemas/LeadPersonType"},{"type":"null"}],"description":"legal for a company, physical for a person."},"source":{"type":["string","null"],"enum":["web","cold_call","referral","campaign","event","partner","import","social_discovery",null],"description":"Where the lead came from: web, cold_call, referral, campaign, event, partner, social_discovery or import. A source that Fusio set itself, like lead_form, cannot be changed."},"website":{"type":["string","null"],"format":"uri","pattern":"^https?:\\/\\/(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?::[0-9]{1,5})?$","maxLength":255,"description":"The website. Fusio keeps only the start, like https://example.cz, unless preserveWebsitePath is true. Without http, Fusio adds https://."},"preserveWebsitePath":{"type":"boolean","description":"true keeps the whole web address, with the path after the domain."},"segmentIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the segments, at most 500. The list replaces the segments it had. Numbers that are not from your company are skipped."},"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags, at most 500. The list replaces the tags it had. Numbers that are not from your company are skipped."},"leadCustomFields":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"integer","description":"The number of the custom field. It must be a field of your company."},"value":{"type":["string","null"],"maxLength":65535,"description":"The value as text, at most 65535 characters. null clears it. When the field is a unique key, no other record may have the same value."}},"required":["customFieldId"]},"description":"The values of your custom fields. The list replaces all values: a field you leave out loses its value."},"firmographics":{"type":["object","null"],"properties":{"czNace":{"type":["string","null"],"description":"The CZ-NACE code of the main business, as in the register codebook."},"legalForm":{"type":["string","null"],"description":"The code of the legal form, as in the register codebook."},"employeeBand":{"anyOf":[{"$ref":"#/components/schemas/EmployeeBand"},{"type":"null"}],"description":"How many people work there: micro, small, medium, large or enterprise."},"region":{"anyOf":[{"$ref":"#/components/schemas/CzechRegion"},{"type":"null"}],"description":"The Czech region, written like Jihomoravský kraj."}},"description":"Facts about the company. A field you leave out keeps its value. null leaves all of them as they are."},"ownerId":{"type":["integer","null"],"description":"The member who looks after the lead. Leave it out and the lead has no owner, unless you may see only your own leads; then it is you."},"contacts":{"type":"array","items":{"type":"object","properties":{"contactId":{"type":["integer","null"],"description":"The number of a contact you already have. It moves to this lead. Send contactId or contact."},"contact":{"type":["object","null"],"properties":{"type":{"$ref":"#/components/schemas/ContactType","description":"company for a work contact of a company, personal for a private person."},"email":{"type":["string","null"],"format":"email","maxLength":255,"description":"The email, at most 255 characters. You need an email or a phone."},"firstName":{"type":["string","null"],"maxLength":255,"description":"The first name, at most 255 characters."},"lastName":{"type":["string","null"],"maxLength":255,"description":"The last name, at most 255 characters."},"name":{"type":["string","null"],"maxLength":255,"description":"A name to show when you do not split it into first and last name, at most 255 characters."},"phone":{"type":["string","null"],"pattern":"^(?:\\+|00)?[0-9][0-9 ().-]*$","maxLength":20,"description":"The phone number, like +420 601 234 567. A number without a country code counts as Czech. At most 20 characters. You need an email or a phone."},"position":{"type":["string","null"],"maxLength":255,"description":"The job of the person, like Owner, at most 255 characters."},"preferredContactChannel":{"anyOf":[{"$ref":"#/components/schemas/PreferredContactChannel"},{"type":"null"}],"description":"How the person likes to be reached: email, phone or whatsapp."}},"required":["type"],"description":"A new contact to add. Send contactId or contact. A new contact needs contacts.write."},"isPrimary":{"type":"boolean","description":"true for the main contact of the lead."}},"required":["isPrimary"]},"minItems":1,"uniqueItems":true,"description":"The people of the lead, at least one. Exactly one of them must have isPrimary true."}},"required":["stage","contacts"]},"example":{"name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","vatNumber":"CZ87654321","street":"Mlýnská 8","city":"Brno","zip":"60200","countryIso":"CZ","stage":"warm","personType":"legal","source":"referral","website":"https://www.example.cz","segmentIds":[21],"tagIds":[71],"leadCustomFields":[{"customFieldId":10,"value":"12"}],"contacts":[{"contact":{"type":"company","email":"petr.svoboda@example.cz","firstName":"Petr","lastName":"Svoboda","phone":"+420 601 234 567","position":"Jednatel","preferredContactChannel":"email"},"isPrimary":true}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateLeadData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Lead created successfully.","payload":{"id":"3051","countryId":58,"countryIso":"CZ","name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","vatNumber":"CZ87654321","unattestedIdentity":null,"street":"Mlýnská 8","city":"Brno","zip":"60200","stage":"warm","lostReason":null,"lostReasonNote":null,"personType":"legal","source":"referral","website":"https://www.example.cz","hasResearchProfile":false,"originatingLeadFormId":null,"outreachStatus":"not_contacted","contactsCount":1,"countryName":"Česko","billingAddressSameAsLegal":true,"billingAddress":null,"registerLookupStatus":"processing","registerLookupLocked":true,"originatingLeadFormName":null,"leadContacts":[{"id":9120,"leadId":3051,"contactId":7720,"isPrimary":true,"buyingRole":"decision_maker","contact":{"id":"7720","userId":88,"tenantId":412,"segments":[],"tags":[],"contactCustomFields":[],"communicationPreference":null,"lead":{"id":"3051","countryId":58,"countryIso":"CZ","name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","vatNumber":"CZ87654321","unattestedIdentity":null,"street":"Mlýnská 8","city":"Brno","zip":"60200","stage":"warm","lostReason":null,"lostReasonNote":null,"personType":"legal","source":"referral","website":"https://www.example.cz","hasResearchProfile":false,"originatingLeadFormId":null,"outreachStatus":"not_contacted","contactsCount":0,"countryName":"Česko","billingAddressSameAsLegal":true,"billingAddress":null,"registerLookupStatus":"completed","registerLookupLocked":false},"type":"company","email":"petr.svoboda@example.cz","firstName":"Petr","lastName":"Svoboda","name":null,"phone":"+420601234567","position":"Jednatel","preferredContactChannel":"email","lastActivityAt":null,"emailVerifiedAt":null}}],"segmentIds":[21],"tagIds":[71],"leadCustomFields":[{"customFieldId":10,"value":"12"}],"tasks":[],"notes":[],"firmographic":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"x-fusio-conditional-scopes":["emails.send","contacts.write"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Add a lead","description":"Adds a lead with its contacts and returns it. In `contacts`, link people you already have (`contactId`) or add new ones (`contact`). Exactly one contact must be the main one (`isPrimary: true`).\n\n> [!WARNING]\n> Fusio does not stop you from adding the same company twice. Ask `leads.check-duplicate` with the company number or an email first.\n\n`segmentIds`, `tagIds` and `leadCustomFields` replace what the lead had. Leave a list out to keep it as it is. A custom field that is a unique key may not have the same value on two leads; then you get 422 on `leadCustomFields`.\n\n`firmographics` holds facts about the company, like the CZ-NACE code and the number of people. Fusio may fill in more from the business register later.\n\n> [!WARNING]\n> While your company has an active email sequence, this change can start it for the lead. A key then needs `emails.send`.\n\nErrors: 422 with `payload.metric` crm_records when your plan has no room for more records. A lead counts as 1 record, and each new contact as 1 more.\n\nNeeds one of these permissions: leads.write. Some values also need: emails.send, contacts.write. You must tick these on purpose: emails.send."}},"/v1/leads/{lead}":{"get":{"operationId":"leads.show","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateLeadData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Lead retrieved successfully.","payload":{"id":"3051","countryId":58,"countryIso":"CZ","name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","vatNumber":"CZ87654321","unattestedIdentity":null,"street":"Mlýnská 8","city":"Brno","zip":"60200","stage":"warm","lostReason":null,"lostReasonNote":null,"personType":"legal","source":"referral","website":"https://www.example.cz","hasResearchProfile":false,"originatingLeadFormId":null,"outreachStatus":"not_contacted","contactsCount":1,"countryName":"Česko","billingAddressSameAsLegal":true,"billingAddress":null,"registerLookupStatus":"completed","registerLookupLocked":false,"originatingLeadFormName":null,"leadContacts":[{"id":9120,"leadId":3051,"contactId":7720,"isPrimary":true,"buyingRole":"decision_maker","contact":{"id":"7720","userId":88,"tenantId":412,"segments":[{"id":21,"tenantId":412,"userId":88,"name":"Pekárny","slug":"pekarny","description":"Pekárny a cukrárny v Brně a okolí."}],"tags":[{"id":71,"tenantId":412,"userId":88,"name":"Firemní flotila","slug":"firemni-flotila","color":"#2b6cb0","notes":null,"assignmentSource":"api"}],"contactCustomFields":[{"id":1503,"contactId":7720,"customField":{"id":9,"userId":88,"tenantId":412,"name":"preferred_visit_day","label":"Den návštěvy","description":null,"type":"text","isRequired":false,"isActive":true,"isUniqueIdentifier":false,"options":null,"deletedAt":null},"value":"úterý"}],"communicationPreference":{"id":6610,"hashToken":"b7f3c2a9e4d14f0c9a1e5d77","prefersId":7720,"prefersType":"contact","isGloballyUnsubscribed":false,"unsubscriptionReason":null,"unsubscriptionReasonDescription":null,"languageId":2,"emailFormat":"html","channelEmailEnabled":true,"channelSmsEnabled":false,"emailConsentStatus":"subscribed","smsConsentStatus":"not_specified","callConsentStatus":"not_specified","consentUpdatedAt":"2026-11-03T08:30:00Z","consentIp":null,"consentUserAgent":null,"consentSource":"api","recipientName":"Petr Svoboda","recipientEmail":"petr.svoboda@example.cz","senderName":"Cyklo Novák s.r.o."},"lead":{"id":"3051","countryId":58,"countryIso":"CZ","name":"Pekárna U Mlýna s.r.o.","registrationNumber":"87654321","vatNumber":"CZ87654321","unattestedIdentity":null,"street":"Mlýnská 8","city":"Brno","zip":"60200","stage":"warm","lostReason":null,"lostReasonNote":null,"personType":"legal","source":"referral","website":"https://www.example.cz","hasResearchProfile":false,"originatingLeadFormId":null,"outreachStatus":"not_contacted","contactsCount":0,"countryName":"Česko","billingAddressSameAsLegal":true,"billingAddress":null,"registerLookupStatus":"completed","registerLookupLocked":false},"type":"company","email":"petr.svoboda@example.cz","firstName":"Petr","lastName":"Svoboda","name":null,"phone":"+420601234567","position":"Jednatel","preferredContactChannel":"email","lastActivityAt":"2026-11-12T13:05:00Z","emailVerifiedAt":null}}],"segmentIds":[21],"tagIds":[71],"leadCustomFields":[{"customFieldId":10,"value":"12"}],"tasks":[{"id":5530,"tenantId":412,"userId":88,"assigneeId":88,"assignee":{"id":88,"firstName":"Jana","lastName":"Nováková"},"taskableType":"lead","taskableId":3051,"noteId":null,"title":"Zavolat kvůli nabídce servisu","description":null,"dueAt":"2026-11-20T09:00:00Z","status":"pending","completedAt":null,"pinnedAt":null,"createdAt":"2026-11-12T13:05:00Z","updatedAt":"2026-11-12T13:05:00Z","cadenceStep":null,"outreachTouchId":null}],"notes":[{"id":4410,"tenantId":412,"userId":88,"user":{"id":88,"firstName":"Jana","lastName":"Nováková"},"noteableType":"lead","noteableId":3051,"body":"Mají 12 firemních kol na rozvoz. Chtějí jeden servis ročně.","leadOutreachTouchId":null,"outreachTouch":null,"createdAt":"2026-11-12T13:05:00Z","updatedAt":"2026-11-12T13:05:00Z","pinnedAt":null}],"firmographic":{"source":"ares","fetchedAt":"2026-11-03T08:31:00Z","isActive":true,"czNace":"10710","czNaceLabel":"Výroba pekařských a cukrářských výrobků, kromě trvanlivých","naceCategory":{"value":"manufacturing","label":"Manufacturing"},"legalForm":{"value":"112","label":"Společnost s ručením omezeným"},"employeeBand":{"value":"small","label":"10–49 employees"},"region":"Jihomoravský kraj","registeredOn":"2014-05-12","shareCapital":200000,"businessActivities":["Pekařství, cukrářství"],"foundedOn":"2014-05-12","taxOffice":{"value":"461","label":"Územní pracoviště Brno I"},"registrations":{"vr":"AKTIVNI","res":"AKTIVNI","rzp":"AKTIVNI","dph":"AKTIVNI","ir":null},"naceCodes":[{"value":"10710","label":"Výroba pekařských a cukrářských výrobků, kromě trvanlivých"}],"institutionalSector":{"value":"11002","label":"Soukromé nefinanční podniky pod zahraniční kontrolou"},"deliveryAddress":"Mlýnská 8, 602 00 Brno","fileNumber":"C 81234","registryCourt":{"value":"KSBR","label":"Krajský soud v Brně"},"registerPeople":[{"firstName":"Petr","lastName":"Svoboda","position":"jednatel","isPrimary":true}],"czNaceExpired":false,"legalFormExpired":false}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Show a lead","description":"Returns the lead with its contacts, segments, tags, custom fields, tasks and more.\n\nNeeds one of these permissions: leads.read."},"put":{"operationId":"leads.update","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"billingAddressSameAsLegal":{"type":"boolean","description":"true means invoices go to the main address. false needs billingAddress. Leave it out to keep it as it is."},"billingAddress":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name on invoices, when it is not the name of the lead."},"street":{"type":"string","maxLength":255,"description":"The street and house number for invoices."},"city":{"type":"string","maxLength":255,"description":"The city for invoices."},"zip":{"type":["string","null"],"maxLength":20,"description":"The postal code for invoices, at most 20 characters."},"countryIso":{"type":"string","minLength":2,"maxLength":2,"description":"The country for invoices as two letters, like CZ."}},"required":["street","city","countryIso"],"description":"The address for invoices. Fusio reads it only when billingAddressSameAsLegal is false; then street, city and countryIso are needed."},"name":{"type":["string","null"],"maxLength":255,"description":"The name of the company or the person, at most 255 characters."},"registrationNumber":{"type":["string","null"],"maxLength":50,"description":"The company number (IČO), at most 50 characters. Ask leads.check-duplicate first, so you do not make the same company twice."},"vatNumber":{"type":["string","null"],"maxLength":50,"description":"The VAT number (DIČ), like CZ12345678, at most 50 characters."},"street":{"type":["string","null"],"maxLength":255,"description":"The street and house number."},"city":{"type":["string","null"],"maxLength":255,"description":"The city."},"zip":{"type":["string","null"],"maxLength":20,"description":"The postal code, at most 20 characters."},"countryIso":{"type":["string","null"],"minLength":2,"maxLength":2,"description":"The country as two letters, like CZ."},"stage":{"$ref":"#/components/schemas/LeadStage","description":"Where the lead is: cold, warm, qualified, client or lost."},"lostReason":{"anyOf":[{"$ref":"#/components/schemas/LeadLostReason"},{"type":"null"}],"description":"Why the lead is lost, like not_interested, no_budget or duplicate. other needs lostReasonNote."},"lostReasonNote":{"type":["string","null"],"maxLength":1000,"description":"Your own words about why the lead is lost, at most 1000 characters. Needed when lostReason is other."},"personType":{"anyOf":[{"$ref":"#/components/schemas/LeadPersonType"},{"type":"null"}],"description":"legal for a company, physical for a person."},"source":{"type":["string","null"],"enum":["web","cold_call","referral","campaign","event","partner","import","social_discovery",null],"description":"Where the lead came from: web, cold_call, referral, campaign, event, partner, social_discovery or import. A source that Fusio set itself, like lead_form, cannot be changed."},"website":{"type":["string","null"],"format":"uri","pattern":"^https?:\\/\\/(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?::[0-9]{1,5})?$","maxLength":255,"description":"The website. Fusio keeps only the start, like https://example.cz, unless preserveWebsitePath is true. Without http, Fusio adds https://."},"preserveWebsitePath":{"type":"boolean","description":"true keeps the whole web address, with the path after the domain."},"segmentIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the segments, at most 500. The list replaces the segments it had. Numbers that are not from your company are skipped."},"tagIds":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":500,"description":"The numbers of the tags, at most 500. The list replaces the tags it had. Numbers that are not from your company are skipped."},"leadCustomFields":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"integer","description":"The number of the custom field. It must be a field of your company."},"value":{"type":["string","null"],"maxLength":65535,"description":"The value as text, at most 65535 characters. null clears it. When the field is a unique key, no other record may have the same value."}}},"description":"The values of your custom fields. The list replaces all values: a field you leave out loses its value."},"firmographics":{"type":["object","null"],"properties":{"czNace":{"type":["string","null"],"description":"The CZ-NACE code of the main business, as in the register codebook."},"legalForm":{"type":["string","null"],"description":"The code of the legal form, as in the register codebook."},"employeeBand":{"anyOf":[{"$ref":"#/components/schemas/EmployeeBand"},{"type":"null"}],"description":"How many people work there: micro, small, medium, large or enterprise."},"region":{"anyOf":[{"$ref":"#/components/schemas/CzechRegion"},{"type":"null"}],"description":"The Czech region, written like Jihomoravský kraj."}},"description":"Facts about the company. A field you leave out keeps its value. null leaves all of them as they are."},"contacts":{"type":"array","items":{"type":"object","properties":{"contactId":{"type":"integer","description":"The number of a contact you already have. When it is on another lead, it moves here."},"isPrimary":{"type":"boolean","description":"true for the main contact of the lead."}},"required":["contactId","isPrimary"]},"minItems":1,"uniqueItems":true,"description":"Contacts to link to the lead or to change, at least one. Exactly one of them must have isPrimary true. Contacts you leave out stay on the lead."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Change a lead","description":"Changes only the fields you send. The answer has no data; read the lead again with `leads.show`.\n\n`contacts` links or changes the contacts you list. It does not take other contacts off the lead; use `lead-contacts.destroy` for that.\n\n`segmentIds`, `tagIds` and `leadCustomFields` replace what the lead had. Leave a list out to keep it as it is. A custom field that is a unique key may not have the same value on two leads; then you get 422 on `leadCustomFields`.\n\n> [!WARNING]\n> While your company has an active email sequence, this change can start it for the lead. A key then needs `emails.send`.\n\nErrors: 409 `lead.register_lookup_processing` when you change the company number, the country or `firmographics` while Fusio is still reading the business register. Try again in a moment.\n\nNeeds one of these permissions: leads.write. Some values also need: emails.send. You must tick these on purpose: emails.send."},"delete":{"operationId":"leads.destroy","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Delete a lead","description":"Deletes the lead and stops its cadences. The answer has no data.\n\nYou get 422 while a document of the lead waits for signatures.\n\n> [!CAUTION]\n> The API cannot bring the lead back.\n\nNeeds one of these permissions: leads.write."}},"/v1/lead-outreach-queue":{"get":{"operationId":"lead-outreach-queue.index","tags":["leads"],"parameters":[{"name":"limit","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":20},"description":"How many prospects to return, from 1 to 20. 20 when left out."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/LeadOutreachQueueItemData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List your prospects waiting for the first contact","description":"You get the prospects that discovery found, someone approved and that are assigned to you, while nobody has contacted them yet: their stage is cold, they have no outbound outreach touch and they are not in a running or paused plan. The best fit comes first; prospects without a score come last.\n\nTo start the outreach, pick an active outreach plan with `GET /lead-cadence-templates?purpose=outreach&active=1` and, if you want, a framework with `GET /message-frameworks?goal=initial_outreach`. Show the prospects and the plan to the person you work for, and after they agree enroll each prospect with `POST /leads/{lead}/cadence-enrollments`. An enrolled prospect leaves this list.\n\nNeeds one of these permissions: leads.read."}},"/v1/lead-cadence-tasks/due":{"get":{"operationId":"lead-cadence-tasks.due","tags":["leads"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CadenceDueTasksData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List cadence messages to send now and steps to prepare","description":"You get the cadence work of the leads assigned to you, in cadences that are running. Only steps that are still open count.\n\n`toSend` holds the messages someone approved in Fusio and that you send yourself: LinkedIn and WhatsApp. Emails are sent by Fusio, and calls, SMS and voice messages are never here. Show the batch to the person you work for and send it only after they agree. Report each message with `POST /lead-cadence-tasks/{leadCadenceTask}/complete` right after you send it, one call at a time and never in parallel. Each cadence gives one message at a time; call this endpoint again for its next one.\n\n`toPrepare` holds steps without content, for example a new path the cadence switched to. `outreachTask` names the kind of content the step needs. Prepare the step, for example with `POST /lead-cadence-tasks/{leadCadenceTask}/outreach/generate`; emails and LinkedIn or WhatsApp messages then wait for approval in Fusio. Never send these steps from this list. After preparing, call this endpoint again to get further steps. Content that someone removed is not offered again; content canceled because the lead replied is.\n\n`contact` is the lead's main contact, or null when the lead has none. `linkedinUrl` is set when Fusio found the lead on LinkedIn.\n\nNeeds one of these permissions: leads.read."}},"/v1/lead-cadence-tasks/{leadCadenceTask}/complete":{"post":{"operationId":"lead-cadence-tasks.complete","tags":["leads"],"parameters":[{"name":"leadCadenceTask","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sentText":{"type":"string","maxLength":5000,"description":"The text you sent to the lead, at most 5000 characters."}},"required":["sentText"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CadenceDueTaskItemData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"summary":"Report an approved cadence message as sent","description":"Call this only after you sent the step's approved LinkedIn or WhatsApp message yourself, right after sending it. Report one message at a time, never in parallel, and get the next one from `GET /lead-cadence-tasks/due`. Fusio marks the message as sent with your text, adds an outbound touch to the lead and completes the step, so the cadence moves on. When this step comes after steps that were not done yet, the cadence skips them and cancels their messages. The answer is the sent item, as in `toSend` of `GET /lead-cadence-tasks/due`.\n\nReporting the same message again changes nothing and gives the same answer. When the step's message is not approved, or was removed, you get 409 `outreach_message_not_approved`. An email, call or other step gives 409 `outreach_channel_mismatch`: Fusio sends emails itself. A message written for another channel than the step uses now also gives 409 `outreach_channel_mismatch`. A message whose send time has not come yet gives 409 `outreach_message_not_due`. When the step is no longer open, for example because the cadence is paused, you get 409 `outreach_task_not_open`.\n\nNeeds one of these permissions: leads.write."}},"/v1/lead-cadence-tasks/{leadCadenceTask}/outreach/generate":{"post":{"operationId":"lead-cadence-tasks.outreach.generate","tags":["leads"],"parameters":[{"name":"leadCadenceTask","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/CadenceOutreachResultData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","leads.write"]}],"x-fusio-conditional-scopes":["emails.write"],"summary":"Write the content of a cadence step with AI","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nFusio writes the content of one step of a lead's cadence: an email, a LinkedIn or WhatsApp message, a call script, an SMS or a voice message. The answer is 201 with the saved content. Emails and LinkedIn or WhatsApp messages wait for approval in Fusio; nothing is sent until someone approves them.\n\nWhen Fusio knows too little about the lead, you get 422 `outreach_insufficient_context` with `missingAxes`, the things it is missing. When the AI answer cannot be used, you get 422 `outreach_generation_invalid`. A step without content, such as a meeting, gives 409 `outreach_channel_mismatch`. While Fusio is still writing the same step for an earlier request, you get 409 `outreach_generation_in_progress`; wait a moment and try again. Credits are charged only when the content is saved.\n\nA key also needs `leads.write`. For an email step, a key without `emails.write` gets 403 `insufficient_scope`.\n\nNeeds one of these permissions: ai.generate. Also needs: leads.write. Some values also need: emails.write."}},"/v1/leads/{lead}/analytics":{"get":{"operationId":"leads.analytics","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."},{"name":"contact_id","in":"query","schema":{"type":["integer","null"]},"description":"Count only this contact of the lead. It must be a contact of this lead."},{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The first day to count, like 2026-11-01. Leave it out to count from the start."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The last day to count, like 2026-11-30. Leave it out to count up to now."},{"name":"cursor","in":"query","schema":{"type":["string","null"]},"description":"Not used here, but Fusio still checks it. Use leads.analytics.history to page through events."},{"name":"per_page","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":100},"description":"Not used here, but Fusio still checks it. Use leads.analytics.history to page through events."},{"name":"campaign_id","in":"query","schema":{"type":["integer","null"]},"description":"Count only this campaign. It must be a campaign of your company."},{"name":"type","in":"query","schema":{"type":["string","null"],"enum":["click","open","sent","web","email","form","ad","booking","deal","note","task","inquiry",null]},"description":"Not used here, but Fusio still checks it. Use leads.analytics.history to filter events."},{"name":"search","in":"query","schema":{"type":["string","null"],"maxLength":255},"description":"Not used here, but Fusio still checks it. Use leads.analytics.history to filter events."},{"name":"actor","in":"query","schema":{"type":["string","null"],"enum":["all","me","team","contact","system",null]},"description":"Not used here, but Fusio still checks it. Use leads.analytics.history to filter events."},{"name":"group_sessions","in":"query","schema":{"type":"boolean"},"description":"Not used here, but Fusio still checks it. Use leads.analytics.history to group web visits."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadAnalyticsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Show how a lead reacts","description":"Returns how the lead and each of its contacts react to emails. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/analytics/history":{"get":{"operationId":"leads.analytics.history","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."},{"name":"contact_id","in":"query","schema":{"type":["integer","null"]},"description":"Count only this contact of the lead. It must be a contact of this lead."},{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The first day to count, like 2026-11-01. Leave it out to count from the start."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The last day to count, like 2026-11-30. Leave it out to count up to now."},{"name":"cursor","in":"query","schema":{"type":["string","null"]},"description":"Where the next page starts. Take it from next_cursor of the page before."},{"name":"per_page","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":100},"description":"How many items one page has, from 1 to 100. Leave it out for 20."},{"name":"campaign_id","in":"query","schema":{"type":["integer","null"]},"description":"Not used here. Fusio checks that the campaign is yours, then shows all campaigns."},{"name":"type","in":"query","schema":{"type":["string","null"],"enum":["click","open","sent","web","email","form","ad","booking","deal","note","task","inquiry",null]},"description":"Show only one kind: click, open, sent, web, email, form, ad, booking, deal, note, task or inquiry."},{"name":"search","in":"query","schema":{"type":["string","null"],"maxLength":255},"description":"Text to look for in the events, at most 255 characters."},{"name":"actor","in":"query","schema":{"type":["string","null"],"enum":["all","me","team","contact","system",null]},"description":"Show only what someone did: all, me (you), team (your colleagues), contact (the people of the lead) or system (Fusio itself)."},{"name":"group_sessions","in":"query","schema":{"type":"boolean"},"description":"true shows each web visit as one event with its pages inside, and adds commonPath on the first page."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadHistoryPageOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Lead history fetched successfully","payload":{"data":[{"channel":"campaign","eventName":null,"campaignName":"Podzimní kontrola kol","trackableType":"email_campaign","trackableId":1840,"date":"2026-11-12T13:06:00Z","context":"button","url":"https://www.example.cz/servis","country":"CZ","deviceType":"mobile","leadFormId":null,"leadFormName":null,"submissionId":null,"browser":"Safari","operatingSystem":"iOS","locale":"cs-CZ","referer":null,"path":null,"hostname":null,"origin":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"utmTerm":null,"utmContent":"hlavni-tlacitko","clickIdSource":null,"clickIdValue":null,"consentState":null,"ingestSource":null,"result":null,"visitorSessionId":null,"payload":null,"recipientEmail":null,"deliveryStatus":null,"deliveredAt":null,"bouncedAt":null,"bounceReason":null,"bounceType":null,"bounceCode":null,"smtpCode":null,"unsubscribedAt":null,"unsubscribeReason":null,"spamComplaintAt":null,"envelopeId":null,"type":"click","source":"email","sourceId":99231,"submission":null,"record":null,"cadenceStep":null,"session":null},{"channel":"campaign","eventName":null,"campaignName":"Podzimní kontrola kol","trackableType":"email_campaign","trackableId":1840,"date":"2026-11-12T13:05:00Z","context":null,"url":null,"country":"CZ","deviceType":"mobile","leadFormId":null,"leadFormName":null,"submissionId":null,"browser":"Safari","operatingSystem":"iOS","locale":"cs-CZ","referer":null,"path":null,"hostname":null,"origin":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"utmTerm":null,"utmContent":null,"clickIdSource":null,"clickIdValue":null,"consentState":null,"ingestSource":null,"result":null,"visitorSessionId":null,"payload":null,"recipientEmail":null,"deliveryStatus":null,"deliveredAt":null,"bouncedAt":null,"bounceReason":null,"bounceType":null,"bounceCode":null,"smtpCode":null,"unsubscribedAt":null,"unsubscribeReason":null,"spamComplaintAt":null,"envelopeId":null,"type":"open","source":"email","sourceId":55410,"submission":null,"record":null,"cadenceStep":null,"session":null},{"channel":null,"eventName":null,"campaignName":null,"trackableType":null,"trackableId":null,"date":"2026-11-12T12:40:00Z","context":null,"url":null,"country":null,"deviceType":null,"leadFormId":null,"leadFormName":null,"submissionId":null,"browser":null,"operatingSystem":null,"locale":null,"referer":null,"path":null,"hostname":null,"origin":null,"utmSource":null,"utmMedium":null,"utmCampaign":null,"utmTerm":null,"utmContent":null,"clickIdSource":null,"clickIdValue":null,"consentState":null,"ingestSource":null,"result":null,"visitorSessionId":null,"payload":null,"recipientEmail":null,"deliveryStatus":null,"deliveredAt":null,"bouncedAt":null,"bounceReason":null,"bounceType":null,"bounceCode":null,"smtpCode":null,"unsubscribedAt":null,"unsubscribeReason":null,"spamComplaintAt":null,"envelopeId":null,"type":"deal","source":"crm","sourceId":1230,"submission":null,"record":{"kind":"deal","id":615,"event":"created","title":"Servis firemních kol 2027","detail":null,"status":"proposal","previousStatus":null,"startsAtUtc":null,"actorName":"Jana Nováková","parent":null},"cadenceStep":null,"session":null}],"path":"https://api.example.cz/api/v1/leads/3051/analytics/history","per_page":3,"next_cursor":"eyJkYXRlIjoiMjAyNi0xMS0xMiAwNzowMDowMCIsInNvdXJjZUlkIjozMDg3N30","next_page_url":"https://api.example.cz/api/v1/leads/3051/analytics/history?per_page=3&cursor=eyJkYXRlIjoiMjAyNi0xMS0xMiAwNzowMDowMCIsInNvdXJjZUlkIjozMDg3N30","prev_cursor":null,"prev_page_url":null,"typeCounts":{"click":2,"open":4,"sent":6,"web":0,"booking":0,"deal":1,"note":1,"task":1,"inquiry":0,"email":0,"form":0,"ad":0},"commonPath":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List the history of a lead page by page","description":"Returns everything that happened with the lead, newest first, one page at a time: emails, web visits, forms, ads, bookings, deals, notes, tasks and inquiries. Send `next_cursor` back as `cursor` to get the next page.\n\nThe person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/analytics/overview":{"get":{"operationId":"leads.analytics.overview","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadAnalyticsOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Show a short story of a lead","description":"Returns the main facts about the lead on one page: where it came from, what it did, what comes next and who decides. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/analytics/forms":{"get":{"operationId":"leads.analytics.forms","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."},{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The first day to count, like 2026-11-01. Leave it out to count from the start."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The last day to count, like 2026-11-30. Leave it out to count up to now."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadAnalyticsFormsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Show the forms a lead filled in","description":"Returns the forms the people of the lead saw, started and sent, with the answers. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/analytics/deals":{"get":{"operationId":"leads.analytics.deals","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadAnalyticsDealsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read","deals.read"]}],"summary":"Show the deals of a lead","description":"Returns the deals of the lead with their value, stage history, tasks and notes. The person behind the key needs the right to see analytics of leads. The person also needs the right to see deals.\n\nNeeds one of these permissions: leads.read. Also needs: deals.read."}},"/v1/leads/{lead}/analytics/web":{"get":{"operationId":"leads.analytics.web","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."},{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The first day to count, like 2026-11-01. Leave it out to count from the start."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The last day to count, like 2026-11-30. Leave it out to count up to now."},{"name":"timezone","in":"query","schema":{"type":["string","null"]},"description":"The time zone for days and hours, like Europe/Prague. Leave it out for UTC."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadAnalyticsWebData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Show the web visits of a lead","description":"Returns the visits of the people of the lead on your website. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/analytics/ads":{"get":{"operationId":"leads.analytics.ads","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."},{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The first day to count, like 2026-11-01. Leave it out to count from the start."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The last day to count, like 2026-11-30. Leave it out to count up to now."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadAnalyticsAdsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read","ads.read"]}],"summary":"Show the ad clicks of a lead","description":"Returns the ads the people of the lead clicked and what came of it. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read. Also needs: ads.read."}},"/v1/leads/{lead}/analytics/emails":{"get":{"operationId":"leads.analytics.emails","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."},{"name":"contact_id","in":"query","schema":{"type":["integer","null"]},"description":"Count only this contact of the lead. It must be a contact of this lead."},{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The first day to count, like 2026-11-01. Leave it out to count from the start."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The last day to count, like 2026-11-30. Leave it out to count up to now."},{"name":"cursor","in":"query","schema":{"type":["string","null"]},"description":"Where the next page starts. Take it from nextCursor of the page before."},{"name":"per_page","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":100},"description":"How many items one page has, from 1 to 100. Leave it out for 20."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadAnalyticsEmailsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read","emails.read"]}],"summary":"List the emails sent to a lead","description":"Returns the emails sent to the people of the lead, page by page, with opens, clicks and answers. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read. Also needs: emails.read."}},"/v1/leads/{lead}/analytics/related":{"get":{"operationId":"leads.analytics.related","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadAnalyticsRelatedData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"List leads that look related","description":"Returns other leads that seem to be the same company or belong to it. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/analytics/timeseries":{"get":{"operationId":"leads.analytics.timeseries","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."},{"name":"contact_id","in":"query","schema":{"type":["integer","null"]},"description":"Count only this contact of the lead. It must be a contact of this lead."},{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The first day to count, like 2026-11-01. Leave it out to count from the start."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date-time"},"description":"The last day to count, like 2026-11-30. Leave it out to count up to now."},{"name":"cursor","in":"query","schema":{"type":["string","null"]},"description":"Not used here, but Fusio still checks it. All days come in one answer."},{"name":"per_page","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":100},"description":"Not used here, but Fusio still checks it. All days come in one answer."},{"name":"campaign_id","in":"query","schema":{"type":["integer","null"]},"description":"Count only this campaign. It must be a campaign of your company."},{"name":"type","in":"query","schema":{"type":["string","null"],"enum":["click","open","sent","web","email","form","ad","booking","deal","note","task","inquiry",null]},"description":"Not used here, but Fusio still checks it. Every kind is counted."},{"name":"search","in":"query","schema":{"type":["string","null"],"maxLength":255},"description":"Not used here, but Fusio still checks it. Every event is counted."},{"name":"actor","in":"query","schema":{"type":["string","null"],"enum":["all","me","team","contact","system",null]},"description":"Not used here, but Fusio still checks it. Every event is counted."},{"name":"group_sessions","in":"query","schema":{"type":"boolean"},"description":"Not used here, but Fusio still checks it. Visits are always counted one by one."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsTimeSeriesDayData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Count what a lead did by day","description":"Returns one item for each day that has something: emails, opens, clicks, answers, web visits, forms, bookings and ad clicks. Days with nothing are left out. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/campaigns":{"get":{"operationId":"leads.campaigns","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsCampaignOutputData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"Lead campaigns fetched successfully","payload":[{"id":52,"name":"Podzimní kontrola kol","mode":"burst","sentAt":"2026-11-12T07:00:00Z"},{"id":47,"name":"Tipy pro firemní flotily","mode":"nurture","sentAt":"2026-10-06T07:00:00Z"}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read","campaigns.read"]}],"summary":"List the campaigns that emailed a lead","description":"Returns the campaigns that sent an email to any contact of the lead, newest first. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read. Also needs: campaigns.read."}},"/v1/leads/{lead}/scoring":{"get":{"operationId":"leads.scoring","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadScoringData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read"]}],"summary":"Show the score of a lead","description":"Returns how well the lead fits and how interested it is, with the reasons. The person behind the key needs the right to see analytics of leads.\n\nNeeds one of these permissions: leads.read."}},"/v1/leads/{lead}/contacts":{"get":{"operationId":"lead-contacts.index","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/LeadContact.IndexLeadContactData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.read","contacts.read"]}],"summary":"List the contacts of a lead","description":"Returns the contacts of the lead. Each item is a link between the lead and a contact.\n\nNeeds one of these permissions: leads.read. Also needs: contacts.read."},"post":{"operationId":"lead-contacts.store","tags":["leads"],"parameters":[{"name":"lead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactId":{"type":"integer","description":"The number of the contact. When it is on another lead, it moves here."},"isPrimary":{"type":"boolean","description":"true makes it the main contact of the lead. Leave it out for false."}},"required":["contactId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadContact.IndexLeadContactData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write","contacts.write"]}],"summary":"Link a contact to a lead","description":"Links the contact to the lead and returns the link. A contact belongs to one lead only, so it leaves its old lead.\n\nNeeds one of these permissions: leads.write. Also needs: contacts.write."}},"/v1/lead-contacts/{leadContact}":{"put":{"operationId":"lead-contacts.update","tags":["leads"],"parameters":[{"name":"leadContact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the link between a lead and a contact. You get it from the list of contacts of the lead."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"contactId":{"type":"integer","description":"Not used here, but Fusio still checks it. The link always keeps its contact."},"isPrimary":{"type":"boolean","description":"true makes it the main contact of the lead."},"buyingRole":{"anyOf":[{"$ref":"#/components/schemas/LeadContactBuyingRole"},{"type":"null"}],"description":"What the person does in the buying: decision_maker, champion, influencer, user or blocker. null clears it."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write","contacts.write"]}],"summary":"Change the role of a contact on a lead","description":"Makes the contact the main one or sets its buying role. The answer has no data.\n\nNeeds one of these permissions: leads.write. Also needs: contacts.write."},"delete":{"operationId":"lead-contacts.destroy","tags":["leads"],"parameters":[{"name":"leadContact","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the link between a lead and a contact. You get it from the list of contacts of the lead."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write","contacts.write"]}],"summary":"Take a contact off a lead","description":"Takes the contact off the lead. The contact itself stays. The answer has no data. You get 422 when it is the last contact of the lead, or the main one; make another contact the main one first.\n\nNeeds one of these permissions: leads.write. Also needs: contacts.write."}},"/v1/mascots":{"get":{"operationId":"mascots.index","tags":["mascots"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/TenantMascotOutputData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"List mascots","description":"Returns all your mascots with their places, friends and the presets that use them.\n\nNeeds one of these permissions: intelligence.read."},"post":{"operationId":"mascots.store","tags":["mascots"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":120,"description":"The name of the mascot, at most 120 characters."},"description":{"type":["string","null"],"maxLength":1000,"description":"What the mascot looks like, at most 1000 characters."},"fileId":{"type":["integer","null"],"description":"The number of a picture of the mascot."},"profileIds":{"type":"array","items":{"type":"integer"},"uniqueItems":true,"description":"Numbers of the image style presets that use the mascot. A preset holds at most 3 mascots."},"personality":{"type":["string","null"],"maxLength":500,"description":"How the mascot behaves, at most 500 characters."},"places":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":300}},"required":["name"]},"maxItems":5,"description":"Places where the mascot appears, at most 5, each with a name and a description of at most 300 characters."},"friends":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":120},"description":{"type":["string","null"],"maxLength":300},"friendMascotId":{"type":["integer","null"]},"fileId":{"type":["integer","null"]}}},"maxItems":5,"uniqueItems":true,"description":"Friends of the mascot, at most 5. Each has a name, or friendMascotId for another of your mascots, a description of at most 300 characters and fileId for a picture."}},"required":["name"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantMascotOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Create a mascot","description":"Creates a mascot. AI can then draw it in pictures of the presets in profileIds.\n\nYou get 422 when a preset in profileIds already has 3 mascots, when the picture is not an image, or when a friend has neither a name nor friendMascotId.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/mascots/generations":{"post":{"operationId":"mascots.generations.store","tags":["mascots"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"profileId":{"type":"integer","description":"The number of the image style preset whose style AI draws in."},"name":{"type":"string","maxLength":120,"description":"The name of the mascot, at most 120 characters."},"prompt":{"type":"string","maxLength":1000,"description":"What the mascot should look like, at most 1000 characters."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["profileId","name","prompt"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AiImageGenerationStatusData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Draw a mascot with AI","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI draws pictures of a mascot in the style of the preset, in the background. The answer is 201 with the work; watch its status and progress.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/mascots/description":{"post":{"operationId":"mascots.description.store","tags":["mascots"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileId":{"type":"integer","description":"The number of your picture of the mascot."},"name":{"type":"string","maxLength":120,"description":"The name of the mascot, at most 120 characters."},"profileId":{"type":["integer","null"],"description":"The number of an image style preset, when the description is for one."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["fileId","name"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MascotDescriptionOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Describe a mascot with AI","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAI looks at a picture of your mascot and writes what it looks like and how it behaves. Nothing is saved: put the text into description and personality of the mascot. The file must be a picture; otherwise you get 422.\n\nYou get 402 when you do not have enough credits.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/mascots/{mascot}":{"put":{"operationId":"mascots.update","tags":["mascots"],"parameters":[{"name":"mascot","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the mascot."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":120,"description":"The name of the mascot, at most 120 characters."},"description":{"type":["string","null"],"maxLength":1000,"description":"What the mascot looks like, at most 1000 characters."},"fileId":{"type":["integer","null"],"description":"The number of a picture of the mascot."},"profileIds":{"type":"array","items":{"type":"integer"},"uniqueItems":true,"description":"Numbers of the image style presets that use the mascot. A preset holds at most 3 mascots."},"personality":{"type":["string","null"],"maxLength":500,"description":"How the mascot behaves, at most 500 characters."},"places":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":120},"description":{"type":["string","null"],"maxLength":300}},"required":["name"]},"maxItems":5,"description":"Places where the mascot appears, at most 5, each with a name and a description of at most 300 characters."},"friends":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":120},"description":{"type":["string","null"],"maxLength":300},"friendMascotId":{"type":["integer","null"]},"fileId":{"type":["integer","null"]}}},"maxItems":5,"uniqueItems":true,"description":"Friends of the mascot, at most 5. Each has a name, or friendMascotId for another of your mascots, a description of at most 300 characters and fileId for a picture."}},"required":["name"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantMascotOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Change a mascot","description":"Changes a mascot. Always send the name. Leave out a field to keep it; a list you send replaces the old one. A mascot cannot be its own friend.\n\nYou get 422 when a preset in profileIds already has 3 mascots, when the picture is not an image, or when a friend has neither a name nor friendMascotId.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."},"delete":{"operationId":"mascots.destroy","tags":["mascots"],"parameters":[{"name":"mascot","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the mascot."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Remove a mascot","description":"Removes a mascot. Presets that used it no longer draw it, and other mascots lose it as a friend.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/meta-ads/overview":{"get":{"operationId":"meta-ads.overview","tags":["meta-ads"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[campaignId]","in":"query","schema":{"type":["integer","null"]},"description":"Only this campaign of yours. Leave it out for all."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Show the Meta ads overview","description":"Returns how your Meta campaigns did in a range of days: impressions, reach, link clicks, results and spend from Meta, and the visits, leads and clients Fusio saw from them.\n\nMeta sends new numbers every night and a few times during the day. Reach shows only for the ranges of the last 7, 30 or 90 days. Meta goals come later. Until then the conversions in kpis are empty, and totals.fusio.conversions is 0.\n\nThis address allows 120 requests a minute.\n\nNeeds one of these permissions: ads.read."}},"/v1/meta-ads-campaigns":{"get":{"operationId":"meta-ads-campaigns.index","tags":["meta-ads"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsTreeData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List Meta ad campaigns","description":"Returns everything about your Meta campaigns at once: your settings and budget, a count, and all campaigns with their ad sets and ads.\n\nThis route takes no filters.\n\nNeeds one of these permissions: ads.read."},"post":{"operationId":"meta-ads-campaigns.store","tags":["meta-ads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name of the campaign, at most 255 characters. No other campaign may have it. When you leave it out on create, Fusio makes one."},"objective":{"$ref":"#/components/schemas/MetaAdsObjective","description":"What the campaign wants to get: awareness, traffic, engagement, leads or sales. Needed on create."},"destination":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsDestination"},{"type":"null"}],"description":"Where people go after a click: website, instant_form or on_post. Which ones work depends on the objective."},"specialAdCategory":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsSpecialAdCategory"},{"type":"null"}],"description":"credit, employment, housing, financial_products_services or online_gambling_and_gaming, or null."},"campaignBudgetEnabled":{"type":"boolean","description":"true for one budget for the whole campaign. false for a budget in each ad set."},"budgetType":{"$ref":"#/components/schemas/MetaAdsBudgetType","description":"daily or lifetime."},"budgetAmount":{"type":["number","null"],"minimum":0.01,"maximum":9999999999999.99,"description":"The budget as text like \"500.00\", or null."},"bidStrategy":{"$ref":"#/components/schemas/MetaAdsBidStrategy","description":"lowest_cost, cost_cap, bid_cap or min_roas. min_roas works only for sales."},"bidAmount":{"type":["number","null"],"minimum":0.01,"maximum":9999999999999.99,"description":"The bid or the cost limit as text. Needed for cost_cap and bid_cap, not allowed for the others."},"roasFloor":{"type":["number","null"],"minimum":0.01,"maximum":9999.9999,"description":"The lowest return on the money, from 0.01 to 9999.9999. Needed for min_roas, not allowed for the others."},"startsAt":{"type":["string","null"],"description":"When the campaign starts, with a time zone, or null."},"endsAt":{"type":["string","null"],"description":"When the campaign ends, with a time zone, or null. It must be after startsAt."},"conversionPixelExternalId":{"type":["string","null"],"maxLength":255,"description":"The Meta pixel that counts the results. Only when the objective needs it. May stay empty on a draft; approval needs it."},"conversionEvent":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsConversionEvent"},{"type":"null"}],"description":"The pixel event that counts as a result, like purchase. Only when the objective needs it. May stay empty on a draft; approval needs it."},"leadFormId":{"type":["integer","null"],"description":"The number of an active lead form from `meta-ads-lead-forms.index`. Only for instant_form. May stay empty on a draft; approval needs it."},"creativeEnhancementsEnabled":{"type":"boolean","description":"true when Meta may change the look of the ads a little."}},"required":["objective"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Create a Meta ad campaign","description":"Creates a draft campaign with one empty ad set and answers 201 with it. Nothing goes to Meta.\n\nWhich fields you may send depends on the objective. A field the objective does not allow gives 422.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-campaigns/bulk-delete":{"post":{"operationId":"meta-ads-campaigns.bulk-delete","tags":["meta-ads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignIds":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":100,"uniqueItems":true,"description":"The numbers of the campaigns to remove, from 1 to 100, each once."}},"required":["campaignIds"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.facebook"],"x-fusio-opt-in-scopes":["ads.execute.facebook"],"summary":"Remove many Meta campaigns at once","description":"> [!WARNING]\n> This cannot be undone.\n\nRemoves draft campaigns with their ad sets and ads. All of them must be drafts; when one is not, nothing is removed and you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running.\n\nCampaigns that are already in Meta are archived there first, so they stop for good. For that a key needs `ads.execute.facebook`. When Meta does not archive one, nothing is removed in Fusio and you get 422; the ones Meta already archived stay archived. Try again later. While an upload runs, you get 422 too.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.facebook. You must tick these on purpose: ads.execute.facebook."}},"/v1/meta-ads-campaigns/brief-picks":{"post":{"operationId":"meta-ads-campaigns.brief-picks","tags":["meta-ads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"objective":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsObjective"},{"type":"null"}],"description":"The goal you already chose: awareness, traffic, engagement, leads or sales. AI keeps it. Leave it out and AI picks."},"brief":{"type":"string","minLength":20,"maxLength":4000,"description":"What the campaign should be about, from 20 to 4000 characters."},"leadFormId":{"type":["integer","null"],"description":"The number of an active lead form from `meta-ads-lead-forms.index`. Send it when people may fill in a form right in Facebook or Instagram."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["brief"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsBriefPicksData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI pick a goal and page for Meta","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nReads your brief and picks with AI the goal, the page of your website and what should count as a result. Nothing is saved; use the picks when you call `meta-ads-campaigns.generate`. The same brief gives the same picks for an hour.\n\nYou get 402 when you do not have enough credits.\n\nThis address allows 10 requests a minute.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/meta-ads-campaigns/generate":{"post":{"operationId":"meta-ads-campaigns.generate","tags":["meta-ads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"objective":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsObjective"},{"type":"null"}],"description":"What the campaign wants to get: awareness, traffic, engagement, leads or sales. Leave it out and AI picks."},"destination":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsDestination"},{"type":"null"}],"description":"Where people go after a click: website, instant_form or on_post. Send it only with objective. Which ones work depends on the objective."},"conversionEvent":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsConversionEvent"},{"type":"null"}],"description":"The pixel event that counts as a result, like purchase. Send it only with an objective that needs it. Leave it out and AI picks."},"brief":{"type":"string","minLength":20,"maxLength":4000,"description":"What the campaign should be about, from 20 to 4000 characters."},"landingPageUrl":{"type":["string","null"],"maxLength":2048,"description":"The page of your website the ads should lead to, at most 2048 characters. Leave it out and AI picks one."},"leadFormId":{"type":["integer","null"],"description":"The number of an active lead form from `meta-ads-lead-forms.index`. Only for leads with instant_form."},"monthlyBudgetShare":{"type":["number","null"],"minimum":0.01,"maximum":9999999999999.99,"description":"How much of your monthly Meta budget this campaign may use, as text like \"2500.00\". Leave it out and it may use all that is left."},"durationDays":{"type":["integer","null"],"minimum":1,"maximum":90,"description":"How many days the campaign should run, from 1 to 90. Leave it out and the campaign runs with no end date, on a daily budget."},"imageSource":{"$ref":"#/components/schemas/MetaAdsImageSource","description":"Where the pictures come from: library (your own files), generate (AI draws new ones) or mixed (both)."},"tenantImageProfileId":{"type":["integer","null"],"description":"The number of the image style preset AI draws with, or null."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["brief","imageSource"]}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdCampaignGenerationOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI build a Meta campaign","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nMakes a draft Meta campaign and lets AI build it in the background: it picks the goal and the page, plans the ad sets and their targeting, writes the ads and adds pictures. The answer is 202 with the campaign and the job; follow the job with `meta-ads-operations.show`. Nothing goes to Meta.\n\nYou get 422 when you have no monthly Meta budget yet or no Meta ad account is picked. You get 422 on `monthlyBudgetShare` when the share is more than what is left this month. You get 409 when another job already runs, and 402 when you do not have enough credits.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/meta-ads-campaigns/{metaAdsCampaign}/generate/retry":{"post":{"operationId":"meta-ads-campaigns.generate.retry","tags":["meta-ads"],"parameters":[{"name":"metaAdsCampaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/AdCampaignGenerationOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI try a failed Meta campaign again","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nStarts the AI building of a Meta campaign again after it failed or stopped. The answer is 202 with the campaign and the new job. When the share of the monthly budget is more than what is left, it is lowered to what is left.\n\nOnly a draft can be built again; otherwise you get 403. When the building did not fail or another job already runs, you get 409. You get 422 for the same reasons as with `meta-ads-campaigns.generate`, and 422 on `monthlyBudgetShare` when nothing is left of the monthly budget.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/meta-ads-campaigns/{metaAdsCampaign}":{"put":{"operationId":"meta-ads-campaigns.update","tags":["meta-ads"],"parameters":[{"name":"metaAdsCampaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the campaign, at most 255 characters. No other campaign may have it."},"objective":{"$ref":"#/components/schemas/MetaAdsObjective","description":"What the campaign wants to get: awareness, traffic, engagement, leads or sales."},"destination":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsDestination"},{"type":"null"}],"description":"Where people go after a click: website, instant_form or on_post. Which ones work depends on the objective."},"specialAdCategory":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsSpecialAdCategory"},{"type":"null"}],"description":"credit, employment, housing, financial_products_services or online_gambling_and_gaming, or null."},"campaignBudgetEnabled":{"type":"boolean","description":"true for one budget for the whole campaign. false for a budget in each ad set."},"budgetType":{"$ref":"#/components/schemas/MetaAdsBudgetType","description":"daily or lifetime."},"budgetAmount":{"type":["number","null"],"minimum":0.01,"maximum":9999999999999.99,"description":"The budget as text like \"500.00\", or null."},"bidStrategy":{"$ref":"#/components/schemas/MetaAdsBidStrategy","description":"lowest_cost, cost_cap, bid_cap or min_roas. min_roas works only for sales."},"bidAmount":{"type":["number","null"],"minimum":0.01,"maximum":9999999999999.99,"description":"The bid or the cost limit as text. Needed for cost_cap and bid_cap, not allowed for the others."},"roasFloor":{"type":["number","null"],"minimum":0.01,"maximum":9999.9999,"description":"The lowest return on the money, from 0.01 to 9999.9999. Needed for min_roas, not allowed for the others."},"startsAt":{"type":["string","null"],"description":"When the campaign starts, with a time zone, or null."},"endsAt":{"type":["string","null"],"description":"When the campaign ends, with a time zone, or null. It must be after startsAt."},"conversionPixelExternalId":{"type":["string","null"],"maxLength":255,"description":"The Meta pixel that counts the results. Only when the objective needs it. May stay empty on a draft; approval needs it."},"conversionEvent":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsConversionEvent"},{"type":"null"}],"description":"The pixel event that counts as a result, like purchase. Only when the objective needs it. May stay empty on a draft; approval needs it."},"leadFormId":{"type":["integer","null"],"description":"The number of an active lead form from `meta-ads-lead-forms.index`. Only for instant_form. May stay empty on a draft; approval needs it."},"creativeEnhancementsEnabled":{"type":"boolean","description":"true when Meta may change the look of the ads a little."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Change a Meta ad campaign","description":"Changes only the fields you send and returns the campaign. Nothing goes to Meta.\n\nOnly a draft can change; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running.\n\nNeeds one of these permissions: ads.write."},"delete":{"operationId":"meta-ads-campaigns.destroy","tags":["meta-ads"],"parameters":[{"name":"metaAdsCampaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"x-fusio-conditional-scopes":["ads.execute.facebook"],"x-fusio-opt-in-scopes":["ads.execute.facebook"],"summary":"Remove a Meta ad campaign","description":"> [!WARNING]\n> This cannot be undone.\n\nRemoves a draft campaign with its ad sets and ads. Only a draft can go; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running.\n\nA campaign that is already in Meta is archived there first, so it stops for good. For that a key needs `ads.execute.facebook`. When Meta does not archive it, nothing is removed and you get 422; try again later. While an upload runs, you get 422 too.\n\nNeeds one of these permissions: ads.write. Some values also need: ads.execute.facebook. You must tick these on purpose: ads.execute.facebook."}},"/v1/meta-ads-campaigns/{metaAdsCampaign}/approve":{"post":{"operationId":"meta-ads-campaigns.approve","tags":["meta-ads"],"parameters":[{"name":"metaAdsCampaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.facebook"]}],"x-fusio-opt-in-scopes":["ads.execute.facebook"],"summary":"Approve a Meta ad campaign","description":"> [!WARNING]\n> This makes the campaign ready to upload to Meta. For that a key needs `ads.execute.facebook`.\n\nApproves a draft campaign and returns it. Nothing goes to Meta yet.\n\nWhen something must be fixed first, you get 422 with the list of codes in `payload.blockers`. Only a draft can be approved; otherwise you get 403.\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.facebook. You must tick these on purpose: ads.execute.facebook."},"delete":{"operationId":"meta-ads-campaigns.unapprove","tags":["meta-ads"],"parameters":[{"name":"metaAdsCampaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Take back the approval of a Meta campaign","description":"Turns an approved campaign back into a draft and returns it, so you can change it again. Only an approved campaign can go back; otherwise you get 403.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-campaigns/{metaAdsCampaign}/meta-ads/preflight":{"get":{"operationId":"meta-ads-campaigns.meta-ads.preflight","tags":["meta-ads"],"parameters":[{"name":"metaAdsCampaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsDeploymentPreflightData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Check a Meta campaign before you upload it","description":"Checks an approved campaign before it is uploaded to Meta. Nothing is uploaded and Meta is not asked.\n\nOnly an approved campaign can be checked; otherwise you get 403.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-campaigns/{metaAdsCampaign}/meta-ads/deploy":{"post":{"operationId":"meta-ads-campaigns.meta-ads.deploy","tags":["meta-ads"],"parameters":[{"name":"metaAdsCampaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planRevision":{"type":"string","pattern":"^[a-f0-9]{64}$","minLength":64,"maxLength":64,"description":"`planRevision` from `meta-ads-campaigns.meta-ads.preflight`: 64 small letters and digits. When the plan changed in the meantime, you get 422 on planRevision."},"idempotencyKey":{"type":"string","format":"uuid","description":"A UUID you make for this upload. When you try again, send the same one, so the campaign is not made twice."}},"required":["planRevision","idempotencyKey"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsDeploymentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.facebook"]}],"x-fusio-opt-in-scopes":["ads.execute.facebook"],"summary":"Upload a campaign to Meta","description":"> [!WARNING]\n> This makes a campaign in your Meta ad account. For that a key needs `ads.execute.facebook`.\n\nUploads an approved campaign to Meta and returns the deployment. The upload runs in the background: pictures and videos, the form, the campaign, its ad sets and ads. Follow it with `meta-ads-deployments.show`. It ends as paused, failed or reconciliation_required. For reconciliation_required, use `meta-ads-deployments.reconcile`.\n\nEverything gets to Meta paused, so nothing is spent until you start it with `meta-ads-deployments.status`.\n\nThe same `idempotencyKey` returns the same deployment. The same key with another plan gets 409. Another key while an upload of the same plan runs returns that upload. Another key after the campaign is already in Meta returns the existing deployment with 200 when the plan did not change. Another key with a changed plan gets 422; send changes with `meta-ads-deployments.apply` instead. When something must be fixed first, you get 422 with the codes in `errors.preflight`, the same as `blockers` of the preflight. You get 409 when Meta must be connected again.\n\nA campaign that stops being approved just before the upload gets 422 on `deployment`.\n\nThis address allows 10 requests a minute.\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.facebook. You must tick these on purpose: ads.execute.facebook."}},"/v1/meta-ads-deployments/{metaAdsDeployment}":{"get":{"operationId":"meta-ads-deployments.show","tags":["meta-ads"],"parameters":[{"name":"metaAdsDeployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment, from `deployment.id` of the campaign or from `id` of the answer of `meta-ads-campaigns.meta-ads.deploy`."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsDeploymentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Show a Meta deployment","description":"Shows the deployment of a campaign in Meta: its state, the waiting changes and every ad set and ad with what Meta found. It only reads what Fusio stored and does not ask Meta. To read Meta again, use `meta-ads-deployments.sync`.\n\nFollow an upload here after `meta-ads-campaigns.meta-ads.deploy` or `meta-ads-deployments.apply`. The upload runs while `status` is draft, validating or publishing; `progressStep` says what it does.\n\nNeeds one of these permissions: ads.read."}},"/v1/meta-ads-deployments/{metaAdsDeployment}/sync":{"post":{"operationId":"meta-ads-deployments.sync","tags":["meta-ads"],"parameters":[{"name":"metaAdsDeployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsDeploymentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Read a Meta deployment again from Meta","description":"Reads the campaign, its ad sets and ads from Meta and returns the deployment. It saves the state, Meta's check of each ad and what Meta found wrong. Nothing changes in Meta. Fusio also does this by itself every hour.\n\nYou get 422 while an upload runs and when Meta does not answer. You get 409 when Meta must be connected again. When Meta limits requests, you get 429 with `Retry-After`.\n\nThis address allows 20 requests a minute.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-deployments/{metaAdsDeployment}/apply":{"post":{"operationId":"meta-ads-deployments.apply","tags":["meta-ads"],"parameters":[{"name":"metaAdsDeployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planRevision":{"type":"string","pattern":"^[a-f0-9]{64}$","minLength":64,"maxLength":64,"description":"The `currentPlanRevision` of the deployment: 64 characters from 0–9 and a–f. When the plan changed since, you get 409."},"confirmActiveCampaign":{"type":"boolean","description":"true to say you know the campaign runs and the changes go live right away. When it runs and you send false, you get 422."},"confirmLearningRestart":{"type":"boolean","description":"true to say you know Meta has to learn again after these changes. Leave it out or send false the first time. While `learningRestartWarnings` is not empty and you send false, you get 422."}},"required":["planRevision","confirmActiveCampaign"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsDeploymentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.facebook"]}],"x-fusio-opt-in-scopes":["ads.execute.facebook"],"summary":"Upload changes to Meta","description":"> [!WARNING]\n> This changes the campaign in your Meta ad account, even while it runs. For that a key needs `ads.execute.facebook`.\n\nUploads to Meta what you changed in the Fusio campaign since the last upload: texts, pictures, ad sets, ads, the budget and the form. It returns the deployment. Check `hasUnsynchronizedChanges` and `canApplyChanges` first.\n\nThe work runs in the background. Follow it with `meta-ads-deployments.show`. It ends as paused, active or reconciliation_required. For reconciliation_required, use `meta-ads-deployments.reconcile`. New ad sets and ads get to Meta paused, even under a running campaign; start them with `meta-ads-deployments.status`. Removed ad sets and ads are archived in Meta.\n\nWhen the changes make Meta learn again, you get 422 with `errors.confirmLearningRestart` and the reasons in `payload.learningRestartWarnings`. Look at them and send again with `confirmLearningRestart` true.\n\nThe Fusio campaign must be approved. You get 422 when the campaign goal changed (copy the campaign instead), when the deployment failed or needs a check with `meta-ads-deployments.reconcile`, and when another upload runs. When Meta does not answer, you get 422. You get 409 when Meta must be connected again. When Meta limits requests, you get 429 with `Retry-After`.\n\nThis address allows 10 requests a minute, counted together with the other Meta upload addresses (apply, reconcile, status, live settings).\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.facebook. You must tick these on purpose: ads.execute.facebook."}},"/v1/meta-ads-deployments/{metaAdsDeployment}/reconcile":{"post":{"operationId":"meta-ads-deployments.reconcile","tags":["meta-ads"],"parameters":[{"name":"metaAdsDeployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsDeploymentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.facebook"]}],"x-fusio-opt-in-scopes":["ads.execute.facebook"],"summary":"Make Fusio match Meta again after a broken upload","description":"> [!WARNING]\n> This can change the deployment and clean up in your Meta ad account. For that a key needs `ads.execute.facebook`.\n\nUse it when `status` is reconciliation_required: an upload stopped and Fusio does not know what Meta saved. Fusio looks for the campaign by its Fusio label, links the campaign, ad sets and ads it finds and takes their state from Meta. It returns the deployment.\n\nWhen Meta has no such campaign, `status` becomes failed and you upload the campaign again with `meta-ads-campaigns.meta-ads.deploy`. Parts that are still missing show up as waiting changes; `meta-ads-deployments.apply` makes them.\n\nYou get 422 when the deployment does not need this, when Fusio cannot check Meta for sure and when Meta does not answer. You get 409 when Meta must be connected again. When Meta limits requests, you get 429 with `Retry-After`.\n\nThis address allows 10 requests a minute, counted together with the other Meta upload addresses (apply, reconcile, status, live settings).\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.facebook. You must tick these on purpose: ads.execute.facebook."}},"/v1/meta-ads-deployments/{metaAdsDeployment}/status":{"post":{"operationId":"meta-ads-deployments.status","tags":["meta-ads"],"parameters":[{"name":"metaAdsDeployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"level":{"$ref":"#/components/schemas/MetaAdsDeploymentLevel","description":"What to switch: campaign (the whole campaign), ad_set (one ad set) or ad (one ad)."},"targetId":{"type":"integer","description":"For ad_set the `adSets.id` of the deployment, for ad the `adSets.ads.id`. These are the numbers of the rows in the deployment, not of the Fusio plan and not of Meta. Leave it out for campaign."},"status":{"$ref":"#/components/schemas/AdDeploymentRemoteStatus","description":"enabled (start it, so it spends money) or paused (stop it)."}},"required":["level","status"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsDeploymentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.facebook"]}],"x-fusio-opt-in-scopes":["ads.execute.facebook"],"summary":"Start or pause a Meta campaign, ad set or ad","description":"> [!WARNING]\n> Starting makes the campaign spend money in Meta. For both a key needs `ads.execute.facebook`.\n\nStarts or pauses one part of the campaign in Meta and returns the deployment. Fusio reads Meta first, so it works with the newest state.\n\nThere are three levels:\n- campaign: starting it starts the campaign and every ad set and ad that is paused in Meta, except the ones you paused yourself and ads Meta rejected. Pausing it pauses only the campaign, so everything below stays as it is.\n- ad_set: starts or pauses one ad set. Fusio remembers that you paused it, and starting the campaign later keeps it paused.\n- ad: starts or pauses one ad, remembered the same way. An ad Meta rejected cannot be started.\n\nTo start anything, the Fusio campaign must be approved and every change uploaded with `meta-ads-deployments.apply`; otherwise you get 422. You get 422 also when the part is not in this deployment, when it is neither running nor paused in Meta, when the deployment needs a check, when another upload runs and when Meta does not answer. You get 409 when Meta must be connected again. When Meta limits requests, you get 429 with `Retry-After`.\n\nThis address allows 10 requests a minute, counted together with the other Meta upload addresses (apply, reconcile, status, live settings).\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.facebook. You must tick these on purpose: ads.execute.facebook."}},"/v1/meta-ads-deployments/{metaAdsDeployment}/live-settings":{"patch":{"operationId":"meta-ads-deployments.live-settings.update","tags":["meta-ads"],"parameters":[{"name":"metaAdsDeployment","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the deployment."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planRevision":{"type":"string","pattern":"^[a-f0-9]{64}$","minLength":64,"maxLength":64,"description":"The `currentPlanRevision` of the deployment: 64 characters from 0–9 and a–f. When the plan changed since, you get 409."},"confirmActiveCampaign":{"type":"boolean","description":"true to say you know the campaign runs and the changes go live right away. When it runs and you send false, you get 422."},"confirmLearningRestart":{"type":"boolean","description":"true to say you know Meta has to learn again after these changes. Leave it out or send false the first time. When a budget changes a lot and you send false, you get 422."},"budgetAmount":{"type":"number","minimum":0.01,"maximum":9999999999999.99,"description":"The new budget of the campaign as text like \"500.00\", with at most two decimals. Leave it out to keep the budget. null is refused, because a running campaign cannot lose its budget."},"adSetBudgets":{"type":"array","items":{"type":"object","properties":{"adSetId":{"type":"integer","description":"The number of the ad set in the Fusio plan, the `id` of the campaign's `adSets`. It is not `adSets.id` of the deployment."},"budgetAmount":{"type":"number","minimum":0.01,"maximum":9999999999999.99,"description":"The new budget of the ad set as text like \"200.00\", with at most two decimals."}},"required":["adSetId","budgetAmount"]},"maxItems":200,"uniqueItems":true,"description":"New budgets of ad sets, at most 200, each ad set once. Only for a campaign where each ad set has its own budget."},"endsAt":{"type":["string","null"],"description":"The new end of the campaign, as a date and time with an offset, like 2026-12-31T23:59:00+01:00. Leave it out to keep it. null is refused here; to drop the end date, change the plan and upload it with `meta-ads-deployments.apply`. A lifetime budget always needs an end."}},"required":["planRevision","confirmActiveCampaign"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsDeploymentData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","ads.execute.facebook"]}],"x-fusio-opt-in-scopes":["ads.execute.facebook"],"summary":"Change the budget or end date of a running Meta campaign","description":"> [!WARNING]\n> This changes how much a running campaign spends in Meta. For that a key needs `ads.execute.facebook`.\n\nChanges the budget of the campaign or of its ad sets, or the end date, in Fusio and in Meta at once. It returns the deployment. Send only what changes.\n\nIt works only when the Fusio campaign is approved, the deployment is paused or active and no other change waits; otherwise you get 422 and must upload changes with `meta-ads-deployments.apply` first. You get 422 when you send budgetAmount to a campaign where each ad set has its own budget, or adSetBudgets to a campaign with one budget. You get 422 when an adSetId is not live in Meta. You get 422 also when the budgets would go over the monthly limit of your company, when the end date is in the past and when another upload runs.\n\nWhen a budget changes a lot, Meta has to learn again. Then you get 422 with `errors.confirmLearningRestart` and the reasons in `payload.learningRestartWarnings`; send again with `confirmLearningRestart` true.\n\nWhen Meta refuses the first change, nothing is saved and you get 422. When Meta takes only part of the changes, Fusio keeps the new values, you get 422, and the rest shows up as waiting changes; upload them with `meta-ads-deployments.apply`. You get 409 when Meta must be connected again. When Meta limits requests, you get 429 with `Retry-After`.\n\nThis address allows 10 requests a minute, counted together with the other Meta upload addresses (apply, reconcile, status, live settings).\n\nNeeds one of these permissions: ads.write. Also needs: ads.execute.facebook. You must tick these on purpose: ads.execute.facebook."}},"/v1/meta-ads-campaigns/{metaAdsCampaign}/duplicate":{"post":{"operationId":"meta-ads-campaigns.duplicate","tags":["meta-ads"],"parameters":[{"name":"metaAdsCampaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the copy, at most 255 characters. No other campaign may have it."}},"required":["name"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Copy a Meta ad campaign","description":"Makes a draft copy of a campaign with its ad sets and ads, and answers 201 with the copy. Nothing goes to Meta.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-campaigns/{metaAdsCampaign}/ad-sets":{"post":{"operationId":"meta-ads-ad-sets.store","tags":["meta-ads"],"parameters":[{"name":"metaAdsCampaign","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the campaign."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name of the ad set, at most 255 characters."},"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the ad set in the campaign, from 0."},"budgetType":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsBudgetType"},{"type":"null"}],"description":"daily or lifetime, together with budgetAmount. Only when the campaign has no budget of its own."},"budgetAmount":{"type":["number","null"],"minimum":0.01,"maximum":9999999999999.99,"description":"The budget of the ad set as text, together with budgetType."},"advantageAudienceEnabled":{"type":"boolean","description":"true when Meta may also reach people outside your targeting."},"ageMin":{"type":"integer","minimum":18,"maximum":65,"description":"The youngest age to reach, from 18 to 65."},"ageMax":{"type":"integer","minimum":18,"maximum":65,"description":"The oldest age to reach, from 18 to 65. It cannot be below ageMin."},"gender":{"$ref":"#/components/schemas/MetaAdsGender","description":"all, male or female."},"advantagePlacementsEnabled":{"type":"boolean","description":"true when Meta picks where the ads show. false to use placements."},"placements":{"type":"array","items":{"type":"object","properties":{"publisherPlatform":{"$ref":"#/components/schemas/MetaAdsPublisherPlatform"},"position":{"$ref":"#/components/schemas/MetaAdsPlacementPosition"}},"required":["publisherPlatform","position"]},"maxItems":18,"description":"The places where the ads show, each as publisherPlatform and position. It replaces the old list."},"frequencyCapImpressions":{"type":["integer","null"],"minimum":1,"maximum":90,"description":"How many times one person may see the ads, or null."},"frequencyCapDays":{"type":["integer","null"],"minimum":1,"maximum":30,"description":"In how many days the frequencyCapImpressions count, or null."},"attributionWindow":{"$ref":"#/components/schemas/MetaAdsAttributionWindow","description":"click_1d, click_7d or click_7d_view_1d."},"locations":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsLocationKind","description":"country, region, city, zip or custom_radius (a circle around a point). The radius is in radiusKm: for a city from 17 to 80 km, for custom_radius from 1 to 80 km."},"externalKey":{"type":["string","null"],"maxLength":255},"name":{"type":"string","maxLength":300},"radiusKm":{"type":["integer","null"]},"latitude":{"type":["number","null"],"minimum":-90,"maximum":90},"longitude":{"type":["number","null"],"minimum":-180,"maximum":180},"mode":{"$ref":"#/components/schemas/MetaAdsTargetingMode","description":"include (reach) or exclude (leave out)."}},"required":["kind","name","mode"]},"maxItems":200,"description":"The places to reach or to leave out. It replaces the old list. Find places with `meta-ads-targeting.search` and type location."},"targets":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsTargetKind"},"externalId":{"type":"string","maxLength":255},"name":{"type":"string","maxLength":300},"graphField":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsDemographicField"},{"type":"null"}],"description":"For demographic only: the Meta group from type of meta-ads-targeting.search, like life_events or income. Leave it out for other kinds."},"source":{"$ref":"#/components/schemas/MetaAdsTargetSource","description":"ai (AI picked it) or user (you picked it)."}},"required":["kind","externalId","name","source"]},"maxItems":50,"description":"The interests, behaviors and demographics to reach. It replaces the old list. Find them with `meta-ads-targeting.search`."},"languages":{"type":"array","items":{"type":"object","properties":{"localeKey":{"type":"integer","minimum":1,"maximum":4294967295},"name":{"type":"string","maxLength":255}},"required":["localeKey","name"]},"maxItems":50,"uniqueItems":true,"description":"The languages people must speak, each once. It replaces the old list."},"audiences":{"type":"array","items":{"type":"object","properties":{"externalAudienceId":{"type":"string","maxLength":255},"name":{"type":"string","maxLength":255},"subtype":{"$ref":"#/components/schemas/MetaAdsAudienceSubtype"},"mode":{"$ref":"#/components/schemas/MetaAdsTargetingMode","description":"include (reach) or exclude (leave out)."}},"required":["externalAudienceId","name","subtype","mode"]},"maxItems":50,"uniqueItems":true,"description":"Your own Meta audiences from `meta-ads-audiences.index`, each once. It replaces the old list."}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Add an ad set to a Meta campaign","description":"Adds an ad set to a draft campaign and answers 201 with the whole campaign. Nothing goes to Meta.\n\nOnly a draft can change; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running.\n\nYou get 422 on `adSets` when the campaign already has 200 ad sets. You get 422 on `budgetAmount` or `budgetType` when the campaign has one budget for all ad sets, and on `budgetType` when a lifetime budget has no campaign end date.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-ad-sets/{metaAdsAdSet}":{"put":{"operationId":"meta-ads-ad-sets.update","tags":["meta-ads"],"parameters":[{"name":"metaAdsAdSet","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad set."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the ad set, at most 255 characters."},"position":{"type":"integer","minimum":0,"maximum":65535,"description":"The order of the ad set in the campaign, from 0."},"budgetType":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsBudgetType"},{"type":"null"}],"description":"daily or lifetime, together with budgetAmount. Only when the campaign has no budget of its own."},"budgetAmount":{"type":["number","null"],"minimum":0.01,"maximum":9999999999999.99,"description":"The budget of the ad set as text, together with budgetType."},"advantageAudienceEnabled":{"type":"boolean","description":"true when Meta may also reach people outside your targeting."},"ageMin":{"type":"integer","minimum":18,"maximum":65,"description":"The youngest age to reach, from 18 to 65."},"ageMax":{"type":"integer","minimum":18,"maximum":65,"description":"The oldest age to reach, from 18 to 65. It cannot be below ageMin."},"gender":{"$ref":"#/components/schemas/MetaAdsGender","description":"all, male or female."},"advantagePlacementsEnabled":{"type":"boolean","description":"true when Meta picks where the ads show. false to use placements."},"placements":{"type":"array","items":{"type":"object","properties":{"publisherPlatform":{"$ref":"#/components/schemas/MetaAdsPublisherPlatform"},"position":{"$ref":"#/components/schemas/MetaAdsPlacementPosition"}},"required":["publisherPlatform","position"]},"maxItems":18,"description":"The places where the ads show, each as publisherPlatform and position. It replaces the old list."},"frequencyCapImpressions":{"type":["integer","null"],"minimum":1,"maximum":90,"description":"How many times one person may see the ads, or null."},"frequencyCapDays":{"type":["integer","null"],"minimum":1,"maximum":30,"description":"In how many days the frequencyCapImpressions count, or null."},"attributionWindow":{"$ref":"#/components/schemas/MetaAdsAttributionWindow","description":"click_1d, click_7d or click_7d_view_1d."},"locations":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsLocationKind","description":"country, region, city, zip or custom_radius (a circle around a point). The radius is in radiusKm: for a city from 17 to 80 km, for custom_radius from 1 to 80 km."},"externalKey":{"type":["string","null"],"maxLength":255},"name":{"type":"string","maxLength":300},"radiusKm":{"type":["integer","null"]},"latitude":{"type":["number","null"],"minimum":-90,"maximum":90},"longitude":{"type":["number","null"],"minimum":-180,"maximum":180},"mode":{"$ref":"#/components/schemas/MetaAdsTargetingMode","description":"include (reach) or exclude (leave out)."}},"required":["kind","name","mode"]},"maxItems":200,"description":"The places to reach or to leave out. It replaces the old list. Find places with `meta-ads-targeting.search` and type location."},"targets":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsTargetKind"},"externalId":{"type":"string","maxLength":255},"name":{"type":"string","maxLength":300},"graphField":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsDemographicField"},{"type":"null"}],"description":"For demographic only: the Meta group from type of meta-ads-targeting.search, like life_events or income. Leave it out for other kinds."},"source":{"$ref":"#/components/schemas/MetaAdsTargetSource","description":"ai (AI picked it) or user (you picked it)."}},"required":["kind","externalId","name","source"]},"maxItems":50,"description":"The interests, behaviors and demographics to reach. It replaces the old list. Find them with `meta-ads-targeting.search`."},"languages":{"type":"array","items":{"type":"object","properties":{"localeKey":{"type":"integer","minimum":1,"maximum":4294967295},"name":{"type":"string","maxLength":255}},"required":["localeKey","name"]},"maxItems":50,"uniqueItems":true,"description":"The languages people must speak, each once. It replaces the old list."},"audiences":{"type":"array","items":{"type":"object","properties":{"externalAudienceId":{"type":"string","maxLength":255},"name":{"type":"string","maxLength":255},"subtype":{"$ref":"#/components/schemas/MetaAdsAudienceSubtype"},"mode":{"$ref":"#/components/schemas/MetaAdsTargetingMode","description":"include (reach) or exclude (leave out)."}},"required":["externalAudienceId","name","subtype","mode"]},"maxItems":50,"uniqueItems":true,"description":"Your own Meta audiences from `meta-ads-audiences.index`, each once. It replaces the old list."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Change a Meta ad set","description":"Changes only the fields you send and returns the whole campaign. A list you send replaces the old one. Nothing goes to Meta.\n\nOnly a draft can change; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running.\n\nYou get 422 on `budgetAmount` or `budgetType` when the campaign has one budget for all ad sets, and on `budgetType` when a lifetime budget has no campaign end date.\n\nNeeds one of these permissions: ads.write."},"delete":{"operationId":"meta-ads-ad-sets.destroy","tags":["meta-ads"],"parameters":[{"name":"metaAdsAdSet","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad set."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Remove a Meta ad set","description":"> [!WARNING]\n> This cannot be undone.\n\nRemoves the ad set with its ads and returns the whole campaign.\n\nOnly a draft can change; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running.\n\nThe last ad set of a campaign cannot be removed; you get 422 on `adSet`.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-ad-sets/{metaAdsAdSet}/audience-estimate":{"post":{"operationId":"meta-ads-ad-sets.audience-estimate","tags":["meta-ads"],"parameters":[{"name":"metaAdsAdSet","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad set."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsAudienceEstimateData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Estimate how many people a Meta ad set reaches","description":"Asks Meta how many people the targeting of the ad set reaches, saves the answer to the ad set and returns it.\n\nOnly a draft can be estimated; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running. Without a picked Meta ad account you get 422 with `payload.error` meta_account_required. If the picked account is not a Meta account, you get 422 with meta_not_meta_account. When Meta allows no more requests, you get 429 with Retry-After. When Meta must be connected again, you get 409 with `payload.error` meta_reconnect_required. Other Meta errors give 422.\n\nThis address allows 30 requests a minute.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-ad-sets/{metaAdsAdSet}/targets/suggest":{"post":{"operationId":"meta-ads-ad-sets.targets.suggest","tags":["meta-ads"],"parameters":[{"name":"metaAdsAdSet","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad set."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"seeds":{"type":["array","null"],"items":{"type":"string","maxLength":120},"maxItems":10,"description":"Topics that describe who you want to reach, like \"yoga\" or \"new parents\", at most 10, each at most 120 characters. Leave them out and the topics saved on the ad set are used."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsTargetSuggestionData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI suggest targeting for a Meta ad set","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nLooks up targeting at Meta for your topics and lets AI pick the best ones for the ad set. Nothing is added to the ad set; add the targeting you like with `meta-ads-ad-sets.update`. When Meta finds nothing, the list is empty and no credits are spent.\n\nOnly a draft can get suggestions; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running. You get 422 on `seeds` when you send no topics and the ad set has none saved. Without a picked Meta ad account you get 422 with `payload.error` meta_account_required. When Meta must be connected again, you get 409 with `payload.error` meta_reconnect_required. You get 402 when you do not have enough credits.\n\nThis address allows 10 requests a minute.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/meta-ads-ad-sets/{metaAdsAdSet}/ads/generate":{"post":{"operationId":"meta-ads-ad-sets.ads.generate","tags":["meta-ads"],"parameters":[{"name":"metaAdsAdSet","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad set."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":["integer","null"],"minimum":1,"maximum":6,"description":"How many new ads AI makes, from 1 to 6. Leave it out for 3."},"imageSource":{"$ref":"#/components/schemas/MetaAdsImageSource","description":"Where the pictures come from: library (your own files), generate (AI draws new ones) or mixed (both)."},"tenantImageProfileId":{"type":["integer","null"],"description":"The number of the image style preset AI draws with, or null."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["imageSource"]}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI add new ads to a Meta ad set","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nLets AI think of new ad ideas for the ad set in the background, write their texts and add pictures. The new ads differ from the ones the ad set already has. The answer is 202 with no content; the new ads show up in `meta-ads-campaigns.index`.\n\nOnly a draft can get new ads; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running. When the ads of the ad set are being made right now, you get 409 with `payload.error` ad_set_busy. You get 422 on `count` when the ad set would have more than 50 ads. You get 402 when you do not have enough credits.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/meta-ads-ad-sets/{metaAdsAdSet}/ads":{"post":{"operationId":"meta-ads-ads.store","tags":["meta-ads"],"parameters":[{"name":"metaAdsAdSet","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad set."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":255,"description":"The name of the ad, at most 255 characters."},"source":{"$ref":"#/components/schemas/MetaAdsAdSource","description":"new (a new ad) or existing_post (a post from your page or profile). Needed on create."},"format":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsAdFormat"},{"type":"null"}],"description":"single_image, single_video or carousel."},"texts":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsAdTextKind","description":"primary_text, headline or description."},"position":{"type":"integer","minimum":1,"maximum":5},"text":{"type":"string"}},"required":["kind","position","text"]},"maxItems":15,"description":"The texts of the ad, each with kind, position and text. It replaces the old texts."},"media":{"type":"object","properties":{"feed":{"type":["object","null"],"properties":{"fileId":{"type":"integer"},"mediaType":{"$ref":"#/components/schemas/MetaAdsMediaType"},"thumbnailFileId":{"type":["integer","null"]}}},"vertical":{"type":["object","null"],"properties":{"fileId":{"type":"integer"},"mediaType":{"$ref":"#/components/schemas/MetaAdsMediaType"},"thumbnailFileId":{"type":["integer","null"]}}}},"description":"The picture or video for feed and vertical. Each one has fileId, mediaType and, for a video, thumbnailFileId."},"cards":{"type":"array","items":{"type":"object","properties":{"fileId":{"type":["integer","null"]},"mediaType":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsMediaType"},{"type":"null"}]},"thumbnailFileId":{"type":["integer","null"]},"headline":{"type":["string","null"],"maxLength":255},"description":{"type":["string","null"],"maxLength":255},"destinationUrl":{"type":["string","null"],"format":"uri","maxLength":2048}}},"maxItems":10,"description":"The cards of a carousel ad. It replaces the old cards."},"sourcePostPlatform":{"type":["string","null"],"enum":["facebook","instagram",null],"description":"facebook or instagram, for existing_post."},"sourcePostExternalId":{"type":["string","null"],"pattern":"^\\d+(_\\d+)?$","maxLength":255,"description":"The post from `meta-ads-posts.index`, for existing_post."},"destinationUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"The web address people go to after a click."},"displayLink":{"type":["string","null"],"maxLength":255,"description":"The short address shown in the ad, like example.cz, or null."},"callToAction":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsCallToAction"},{"type":"null"}],"description":"The button of the ad, like learn_more or sign_up, or null."}},"required":["source"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Add an ad to a Meta ad set","description":"Adds an ad to an ad set of a draft campaign and answers 201 with the whole campaign. The files are files you uploaded to Fusio. Nothing goes to Meta.\n\nOnly a draft can change; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running.\n\nWith existing_post, Fusio reads the post from Meta. Without a picked Meta ad account you get 422 with `payload.error` meta_account_required. If the picked account is not a Meta account, you get 422 with meta_not_meta_account. Without a Facebook page you get 422 with meta_page_required, without an Instagram profile 422 with meta_instagram_required. When Meta gives no access to your Facebook page, you get 422 with meta_page_unavailable. A post that is gone or cannot be promoted gives 422 on sourcePostExternalId. When Meta allows no more requests, you get 429 with Retry-After. When Meta must be connected again, you get 409 with `payload.error` meta_reconnect_required. Other Meta errors give 422.\n\nAn ad set can hold at most 50 ads; otherwise you get 422 on `ads`.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-ads/{metaAdsAd}":{"put":{"operationId":"meta-ads-ads.update","tags":["meta-ads"],"parameters":[{"name":"metaAdsAd","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the ad, at most 255 characters."},"source":{"$ref":"#/components/schemas/MetaAdsAdSource","description":"new (a new ad) or existing_post (a post from your page or profile)."},"format":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsAdFormat"},{"type":"null"}],"description":"single_image, single_video or carousel."},"texts":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsAdTextKind","description":"primary_text, headline or description."},"position":{"type":"integer","minimum":1,"maximum":5},"text":{"type":"string"}},"required":["kind","position","text"]},"maxItems":15,"description":"The texts of the ad, each with kind, position and text. It replaces the old texts."},"media":{"type":"object","properties":{"feed":{"type":["object","null"],"properties":{"fileId":{"type":"integer"},"mediaType":{"$ref":"#/components/schemas/MetaAdsMediaType"},"thumbnailFileId":{"type":["integer","null"]}}},"vertical":{"type":["object","null"],"properties":{"fileId":{"type":"integer"},"mediaType":{"$ref":"#/components/schemas/MetaAdsMediaType"},"thumbnailFileId":{"type":["integer","null"]}}}},"description":"The picture or video for feed and vertical. Each one has fileId, mediaType and, for a video, thumbnailFileId."},"cards":{"type":"array","items":{"type":"object","properties":{"fileId":{"type":["integer","null"]},"mediaType":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsMediaType"},{"type":"null"}]},"thumbnailFileId":{"type":["integer","null"]},"headline":{"type":["string","null"],"maxLength":255},"description":{"type":["string","null"],"maxLength":255},"destinationUrl":{"type":["string","null"],"format":"uri","maxLength":2048}}},"maxItems":10,"description":"The cards of a carousel ad. It replaces the old cards."},"sourcePostPlatform":{"type":["string","null"],"enum":["facebook","instagram",null],"description":"facebook or instagram, for existing_post."},"sourcePostExternalId":{"type":["string","null"],"pattern":"^\\d+(_\\d+)?$","maxLength":255,"description":"The post from `meta-ads-posts.index`, for existing_post."},"destinationUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"The web address people go to after a click."},"displayLink":{"type":["string","null"],"maxLength":255,"description":"The short address shown in the ad, like example.cz, or null."},"callToAction":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsCallToAction"},{"type":"null"}],"description":"The button of the ad, like learn_more or sign_up, or null."},"expectedRevision":{"type":"string","minLength":32,"maxLength":32,"description":"The revision of the ad you saw last. When the ad changed since then, you get 409."}},"required":["expectedRevision"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Change a Meta ad","description":"Changes only the fields you send and returns the whole campaign. Nothing goes to Meta.\n\nWhen someone changed the ad after you read it, you get 409 with `payload.error` meta_ad_changed and nothing changes. Read the campaign again and send the new revision. Only a draft can change; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running.\n\nWith existing_post, Fusio reads the post from Meta. Without a picked Meta ad account you get 422 with `payload.error` meta_account_required. If the picked account is not a Meta account, you get 422 with meta_not_meta_account. Without a Facebook page you get 422 with meta_page_required, without an Instagram profile 422 with meta_instagram_required. When Meta gives no access to your Facebook page, you get 422 with meta_page_unavailable. A post that is gone or cannot be promoted gives 422 on sourcePostExternalId. When Meta allows no more requests, you get 429 with Retry-After. When Meta must be connected again, you get 409 with `payload.error` meta_reconnect_required. Other Meta errors give 422.\n\nNeeds one of these permissions: ads.write."},"delete":{"operationId":"meta-ads-ads.destroy","tags":["meta-ads"],"parameters":[{"name":"metaAdsAd","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Remove a Meta ad","description":"> [!WARNING]\n> This cannot be undone.\n\nRemoves the ad and returns the whole campaign.\n\nOnly a draft can change; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-ads/{metaAdsAd}/texts/suggest":{"post":{"operationId":"meta-ads-ads.texts.suggest","tags":["meta-ads"],"parameters":[{"name":"metaAdsAd","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsAdTextKind","description":"What to suggest: primary_text (the main text), headline or description."},"existingTexts":{"type":["array","null"],"items":{"type":"string","maxLength":2200},"maxItems":20,"description":"Texts you already have, so AI writes new ones, at most 20, each at most 2200 characters."},"count":{"type":["integer","null"],"minimum":1,"maximum":5,"description":"How many texts AI suggests, from 1 to 5. Leave it out for 5."},"instruction":{"type":["string","null"],"maxLength":500,"description":"What AI should keep in mind, at most 500 characters."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["kind"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsAdTextSuggestionsData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI suggest texts for a Meta ad","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAsks AI for new texts of one kind for the ad. Nothing is saved; add the texts you like with `meta-ads-ads.update`.\n\nOnly a draft can get suggestions; otherwise you get 403. When AI builds the campaign right now, you get 409 with `payload.error` meta_generation_running. An ad from an existing post has no texts of its own, so you get 422 on `ad`. You get 402 when you do not have enough credits.\n\nThis address allows 10 requests a minute.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/meta-ads-ads/{metaAdsAd}/images/generate":{"post":{"operationId":"meta-ads-ads.images.generate","tags":["meta-ads"],"parameters":[{"name":"metaAdsAd","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the ad."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"imageSource":{"$ref":"#/components/schemas/MetaAdsImageSource","description":"Where the pictures come from: library (AI picks from your own files), generate (AI draws new ones) or mixed (both)."},"tenantImageProfileId":{"type":["integer","null"],"description":"The number of the image style preset AI draws with, or null."},"cardPosition":{"type":["integer","null"],"minimum":1,"description":"For a carousel: the number of the card that gets a new picture. Leave it out and every empty card gets one, or every card when none is empty."},"imageBrief":{"type":["string","null"],"maxLength":1000,"description":"What the picture should show, at most 1000 characters. Leave it out and AI uses the idea of the ad."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["imageSource"]}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","ads.write"]}],"summary":"Let AI add pictures to a Meta ad","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nLets AI find or draw pictures for the ad in the background. The answer is 202 with no content; `generationStatus` of the ad in `meta-ads-campaigns.index` shows how it goes.\n\nOnly a draft can get pictures; otherwise you get 403. When pictures for the ad are being made right now, you get 409 with `payload.error` meta_generation_running. You get 422 on `ad` for a video ad or an ad from an existing post. You get 422 on `cardPosition` when the ad is not a carousel or has no card with that number. You get 402 when you do not have enough credits.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: ads.write."}},"/v1/meta-ads-lead-forms":{"get":{"operationId":"meta-ads-lead-forms.index","tags":["meta-ads"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsLeadFormData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List Meta lead forms","description":"Returns your lead forms for Meta campaigns with the objective leads and the destination instant_form, newest first.\n\nNeeds one of these permissions: ads.read."},"post":{"operationId":"meta-ads-lead-forms.store","tags":["meta-ads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the form, at most 255 characters."},"formType":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsLeadFormType"},{"type":"null"}],"description":"more_volume or higher_intent, or null."},"introHeadline":{"type":["string","null"],"maxLength":60,"description":"The headline at the start of the form, or null."},"introText":{"type":["string","null"],"maxLength":5000,"description":"The text at the start of the form, or null."},"privacyPolicyUrl":{"type":"string","format":"uri","maxLength":2048,"description":"The address of your privacy policy."},"thankYouTitle":{"type":["string","null"],"maxLength":255,"description":"The title after sending the form, or null."},"thankYouText":{"type":["string","null"],"maxLength":5000,"description":"The text after sending the form, or null."},"thankYouUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"The address of the button after sending the form, or null."},"phoneOtpVerification":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsPhoneOtpVerification"},{"type":"null"}],"description":"disabled, optional or required, or null. null means disabled."},"tenantLeadFormId":{"type":["integer","null"],"description":"Your Fusio form where the answers go, or null."},"questions":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsLeadFormQuestionKind","description":"full_name, email, phone, city, company_name, job_title or custom."},"label":{"type":"string","maxLength":80,"description":"The text of a custom question. Only for custom."},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":80}},"required":["label"]},"minItems":2,"maxItems":20,"description":"The options of a custom question, each with label. Only for custom."}},"required":["kind"]},"minItems":1,"maxItems":15,"description":"The questions in order. It replaces the old questions."}},"required":["name","privacyPolicyUrl","questions"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsLeadFormData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Create a Meta lead form","description":"Creates a lead form and answers 201 with it. The form goes to Meta only with a campaign that uses it.\n\nThe form uses your company's AI language when Meta offers it. Otherwise Meta picks the language. Without thankYouTitle the form says \"Thank you\", and with thankYouUrl the button says \"Visit website\". Fusio writes these two texts in that language, or in English when it has none.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-lead-forms/{metaAdsLeadForm}":{"get":{"operationId":"meta-ads-lead-forms.show","tags":["meta-ads"],"parameters":[{"name":"metaAdsLeadForm","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead form."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsLeadFormData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Show a Meta lead form","description":"Returns one lead form with its questions.\n\nNeeds one of these permissions: ads.read."},"put":{"operationId":"meta-ads-lead-forms.update","tags":["meta-ads"],"parameters":[{"name":"metaAdsLeadForm","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead form."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the form, at most 255 characters."},"formType":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsLeadFormType"},{"type":"null"}],"description":"more_volume or higher_intent, or null."},"introHeadline":{"type":["string","null"],"maxLength":60,"description":"The headline at the start of the form, or null."},"introText":{"type":["string","null"],"maxLength":5000,"description":"The text at the start of the form, or null."},"privacyPolicyUrl":{"type":"string","format":"uri","maxLength":2048,"description":"The address of your privacy policy."},"thankYouTitle":{"type":["string","null"],"maxLength":255,"description":"The title after sending the form, or null."},"thankYouText":{"type":["string","null"],"maxLength":5000,"description":"The text after sending the form, or null."},"thankYouUrl":{"type":["string","null"],"format":"uri","maxLength":2048,"description":"The address of the button after sending the form, or null."},"phoneOtpVerification":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsPhoneOtpVerification"},{"type":"null"}],"description":"disabled, optional or required, or null. null means disabled."},"tenantLeadFormId":{"type":["integer","null"],"description":"Your Fusio form where the answers go, or null."},"questions":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsLeadFormQuestionKind","description":"full_name, email, phone, city, company_name, job_title or custom."},"label":{"type":"string","maxLength":80,"description":"The text of a custom question. Only for custom."},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":80}},"required":["label"]},"minItems":2,"maxItems":20,"description":"The options of a custom question, each with label. Only for custom."}},"required":["kind"]},"minItems":1,"maxItems":15,"description":"The questions in order. It replaces the old questions."}},"required":["questions"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsLeadFormData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Change a Meta lead form","description":"Changes the lead form and returns it. Send all questions every time; they replace the old ones.\n\nThe form uses your company's AI language when Meta offers it. Otherwise Meta picks the language. Without thankYouTitle the form says \"Thank you\", and with thankYouUrl the button says \"Visit website\". Fusio writes these two texts in that language, or in English when it has none.\n\nNeeds one of these permissions: ads.write."},"delete":{"operationId":"meta-ads-lead-forms.destroy","tags":["meta-ads"],"parameters":[{"name":"metaAdsLeadForm","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead form."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Remove a Meta lead form","description":"> [!WARNING]\n> This cannot be undone.\n\nRemoves a lead form. When a campaign still uses it, you get 422 and nothing is removed.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-leads/grid":{"get":{"operationId":"meta-ads-leads.grid","tags":["meta-ads"],"parameters":[{"name":"filter[status]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The status. One or more values, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["createdAt","leadCreatedAt","-createdAt","-leadCreatedAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsLeadData"},"description":"The leads of this page."},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List leads from Meta forms in a table","description":"Returns the leads from your Facebook and Instagram forms page by page, ready for a table, newest first. Filter them by `status` (pending, ingested, rejected or failed) and sort them by `createdAt` (when Fusio received the lead) or `leadCreatedAt` (when the person filled in the form). Use `filter`, `sort`, `page` and `perPage` as the shape of the list says. People's form answers are not included. You find them in the inquiry.\n\nNeeds one of these permissions: ads.read."}},"/v1/meta-ads-leads/{metaAdsLead}/retry":{"post":{"operationId":"meta-ads-leads.retry","tags":["meta-ads"],"parameters":[{"name":"metaAdsLead","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the lead in Fusio."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsLeadData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write"]}],"summary":"Load a lead from Meta again","description":"Tries again to load a lead in the status rejected or failed. Fix the cause from `lastError` first. Fusio reads the lead from Meta again, so this works only for 90 days after the form was filled in.\n\nThe answer is the lead in the same shape as in `meta-ads-leads.grid`. Its `status` is pending, `lastError` is null and `attempts` is 0. When the lead waits or is already in Fusio, you get 422 `meta_ads_lead_not_retryable`.\n\nThis address allows 10 requests a minute.\n\nNeeds one of these permissions: ads.write."}},"/v1/meta-ads-targeting/search":{"get":{"operationId":"meta-ads-targeting.search","tags":["meta-ads"],"parameters":[{"name":"type","in":"query","required":true,"schema":{"$ref":"#/components/schemas/MetaAdsTargetingSearchType"},"description":"What to look for: interest, behavior, demographic, location or language."},{"name":"query","in":"query","schema":{"type":["string","null"],"minLength":1,"maxLength":100},"description":"The text to look for, at most 100 characters. Needed for interest, location and language. For behavior and demographic it is optional and keeps only options whose name contains it."},{"name":"limit","in":"query","schema":{"type":["integer","null"],"minimum":1,"maximum":50},"description":"How many results you want, from 1 to 50. Without it 25. Not allowed for behavior and demographic, which return the whole list."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsTargetingOptionData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Find Meta targeting options","description":"Asks Meta for interests, behaviors, demographics, places or languages for the targeting of an ad set.\n\nWithout a picked Meta ad account you get 422 with `payload.error` meta_account_required. If the picked account is not a Meta account, you get 422 with `payload.error` meta_not_meta_account. When Meta allows no more requests, you get 429 with Retry-After. When Meta must be connected again, you get 409 with `payload.error` meta_reconnect_required. Other Meta errors give 422.\n\nThis address allows 60 requests a minute.\n\nNeeds one of these permissions: ads.read."}},"/v1/meta-ads-audiences":{"get":{"operationId":"meta-ads-audiences.index","tags":["meta-ads"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAudienceData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List your Meta audiences","description":"Asks Meta for the custom and lookalike audiences of your ad account.\n\nWithout a picked Meta ad account you get 422 with `payload.error` meta_account_required. If the picked account is not a Meta account, you get 422 with `payload.error` meta_not_meta_account. When Meta allows no more requests, you get 429 with Retry-After. When Meta must be connected again, you get 409 with `payload.error` meta_reconnect_required. Other Meta errors give 422.\n\nThis address allows 30 requests a minute.\n\nNeeds one of these permissions: ads.read."}},"/v1/meta-ads-posts":{"get":{"operationId":"meta-ads-posts.index","tags":["meta-ads"],"parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","enum":["facebook","instagram"]},"description":"facebook (posts of your page) or instagram (posts of your profile)."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsPostData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"List your Facebook or Instagram posts","description":"Asks Meta for the newest posts of your Facebook page or Instagram profile, so you can make an ad from one.\n\nWithout a picked Meta ad account you get 422 with `payload.error` meta_account_required. If the picked account is not a Meta account, you get 422 with meta_not_meta_account. Without a Facebook page you get 422 with meta_page_required, without an Instagram profile 422 with meta_instagram_required. When Meta gives no access to your Facebook page, you get 422 with meta_page_unavailable. When Meta allows no more requests, you get 429 with Retry-After. When Meta must be connected again, you get 409 with `payload.error` meta_reconnect_required. Other Meta errors give 422.\n\nThis address allows 30 requests a minute.\n\nNeeds one of these permissions: ads.read."}},"/v1/meta-ads-operations/{metaAdsOperation}":{"get":{"operationId":"meta-ads-operations.show","tags":["meta-ads"],"parameters":[{"name":"metaAdsOperation","in":"path","required":true,"schema":{"type":"string"},"description":"The code of the job, from the answer that started it."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/MetaAdsOperationData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.read"]}],"summary":"Show a Meta ads job","description":"Returns how a background job goes. Ask again until `status` is completed or failed. A job of another company gives 404.\n\nNeeds one of these permissions: ads.read."}},"/v1/notes":{"post":{"operationId":"notes.store","tags":["notes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"noteableType":{"$ref":"#/components/schemas/NoteableType","description":"The kind of record the note belongs to: lead, deal or lead_contact."},"noteableId":{"type":"integer","description":"The number of that record."},"body":{"type":"string","maxLength":65535,"description":"The text of the note, at most 65535 bytes."}},"required":["noteableType","noteableId","body"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/NoteOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"x-fusio-conditional-scopes":["deals.write","contacts.write"],"summary":"Add a note","description":"A key with the leads.write scope can add a note to a lead. A note on a deal also needs the deals.write scope, and a note on a contact of a lead also needs the contacts.write scope.\n\nNeeds one of these permissions: leads.write. Some values also need: deals.write, contacts.write."}},"/v1/product":{"get":{"operationId":"product.show","tags":["product"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantProductData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Product fetched successfully","payload":{"id":5,"tenantId":412,"leadId":null,"derivedFromAnalysisId":52,"createdBy":88,"name":"Servis a prodej kol","oneLiner":"Servis kol v Brně, hotový do 48 hodin.","description":"Opravujeme a prodáváme kola. Kolo si u tebe vyzvedneme, opravíme v naší dílně a do dvou dnů ti ho vrátíme hotové a seřízené.","productType":"service","customerType":"consumer","businessModel":"Platba za servis a prodej kol a dílů.","pricingSummary":"Základní servis od 790 Kč.","pricingRationale":null,"primaryUseCase":"Připravit kolo na sezónu.","coreProblem":"Servis jinde trvá týden.","costOfInaction":"Přijdeš o víkendy na kole.","emotionalTension":null,"howWeSolveDifferently":"Servis do 48 hodin a odvoz kola.","whyBetter":"Rychleji a bez cesty do dílny.","antiPersona":"Závodníci, kteří si kolo servisují sami.","businessGoal":"Víc objednávek servisu na jaře.","conversionAction":"Objednat servis","logoIconUrl":null,"logoFullUrl":null,"brandColors":{"primary":"#1F6F43","accent":"#F2A900","secondary":"#FFFFFF","additional":[]},"brandKeywords":["servis kol","Brno"],"targetCompanies":null,"targetIndustries":[],"targetDecisionMakers":[],"targetMarkets":{"isGlobal":false,"countryCodes":["CZ","SK"]},"jobsToBeDone":[{"kind":"functional","label":"Mít kolo připravené na víkend."}],"useCaseScenarios":["Jarní servis po zimě"],"alternativesFallingShort":[{"alternative":"Oprava doma","why":"Chybí nářadí a čas."}],"keyDifferentiators":["Hotovo do 48 hodin","Odvoz kola"],"objections":[{"objection":"Servis je drahý","response":"Cenu znáš předem."}],"switchingDynamics":null,"customerLanguageProblem":["kolo mi skřípe"],"customerLanguageSolution":["kolo jede jako nové"],"wordsToUse":["rádi poradíme"],"wordsToAvoid":["bezkonkurenční"],"glossary":[],"proofMetrics":[{"metric":"Opravených kol za rok","value":"1 800"}],"notableCustomers":[],"testimonials":[{"quote":"Kolo bylo hotové za den.","attribution":"Jana z Brna"}],"valueThemes":[{"theme":"Rychlost","proof":"Servis do 48 hodin"}],"naceCodes":[{"code":"952","name":"Opravy výrobků pro osobní potřebu a převážně pro domácnost"}],"naceCodeSource":"ai","googleAdsCategories":[],"analyzedAt":"2026-11-03T08:30:00Z","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"Show your product","description":"Returns your product: what you sell, for whom and why it is better. Fusio fills these from the analysis of your website, and you can change everything later.\n\nNeeds one of these permissions: intelligence.read."},"patch":{"operationId":"product.update","tags":["product"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the product, at most 255 characters."},"oneLiner":{"type":["string","null"],"minLength":20,"maxLength":255,"description":"Your product in one sentence. From 20 to 255 characters."},"description":{"type":["string","null"],"minLength":120,"maxLength":5000,"description":"A longer text about the product. From 120 to 5000 characters."},"pricingSummary":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"How much it costs, in your words. From 20 to 5000 characters."},"pricingRationale":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"Why it costs what it costs. From 20 to 5000 characters."},"primaryUseCase":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"What people use it for most. From 20 to 5000 characters."},"coreProblem":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"The main problem it solves. From 20 to 5000 characters."},"costOfInaction":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"What it costs people when they do nothing. From 20 to 5000 characters."},"emotionalTension":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"How the problem makes people feel. From 20 to 5000 characters."},"howWeSolveDifferently":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"How you solve the problem in your own way. From 20 to 5000 characters."},"whyBetter":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"Why it is better than other choices. From 20 to 5000 characters."},"antiPersona":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"Who it is not for. From 20 to 5000 characters."},"businessGoal":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"What you want to reach with marketing. From 20 to 5000 characters."},"conversionAction":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"What a visitor should do, like book a demo. From 20 to 5000 characters."},"businessModel":{"type":["string","null"],"minLength":2,"maxLength":255,"description":"How you make money, like subscription. From 2 to 255 characters."},"productType":{"anyOf":[{"$ref":"#/components/schemas/TenantProductType"},{"type":"null"}],"description":"The kind of product: saas, marketplace, ecommerce, service, physical_product, mobile_app, agency or other."},"customerType":{"$ref":"#/components/schemas/CustomerType","description":"Who buys: business, consumer or both. A change grades the fit of all your leads again in the background."},"logoIconUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The web address of your small logo, at most 255 characters."},"logoFullUrl":{"type":["string","null"],"format":"uri","maxLength":255,"description":"The web address of your full logo, at most 255 characters."},"brandColors":{"type":"object","properties":{"primary":{"type":["string","null"],"pattern":"^#[0-9A-Fa-f]{3,8}$","description":"The main color. A color like #1A2B3C (3 to 8 hex digits after #)."},"accent":{"type":["string","null"],"pattern":"^#[0-9A-Fa-f]{3,8}$","description":"The color for things that stand out. A color like #1A2B3C (3 to 8 hex digits after #)."},"secondary":{"type":["string","null"],"pattern":"^#[0-9A-Fa-f]{3,8}$","description":"The second color. A color like #1A2B3C (3 to 8 hex digits after #)."},"additional":{"type":["array","null"],"items":{"type":"string","pattern":"^#[0-9A-Fa-f]{3,8}$"},"maxItems":12,"description":"More colors, at most 12. A color like #1A2B3C (3 to 8 hex digits after #)."}},"description":"Your brand colors."},"targetMarkets":{"type":"object","properties":{"isGlobal":{"type":"boolean","description":"true when you sell everywhere. Needed when you send targetMarkets."},"countryCodes":{"type":["array","null"],"items":{"type":"string","minLength":2,"maxLength":2},"maxItems":10,"description":"The countries as two letters, like CZ, at most 10."}},"description":"Where you sell."},"targetCompanies":{"type":"object","properties":{"industries":{"type":["array","null"],"items":{"type":"string"},"maxItems":10,"uniqueItems":true,"description":"Field codes (NACE) of the companies you sell to, like 62, at most 10, each once."},"companySizes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/EmployeeBand"},"uniqueItems":true,"description":"How many people the companies you sell to have: micro, small, medium, large or enterprise."},"stages":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CompanyAgeBand"},"uniqueItems":true,"description":"How old the companies you sell to are. Pick from new (under 2 years), young (2 to 5 years), established (5 to 10 years) or mature (over 10 years)."}},"description":"What companies you sell to."},"switchingDynamics":{"type":"object","properties":{"push":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"What pushes people away from what they use now. From 20 to 5000 characters."},"pull":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"What pulls people to your product. From 20 to 5000 characters."},"habit":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"What habit keeps people where they are. From 20 to 5000 characters."},"anxiety":{"type":["string","null"],"minLength":20,"maxLength":5000,"description":"What people fear about changing. From 20 to 5000 characters."}},"description":"Why people switch to you or stay where they are."},"brandKeywords":{"type":["array","null"],"items":{"type":"string","maxLength":1000},"maxItems":10,"description":"A list of words that belong to your brand, at most 10. Each at most 1000 characters."},"useCaseScenarios":{"type":["array","null"],"items":{"type":"string","maxLength":1000},"maxItems":50,"description":"A list of situations where people use it, at most 50. Each at most 1000 characters."},"keyDifferentiators":{"type":["array","null"],"items":{"type":"string","maxLength":1000},"maxItems":50,"description":"A list of things that make you different, at most 50. Each at most 1000 characters."},"customerLanguageProblem":{"type":["array","null"],"items":{"type":"string","maxLength":1000},"maxItems":50,"description":"A list of words customers use for the problem, at most 50. Each at most 1000 characters."},"customerLanguageSolution":{"type":["array","null"],"items":{"type":"string","maxLength":1000},"maxItems":50,"description":"A list of words customers use for the solution, at most 50. Each at most 1000 characters."},"wordsToUse":{"type":["array","null"],"items":{"type":"string","maxLength":1000},"maxItems":50,"description":"A list of words to use in texts, at most 50. Each at most 1000 characters."},"wordsToAvoid":{"type":["array","null"],"items":{"type":"string","maxLength":1000},"maxItems":50,"description":"A list of words to keep out of texts, at most 50. Each at most 1000 characters."},"notableCustomers":{"type":["array","null"],"items":{"type":"string","maxLength":1000},"maxItems":50,"description":"A list of well-known customers, at most 50. Each at most 1000 characters."},"targetDecisionMakers":{"type":["array","null"],"items":{"type":"object","properties":{"role":{"type":"string","maxLength":1000,"description":"Their job, like CEO. Up to 1000 characters."},"department":{"type":["string","null"],"maxLength":1000,"description":"Their team, like Sales. Up to 1000 characters."}},"required":["role"]},"maxItems":50,"description":"People who decide about buying, at most 50."},"jobsToBeDone":{"type":["array","null"],"items":{"type":"object","properties":{"kind":{"type":"string","enum":["functional","emotional","social"],"description":"The kind: functional (a task), emotional (a feeling) or social (how others see them)."},"label":{"type":"string","maxLength":1000,"description":"The job in a few words. Up to 1000 characters."}},"required":["kind","label"]},"maxItems":50,"description":"What customers want to get done, at most 50."},"alternativesFallingShort":{"type":["array","null"],"items":{"type":"object","properties":{"alternative":{"type":"string","maxLength":1000,"description":"The other choice. Up to 1000 characters."},"why":{"type":"string","maxLength":1000,"description":"Why it falls short. Up to 1000 characters."}},"required":["alternative","why"]},"maxItems":50,"description":"Other choices that do not work well enough, at most 50."},"objections":{"type":["array","null"],"items":{"type":"object","properties":{"objection":{"type":"string","maxLength":1000,"description":"The doubt. Up to 1000 characters."},"response":{"type":"string","maxLength":1000,"description":"Your answer to it. Up to 1000 characters."}},"required":["objection","response"]},"maxItems":50,"description":"Doubts people have before buying, with your answer, at most 50."},"glossary":{"type":["array","null"],"items":{"type":"object","properties":{"term":{"type":"string","maxLength":1000,"description":"The word. Up to 1000 characters."},"meaning":{"type":"string","maxLength":1000,"description":"What it means. Up to 1000 characters."}},"required":["term","meaning"]},"maxItems":50,"description":"Words of your field with what they mean, at most 50."},"proofMetrics":{"type":["array","null"],"items":{"type":"object","properties":{"metric":{"type":"string","maxLength":1000,"description":"What you measure, like saved time. Up to 1000 characters."},"value":{"type":"string","maxLength":1000,"description":"The number, like 30 %. Up to 1000 characters."}},"required":["metric","value"]},"maxItems":50,"description":"Numbers that prove your results, at most 50."},"testimonials":{"type":["array","null"],"items":{"type":"object","properties":{"quote":{"type":"string","maxLength":1000,"description":"Their words. Up to 1000 characters."},"attribution":{"type":"string","maxLength":1000,"description":"Who said it. Up to 1000 characters."}},"required":["quote","attribution"]},"maxItems":50,"description":"What happy customers said, at most 50."},"valueThemes":{"type":["array","null"],"items":{"type":"object","properties":{"theme":{"type":"string","maxLength":1000,"description":"The promise. Up to 1000 characters."},"proof":{"type":"string","maxLength":1000,"description":"What proves it. Up to 1000 characters."}},"required":["theme","proof"]},"maxItems":50,"description":"Main promises of value with a proof, at most 50."},"naceCodes":{"type":"array","items":{"type":"string"},"maxItems":5,"uniqueItems":true,"description":"Your field codes (NACE), like 62, at most 5. They replace the old ones, and Fusio stops picking them itself. You may not send them together with resetNaceCodesToAi."},"resetNaceCodesToAi":{"type":"boolean","description":"true removes your field codes and lets AI pick them again in the background."},"derivedFromAnalysisId":{"type":["integer","null"],"description":"The number of the website analysis this came from. Leave it out when you write it yourself."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantProductData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Change your product","description":"Changes your product. Send only what you want to change. A field you leave out stays as it is; null clears it. A list you send replaces the whole old list.\n\nWhen you change the name, one-liner or description and you did not pick the field codes yourself, AI picks new field codes in the background.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/product/scoring-profile":{"get":{"operationId":"product.scoring-profile","tags":["product"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantLeadScoringProfileOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"Show how leads are scored","description":"Returns how Fusio scores your leads: the signals it looks for, how much each counts, your ideal lead and what rules a lead out.\n\nNeeds one of these permissions: intelligence.read."}},"/v1/product/lead-conversion-model":{"get":{"operationId":"product.lead-conversion-model.show","tags":["product"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/LeadConversionModelStatusOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"Show the lead prediction model","description":"Returns the state of the model that guesses which leads will become clients.\n\nThe model learns from your won and lost leads. Until it has enough of them, the status is collecting.\n\nNeeds one of these permissions: intelligence.read."}},"/v1/articles/public":{"get":{"operationId":"public.articles.index","tags":["public-content"],"parameters":[{"name":"locale","in":"query","required":true,"schema":{"type":"string"},"description":"The language of the texts, like cs_CZ."},{"name":"perPage","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"How many articles on one page, 1 to 100."},{"name":"page","in":"query","schema":{"type":"integer","minimum":1},"description":"The page number, from 1."},{"name":"categorySlug","in":"query","schema":{"type":["string","null"]},"description":"Only articles of this category and the categories under it."},{"name":"authorSlug","in":"query","schema":{"type":["string","null"]},"description":"Only articles of this author."},{"name":"withContent","in":"query","schema":{"type":"boolean"},"description":"Also send the whole text of each article as HTML."},{"name":"articleIntegrationId","in":"query","schema":{"type":"integer"},"description":"Only articles of this website of yours."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UpdateArticleData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]}],"summary":"List published articles","description":"Returns the published, visible articles that have a text in `locale`, newest first. It is what your blog page shows.\n\nNeeds one of these permissions: articles.read."}},"/v1/articles/public/authors":{"get":{"operationId":"public.article-authors.index","tags":["public-content"],"parameters":[{"name":"locale","in":"query","required":true,"schema":{"type":"string"},"description":"The language of the texts, like cs_CZ."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/PublicTenantArticleAuthorData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-authors.read"]}],"summary":"List active authors","description":"Returns the active authors with their texts in `locale` and the number of their published articles. The default author comes first.\n\nNeeds one of these permissions: article-authors.read."}},"/v1/articles/public/authors/{slug}":{"get":{"operationId":"public.article-authors.show","tags":["public-content"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The web address part of the author."},{"name":"locale","in":"query","required":true,"schema":{"type":"string"},"description":"The language of the texts, like cs_CZ."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/PublicTenantArticleAuthorData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Article author fetched successfully","payload":{"id":7,"slug":"jana-novakova","type":"person","name":"Jana Nováková","jobTitle":"Vedoucí servisu","bio":"Jana opravuje kola přes deset let.","metaDescription":"Články od Jany Novákové.","avatar":null,"websiteUrl":"https://www.example.cz/o-nas","facebookUrl":null,"instagramUrl":null,"linkedinUrl":"https://www.linkedin.com/in/jana-novakova-example","xUrl":null,"youtubeUrl":null,"tiktokUrl":null,"githubUrl":null,"email":null,"sameAs":["https://www.linkedin.com/in/jana-novakova-example"],"knowsAbout":["horská kola","servis kol"],"articleCount":12,"isActive":true}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["article-authors.read"]}],"summary":"Show one active author","description":"Returns one active author for the author page of your website. Error: 404 when there is no active author with this address.\n\nNeeds one of these permissions: article-authors.read."}},"/v1/articles/public/{slug}":{"get":{"operationId":"public.articles.show","tags":["public-content"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The web address part of the article in this language."},{"name":"locale","in":"query","required":true,"schema":{"type":"string"},"description":"The language of the texts, like cs_CZ."},{"name":"utm_sid","in":"query","schema":{"type":["string","null"]},"description":"The reader key from an email link. Fusio counts the visit for that reader."},{"name":"countView","in":"query","schema":{"type":"boolean"},"description":"Send false when your page counts the visit itself. Fusio then counts nothing."},{"name":"articleIntegrationId","in":"query","schema":{"type":"integer"},"description":"Only articles of this website of yours."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateArticleData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Public article fetched successfully","payload":{"id":1284,"publication":null,"campaign":null,"translation":{"id":2210,"articleId":1284,"locale":"cs_CZ","isPrimary":true,"name":"Jak vybrat horské kolo","content":"## Na čem záleží\n\nVyber rám podle své výšky a terénu, kam jezdíš.","contentHtml":"<h2>Na čem záleží</h2><p>Vyber rám podle své výšky a terénu, kam jezdíš.</p>","slug":"jak-vybrat-horske-kolo","breadcrumbTitle":"Výběr horského kola","metaTitle":"Jak vybrat horské kolo | Cyklo Novák","metaDescription":"Krátký návod, jak vybrat horské kolo podle výšky a terénu.","primaryFocusKeyword":"horské kolo","secondaryKeywords":["výběr kola","velikost rámu"],"canonicalUrl":"https://www.example.cz/blog/jak-vybrat-horske-kolo","ogTitle":"Jak vybrat horské kolo","ogDescription":"Návod na výběr horského kola.","ogImageId":null,"ogImage":null,"twitterTitle":null,"twitterDescription":null,"twitterImageId":null,"twitterImage":null,"wordCount":860,"readingTime":4,"summary":"Rám vyber podle výšky, kola podle terénu.","summaryHtml":"<p>Rám vyber podle výšky, kola podle terénu.</p>","signature":null,"sources":[],"tableOfContents":[]},"availableLocales":["cs_CZ"],"alternates":[{"locale":"cs_CZ","slug":"jak-vybrat-horske-kolo","languageTag":"cs-CZ","languageCode":"cs","categorySlug":"navody"}],"tenantId":412,"tenantSequence":37,"userId":88,"articleCategoryId":31,"categorySlug":"navody","tenantArticleAuthorId":7,"author":null,"bannerImageId":5120,"unsplashBannerImageUrl":null,"unsplashBannerCredit":null,"bannerImage":null,"articleIntegrationId":3,"articleIntegration":null,"state":"published","schemaType":"BlogPosting","seoIndex":true,"seoFollow":true,"robotsNoarchive":false,"robotsNosnippet":false,"robotsMaxSnippet":null,"robotsMaxImagePreview":"large","robotsMaxVideoPreview":null,"isVisible":true,"isCornerstone":false,"publishedAt":"2026-11-12T13:05:00Z","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z","blueprint":null,"campaignAsset":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]}],"summary":"Show one published article","description":"Returns one article as your website shows it, with links to its other languages. When the campaign of the article runs and tracks views, Fusio counts the visit for it.\n\nErrors: 404 when the article is hidden, not published or not in a campaign, and 410 when it was deleted.\n\nNeeds one of these permissions: articles.read."}},"/v1/publications/{publication}/reschedule":{"patch":{"operationId":"publications.reschedule","tags":["publications"],"parameters":[{"name":"publication","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the publication."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scheduledAt":{"type":"string","description":"The new time, in the future, with a time zone, like 2026-12-01T09:00:00+01:00."}},"required":["scheduledAt"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.publish"]},{"fusioToken":["emails.send"]},{"fusioToken":["social-posts.publish.x"]},{"fusioToken":["social-posts.publish.facebook"]},{"fusioToken":["social-posts.publish.linkedin"]},{"fusioToken":["social-posts.publish.instagram"]},{"fusioToken":["campaigns.execute"]},{"fusioToken":["ads.execute.google"]},{"fusioToken":["ads.execute.facebook"]},{"fusioToken":["ads.execute.linkedin"]},{"fusioToken":["ads.execute.instagram"]}],"x-fusio-conditional-scopes":["articles.publish","emails.send","social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram","campaigns.execute","ads.write","ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"x-fusio-opt-in-scopes":["articles.publish","emails.send","social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram","campaigns.execute","ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Move a publication to another time","description":"Moves the publication to a new time. A failed publication is planned again. When the content belongs to a campaign, the campaign must be draft, scheduled or active.\n\nNeeds the permission that lets the content go out, like `articles.publish`. An article, email or social post also needs its write permission, like `articles.write`, and `campaigns.write` when it belongs to a campaign. A campaign publication needs `campaigns.write` and the write permission of each kind of content in the campaign.\n\nErrors: 403 `insufficient_scope`, 422 when the publication already started or the time is in the past.\n\nNeeds one of these permissions: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. Some values also need: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.write, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."}},"/v1/publications":{"get":{"operationId":"publications.index","tags":["publications"],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"description":"The start of the range, as a date or a date and time."},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"description":"The end of the range. It cannot be before from."},{"name":"statuses[]","in":"query","schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicationStatus"}},"description":"Return only publications with these statuses, like scheduled or failed."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/SchedulingPublicationData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]},{"fusioToken":["emails.read"]},{"fusioToken":["social-posts.read"]},{"fusioToken":["campaigns.read"]}],"summary":"List publications in a time range","description":"Returns the publications planned between `from` and `to`, earliest first. You see only content you may read.\n\nNeeds one of these permissions: articles.read, emails.read, social-posts.read, campaigns.read."},"post":{"operationId":"publications.store","tags":["publications"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":["integer","null"],"description":"The campaign the items join."},"timezone":{"type":["string","null"],"maxLength":64,"description":"The time zone for the times, like Europe/Prague. Leave it out for the time zone of the campaign."},"mainEntity":{"type":"object","properties":{"type":{"type":"string","enum":["socialPost","article","email","emailTemplate","leadDiscoveryRun","leadImportRun","contact","crmImportRun","emailCampaign","topic","socialPlatform","ad","adPlatform","campaign","campaignGenerationSequenceRun","researchProfile","tenant","aiGenerationRun","personalEmailDraft","googleAdsSearchCampaign","metaAdsCampaign","report"],"description":"What to publish: article, socialPost, email or ad. campaign launches a whole campaign. Other names are refused with 422."},"id":{"type":"integer","description":"The number of the item."},"isImmediate":{"type":"boolean","description":"true publishes now. false publishes at publishAt. A campaign ignores it and starts at its startAt."},"publishAt":{"type":["string","null"],"description":"When to publish, in the future, with a time zone, like 2026-12-01T09:00:00+01:00. Needed when isImmediate is false."}},"required":["type","id","isImmediate"],"description":"The main item to publish."},"relatedEntities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["socialPost","article","email","emailTemplate","leadDiscoveryRun","leadImportRun","contact","crmImportRun","emailCampaign","topic","socialPlatform","ad","adPlatform","campaign","campaignGenerationSequenceRun","researchProfile","tenant","aiGenerationRun","personalEmailDraft","googleAdsSearchCampaign","metaAdsCampaign","report"],"description":"What to publish: article, socialPost, email or ad."},"id":{"type":"integer","description":"The number of the item."},"useMainTime":{"type":"boolean","description":"true publishes it at the same time as the main item."},"publishAt":{"type":["string","null"],"description":"Its own time, in the future, with a time zone. Needed when useMainTime is false."}},"required":["type","id","useMainTime"]},"maxItems":100,"description":"More items to publish with the main one, at most 100. Not allowed with a campaign."}},"required":["mainEntity"]},"example":{"campaignId":58,"timezone":"Europe/Prague","mainEntity":{"type":"article","id":1284,"isImmediate":false,"publishAt":"2027-03-02T09:00:00+01:00"},"relatedEntities":[{"type":"socialPost","id":902,"useMainTime":false,"publishAt":"2027-03-02T12:00:00+01:00"}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Publications were added to queue successfully","payload":null}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.publish"]},{"fusioToken":["emails.send"]},{"fusioToken":["social-posts.publish.x"]},{"fusioToken":["social-posts.publish.facebook"]},{"fusioToken":["social-posts.publish.linkedin"]},{"fusioToken":["social-posts.publish.instagram"]},{"fusioToken":["campaigns.execute"]},{"fusioToken":["ads.execute.google"]},{"fusioToken":["ads.execute.facebook"]},{"fusioToken":["ads.execute.linkedin"]},{"fusioToken":["ads.execute.instagram"]}],"x-fusio-conditional-scopes":["articles.publish","emails.send","social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram","campaigns.execute","ads.write","ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"x-fusio-opt-in-scopes":["articles.publish","emails.send","social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram","campaigns.execute","ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Publish content now or later","description":"Plans the main item and the related items. Each item must be approved. An article needs a website whose domain is verified, an email needs a set up sender.\n\nWith a campaign as the main item, Fusio plans its start at the campaign `startAt` and the campaign becomes `scheduled`. The campaign must be `approved` and never published before.\n\nEach item needs its own permission: an article `articles.publish`, an email `emails.send`, a social post the publish permission of its network, an ad `ads.write` and the execute permission of its network, a campaign `campaigns.execute`. An article, email or social post also needs its write permission: `articles.write`, `emails.write` or `social-posts.write`. When it belongs to a campaign, or you send `campaignId`, a key also needs `campaigns.write`. A campaign needs `campaigns.write` and the write permission of each kind of content in it.\n\n> [!WARNING]\n> With `isImmediate` true, the content goes out at once: the article goes live, the email is sent, the post appears on the network.\n\nErrors: 403 `insufficient_scope`, 422 when an item is not approved, a time is in the past or outside the campaign dates, or the item cannot be published.\n\nNeeds one of these permissions: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. Some values also need: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.write, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."}},"/v1/publications/{publication}":{"get":{"operationId":"publications.show","tags":["publications"],"parameters":[{"name":"publication","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the publication."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"type":"string"},"maxItems":0}},"required":["status","message","payload"]},"example":{"status":"success","message":"Publication fetched successfully","payload":[]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]},{"fusioToken":["emails.read"]},{"fusioToken":["social-posts.read"]},{"fusioToken":["campaigns.read"]},{"fusioToken":["ads.read"]}],"summary":"Check one publication","description":"Checks that the publication exists and that you may see it. The answer has an empty list in `payload`; use the list of publications to read the details.\n\nErrors: 403 `insufficient_scope` without the read permission of its content, 404 when it does not exist.\n\nNeeds one of these permissions: articles.read, emails.read, social-posts.read, campaigns.read, ads.read."},"put":{"operationId":"publications.update","tags":["publications"],"parameters":[{"name":"publication","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the publication."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the publication again. Send the same number as in the address; another number gives 422."},"campaignId":{"type":["integer","null"],"description":"The campaign the items join."},"timezone":{"type":["string","null"],"maxLength":64,"description":"The time zone for the times, like Europe/Prague. Leave it out for the time zone of the campaign."},"mainEntity":{"type":"object","properties":{"type":{"type":"string","enum":["socialPost","article","email","emailTemplate","leadDiscoveryRun","leadImportRun","contact","crmImportRun","emailCampaign","topic","socialPlatform","ad","adPlatform","campaign","campaignGenerationSequenceRun","researchProfile","tenant","aiGenerationRun","personalEmailDraft","googleAdsSearchCampaign","metaAdsCampaign","report"],"description":"What to publish: article, socialPost, email or ad. campaign launches a whole campaign. Other names are refused with 422."},"id":{"type":"integer","description":"The number of the item."},"isImmediate":{"type":"boolean","description":"true publishes now. false publishes at publishAt. A campaign ignores it and starts at its startAt."},"publishAt":{"type":["string","null"],"description":"When to publish, in the future, with a time zone, like 2026-12-01T09:00:00+01:00. Needed when isImmediate is false."}},"required":["type","id","isImmediate"],"description":"The main item to publish."},"relatedEntities":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["socialPost","article","email","emailTemplate","leadDiscoveryRun","leadImportRun","contact","crmImportRun","emailCampaign","topic","socialPlatform","ad","adPlatform","campaign","campaignGenerationSequenceRun","researchProfile","tenant","aiGenerationRun","personalEmailDraft","googleAdsSearchCampaign","metaAdsCampaign","report"],"description":"What to publish: article, socialPost, email or ad."},"id":{"type":"integer","description":"The number of the item."},"useMainTime":{"type":"boolean","description":"true publishes it at the same time as the main item."},"publishAt":{"type":["string","null"],"description":"Its own time, in the future, with a time zone. Needed when useMainTime is false."}},"required":["type","id","useMainTime"]},"maxItems":100,"description":"More items to publish with the main one, at most 100. Not allowed with a campaign."}},"required":["id","mainEntity"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.publish"]},{"fusioToken":["emails.send"]},{"fusioToken":["social-posts.publish.x"]},{"fusioToken":["social-posts.publish.facebook"]},{"fusioToken":["social-posts.publish.linkedin"]},{"fusioToken":["social-posts.publish.instagram"]},{"fusioToken":["campaigns.execute"]},{"fusioToken":["ads.execute.google"]},{"fusioToken":["ads.execute.facebook"]},{"fusioToken":["ads.execute.linkedin"]},{"fusioToken":["ads.execute.instagram"]}],"x-fusio-conditional-scopes":["articles.publish","emails.send","social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram","campaigns.execute","ads.write","ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"x-fusio-opt-in-scopes":["articles.publish","emails.send","social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram","campaigns.execute","ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Change a publication","description":"Plans the items again with new times. An item already in this publication may be approved, scheduled or failed; a new item must be approved. A campaign publication cannot change here; delete it and create a new one.\n\nEach item needs its own permission: an article `articles.publish`, an email `emails.send`, a social post the publish permission of its network, an ad `ads.write` and the execute permission of its network, a campaign `campaigns.execute`. An article, email or social post also needs its write permission: `articles.write`, `emails.write` or `social-posts.write`. When it belongs to a campaign, or you send `campaignId`, a key also needs `campaigns.write`. A campaign needs `campaigns.write` and the write permission of each kind of content in it.\n\n> [!WARNING]\n> With `isImmediate` true, the content goes out at once.\n\nErrors: 403 `insufficient_scope`, 422 when an item cannot be planned, a time is outside the campaign dates, or the publication is for a campaign.\n\nNeeds one of these permissions: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. Some values also need: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.write, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."},"delete":{"operationId":"publications.destroy","tags":["publications"],"parameters":[{"name":"publication","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the publication."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.publish"]},{"fusioToken":["emails.send"]},{"fusioToken":["social-posts.publish.x"]},{"fusioToken":["social-posts.publish.facebook"]},{"fusioToken":["social-posts.publish.linkedin"]},{"fusioToken":["social-posts.publish.instagram"]},{"fusioToken":["campaigns.execute"]},{"fusioToken":["ads.execute.google"]},{"fusioToken":["ads.execute.facebook"]},{"fusioToken":["ads.execute.linkedin"]},{"fusioToken":["ads.execute.instagram"]}],"x-fusio-conditional-scopes":["articles.publish","emails.send","social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram","campaigns.execute","ads.write","ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"x-fusio-opt-in-scopes":["articles.publish","emails.send","social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram","campaigns.execute","ads.execute.google","ads.execute.facebook","ads.execute.linkedin","ads.execute.instagram"],"summary":"Cancel a publication","description":"Cancels a scheduled or failed publication. The content goes back to approved and nothing goes out. A campaign publication stops the planned start.\n\nNeeds the permission that lets the content go out. An article, email or social post also needs its write permission, like `articles.write`, and `campaigns.write` when it belongs to a campaign. A campaign publication needs `campaigns.write` and the write permission of each kind of content in the campaign.\n\nErrors: 403 `insufficient_scope`, 422 when the publication is not scheduled or failed.\n\nNeeds one of these permissions: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. Some values also need: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.write, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram. You must tick these on purpose: articles.publish, emails.send, social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram, campaigns.execute, ads.execute.google, ads.execute.facebook, ads.execute.linkedin, ads.execute.instagram."}},"/v1/scheduling/available-entities":{"get":{"operationId":"scheduling.available-entities","tags":["publications"],"parameters":[{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["article","email","social_post","campaign"]},"description":"The kind of content: article, email, social_post or campaign."},{"name":"search","in":"query","schema":{"type":["string","null"],"maxLength":255},"description":"Text to look for in the name, at most 255 characters."},{"name":"cursor","in":"query","schema":{"type":["string","null"]},"description":"Where the next page starts. Take it from next_cursor of the page before."},{"name":"perPage","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"How many items on one page, 1 to 100."},{"name":"states[]","in":"query","schema":{"type":"array","items":{"type":"string","enum":["drafted","approved","rejected","scheduled","published","failed","draft","active","paused","completed","cancelled","archived"],"maxLength":64}},"description":"Return items in these states. Leave it out for approved items only."},{"name":"campaignIds[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1}},"description":"Return only items of these campaigns. Not used for type campaign."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/SchedulingAvailableEntitiesOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Available entities fetched successfully","payload":{"data":[{"id":1284,"name":"Jak vybrat horské kolo","state":"approved","assignedToCampaign":true,"campaignId":58,"campaignName":"Jarní servis 2027","campaignOrigin":"manual"},{"id":1279,"name":"Pět chyb při mazání řetězu","state":"approved","assignedToCampaign":false,"campaignId":null,"campaignName":null,"campaignOrigin":null}],"path":"https://api.example.cz/api/v1/scheduling/available-entities","per_page":20,"next_cursor":"eyJpZCI6MTI3OSwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ","next_page_url":"https://api.example.cz/api/v1/scheduling/available-entities?type=article&cursor=eyJpZCI6MTI3OSwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ","prev_cursor":null,"prev_page_url":null}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["articles.read"]},{"fusioToken":["emails.read"]},{"fusioToken":["social-posts.read"]},{"fusioToken":["campaigns.read"]}],"x-fusio-conditional-scopes":["articles.read","emails.read","social-posts.read","campaigns.read"],"summary":"List content you can publish","description":"Returns content of one kind that you can put in a publication, newest first, page by page. Pass `next_cursor` as `cursor` to get the next page; it is null on the last page.\n\nNeeds the read permission of that kind, like `articles.read`.\n\nNeeds one of these permissions: articles.read, emails.read, social-posts.read, campaigns.read. Some values also need: articles.read, emails.read, social-posts.read, campaigns.read."}},"/v1/seo-audits/overview":{"get":{"operationId":"seo-audits.overview","tags":["seo-audits"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[tenantProductId]","in":"query","schema":{"type":["integer","null"]},"description":"Only audits of this product of yours."},{"name":"filter[countryCode]","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":2},"description":"Only this country, as two letters like CZ."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/SeoAuditOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["seo.read"]}],"summary":"Show the SEO overview","description":"Returns the main SEO numbers for a range of days: your visibility against rivals and the findings to fix first.\n\nNeeds one of these permissions: seo.read."}},"/v1/seo-audits":{"get":{"operationId":"seo-audits.index","tags":["seo-audits"],"parameters":[{"name":"tenantProductId","in":"query","schema":{"type":["integer","null"]},"description":"Only audits of this product of yours."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["seo.read"]}],"summary":"List SEO audits","description":"Returns your SEO audits, newest first, with their findings and markets.\n\nNeeds one of these permissions: seo.read."}},"/v1/seo-audits/{seoAudit}":{"get":{"operationId":"seo-audits.show","tags":["seo-audits"],"parameters":[{"name":"seoAudit","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the SEO audit."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantSeoAuditDetailData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"SEO audit fetched successfully","payload":{"audit":{"id":18,"tenantId":412,"tenantProductId":5,"tenantProductName":"Servis a prodej kol","derivedFromAnalysisId":52,"websiteUrl":"https://www.example.cz","createdBy":88,"overallHealth":"needs_work","summary":"Web je rychlý, ale stránka servisu nemá texty, které lidé hledají.","findings":[],"currentKeywordCoverage":[],"intentCoverage":null,"rawSources":[],"analyzedAt":"2026-11-03T08:30:00Z","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","searchResearch":null,"recommendations":null,"visibility":null,"competitorPattern":"Konkurence píše návody k údržbě kol.","markets":[{"id":30,"seoAuditId":18,"countryCode":"CZ","countryName":"Česko","languageId":1,"languageSlug":"cs","languageName":"Čeština","isPrimary":true,"isBase":true,"status":"completed","failureReason":null,"summary":{"searchVolume":12400,"cpcLow":3.1,"cpcHigh":11.8,"currencyCode":"CZK","difficulty":34,"top10Count":6}}],"researchCountryCode":"CZ","researchCountrySource":"target_markets"},"keywordOpportunities":[{"id":901,"tenantId":412,"derivedFromAnalysisId":52,"createdBy":88,"keyword":"servis kol brno","searchVolume":390,"isVolumeUnknown":false,"cpcLow":4.2,"cpcHigh":11.8,"currencyCode":"CZK","competitionIndex":38,"intent":"transactional","difficultyEstimate":28.5,"priorityScore":86,"priorityRank":1,"priceBand":"medium","source":"product","cluster":"Servis","isGap":true,"isRecommended":true,"rationale":"Lidé to hledají a ty na to zatím nemáš stránku.","analyzedAt":"2026-11-03T08:30:00Z","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z","isCpcUnknown":false,"isCompetitionUnknown":false}],"competitors":[{"id":77,"name":"Kola Horák","websiteUrl":"https://www.example.cz","competitorType":"direct","positioningAngle":"Kola pro celou rodinu","summary":"Velký výběr dětských kol a půjčovna.","theirAdvantage":"Návody k údržbě kol.","ourAdvantage":"Rychlejší servis.","strengths":["Návody"],"weaknesses":["Pomalý servis"],"estimatedDomainAuthority":22,"seoMove":"Napiš stránku o jarním servisu.","keywordOpportunityIds":[901]}],"googleAdsSearchCampaign":null,"markets":[{"id":30,"seoAuditId":18,"countryCode":"CZ","countryName":"Česko","languageId":1,"languageSlug":"cs","languageName":"Čeština","isPrimary":true,"isBase":true,"status":"completed","failureReason":null,"summary":{"searchVolume":12400,"cpcLow":3.1,"cpcHigh":11.8,"currencyCode":"CZK","difficulty":34,"top10Count":6}}]}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["seo.read"]}],"summary":"Show an SEO audit","description":"Returns one SEO audit with its search word chances, competitors, markets and the Google Ads campaign made from it.\n\nNeeds one of these permissions: seo.read."},"delete":{"operationId":"seo-audits.destroy","tags":["seo-audits"],"parameters":[{"name":"seoAudit","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the SEO audit."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["seo.write"]}],"x-fusio-opt-in-scopes":["seo.write"],"summary":"Remove an SEO audit","description":"Removes an SEO audit with all its markets. A market check that still runs is stopped.\n\nYou cannot remove the audit of a single market this way; you get 422 `tenant_seo_audit.market_not_removable`. Remove the market with `seo-audits.markets.destroy` instead.\n\nNeeds one of these permissions: seo.write. You must tick these on purpose: seo.write."}},"/v1/seo-audits/{seoAudit}/findings/{priority}":{"put":{"operationId":"seo-audits.findings.update","tags":["seo-audits"],"parameters":[{"name":"seoAudit","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the SEO audit."},{"name":"priority","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the finding, from `findings.priority`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"isResolved":{"type":"boolean","description":"true when you fixed it, false to open it again."}},"required":["isResolved"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantSeoAuditDetailData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["seo.write"]}],"x-fusio-opt-in-scopes":["seo.write"],"summary":"Mark an SEO finding as fixed","description":"Marks one finding of the audit as fixed or open again, and returns the whole audit. When the audit has no finding with this number, you get 404.\n\nNeeds one of these permissions: seo.write. You must tick these on purpose: seo.write."}},"/v1/seo-audits/{seoAudit}/google-ads-search-campaign":{"post":{"operationId":"seo-audits.google-ads-search-campaign.store","tags":["seo-audits"],"parameters":[{"name":"seoAudit","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the SEO audit."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the campaign, at most 255 characters. No other campaign may have it."},"sets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","maxLength":255,"description":"The key of a set the audit recommends. Take it from `google-ads-search-seo-keyword-sets.index`. Each set once."},"keywords":{"type":"array","items":{"type":"string","maxLength":255},"minItems":1,"maxItems":8,"description":"The keywords of that set you want, from 1 to 8, each at most 255 characters."},"negativeKeywords":{"type":"array","items":{"type":"string","maxLength":255},"maxItems":15,"description":"The negative keywords of that set you want, at most 15. Send an empty list for none."}},"required":["key","keywords","negativeKeywords"]},"minItems":1,"maxItems":8,"uniqueItems":true,"description":"The keyword sets to use, from 1 to 8. Each set becomes one ad group."},"accountNegativeKeywords":{"type":"array","items":{"type":"string","maxLength":255},"maxItems":15,"description":"Negative keywords the audit recommends for the whole account that you want, at most 15. Send an empty list for none."}},"required":["name","sets","accountNegativeKeywords"]}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ads.write","seo.read"]}],"summary":"Make a Google Ads campaign from an audit","description":"Makes a draft Google Ads search campaign from the keyword sets of the audit and answers 201. Nothing goes to Google Ads yet.\n\nEvery keyword must come from the set the audit recommends; a key or word that is not there gets 422. Then write the ads with `google-ads-search-ad-groups.search-ad.generate`, approve the campaign and send it to Google Ads.\n\nThis address allows 10 requests a minute.\n\nNeeds one of these permissions: ads.write. Also needs: seo.read."}},"/v1/seo-audits/{seoAudit}/markets":{"post":{"operationId":"seo-audits.markets.store","tags":["seo-audits"],"parameters":[{"name":"seoAudit","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the SEO audit."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"The country as two letters, like DE."},"languageId":{"type":"integer","description":"The number of the language to check."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["countryCode","languageId"]},"example":{"countryCode":"SK","languageId":4,"maxCredits":60}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditMarketData"}}},"required":["status","message","payload"]},"example":{"status":"success","message":"The market is being analysed.","payload":[{"id":30,"seoAuditId":18,"countryCode":"CZ","countryName":"Česko","languageId":1,"languageSlug":"cs","languageName":"Čeština","isPrimary":true,"isBase":true,"status":"completed","failureReason":null,"summary":{"searchVolume":12400,"cpcLow":3.1,"cpcHigh":11.8,"currencyCode":"CZK","difficulty":34,"top10Count":6}},{"id":31,"seoAuditId":18,"countryCode":"SK","countryName":"Slovensko","languageId":4,"languageSlug":"sk","languageName":"Slovenčina","isPrimary":false,"isBase":false,"status":"running","failureReason":null,"summary":null}]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","seo.write"]}],"x-fusio-opt-in-scopes":["seo.write"],"summary":"Add a market to an SEO audit","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAdds a country and language to the audit and starts checking it with AI in the background. The answer is 201 with all markets of the audit.\n\nAn audit has at most 5 markets; failed ones do not count. You get 422 when the audit was not made from your website analysis, the language is not supported, your domain is not verified, the country is already there, or another market check runs. The error is in `payload.error`.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: seo.write. You must tick these on purpose: seo.write."}},"/v1/seo-audits/{seoAudit}/markets/{market}/primary":{"put":{"operationId":"seo-audits.markets.primary","tags":["seo-audits"],"parameters":[{"name":"seoAudit","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the SEO audit."},{"name":"market","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the market of the audit."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditMarketData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["seo.write"]}],"x-fusio-opt-in-scopes":["seo.write"],"summary":"Make a market the primary one","description":"Makes this market the one whose numbers you see first, and returns all markets. The market must be completed; otherwise you get 422 `tenant_seo_audit.market_not_completed`.\n\nNeeds one of these permissions: seo.write. You must tick these on purpose: seo.write."}},"/v1/seo-audits/{seoAudit}/markets/{market}/country":{"put":{"operationId":"seo-audits.markets.country","tags":["seo-audits"],"parameters":[{"name":"seoAudit","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the SEO audit."},{"name":"market","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the market of the audit."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"The country as two letters, like CZ."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["countryCode"]}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditMarketData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","seo.write"]}],"x-fusio-opt-in-scopes":["seo.write"],"summary":"Set the country of the first market","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nGives the first market of the audit its country, adds the country to the target markets of your product, and checks it again with AI in the background. The answer is 202 with all markets.\n\nIt works only for the first market when it has no country yet or its check failed. You get 422 when the country is already in another market, another check runs, or a newer website analysis exists. The error is in `payload.error`.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: seo.write. You must tick these on purpose: seo.write."}},"/v1/seo-audits/{seoAudit}/markets/{market}":{"delete":{"operationId":"seo-audits.markets.destroy","tags":["seo-audits"],"parameters":[{"name":"seoAudit","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the SEO audit."},{"name":"market","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the market of the audit."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditMarketData"}}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["seo.write"]}],"x-fusio-opt-in-scopes":["seo.write"],"summary":"Remove a market from an SEO audit","description":"Removes a market and returns the markets that stay. You cannot remove the first market, the primary market, or one whose check still runs; then you get 422 `tenant_seo_audit.market_not_removable`.\n\nNeeds one of these permissions: seo.write. You must tick these on purpose: seo.write."}},"/v1/social-posts/grid":{"get":{"operationId":"social-posts.grid","tags":["social-posts"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[platform]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The network, like google or facebook. For prospects it means the ads they came from. Social posts take several, split by commas."},{"name":"filter[campaign]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more campaign IDs, split by commas."},{"name":"filter[campaignRelation]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows rows in a campaign. without shows rows outside any campaign."},{"name":"filter[sourceArticle]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more article IDs the post was made from, split by commas."},{"name":"filter[publishedAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it went out. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[updatedAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was last changed. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","state","publishedAt","createdAt","updatedAt","-name","-state","-publishedAt","-createdAt","-updatedAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexSocialPostData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.read"]}],"summary":"List social posts in a table","description":"Returns one page of social posts with the filters and the sort you ask for.\n\nNeeds one of these permissions: social-posts.read."}},"/v1/social-posts/options":{"get":{"operationId":"social-posts.options","tags":["social-posts"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name. At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[platform]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The network, like google or facebook. For prospects it means the ads they came from. Social posts take several, split by commas."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionSocialPostData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.read"]}],"summary":"List social posts for a picker","description":"Returns short items with the number and the name of each post. Use it to fill a picker.\n\nNeeds one of these permissions: social-posts.read."}},"/v1/social-posts/board/summary":{"get":{"operationId":"social-posts.board.summary","tags":["social-posts"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[platform]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The network, like google or facebook. For prospects it means the ads they came from. Social posts take several, split by commas."},{"name":"filter[campaign]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more campaign IDs, split by commas."},{"name":"filter[campaignRelation]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows rows in a campaign. without shows rows outside any campaign."},{"name":"filter[sourceArticle]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more article IDs the post was made from, split by commas."},{"name":"filter[publishedAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it went out. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[updatedAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was last changed. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BoardSummaryData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.read"]}],"summary":"Count social posts in each state","description":"Returns how many posts there are in each column of the board. A column is one state.\n\nNeeds one of these permissions: social-posts.read."}},"/v1/social-posts/board/{status}":{"get":{"operationId":"social-posts.board.column","tags":["social-posts"],"parameters":[{"name":"status","in":"path","required":true,"schema":{"type":"string","enum":["drafted","approved","rejected","scheduled","published","failed"]},"description":"The column: drafted, approved, rejected, scheduled, published or failed."},{"name":"cursor","in":"query","schema":{"type":["string","null"],"maxLength":512},"description":"Where the next page starts. Take it from nextCursor of the page before."},{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[platform]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The network, like google or facebook. For prospects it means the ads they came from. Social posts take several, split by commas."},{"name":"filter[campaign]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more campaign IDs, split by commas."},{"name":"filter[campaignRelation]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"with shows rows in a campaign. without shows rows outside any campaign."},{"name":"filter[sourceArticle]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"One or more article IDs the post was made from, split by commas."},{"name":"filter[publishedAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it went out. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[updatedAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was last changed. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexSocialPostData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.read"]}],"summary":"List social posts of one state","description":"Returns the posts of one board column, page by page. Pass `nextCursor` as `cursor` to get the next page.\n\nNeeds one of these permissions: social-posts.read."}},"/v1/social-posts/overview":{"get":{"operationId":"social-posts.overview","tags":["social-posts"],"parameters":[{"name":"from","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The first day of the range, as YYYY-MM-DD. Leave it out to start at your oldest data, at most 366 days back."},{"name":"to","in":"query","schema":{"type":["string","null"],"format":"date"},"description":"The last day of the range, as YYYY-MM-DD. Leave it out for today. The range may be at most 366 days long."},{"name":"compare","in":"query","schema":{"type":["boolean","null"]},"description":"true to also count the same long range just before, for comparison."},{"name":"filter[platform]","in":"query","schema":{"anyOf":[{"$ref":"#/components/schemas/CampaignSocialNetwork"},{"type":"null"}]},"description":"Count only posts of this network."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/SocialPostOverviewData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.read"]}],"summary":"Show social post numbers for a time range","description":"Returns the numbers of your social posts for the days you pick: how many you published, how many people saw them and how many reacted, the best times to post and the best posts.\n\nAsk again when `ready` is false.\n\nNeeds one of these permissions: social-posts.read."}},"/v1/social-posts/bulk-state":{"patch":{"operationId":"social-posts.bulk-set-state","tags":["social-posts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"socialPostIds":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":200,"description":"The numbers of the posts, at most 200."},"state":{"$ref":"#/components/schemas/SocialPostState","description":"The new state for all of them. Any state other than drafted or rejected needs the publish permission of the network, like social-posts.publish.linkedin."}},"required":["socialPostIds","state"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.write"]}],"x-fusio-conditional-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"x-fusio-opt-in-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"summary":"Move many social posts to one state","description":"Moves each post like the single state change does. The same steps are allowed. It is all or nothing: when one post cannot move, none of them moves. When one of the posts belongs to a campaign, a key also needs `campaigns.write`.\n\nNeeds one of these permissions: social-posts.write. Some values also need: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram. You must tick these on purpose: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram."}},"/v1/social-posts/{socialPost}/state":{"patch":{"operationId":"social-posts.set-state","tags":["social-posts"],"parameters":[{"name":"socialPost","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the social post."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/SocialPostState","description":"The new state. Any state other than drafted or rejected needs the publish permission of the network, like social-posts.publish.linkedin."}},"required":["state"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.write"]}],"x-fusio-conditional-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"x-fusio-opt-in-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"summary":"Move a social post to another state","description":"Allowed steps: from drafted to approved or rejected, from rejected to approved, and from approved to rejected. A scheduled or published post cannot change here; use publications.\n\nAn Instagram post needs a picture or video before it is approved. `approved` needs the publish permission of the network. When the post belongs to a campaign, a key also needs `campaigns.write`.\n\nErrors: 403 `insufficient_scope`, 422 when the step is not allowed.\n\nNeeds one of these permissions: social-posts.write. Some values also need: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram. You must tick these on purpose: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram."}},"/v1/social-posts/{socialPost}/fields":{"patch":{"operationId":"social-posts.update-fields","tags":["social-posts"],"parameters":[{"name":"socialPost","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the social post."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the post, at most 255 characters."},"content":{"type":"string","maxLength":5000,"description":"The text people see, at most 5000 characters."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.write"]}],"summary":"Change the name or text of a post","description":"Changes only the fields you send. The state does not change.\n\nOnly a `drafted` post can change here. Any other post gets 422. When the post belongs to a campaign, a key also needs `campaigns.write`.\n\nNeeds one of these permissions: social-posts.write."}},"/v1/social-posts":{"post":{"operationId":"social-posts.store","tags":["social-posts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"batchId":{"type":["integer","null"],"description":"Joins posts that were made together. Leave it out and Fusio starts a new group."},"userId":{"type":"integer","description":"The person who owns the post. It must be an active member of your company."},"tenantOAuthPlatformId":{"type":["integer","null"],"description":"The connected account the post goes out from, like your LinkedIn page."},"socialPlatformId":{"type":["integer","null"],"description":"The network the post is for. Needed when you do not send tenantOAuthPlatformId."},"languageId":{"type":"integer","description":"The number of the language of the post."},"topicId":{"type":["integer","null"],"description":"The number of the topic the post is about."},"name":{"type":"string","maxLength":255,"description":"The name of the post, at most 255 characters. Only your team sees it."},"content":{"type":"string","description":"The text people see. It may be as long as the network allows. Pictures may only use files your company can see."},"state":{"$ref":"#/components/schemas/SocialPostState","description":"drafted, approved, rejected, scheduled, published or failed. Any state other than drafted or rejected needs the publish permission of the network, like social-posts.publish.linkedin."},"fileIds":{"type":"array","items":{"type":"integer"},"description":"The numbers of the pictures or videos of the post. An Instagram post needs at least one before it is approved."},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"Leave it out. A new post has no parts yet."},"kind":{"$ref":"#/components/schemas/SocialPostCommentKind","description":"thread_item is the next post of a thread, only on X. comment is a comment under the post."},"content":{"type":"string","description":"The text of the part. Pictures may only use files your company can see."},"fileIds":{"type":"array","items":{"type":"integer"},"description":"The numbers of the files shown with this part. Only parts on X may have files, at most 4."},"delayValue":{"type":["integer","null"],"minimum":0,"maximum":65535,"description":"How long to wait after the post before this part goes out, 0 to 65535."},"delayUnit":{"anyOf":[{"$ref":"#/components/schemas/SocialPostCommentDelayUnit"},{"type":"null"}],"description":"The unit of the wait: minutes, hours or days. Needed with delayValue."}}},"description":"More parts that follow the post: the next posts of a thread or comments under it."},"campaignId":{"type":["integer","null"],"description":"The campaign the post joins. A key then also needs campaigns.write."}},"required":["userId","languageId","name","content","state"]},"example":{"userId":88,"socialPlatformId":1,"languageId":2,"name":"Tip na jarní servis","content":"Než vyrazíš na první jarní vyjížďku, zkontroluj brzdy a tlak v pneumatikách.","state":"drafted","fileIds":[5120],"comments":[{"kind":"comment","content":"Objednej se u nás: https://www.example.cz/servis","delayValue":10,"delayUnit":"minutes"}]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateSocialPostData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Social post created successfully","payload":{"id":902,"batchId":5501,"tenantOAuthPlatform":null,"socialPlatform":{"id":1,"name":"X","slug":"x"},"publication":null,"campaign":null,"xSocialPost":null,"instagramSocialPost":null,"facebookSocialPost":null,"linkedInSocialPost":null,"languageId":2,"topicId":null,"tenantId":412,"tenantSequence":44,"userId":88,"name":"Tip na jarní servis","content":"Než vyrazíš na první jarní vyjížďku, zkontroluj brzdy a tlak v pneumatikách.","state":"drafted","files":[{"id":5120,"name":"kolo-v-lese.jpg","alt":"Horské kolo na lesní cestě","slug":"kolo-v-lese","extension":"jpg","mimeType":"image/jpeg","size":348211,"width":1600,"height":900,"ratio":1.78,"path":"tenants/412/files/kolo-v-lese.jpg","url":"https://cdn.example.cz/fusio/files/kolo-v-lese.jpg","hash":"9f2c4e1a7b5d3c8e","isAiGenerated":false,"isImageEdited":false,"isCroppable":true,"createdAt":"2026-11-03T08:30:00Z","usageCount":2,"isInUse":true,"canDelete":false}],"comments":[{"id":3301,"socialPostId":902,"parentCommentId":null,"tenantId":412,"userId":88,"content":"Objednej se u nás: https://www.example.cz/servis","commentOrder":0,"kind":"comment","delayValue":10,"delayUnit":"minutes","state":"drafted","externalId":null,"rejectReason":null,"files":[],"scheduledAt":null,"publishedAt":null,"updatedAt":"2026-11-03T08:30:00Z","createdAt":"2026-11-03T08:30:00Z","deletedAt":null}],"updatedAt":"2026-11-03T08:30:00Z","createdAt":"2026-11-03T08:30:00Z","deletedAt":null,"blueprint":null,"isAwaitingArticle":false}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.write"]}],"x-fusio-conditional-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"x-fusio-opt-in-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"summary":"Create a social post","description":"Creates a post for one network. Pick the account it goes out from with `tenantOAuthPlatformId`, or only the network with `socialPlatformId`. When you send `campaignId`, the post joins that campaign.\n\nA state other than `drafted` or `rejected` needs the publish permission of the network.\n\n> [!WARNING]\n> A `published` post may go out on the network at once, where everyone can see it.\n\nErrors: 403 `insufficient_scope` without the publish permission, 403 with `campaignId` without `campaigns.write`, 422 when a field is wrong, the text is too long for the network, or an Instagram post has no picture.\n\nNeeds one of these permissions: social-posts.write. Some values also need: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram. You must tick these on purpose: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram."}},"/v1/social-posts/{socialPost}":{"get":{"operationId":"social-posts.show","tags":["social-posts"],"parameters":[{"name":"socialPost","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the social post."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateSocialPostData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Social post 902 retrieved successfully","payload":{"id":902,"batchId":5501,"tenantOAuthPlatform":null,"socialPlatform":{"id":1,"name":"X","slug":"x"},"publication":null,"campaign":null,"xSocialPost":null,"instagramSocialPost":null,"facebookSocialPost":null,"linkedInSocialPost":null,"languageId":2,"topicId":null,"tenantId":412,"tenantSequence":44,"userId":88,"name":"Tip na jarní servis","content":"Než vyrazíš na první jarní vyjížďku, zkontroluj brzdy a tlak v pneumatikách.","state":"drafted","files":[{"id":5120,"name":"kolo-v-lese.jpg","alt":"Horské kolo na lesní cestě","slug":"kolo-v-lese","extension":"jpg","mimeType":"image/jpeg","size":348211,"width":1600,"height":900,"ratio":1.78,"path":"tenants/412/files/kolo-v-lese.jpg","url":"https://cdn.example.cz/fusio/files/kolo-v-lese.jpg","hash":"9f2c4e1a7b5d3c8e","isAiGenerated":false,"isImageEdited":false,"isCroppable":true,"createdAt":"2026-11-03T08:30:00Z","usageCount":2,"isInUse":true,"canDelete":false}],"comments":[{"id":3301,"socialPostId":902,"parentCommentId":null,"tenantId":412,"userId":88,"content":"Objednej se u nás: https://www.example.cz/servis","commentOrder":0,"kind":"comment","delayValue":10,"delayUnit":"minutes","state":"drafted","externalId":null,"rejectReason":null,"files":[],"scheduledAt":null,"publishedAt":null,"updatedAt":"2026-11-03T08:30:00Z","createdAt":"2026-11-03T08:30:00Z","deletedAt":null}],"updatedAt":"2026-11-12T13:05:00Z","createdAt":"2026-11-03T08:30:00Z","deletedAt":null,"blueprint":null,"sourceArticle":null,"isAwaitingArticle":false}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.read"]}],"summary":"Show one social post","description":"Returns the post with its text, its files, its account and the parts that follow it.\n\nNeeds one of these permissions: social-posts.read."},"put":{"operationId":"social-posts.update","tags":["social-posts"],"parameters":[{"name":"socialPost","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the social post."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"batchId":{"type":"integer","description":"The group of posts this post belongs to. Send the value you got."},"userId":{"type":"integer","description":"The person who owns the post. It must be an active member of your company."},"tenantOAuthPlatformId":{"type":["integer","null"],"description":"The connected account the post goes out from, like your LinkedIn page."},"socialPlatformId":{"type":["integer","null"],"description":"The network the post is for. Needed when you do not send tenantOAuthPlatformId."},"languageId":{"type":"integer","description":"The number of the language of the post."},"topicId":{"type":["integer","null"],"description":"The number of the topic the post is about."},"name":{"type":"string","maxLength":255,"description":"The name of the post, at most 255 characters. Only your team sees it."},"content":{"type":"string","description":"The text people see. It may be as long as the network allows. Pictures may only use files your company can see."},"state":{"$ref":"#/components/schemas/SocialPostState","description":"drafted, approved, rejected, scheduled, published or failed. Any state other than drafted or rejected needs the publish permission of the network, like social-posts.publish.linkedin."},"fileIds":{"type":"array","items":{"type":"integer"},"description":"The numbers of the pictures or videos of the post. An Instagram post needs at least one before it is approved."},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"The number of a part you keep. Leave it out for a new part."},"kind":{"$ref":"#/components/schemas/SocialPostCommentKind","description":"thread_item is the next post of a thread, only on X. comment is a comment under the post. Needed in each part."},"content":{"type":"string","description":"The text of the part. Pictures may only use files your company can see."},"fileIds":{"type":"array","items":{"type":"integer"},"description":"The numbers of the files shown with this part. Only parts on X may have files, at most 4."},"delayValue":{"type":["integer","null"],"minimum":0,"maximum":65535,"description":"How long to wait after the post before this part goes out, 0 to 65535. Send it in each part; null means no wait."},"delayUnit":{"anyOf":[{"$ref":"#/components/schemas/SocialPostCommentDelayUnit"},{"type":"null"}],"description":"The unit of the wait: minutes, hours or days. Send it in each part; it is needed when delayValue is not null."}},"required":["kind","delayValue","delayUnit"]},"description":"More parts that follow the post: the next posts of a thread or comments under it. The list replaces the old one."},"id":{"type":"integer","description":"The number of the post again. It must be the same as in the address."}},"required":["batchId","userId","languageId","name","content","state","id"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateSocialPostData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.write"]}],"x-fusio-conditional-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"x-fusio-opt-in-scopes":["social-posts.publish.x","social-posts.publish.facebook","social-posts.publish.linkedin","social-posts.publish.instagram"],"summary":"Change a whole social post","description":"Replaces the post. Send every field, not just the changed ones. `comments` replaces the parts that follow the post.\n\nChanging a post that is not `drafted` or `rejected` needs the publish permission of the network, and so does moving it to such a state. When the post belongs to a campaign, a key also needs `campaigns.write`.\n\n> [!WARNING]\n> Changing a scheduled post changes what goes out on the network.\n\nErrors: 403 `insufficient_scope`, 422 when a field is wrong.\n\nNeeds one of these permissions: social-posts.write. Some values also need: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram. You must tick these on purpose: social-posts.publish.x, social-posts.publish.facebook, social-posts.publish.linkedin, social-posts.publish.instagram."},"delete":{"operationId":"social-posts.destroy","tags":["social-posts"],"parameters":[{"name":"socialPost","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the social post."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["social-posts.write"]}],"summary":"Delete a social post","description":"Moves the post to the trash and removes its publication. When the post belongs to a campaign, a key also needs `campaigns.write`.\n\n> [!WARNING]\n> A post already live on Facebook is deleted on Facebook too. When Facebook refuses, the post is deleted only in Fusio.\n\nNeeds one of these permissions: social-posts.write."}},"/v1/strategies/grid":{"get":{"operationId":"strategies.grid","tags":["strategies"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[category]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The kind of plan. One or more values, split by commas."},{"name":"filter[phase]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The step of the plan. One or more values, split by commas."},{"name":"filter[implementationType]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How the plan is carried out. One or more values, split by commas."},{"name":"filter[stage]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The step it is at. One or more values, split by commas."},{"name":"filter[priorityScore]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"How important it is. Two numbers as from,to. Leave one side empty for no limit."},{"name":"filter[createdAt]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"When it was made. One date (YYYY-MM-DD), or two dates as from,to. Leave one side empty for no limit."},{"name":"filter[ids]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Up to 100 IDs, split by commas."},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","category","phase","implementationType","stage","priorityScore","createdAt","-name","-category","-phase","-implementationType","-stage","-priorityScore","-createdAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexTenantStrategyData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"List strategies in a table","description":"Returns your strategies page by page, ready for a table. Use `filter`, `sort`, `page` and `perPage` as the shape of the list says.\n\nNeeds one of these permissions: intelligence.read."}},"/v1/strategies":{"post":{"operationId":"strategies.store","tags":["strategies"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the strategy, from 1 to 255 characters."},"tenantProductId":{"type":["integer","null"],"description":"The number of your product this belongs to. Leave it out for your main product."},"ideaSummary":{"type":"string","maxLength":5000,"description":"What the idea is. At most 5000 characters."},"category":{"$ref":"#/components/schemas/TenantStrategyCategory","description":"The area: content, social, email, paid_ads, web_seo, conversion or growth."},"whyItFits":{"type":"string","maxLength":5000,"description":"Why it fits your business. At most 5000 characters."},"expectedOutcome":{"type":"string","maxLength":5000,"description":"What you expect to get. At most 5000 characters."},"stage":{"$ref":"#/components/schemas/TenantStrategyStage","description":"For what stage of your business: pre_launch, early, growth or scale."},"budgetLevel":{"$ref":"#/components/schemas/TenantStrategyBudgetLevel","description":"How much money it needs: free, low, medium or high."},"timeline":{"$ref":"#/components/schemas/TenantStrategyTimeline","description":"When it brings results: quick_wins, medium_term or long_term."},"priorityScore":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"How important it is, from 0 to 100."},"status":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyStatus"},{"type":"null"}],"description":"Where you are with it: proposed, planned, in_progress, done or archived."},"sourceIdeaNumber":{"type":["integer","null"],"minimum":0,"description":"The number of the idea in the list it came from, 0 or more."},"sourceIdeaSlug":{"type":["string","null"],"maxLength":255,"description":"The short name of the idea it came from, at most 255 characters."},"derivedFromAnalysisId":{"type":["integer","null"],"description":"The number of the website analysis this came from. Leave it out when you write it yourself."},"implementationType":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyImplementationType"},{"type":"null"}],"description":"How it gets done: campaign_implementable (Fusio can run it as a campaign), advisory_only (advice) or setup_task (a one-time setup)."},"phase":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyPhase"},{"type":"null"}],"description":"The step of the customer journey: awareness, acquisition, nurture, conversion or retention."},"integrations":{"type":["array","null"],"items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/StrategyIntegrationKind","description":"The kind: article, social, email, ads, seo, website, landing_page, lead_form, tracking or crm_scoring. Needed in each item."},"platforms":{"type":["array","null"],"items":{"type":"string"},"description":"Platforms: for social linkedin, meta, instagram or x; for ads linkedin, meta or x. Other kinds have none."},"leadTemperature":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadStage"},"description":"Which leads it is for: cold, warm, qualified, client or lost."},"formatHint":{"type":["string","null"],"description":"The format. article: how_to, listicle, comparison, deep_dive or case_study. social: single_post, thread, carousel, reel or story. email: broadcast, sequence, newsletter or nurture. ads: search_ad, display, sponsored_post or retargeting. landing_page: lead_capture, sales_page, comparison or waitlist. lead_form: inline, popup or gated_content. Other kinds have none."},"cadenceHint":{"type":["string","null"],"description":"How often, as daily, weekly, twice_weekly, monthly or a repeat rule like FREQ=WEEKLY;BYDAY=MO."},"enabled":{"type":"boolean","description":"true when this part is on. Needed in each item."}}},"description":"What kinds of work the strategy uses."},"leadTemperature":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadStage"},"description":"Which leads the strategy is for: cold, warm, qualified, client or lost."},"askRatio":{"type":["number","null"],"minimum":0,"maximum":1,"description":"How much of the content asks for something, from 0 to 1. 0.2 means one piece in five."},"sources":{"type":["object","null"],"properties":{"sourceType":{"type":"string","enum":["url_list","brief","topic_ref"],"description":"url_list (web pages), brief (angles you write) or topic_ref (a topic). Needed when you send sources."},"urls":{"type":["array","null"],"items":{"type":"string","format":"uri","maxLength":255},"maxItems":100,"description":"Web addresses, at most 100, each at most 255 characters."},"angles":{"type":["array","null"],"items":{"type":"string","maxLength":5000},"maxItems":15,"description":"Angles to write about, at most 15, each at most 5000 characters."},"topicId":{"type":["integer","null"],"description":"The number of the topic."},"includeKeywords":{"type":["array","null"],"items":{"type":"string","maxLength":255},"description":"Words the content should have, each at most 255 characters."},"excludeKeywords":{"type":["array","null"],"items":{"type":"string","maxLength":255},"description":"Words the content must not have, each at most 255 characters."}},"description":"Where the content gets its ideas."},"suggestedCtas":{"type":["array","null"],"items":{"type":"object","properties":{"label":{"type":"string","maxLength":255,"description":"The text of the call, like Book a demo. At most 255 characters. Needed in each item."},"description":{"type":["string","null"],"maxLength":5000,"description":"More about it. At most 5000 characters."}}},"maxItems":5,"description":"Calls to action, at most 5."},"implementationSteps":{"type":["array","null"],"items":{"type":"object","properties":{"step":{"type":"integer","minimum":1,"description":"The number of the step, 1 or more. Each step has its own number."},"description":{"type":["string","null"],"maxLength":1000,"description":"What to do. At most 1000 characters."}},"required":["step"]},"maxItems":15,"uniqueItems":true,"description":"The steps to do it, at most 15."},"resourcesNeeded":{"type":"object","properties":{"time":{"type":["string","null"],"maxLength":255,"description":"How much time. At most 255 characters."},"budget":{"type":["string","null"],"maxLength":255,"description":"How much money. At most 255 characters."},"skills":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":15,"description":"Skills needed, at most 15, each at most 255 characters."}},"description":"What it takes."},"kpiTargets":{"type":["array","null"],"items":{},"maxItems":10,"description":"Goals as numbers, at most 10: an object where each key is the name of the goal (at most 120 characters) and each value is a number, like {\"leads\": 40}."},"prerequisites":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":15,"description":"What must be ready first, at most 15, each at most 255 characters."},"riskLevel":{"type":["string","null"],"maxLength":64,"description":"How risky it is, in a word, at most 64 characters."},"iceImpact":{"type":["integer","null"],"minimum":1,"maximum":10,"description":"How big the effect is, from 1 to 10."},"iceConfidence":{"type":["integer","null"],"minimum":1,"maximum":10,"description":"How sure you are it works, from 1 to 10."},"iceEase":{"type":["integer","null"],"minimum":1,"maximum":10,"description":"How easy it is, from 1 to 10."},"targetedPersonaIds":{"type":["array","null"],"items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"Numbers of customer profiles it is for, at most 20, each once."},"targetedCompetitorIds":{"type":["array","null"],"items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"Numbers of competitors it is against, at most 20, each once."}},"required":["name","ideaSummary","category","whyItFits","expectedOutcome","stage","budgetLevel","timeline"]},"example":{"name":"Jarní servisní kampaň","ideaSummary":"Připomenout lidem servis kola před sezónou e-mailem a příspěvky.","category":"email","whyItFits":"Na jaře roste zájem o servis a máme seznam zákazníků z loňska.","expectedOutcome":"O 30 % víc objednávek servisu v březnu.","stage":"growth","budgetLevel":"low","timeline":"quick_wins","priorityScore":80,"status":"planned","implementationType":"campaign_implementable","phase":"retention"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantStrategyData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Strategy created successfully","payload":{"id":145,"tenantId":412,"tenantProductId":null,"derivedFromAnalysisId":null,"createdBy":88,"name":"Jarní servisní kampaň","ideaSummary":"Připomenout lidem servis kola před sezónou e-mailem a příspěvky.","category":"email","whyItFits":"Na jaře roste zájem o servis a máme seznam zákazníků z loňska.","expectedOutcome":"O 30 % víc objednávek servisu v březnu.","stage":"growth","budgetLevel":"low","timeline":"quick_wins","status":"planned","priorityScore":80,"sourceIdeaNumber":null,"sourceIdeaSlug":null,"targetedPersonaIds":[],"targetedCompetitorIds":[],"implementationSteps":null,"resourcesNeeded":null,"implementationType":"campaign_implementable","phase":"retention","integrations":null,"leadTemperature":[],"askRatio":null,"sources":null,"suggestedCtas":null,"kpiTargets":null,"prerequisites":[],"riskLevel":null,"iceImpact":null,"iceConfidence":null,"iceEase":null,"effectiveStatus":"planned","linkedCampaignsCount":0,"linkedCampaigns":[],"analyzedAt":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Create a strategy","description":"Writes down a marketing strategy. You need the name, idea, category, why it fits, the expected outcome, stage, budget and timeline.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/strategies/{strategy}":{"get":{"operationId":"strategies.show","tags":["strategies"],"parameters":[{"name":"strategy","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the strategy."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantStrategyData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Strategy fetched successfully","payload":{"id":145,"tenantId":412,"tenantProductId":null,"derivedFromAnalysisId":null,"createdBy":88,"name":"Jarní servisní kampaň","ideaSummary":"Připomenout lidem servis kola před sezónou e-mailem a příspěvky.","category":"email","whyItFits":"Na jaře roste zájem o servis a máme seznam zákazníků z loňska.","expectedOutcome":"O 30 % víc objednávek servisu v březnu.","stage":"growth","budgetLevel":"low","timeline":"quick_wins","status":"planned","priorityScore":80,"sourceIdeaNumber":null,"sourceIdeaSlug":null,"targetedPersonaIds":[],"targetedCompetitorIds":[],"implementationSteps":null,"resourcesNeeded":null,"implementationType":"campaign_implementable","phase":"retention","integrations":null,"leadTemperature":[],"askRatio":null,"sources":null,"suggestedCtas":null,"kpiTargets":null,"prerequisites":[],"riskLevel":null,"iceImpact":null,"iceConfidence":null,"iceEase":null,"effectiveStatus":"planned","linkedCampaignsCount":0,"linkedCampaigns":[],"analyzedAt":null,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"Show a strategy","description":"Returns one strategy with its steps, goals and parts.\n\nNeeds one of these permissions: intelligence.read."},"put":{"operationId":"strategies.update","tags":["strategies"],"parameters":[{"name":"strategy","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the strategy."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the strategy, from 1 to 255 characters."},"tenantProductId":{"type":["integer","null"],"description":"The number of your product this belongs to. Send null for your main product. Leave it out to keep it."},"ideaSummary":{"type":"string","maxLength":5000,"description":"What the idea is. At most 5000 characters."},"category":{"$ref":"#/components/schemas/TenantStrategyCategory","description":"The area: content, social, email, paid_ads, web_seo, conversion or growth."},"whyItFits":{"type":"string","maxLength":5000,"description":"Why it fits your business. At most 5000 characters."},"expectedOutcome":{"type":"string","maxLength":5000,"description":"What you expect to get. At most 5000 characters."},"stage":{"$ref":"#/components/schemas/TenantStrategyStage","description":"For what stage of your business: pre_launch, early, growth or scale."},"budgetLevel":{"$ref":"#/components/schemas/TenantStrategyBudgetLevel","description":"How much money it needs: free, low, medium or high."},"timeline":{"$ref":"#/components/schemas/TenantStrategyTimeline","description":"When it brings results: quick_wins, medium_term or long_term."},"priorityScore":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"How important it is, from 0 to 100. Leave it out to keep it."},"status":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyStatus"},{"type":"null"}],"description":"Where you are with it: proposed, planned, in_progress, done or archived. Leave it out to keep it."},"sourceIdeaNumber":{"type":["integer","null"],"minimum":0,"description":"The number of the idea in the list it came from, 0 or more. Leave it out to keep it."},"sourceIdeaSlug":{"type":["string","null"],"maxLength":255,"description":"The short name of the idea it came from, at most 255 characters. Leave it out to keep it."},"derivedFromAnalysisId":{"type":["integer","null"],"description":"The number of the website analysis this came from. Leave it out to keep it."},"implementationType":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyImplementationType"},{"type":"null"}],"description":"How it gets done: campaign_implementable (Fusio can run it as a campaign), advisory_only (advice) or setup_task (a one-time setup). Leave it out to keep it."},"phase":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyPhase"},{"type":"null"}],"description":"The step of the customer journey: awareness, acquisition, nurture, conversion or retention. Leave it out to keep it."},"integrations":{"type":["array","null"],"items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/StrategyIntegrationKind","description":"The kind: article, social, email, ads, seo, website, landing_page, lead_form, tracking or crm_scoring. Needed in each item."},"platforms":{"type":["array","null"],"items":{"type":"string"},"description":"Platforms: for social linkedin, meta, instagram or x; for ads linkedin, meta or x. Other kinds have none."},"leadTemperature":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadStage"},"description":"Which leads it is for: cold, warm, qualified, client or lost."},"formatHint":{"type":["string","null"],"description":"The format. article: how_to, listicle, comparison, deep_dive or case_study. social: single_post, thread, carousel, reel or story. email: broadcast, sequence, newsletter or nurture. ads: search_ad, display, sponsored_post or retargeting. landing_page: lead_capture, sales_page, comparison or waitlist. lead_form: inline, popup or gated_content. Other kinds have none."},"cadenceHint":{"type":["string","null"],"description":"How often, as daily, weekly, twice_weekly, monthly or a repeat rule like FREQ=WEEKLY;BYDAY=MO."},"enabled":{"type":"boolean","description":"true when this part is on. Needed in each item."}}},"description":"What kinds of work the strategy uses. Leave it out to keep it."},"leadTemperature":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadStage"},"description":"Which leads the strategy is for: cold, warm, qualified, client or lost. Leave it out to keep it."},"askRatio":{"type":["number","null"],"minimum":0,"maximum":1,"description":"How much of the content asks for something, from 0 to 1. 0.2 means one piece in five. Leave it out to keep it."},"sources":{"type":["object","null"],"properties":{"sourceType":{"type":"string","enum":["url_list","brief","topic_ref"],"description":"url_list (web pages), brief (angles you write) or topic_ref (a topic). Needed when you send sources."},"urls":{"type":["array","null"],"items":{"type":"string","format":"uri","maxLength":255},"maxItems":100,"description":"Web addresses, at most 100, each at most 255 characters."},"angles":{"type":["array","null"],"items":{"type":"string","maxLength":5000},"maxItems":15,"description":"Angles to write about, at most 15, each at most 5000 characters."},"topicId":{"type":["integer","null"],"description":"The number of the topic."},"includeKeywords":{"type":["array","null"],"items":{"type":"string","maxLength":255},"description":"Words the content should have, each at most 255 characters."},"excludeKeywords":{"type":["array","null"],"items":{"type":"string","maxLength":255},"description":"Words the content must not have, each at most 255 characters."}},"description":"Where the content gets its ideas. Leave it out to keep it."},"suggestedCtas":{"type":["array","null"],"items":{"type":"object","properties":{"label":{"type":"string","maxLength":255,"description":"The text of the call, like Book a demo. At most 255 characters. Needed in each item."},"description":{"type":["string","null"],"maxLength":5000,"description":"More about it. At most 5000 characters."}}},"maxItems":5,"description":"Calls to action, at most 5. Leave it out to keep it."},"implementationSteps":{"type":["array","null"],"items":{"type":"object","properties":{"step":{"type":"integer","minimum":1,"description":"The number of the step, 1 or more. Each step has its own number."},"description":{"type":["string","null"],"maxLength":1000,"description":"What to do. At most 1000 characters."}},"required":["step"]},"maxItems":15,"uniqueItems":true,"description":"The steps to do it, at most 15. Leave it out to keep it."},"resourcesNeeded":{"type":"object","properties":{"time":{"type":["string","null"],"maxLength":255,"description":"How much time. At most 255 characters."},"budget":{"type":["string","null"],"maxLength":255,"description":"How much money. At most 255 characters."},"skills":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":15,"description":"Skills needed, at most 15, each at most 255 characters."}},"description":"What it takes. Leave it out to keep it."},"kpiTargets":{"type":["array","null"],"items":{},"maxItems":10,"description":"Goals as numbers, at most 10: an object where each key is the name of the goal (at most 120 characters) and each value is a number, like {\"leads\": 40}. Leave it out to keep it."},"prerequisites":{"type":["array","null"],"items":{"type":"string","maxLength":255},"maxItems":15,"description":"What must be ready first, at most 15, each at most 255 characters. Leave it out to keep it."},"riskLevel":{"type":["string","null"],"maxLength":64,"description":"How risky it is, in a word, at most 64 characters. Leave it out to keep it."},"iceImpact":{"type":["integer","null"],"minimum":1,"maximum":10,"description":"How big the effect is, from 1 to 10. Leave it out to keep it."},"iceConfidence":{"type":["integer","null"],"minimum":1,"maximum":10,"description":"How sure you are it works, from 1 to 10. Leave it out to keep it."},"iceEase":{"type":["integer","null"],"minimum":1,"maximum":10,"description":"How easy it is, from 1 to 10. Leave it out to keep it."},"targetedPersonaIds":{"type":["array","null"],"items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"Numbers of customer profiles it is for, at most 20, each once. Leave it out to keep it."},"targetedCompetitorIds":{"type":["array","null"],"items":{"type":"integer"},"maxItems":20,"uniqueItems":true,"description":"Numbers of competitors it is against, at most 20, each once. Leave it out to keep it."}},"required":["name","ideaSummary","category","whyItFits","expectedOutcome","stage","budgetLevel","timeline"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantStrategyData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Change a strategy","description":"Changes a strategy. Always send the name, idea, category, why it fits, the expected outcome, stage, budget and timeline. Other fields you leave out stay as they are. A list you send replaces the whole old list.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."},"delete":{"operationId":"strategies.destroy","tags":["strategies"],"parameters":[{"name":"strategy","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the strategy."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Remove a strategy","description":"Removes a strategy.\n\nNeeds one of these permissions: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v2/sync/leads":{"post":{"operationId":"sync.v2.leads","tags":["sync"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"A unique key for this batch, at most 255 characters. The same key with the same body gives back the same import; the same key with a different body gives 409."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leads":{"type":"array","items":{},"minItems":1,"description":"The leads, at most 2000 in one batch. Each item is an object: name (required), id or externalId, website, street, city, zip, countryIso, registrationNumber, vatNumber, personType, stage, ownerId, assigneeIds, contacts, customFields, tags and segments."},"initial":{"type":"boolean","description":"true for the first big import. Then no automatic emails go out, so emails.send is not needed."}},"required":["leads"]},"example":{"leads":[{"externalId":"crm-1001","name":"Pekárna U Mlýna s.r.o.","website":"https://www.example.cz","city":"Brno","zip":"60200","countryIso":"CZ","registrationNumber":"87654321","personType":"legal","stage":"warm","contacts":[{"externalId":"crm-c-5001","type":"personal","firstName":"Petr","lastName":"Svoboda","email":"petr.svoboda@example.cz","isPrimary":true}],"tags":["pekarny"]}]}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/SyncAcceptedOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Request processed successfully","payload":{"importId":9031,"status":"queued","total":1,"links":{"self":"/api/v2/sync/imports/9031","results":"/api/v2/sync/imports/9031/results"}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]}],"x-fusio-conditional-scopes":["emails.send"],"x-fusio-opt-in-scopes":["emails.send"],"summary":"Send a batch of leads","description":"Puts the leads in a queue and answers 202 at once. Fusio checks each item on its own later, so one bad item does not stop the rest. The `Location` header and `links.self` point to the import; `Idempotent-Replayed: true` says you sent this batch before. Send a unique key for each batch in the `Idempotency-Key` header, not in the body; without the header you get 422.\n\nFusio finds an existing lead by `id`, or by `externalId` or the unique custom field, as set in the sync settings. `ownerId` and `assigneeIds` are the member numbers from your CRM. Each contact needs `type` and an `id` or `externalId`.\n\n> [!WARNING]\n> A batch that is not `initial` can start automatic email sequences. A personal key then needs `emails.send`.\n\nErrors: 413 `batch_too_large` (more than 2000 items or 10 MB) and 409 `idempotency_key_reused`. These two answers have no wrapper: they hold `message`, `code` and the limits or `importId`. This address allows 120 requests a minute.\n\nNeeds one of these permissions: leads.write. Some values also need: emails.send. You must tick these on purpose: emails.send."}},"/v2/sync/deals":{"post":{"operationId":"sync.v2.deals","tags":["sync"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"A unique key for this batch, at most 255 characters. The same key with the same body gives back the same import; the same key with a different body gives 409."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deals":{"type":"array","items":{},"minItems":1,"description":"The deals, at most 2000 in one batch. Each item is an object: lead (with id or externalId), name, stage and expectedValue are required; also id or externalId, currency, winProbability, expectedCloseDate, closedAt, lostReason, lostReasonNote and ownerId."},"initial":{"type":"boolean","description":"true for the first big import. Then no automatic emails go out, so emails.send is not needed."}},"required":["deals"]},"example":{"deals":[{"externalId":"crm-d-301","lead":{"externalId":"crm-1001"},"name":"Servis firemních kol","stage":"proposal","expectedValue":48000,"currency":"CZK","winProbability":60,"expectedCloseDate":"2026-12-15"}]}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/SyncAcceptedOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Request processed successfully","payload":{"importId":9032,"status":"queued","total":1,"links":{"self":"/api/v2/sync/imports/9032","results":"/api/v2/sync/imports/9032/results"}}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["deals.write"]}],"x-fusio-conditional-scopes":["emails.send","deals.execute"],"x-fusio-opt-in-scopes":["emails.send","deals.execute"],"summary":"Send a batch of deals","description":"Puts the deals in a queue and answers 202 at once. Fusio checks each item on its own later. The `Location` header and `links.self` point to the import; `Idempotent-Replayed: true` says you sent this batch before. Send a unique key for each batch in the `Idempotency-Key` header, not in the body; without the header you get 422.\n\nA deal with the stage `won` needs `deals.execute` on a personal key.\n\n> [!WARNING]\n> A batch that is not `initial` can start automatic email sequences. A personal key then needs `emails.send`.\n\nErrors: 413 `batch_too_large` (more than 2000 items or 10 MB) and 409 `idempotency_key_reused`. These two answers have no wrapper: they hold `message`, `code` and the limits or `importId`. This address allows 120 requests a minute.\n\nNeeds one of these permissions: deals.write. Some values also need: emails.send, deals.execute. You must tick these on purpose: emails.send, deals.execute."}},"/v2/sync/imports/{syncRun}":{"get":{"operationId":"sync.v2.imports.show","tags":["sync"],"parameters":[{"name":"syncRun","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the import. You get it back when you send a batch."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/SyncRunStatusOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Request processed successfully","payload":{"importId":9031,"object":"leads","status":"completed","total":1,"processed":1,"progress":100,"created":1,"updated":0,"unchanged":0,"skipped":0,"error":null,"createdAt":"2026-11-03T08:30:00Z","finishedAt":"2026-11-03T08:30:04Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]},{"fusioToken":["deals.write"]}],"summary":"Show how far an import got","description":"Returns the state and the counts of one import. While it is not finished, the answer has a `Retry-After` header with the seconds to wait before you ask again. This address allows 120 requests a minute.\n\nNeeds one of these permissions: leads.write, deals.write."}},"/v2/sync/imports/{syncRun}/results":{"get":{"operationId":"sync.v2.imports.results","tags":["sync"],"parameters":[{"name":"syncRun","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the import. You get it back when you send a batch."},{"name":"result","in":"query","schema":{"anyOf":[{"$ref":"#/components/schemas/SyncItemResult"},{"type":"null"}]},"description":"Show only items with this result, like skipped."},{"name":"cursor","in":"query","schema":{"type":["string","null"]},"description":"Where the next page starts. Take it from nextCursor."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/SyncItemResultPageOutputData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["leads.write"]},{"fusioToken":["deals.write"]}],"summary":"List the results of an import","description":"Returns the result of each item, page by page. `warnings` hold things Fusio skipped but still saved the item, like an unknown member. `errors` say why an item was skipped. This address allows 120 requests a minute.\n\nNeeds one of these permissions: leads.write, deals.write."}},"/v1/tenant-analysis":{"get":{"operationId":"tenant-analysis.show","tags":["tenant-analysis"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"anyOf":[{"$ref":"#/components/schemas/UpdateTenantAnalysisData"},{"type":"null"}]}},"required":["status","message","payload"]},"example":{"status":"success","message":"Tenant analysis fetched successfully","payload":{"id":52,"tenantId":412,"url":"https://www.example.cz","batchId":null,"analyzedAt":"2026-11-03T08:30:00Z","websiteLanguageId":1,"industryCategoryId":14,"aiProviderModelId":3,"pagesCrawled":24,"createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-03T08:30:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"Show the website analysis","description":"Returns your newest website analysis. The payload is null when you never ran one.\n\nNeeds one of these permissions: intelligence.read."}},"/v1/tenant-analysis/analyze":{"post":{"operationId":"tenant-analysis.analyze","tags":["tenant-analysis"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"websiteUrl":{"type":"string","format":"uri","maxLength":2048,"description":"The web address of your website, at most 2048 characters."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}},"required":["websiteUrl"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateTenantAnalysisData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","intelligence.write"]}],"x-fusio-opt-in-scopes":["intelligence.write"],"summary":"Analyse your website","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nStarts reading your website with AI in the background. The answer is the new analysis; `analyzedAt` stays null until it is done, so ask `tenant-analysis.show` later.\n\nWhen it is done, Fusio fills your product, brand voice, competitors, customers and strategy ideas. When an analysis already runs, you get 422.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: intelligence.write. You must tick these on purpose: intelligence.write."}},"/v1/tenant-analysis/reanalyze-seo":{"post":{"operationId":"tenant-analysis.reanalyze-seo","tags":["tenant-analysis"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it."}}},"example":{"maxCredits":120}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/GoogleAdsSearchSeoRefreshOutputData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Website analysis started successfully.","payload":{"operationId":"3f8e2b1a-7c4d-4e9f-8a6b-5d2c1e0f9a7b","type":"seo_google_ads_search_refresh","status":"pending"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["ai.generate","seo.write"]}],"x-fusio-opt-in-scopes":["seo.write"],"summary":"Check your SEO again","description":"> [!WARNING]\n> This spends AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nStarts a new SEO check of your website in the background and answers 202 with the job. Follow it with `google-ads-search-operations.show`.\n\nYour domain must be verified first; otherwise you get 422.\n\nThis address allows 30 requests a minute, counted together with the other AI generation addresses.\n\nNeeds one of these permissions: ai.generate. Also needs: seo.write. You must tick these on purpose: seo.write."}},"/v1/tenant-intelligence":{"get":{"operationId":"tenant-intelligence.show","tags":["tenant-intelligence"],"parameters":[{"name":"include[]","in":"query","required":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantIntelligenceSummaryArea"},"uniqueItems":true},"description":"Which parts to return: brand_voice, product, competitors, customers, strategies, seo, ads_performance and facts. Leave it out to get all of them."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/TenantIntelligenceSummaryData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Tenant intelligence summary fetched successfully","payload":{"brandVoice":{"id":23,"markdown":"# Přátelský odborník\n\nMluvíme jako zkušený mechanik, který rád poradí."},"product":{"id":5,"markdown":"# Servis a prodej kol\n\nServis kol v Brně, hotový do 48 hodin."},"competitors":{"items":[{"id":77,"name":"Kola Horák","summary":"Velký výběr dětských kol a půjčovna."}],"total":1},"customers":{"items":[{"id":58,"name":"Víkendový cyklista","summary":"Lidé 30–50 let z Brna, jezdí s rodinou na výlety."}],"total":1},"strategies":null,"seo":null,"adsPerformance":null,"facts":{"preferredAiLanguage":{"id":1,"name":"Čeština","slug":"cs"},"websiteLanguage":{"id":1,"name":"Čeština","slug":"cs"},"targetMarkets":{"isGlobal":false,"countryCodes":["CZ","SK"]},"verifiedDomain":"example.cz","imagePresets":[{"id":19,"name":"Fotky z dílny","isPrimary":true}],"socialPlatforms":[{"slug":"facebook","status":"connected"}],"adPlatforms":[{"slug":"google","status":"connected"}]},"unavailable":[{"area":"strategies","reason":"not_requested"},{"area":"seo","reason":"empty"},{"area":"ads_performance","reason":"missing_scope"}]}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["intelligence.read"]}],"summary":"Show all company knowledge","description":"Returns what Fusio knows about your company, written as text that an AI can read.\n\nA part you cannot see is null and is listed in `unavailable` with the reason. The seo part needs `seo.read` and the ads part needs `ads.read`; without them you get `missing_scope`, not an error.\n\nNeeds one of these permissions: intelligence.read."}},"/v1/topics/grid":{"get":{"operationId":"topics.grid","tags":["topics"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[type]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The kind. One or more values, split by commas."},{"name":"filter[assignee]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of the team member it is given to."},{"name":"sort","in":"query","schema":{"type":"string","enum":["name","type","state","lastCrawledAt","createdAt","updatedAt","-name","-type","-state","-lastCrawledAt","-createdAt","-updatedAt"],"default":"-createdAt"},"description":"The order of the rows. Put a minus sign in front for the opposite order."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexTopicData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.read"]}],"summary":"List topics in a table","description":"Returns one page of topics with the filters and the sort you ask for.\n\nNeeds one of these permissions: topics.read."}},"/v1/topics/options":{"get":{"operationId":"topics.options","tags":["topics"],"parameters":[{"name":"search","in":"query","schema":{"type":["string","null"],"minLength":2,"maxLength":100},"description":"Text to look for in the name. At least 2 and at most 100 characters."},{"name":"ids[]","in":"query","schema":{"type":"array","items":{"type":"integer","minimum":1},"maxItems":100},"description":"Return just these numbers, at most 100. Use it to show the names of items you already picked."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[type]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The kind. One or more values, split by commas."},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1,"maximum":10000},"description":"The page number. The first page is 1."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionTopicData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.read"]}],"summary":"List topics for a picker","description":"Returns short items with the number and the name of each topic.\n\nNeeds one of these permissions: topics.read."}},"/v1/topics/board/summary":{"get":{"operationId":"topics.board.summary","tags":["topics"],"parameters":[{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[type]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The kind. One or more values, split by commas."},{"name":"filter[assignee]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of the team member it is given to."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/BoardSummaryData"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.read"]}],"summary":"Count topics in each state","description":"Returns how many topics there are in each column of the board.\n\nNeeds one of these permissions: topics.read."}},"/v1/topics/board/{status}":{"get":{"operationId":"topics.board.column","tags":["topics"],"parameters":[{"name":"status","in":"path","required":true,"schema":{"type":"string","enum":["drafted","approved","rejected","active","paused"]},"description":"The column: drafted, approved, rejected, active or paused."},{"name":"cursor","in":"query","schema":{"type":["string","null"],"maxLength":512},"description":"Where the next page starts. Take it from nextCursor of the page before."},{"name":"filter[name]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"Part of the name."},{"name":"filter[state]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The state. One or more values, split by commas."},{"name":"filter[type]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The kind. One or more values, split by commas."},{"name":"filter[assignee]","in":"query","style":"deepObject","schema":{"type":"string"},"explode":true,"description":"The ID of the team member it is given to."},{"name":"perPage","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"How many rows one page holds."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GridIndexTopicData"}},"currentPage":{"type":"integer"},"perPage":{"type":"integer"},"lastPage":{"type":["integer","null"]},"total":{"type":["integer","null"]},"from":{"type":["integer","null"]},"to":{"type":["integer","null"]},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]},"hasMorePages":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","currentPage","perPage","lastPage","total","from","to","nextPageUrl","previousPageUrl","hasMorePages","nextCursor"]}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.read"]}],"summary":"List the topics of one board column","description":"Returns the topics in one state, page by page. Send `nextCursor` back as `cursor` for the next page.\n\nNeeds one of these permissions: topics.read."}},"/v1/topics/{topic}/state":{"patch":{"operationId":"topics.set-state","tags":["topics"],"parameters":[{"name":"topic","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the topic."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/TopicState","description":"The new state."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it when the change starts a web search."}},"required":["state"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.write"]}],"summary":"Move a topic to another state","description":"> [!WARNING]\n> This can spend AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nAllowed steps: from drafted to approved or rejected, from approved to rejected or active, from rejected to approved, from active to paused and from paused to active. Other steps are refused with 422 and a message. Moving to active starts a web search: every time for news, the first time for evergreen. Only that search spends credits. A key without `maxCredits` gets 422 on `maxCredits`, and a key that reached its monthly credit limit gets 422 `monthly_credit_limit_reached`.\n\nNeeds one of these permissions: topics.write."}},"/v1/topics/bulk-state":{"patch":{"operationId":"topics.bulk-set-state","tags":["topics"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"topicIds":{"type":"array","items":{"type":"integer"},"minItems":1,"maxItems":200,"description":"The numbers of the topics, at most 200."},"state":{"$ref":"#/components/schemas/TopicState","description":"The new state for all of them."},"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it when the change starts a web search."}},"required":["topicIds","state"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.write"]}],"summary":"Move many topics to one state","description":"> [!WARNING]\n> This can spend AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nMoves each topic like the single state change does. It is all or nothing: when one topic cannot move, no topic moves and you get 422 with its message. When the change starts web searches, `maxCredits` must cover all of them together. A key without `maxCredits` gets 422 on `maxCredits`, and a key that reached its monthly credit limit gets 422 `monthly_credit_limit_reached`.\n\nWhen you may change only the topics assigned to you, Fusio skips the others.\n\nNeeds one of these permissions: topics.write."}},"/v1/topics/{topic}/re-crawl":{"post":{"operationId":"topics.re-crawl","tags":["topics"],"parameters":[{"name":"topic","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the topic."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxCredits":{"type":["integer","null"],"minimum":1,"maximum":1000000,"description":"The most credits this request may cost, from 1 to 1000000. A key must send it when the search starts."}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.write"]}],"summary":"Search the web for a topic again","description":"> [!WARNING]\n> This can spend AI credits of your company. A key must send `maxCredits`: the most it may cost. When the work would cost more, nothing happens and you get 422 `max_credits_below_estimate` with `estimatedCredits`, the price it would have.\n\nStarts a new web search for the topic now. Nothing happens when the topic is not active or a search is already running. The search spends credits every time for news and the first time for evergreen. A key without `maxCredits` gets 422 on `maxCredits`, and a key that reached its monthly credit limit gets 422 `monthly_credit_limit_reached`.\n\nNeeds one of these permissions: topics.write."}},"/v1/topics":{"post":{"operationId":"topics.store","tags":["topics"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"batchId":{"type":["integer","null"],"description":"Joins topics that were made together. You can leave it out."},"userId":{"type":"integer","description":"The person who owns the topic."},"name":{"type":"string","description":"The name of the topic."},"query":{"type":["string","null"],"description":"The words Fusio searches the web for."},"frequency":{"anyOf":[{"$ref":"#/components/schemas/TopicFrequency"},{"type":"null"}],"description":"How often Fusio looks for news: 24h, 7d, 14d, 30d or none."},"type":{"anyOf":[{"$ref":"#/components/schemas/TopicType"},{"type":"null"}],"description":"news looks for new pages again and again. evergreen looks once."},"timeRange":{"anyOf":[{"$ref":"#/components/schemas/TopicTimeRange"},{"type":"null"}],"description":"How old the found pages may be: 1d, 3d, 7d, 14d or 30d."},"targetLanguageId":{"type":["integer","null"],"description":"The number of the language of the pages to find."},"targetCountryId":{"type":["integer","null"],"description":"The number of the country of the pages to find."},"excludeWebsites":{"type":["array","null"],"items":{"type":"string","format":"uri"},"description":"Web addresses Fusio must skip."},"includeWebsites":{"type":["array","null"],"items":{"type":"string","format":"uri"},"description":"When you fill it, Fusio searches only these websites."},"state":{"$ref":"#/components/schemas/TopicState","description":"drafted, approved, rejected, active or paused."},"createdAt":{"type":["string","null"],"description":"When the topic was made. You can leave it out."},"updatedAt":{"type":["string","null"],"description":"When the topic last changed. You can leave it out."}},"required":["userId","name","state"]},"example":{"userId":88,"name":"Novinky v elektrokolech","query":"elektrokola novinky 2026","type":"news","frequency":"7d","timeRange":"7d","targetLanguageId":2,"targetCountryId":58,"state":"drafted"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Topic created successfully","payload":null}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.write"]}],"summary":"Create a topic","description":"Creates a topic. You become one of the people assigned to it. The answer has no data; find the new topic in the list.\n\nNeeds one of these permissions: topics.write."}},"/v1/topics/{topic}":{"get":{"operationId":"topics.show","tags":["topics"],"parameters":[{"name":"topic","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the topic."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"$ref":"#/components/schemas/UpdateTopicData"}},"required":["status","message","payload"]},"example":{"status":"success","message":"Topic fetched successfully","payload":{"id":214,"tenantId":412,"userId":88,"batchId":5490,"name":"Novinky v elektrokolech","query":"elektrokola novinky 2026","type":"news","frequency":"7d","timeRange":"7d","targetLanguageId":2,"targetCountryId":58,"excludeWebsites":[],"includeWebsites":[],"state":"active","usedBySocialPostId":null,"usedByArticleId":null,"usedByEmailId":null,"lastCrawledAt":"2026-11-12T13:05:00Z","createdAt":"2026-11-03T08:30:00Z","updatedAt":"2026-11-12T13:05:00Z"}}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.read"]}],"summary":"Show one topic","description":"Returns one topic with its search settings.\n\nNeeds one of these permissions: topics.read."},"put":{"operationId":"topics.update","tags":["topics"],"parameters":[{"name":"topic","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the topic."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"batchId":{"type":["integer","null"],"description":"Joins topics that were made together. You can leave it out."},"userId":{"type":"integer","description":"The person who owns the topic."},"name":{"type":"string","description":"The name of the topic."},"query":{"type":["string","null"],"description":"The words Fusio searches the web for."},"frequency":{"anyOf":[{"$ref":"#/components/schemas/TopicFrequency"},{"type":"null"}],"description":"How often Fusio looks for news: 24h, 7d, 14d, 30d or none."},"type":{"anyOf":[{"$ref":"#/components/schemas/TopicType"},{"type":"null"}],"description":"news looks for new pages again and again. evergreen looks once."},"timeRange":{"anyOf":[{"$ref":"#/components/schemas/TopicTimeRange"},{"type":"null"}],"description":"How old the found pages may be: 1d, 3d, 7d, 14d or 30d."},"targetLanguageId":{"type":["integer","null"],"description":"The number of the language of the pages to find."},"targetCountryId":{"type":["integer","null"],"description":"The number of the country of the pages to find."},"excludeWebsites":{"type":["array","null"],"items":{"type":"string","format":"uri"},"description":"Web addresses Fusio must skip."},"includeWebsites":{"type":["array","null"],"items":{"type":"string","format":"uri"},"description":"When you fill it, Fusio searches only these websites."},"state":{"$ref":"#/components/schemas/TopicState","description":"drafted, approved, rejected, active or paused."},"createdAt":{"type":["string","null"],"description":"When the topic was made. You can leave it out."},"updatedAt":{"type":["string","null"],"description":"When the topic last changed. You can leave it out."},"id":{"type":"integer","enum":[""],"description":"The number of the topic. Send the same number as in the address; another number gives 422."}},"required":["userId","name","state","id"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.write"]}],"summary":"Change a topic","description":"Replaces the topic. Send every field, not just the changed ones. The state is saved as you send it and no search starts.\n\nNeeds one of these permissions: topics.write."},"delete":{"operationId":"topics.destroy","tags":["topics"],"parameters":[{"name":"topic","in":"path","required":true,"schema":{"type":"integer"},"description":"The number of the topic."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"success"},"message":{"type":"string"},"payload":{"type":"null"}},"required":["status","message","payload"]}}}},"401":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InsufficientScopeResponse"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"fusioToken":["topics.write"]}],"summary":"Delete a topic","description":"Moves the topic to the trash. Fusio stops searching for it.\n\nNeeds one of these permissions: topics.write."}}},"components":{"securitySchemes":{"fusioToken":{"type":"http","description":"Your key goes in the Authorization header, after the word Bearer.","scheme":"bearer"}},"schemas":{"AbandonedFieldStatus":{"type":"string","enum":["filled","stopped","skipped","notReached"],"title":"AbandonedFieldStatus"},"AdAccountBillingStatus":{"type":"string","enum":["required","pending","approved_held","approved","cancelled"],"title":"AdAccountBillingStatus"},"AdAccountInvitationStatus":{"type":"string","enum":["required","pending","declined","expired","accepted"],"title":"AdAccountInvitationStatus"},"AdAccountPaymentStatus":{"type":"string","enum":["valid","missing","declined"],"title":"AdAccountPaymentStatus"},"AdAccountStatus":{"type":"string","enum":["active","disabled","unsettled","pending_review","closed"],"title":"AdAccountStatus"},"AdAcquisitionData":{"type":"object","properties":{"spend":{"type":"array","items":{"$ref":"#/components/schemas/ConversionValueTotalData"}},"leads":{"type":"integer"},"customers":{"type":"integer"},"lifetimeCustomers":{"type":"integer"},"lifetimeRevenue":{"$ref":"#/components/schemas/CustomerRevenueData"}},"required":["spend","leads","customers","lifetimeCustomers","lifetimeRevenue"],"title":"AdAcquisitionData"},"AdAudienceEstimateOutputData":{"type":"object","properties":{"isAvailable":{"type":"boolean","description":"false when the network could not tell, like when the ad has no ad account."},"lowerBound":{"type":["integer","null"],"description":"The fewest people the ad may reach, or null."},"upperBound":{"type":["integer","null"],"description":"The most people the ad may reach, or null."}},"required":["isAvailable","lowerBound","upperBound"],"title":"AdAudienceEstimateOutputData"},"AdBriefLandingPagePickData":{"type":"object","properties":{"url":{"type":"string","description":"The address of the page."},"title":{"type":"string","description":"The title of the page."},"fitScore":{"type":"integer","description":"How well the page fits, from 0 to 100."},"reason":{"type":"string","description":"Why AI picked it."}},"required":["url","title","fitScore","reason"],"title":"AdBriefLandingPagePickData"},"AdBudgetType":{"type":"string","enum":["daily","lifetime"],"title":"AdBudgetType"},"AdBulkAction":{"type":"string","enum":["move","duplicate","delete"],"title":"AdBulkAction"},"AdBulkItemStatus":{"type":"string","enum":["succeeded","failed"],"title":"AdBulkItemStatus"},"AdBulkResultData":{"type":"object","properties":{"adId":{"type":"integer","description":"The number of the ad."},"status":{"$ref":"#/components/schemas/AdBulkItemStatus","description":"succeeded or failed."},"error":{"type":["string","null"],"description":"Why it failed, as a code like invalid_state_transition or network_sync_failed, or null."}},"required":["adId","status","error"],"title":"AdBulkResultData"},"AdCampaignFunnelData":{"type":"object","properties":{"visits":{"type":"integer"},"browsing":{"type":"integer"},"formViews":{"type":"integer"},"formStarts":{"type":"integer"},"formSubmits":{"type":"integer"},"leads":{"type":["integer","null"]},"reviewed":{"type":["integer","null"]},"qualified":{"type":["integer","null"]},"contacted":{"type":["integer","null"]},"replied":{"type":["integer","null"]},"deals":{"type":["integer","null"]},"offers":{"type":["integer","null"]},"customers":{"type":["integer","null"]},"segments":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaignFunnelSegmentData"}},"abandonedFields":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaignFunnelFieldData"}},"disqualificationReasons":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaignFunnelDisqualificationReasonData"}},"lostReasons":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaignFunnelLostReasonData"}},"salespeople":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaignFunnelSalespersonData"}}},"required":["visits","browsing","formViews","formStarts","formSubmits","leads","reviewed","qualified","contacted","replied","deals","offers","customers","segments","abandonedFields","disqualificationReasons","lostReasons","salespeople"],"title":"AdCampaignFunnelData"},"AdCampaignFunnelDisqualificationReasonData":{"type":"object","properties":{"reason":{"anyOf":[{"$ref":"#/components/schemas/LeadLostReason"},{"type":"null"}]},"isOpen":{"type":"boolean"},"count":{"type":"integer"}},"required":["reason","isOpen","count"],"title":"AdCampaignFunnelDisqualificationReasonData"},"AdCampaignFunnelFieldData":{"type":"object","properties":{"label":{"type":["string","null"]},"count":{"type":"integer"}},"required":["label","count"],"title":"AdCampaignFunnelFieldData"},"AdCampaignFunnelLostReasonData":{"type":"object","properties":{"reason":{"anyOf":[{"$ref":"#/components/schemas/DealLostReason"},{"type":"null"}]},"count":{"type":"integer"}},"required":["reason","count"],"title":"AdCampaignFunnelLostReasonData"},"AdCampaignFunnelSalespersonData":{"type":"object","properties":{"userId":{"type":"integer"},"name":{"type":"string"},"isRemoved":{"type":"boolean"},"qualified":{"type":"integer"},"contacted":{"type":"integer"},"replied":{"type":"integer"},"customers":{"type":"integer"},"firstContactMinutes":{"type":["integer","null"]}},"required":["userId","name","isRemoved","qualified","contacted","replied","customers","firstContactMinutes"],"title":"AdCampaignFunnelSalespersonData"},"AdCampaignFunnelSegmentData":{"type":"object","properties":{"dimension":{"$ref":"#/components/schemas/AdCampaignFunnelSegmentDimension"},"key":{"type":"string"},"label":{"type":"string"},"isRemoved":{"type":"boolean"},"visits":{"type":"integer"},"browsing":{"type":"integer"},"formViews":{"type":"integer"},"formStarts":{"type":"integer"},"formSubmits":{"type":"integer"},"leads":{"type":["integer","null"]},"reviewed":{"type":["integer","null"]},"qualified":{"type":["integer","null"]},"contacted":{"type":["integer","null"]},"replied":{"type":["integer","null"]},"deals":{"type":["integer","null"]},"offers":{"type":["integer","null"]},"customers":{"type":["integer","null"]}},"required":["dimension","key","label","isRemoved","visits","browsing","formViews","formStarts","formSubmits","leads","reviewed","qualified","contacted","replied","deals","offers","customers"],"title":"AdCampaignFunnelSegmentData"},"AdCampaignFunnelSegmentDimension":{"type":"string","enum":["device","campaign","keyword","ad","landingPage","salesperson"],"title":"AdCampaignFunnelSegmentDimension"},"AdCampaignGenerationOutputData":{"type":"object","properties":{"campaignId":{"type":"integer","description":"The number of the campaign AI builds. It is a draft that AI fills in the background."},"operationId":{"type":"string","description":"The code of the job, a long text like 9d1c6c7e-4f0b-4a51-9a3e-2c1f0b7d5e21. Send it to the job address of the same ad platform, `google-ads-search-operations.show` or `meta-ads-operations.show`, to see how the job goes."}},"required":["campaignId","operationId"],"title":"AdCampaignGenerationOutputData"},"AdCampaignOverviewCampaignOptionData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the campaign. Send it as filter[campaignId]."},"name":{"type":"string","description":"The name of the campaign."}},"required":["id","name"],"title":"AdCampaignOverviewCampaignOptionData"},"AdCampaignOverviewFusioData":{"type":"object","properties":{"sessions":{"type":"integer","description":"How many visits came from the ads."},"visitors":{"type":"integer","description":"How many different people visited."},"conversions":{"type":"integer","description":"How many goals the visitors reached, like a sent form."}},"required":["sessions","visitors","conversions"],"title":"AdCampaignOverviewFusioData"},"AdCampaignOverviewSpendData":{"type":"object","properties":{"currencyCode":{"type":"string"},"value":{"type":"number"},"previousValue":{"type":["number","null"]},"series":{"type":"array","items":{}},"previousSeries":{"type":"array","items":{}}},"required":["currencyCode","value","previousValue","series","previousSeries"],"title":"AdCampaignOverviewSpendData"},"AdCampaignPlatform":{"type":"string","enum":["google","facebook","linkedin","x","tiktok","instagram","youtube","bing"],"title":"AdCampaignPlatform"},"AdClickCampaignData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"utmSlug":{"type":"string"},"isDeleted":{"type":"boolean"}},"required":["id","name","utmSlug","isDeleted"],"title":"AdClickCampaignData"},"AdClickOutputData":{"type":"object","properties":{"id":{"type":"integer"},"source":{"type":"string"},"platform":{"type":["string","null"]},"clickedAt":{"type":"string"},"utmSource":{"type":["string","null"]},"utmMedium":{"type":["string","null"]},"utmCampaign":{"type":["string","null"]},"utmTerm":{"type":["string","null"]},"utmContent":{"type":["string","null"]},"campaign":{"anyOf":[{"$ref":"#/components/schemas/AdClickCampaignData"},{"type":"null"}]},"landingPath":{"type":["string","null"]},"hasAdConsent":{"type":"boolean"}},"required":["id","source","platform","clickedAt","utmSource","utmMedium","utmCampaign","utmTerm","utmContent","campaign","landingPath","hasAdConsent"],"title":"AdClickOutputData"},"AdCta":{"type":"string","enum":["apply_now","book_now","download","get_offer","get_quote","learn_more","subscribe","sign_up"],"title":"AdCta"},"AdDailySeriesData":{"type":"object","properties":{"totals":{"$ref":"#/components/schemas/AdMetricTotalsData","description":"The totals of all days."},"days":{"type":"array","items":{"$ref":"#/components/schemas/AdMetricDayData"},"description":"The numbers of each day."},"lastSyncedAt":{"type":["string","null"],"description":"When Fusio last read numbers from the network, or null."}},"required":["totals","days","lastSyncedAt"],"title":"AdDailySeriesData"},"AdDeploymentChangeSummaryData":{"type":"object","properties":{"rsaGroups":{"type":"integer"},"sitelinks":{"type":"integer"},"callouts":{"type":"integer"},"urls":{"type":"integer"},"keywords":{"type":"integer"},"adGroups":{"type":"integer"},"campaignSettings":{"type":"boolean"},"snippets":{"type":"integer"},"campaignAssets":{"type":"boolean"}},"required":["rsaGroups","sitelinks","callouts","urls","keywords","adGroups","campaignSettings","snippets","campaignAssets"],"title":"AdDeploymentChangeSummaryData"},"AdDeploymentData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the deployment. Use it with the ad-deployments routes."},"name":{"type":"string","description":"The name of the campaign in Google Ads."},"mode":{"type":"string","description":"How it got to Google Ads: manual, api (Fusio sent it) or imported."},"status":{"type":"string","description":"Where the campaign is in Google Ads: draft, exported, validating, publishing, paused, active, failed, reconciliation_required, drifted or imported."},"managementState":{"type":"string","description":"managed (Fusio may change it) or read_only (Fusio only reads it)."},"market":{"type":"string","description":"The country of the campaign, as two letters."},"language":{"type":"string","description":"The language of the campaign, like cs."},"currencyCode":{"type":"string","description":"The currency, like CZK."},"dailyBudgetAmount":{"type":"string","description":"How much the campaign may spend in a day, as text like \"500.00\"."},"planRevision":{"type":"string","description":"The version of the plan that was sent."},"sourceGoogleAdsSearchCampaignId":{"type":["integer","null"],"description":"The number of the Fusio campaign it came from, or null."},"externalCampaignId":{"type":["string","null"],"description":"The number of the campaign in Google Ads, or null before it is there."},"failureReason":{"type":["string","null"],"description":"Why sending failed, or null."},"servingStatus":{"type":["string","null"],"description":"What Google Ads says about showing the ads, or null."},"deployedAt":{"type":["string","null"],"description":"When the campaign got to Google Ads, or null."},"lastSyncedAt":{"type":["string","null"],"description":"When Fusio last read the campaign from Google Ads, or null."},"currentPlanRevision":{"type":["string","null"],"description":"The version of the plan in Fusio now. When it differs from planRevision, you changed something."},"hasUnsynchronizedChanges":{"type":"boolean","description":"true when you changed the campaign in Fusio and Google Ads does not have it yet."},"unsynchronizedChangeSummary":{"$ref":"#/components/schemas/AdDeploymentChangeSummaryData","description":"How many things of each kind changed and wait to be sent."},"canApplyChanges":{"type":"boolean","description":"true when you can send the waiting changes with `ad-deployments.google-ads.apply`."}},"required":["id","name","mode","status","managementState","market","language","currencyCode","dailyBudgetAmount","planRevision","sourceGoogleAdsSearchCampaignId","externalCampaignId","failureReason","servingStatus","deployedAt","lastSyncedAt","currentPlanRevision","hasUnsynchronizedChanges","unsynchronizedChangeSummary","canApplyChanges"],"title":"AdDeploymentData"},"AdDeploymentRemoteStatus":{"type":"string","enum":["enabled","paused"],"title":"AdDeploymentRemoteStatus"},"AdFormat":{"type":"string","enum":["single_image"],"title":"AdFormat"},"AdGenerationDispatchOutputData":{"type":"object","properties":{"runId":{"type":"integer","description":"The number of the AI job. Ask `ai.generation-runs.show` with it to see how it goes."},"action":{"type":"string","description":"The kind of job: generate_social_ad."},"status":{"type":"string","description":"queued: the job waits to start."}},"required":["runId","action","status"],"title":"AdGenerationDispatchOutputData"},"AdGenerationMode":{"type":"string","enum":["ad","post","variants"],"title":"AdGenerationMode"},"AdImprovementOutputData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the tip."},"platform":{"type":"string","description":"The ad network."},"type":{"type":"string","description":"The kind of tip: exclude_search_term, budget_lost_impression_share, cost_per_click_above_forecast, low_click_through_rate, high_cost_per_mille, rejected_ad, draft_starting_soon, scheduled_starting_soon, learning_limited, creative_fatigue or poor_performing_ad."},"campaignId":{"type":["integer","null"],"description":"The number of the campaign, or null."},"campaignName":{"type":["string","null"],"description":"The name of the campaign, or null."},"adId":{"type":["integer","null"],"description":"The number of the ad, or null."},"adName":{"type":["string","null"],"description":"The name of the ad, or null."},"adSetId":{"type":["integer","null"],"description":"For Meta tips: the number of the ad set in your plan. null otherwise."},"searchTerm":{"type":["string","null"],"description":"For exclude_search_term: what people searched for. null otherwise."},"clicks":{"type":["integer","null"],"description":"How many clicks it is about, or null."},"results":{"type":["string","null"],"description":"For poor_performing_ad: how many results the ad brought. null otherwise."},"amount":{"type":["string","null"],"description":"How much money it is about, or null."},"percent":{"type":["string","null"],"description":"The share in percent it is about, or null."},"currencyCode":{"type":["string","null"],"description":"The currency of amount, or null."},"eventDate":{"type":["string","null"],"description":"The day it is about, or null."},"reason":{"type":["string","null"],"description":"Why Fusio gives the tip, or null."}},"required":["id","platform","type","campaignId","campaignName","adId","adName","adSetId","searchTerm","clicks","results","amount","percent","currencyCode","eventDate","reason"],"title":"AdImprovementOutputData"},"AdImprovementType":{"type":"string","enum":["exclude_search_term","budget_lost_impression_share","cost_per_click_above_forecast","low_click_through_rate","high_cost_per_mille","rejected_ad","draft_starting_soon","scheduled_starting_soon","learning_limited","creative_fatigue","poor_performing_ad"],"title":"AdImprovementType"},"AdIssueCountsData":{"type":"object","properties":{"google":{"type":"integer","description":"How many Google Ads campaigns have a problem."},"facebook":{"type":"integer","description":"How many Meta campaigns have a problem."},"instagram":{"type":"integer","description":"Always 0. Meta campaigns count under facebook."},"linkedin":{"type":"integer","description":"How many LinkedIn ads have a problem."}},"required":["google","facebook","instagram","linkedin"],"title":"AdIssueCountsData"},"AdIssueData":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/AdIssueKind","description":"What is wrong: rejected, failed, suspended or missing_data."},"reason":{"type":["string","null"],"description":"Why, in words from the ad network, or null."},"policyTopics":{"type":"array","items":{"type":"string"},"description":"The rules of the ad network the ad broke."},"adGroupId":{"type":["integer","null"],"description":"The number of the ad group with the problem, or null."},"rejectedAdCount":{"type":"integer","description":"How many ads the network rejected."}},"required":["kind","reason","policyTopics","adGroupId","rejectedAdCount"],"title":"AdIssueData"},"AdIssueKind":{"type":"string","enum":["rejected","failed","suspended","missing_data"],"title":"AdIssueKind"},"AdMetricDayData":{"type":"object","properties":{"date":{"type":"string"},"spend":{"type":"number"},"impressions":{"type":"integer"},"clicks":{"type":"integer"},"conversions":{"type":"number"}},"required":["date","spend","impressions","clicks","conversions"],"title":"AdMetricDayData"},"AdMetricTotalsData":{"type":"object","properties":{"spend":{"type":"number","description":"How much was spent."},"impressions":{"type":"integer","description":"How many times the ad showed."},"clicks":{"type":"integer","description":"How many times people clicked."},"conversions":{"type":"number","description":"How many results the ad network counted."},"currencyCode":{"type":["string","null"],"description":"The currency of spend, like CZK, or null."}},"required":["spend","impressions","clicks","conversions","currencyCode"],"title":"AdMetricTotalsData"},"AdOverviewData":{"type":"object","properties":{"platform":{"type":"string","description":"The ad network of the numbers."},"currency":{"type":["string","null"],"description":"The currency of the money numbers, or null."},"hasMixedCurrencies":{"type":"boolean","description":"true when your accounts use more currencies, so money totals are not added up."},"lastSyncedAt":{"type":["string","null"],"description":"When Fusio last read numbers from the network, or null."},"kpis":{"$ref":"#/components/schemas/AdOverviewKpisData","description":"The main numbers: spend, impressions, clicks, conversions, leads and deals, each with the value before and a line by day."},"funnel":{"$ref":"#/components/schemas/AdOverviewFunnelData","description":"How clicks became leads and deals, by ad and by campaign."},"runningAdCount":{"type":"integer","description":"How many ads run now."},"dailyBudgetAmount":{"type":"number","description":"How much the running ads may spend in a day together."},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/SocialAdAccountSummaryData"},"description":"Your ad accounts on the network."},"ads":{"type":"array","items":{"$ref":"#/components/schemas/SocialAdResultData"},"description":"The numbers of each ad."},"ready":{"type":"boolean","description":"false while Fusio is still counting the numbers. Then the lists are empty; try again later."},"rolledUpAt":{"type":["string","null"],"description":"When Fusio last counted the numbers."},"range":{"$ref":"#/components/schemas/OverviewRangeData","description":"The days the numbers are for."},"previousRange":{"anyOf":[{"$ref":"#/components/schemas/OverviewRangeData"},{"type":"null"}],"description":"The range just before, when you sent compare=true. Otherwise null."},"dates":{"type":"array","items":{"type":"string"},"description":"Every day of the range. Day lists in the answer follow this order."}},"required":["platform","currency","hasMixedCurrencies","lastSyncedAt","kpis","funnel","runningAdCount","dailyBudgetAmount","accounts","ads","ready","rolledUpAt","range","previousRange","dates"],"title":"AdOverviewData"},"AdOverviewFunnelData":{"type":"object","properties":{"ads":{"type":"array","items":{"$ref":"#/components/schemas/SocialAdLeadSegmentData"}},"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/SocialAdLeadSegmentData"}}},"required":["ads","campaigns"],"title":"AdOverviewFunnelData"},"AdOverviewKpisData":{"type":"object","properties":{"spend":{"$ref":"#/components/schemas/OverviewKpiData"},"impressions":{"$ref":"#/components/schemas/OverviewKpiData"},"clicks":{"$ref":"#/components/schemas/OverviewKpiData"},"conversions":{"$ref":"#/components/schemas/OverviewKpiData"},"leads":{"$ref":"#/components/schemas/OverviewKpiData"},"deals":{"$ref":"#/components/schemas/OverviewKpiData"}},"required":["spend","impressions","clicks","conversions","leads","deals"],"title":"AdOverviewKpisData"},"AdPendingNetworkChange":{"type":"string","enum":["none","settings","creative"],"title":"AdPendingNetworkChange"},"AdPublicationData":{"type":"object","properties":{"id":{"type":"integer"},"status":{"$ref":"#/components/schemas/PublicationStatus"},"publishAt":{"type":["string","null"]}},"required":["id","status","publishAt"],"title":"AdPublicationData"},"AdState":{"type":"string","enum":["drafted","rejected","approved","published","scheduled","failed"],"title":"AdState"},"AdType":{"type":"string","enum":["post_engagement","website_traffic","lead","search","performance_max","display","video","demand_gen"],"title":"AdType"},"AdsPerformancePlatformData":{"type":"object","properties":{"platform":{"$ref":"#/components/schemas/AdCampaignPlatform"},"currencyCode":{"type":["string","null"]},"spend":{"type":"number"},"impressions":{"type":"integer"},"clicks":{"type":"integer"},"conversions":{"type":"number"},"clickThroughRate":{"type":["number","null"]},"costPerConversion":{"type":["number","null"]}},"required":["platform","currencyCode","spend","impressions","clicks","conversions","clickThroughRate","costPerConversion"],"title":"AdsPerformancePlatformData"},"AdsPerformanceRecommendationData":{"type":"object","properties":{"id":{"type":"integer"},"platform":{"$ref":"#/components/schemas/AdCampaignPlatform"},"type":{"$ref":"#/components/schemas/AdImprovementType"},"reason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","platform","type","reason","createdAt"],"title":"AdsPerformanceRecommendationData"},"AdsPerformanceSnapshotData":{"type":"object","properties":{"periodFrom":{"type":"string"},"periodTo":{"type":"string"},"platforms":{"type":"array","items":{"$ref":"#/components/schemas/AdsPerformancePlatformData"}},"bestAds":{"type":"array","items":{"$ref":"#/components/schemas/AdsPerformanceSubjectData"}},"weakestAds":{"type":"array","items":{"$ref":"#/components/schemas/AdsPerformanceSubjectData"}},"openRecommendations":{"type":"array","items":{"$ref":"#/components/schemas/AdsPerformanceRecommendationData"}},"openRecommendationCount":{"type":"integer","description":"How many tips for your ads wait for you."},"markdown":{"type":"string"}},"required":["periodFrom","periodTo","platforms","bestAds","weakestAds","openRecommendations","openRecommendationCount","markdown"],"title":"AdsPerformanceSnapshotData"},"AdsPerformanceSubjectData":{"type":"object","properties":{"subjectType":{"$ref":"#/components/schemas/AdsPerformanceSubjectType"},"id":{"type":"integer"},"name":{"type":"string"},"platform":{"$ref":"#/components/schemas/AdCampaignPlatform"},"currencyCode":{"type":["string","null"]},"spend":{"type":"number"},"impressions":{"type":"integer"},"clicks":{"type":"integer"},"conversions":{"type":"number"},"clickThroughRate":{"type":"number"}},"required":["subjectType","id","name","platform","currencyCode","spend","impressions","clicks","conversions","clickThroughRate"],"title":"AdsPerformanceSubjectData"},"AdsPerformanceSubjectType":{"type":"string","enum":["ad","google_ads_deployment","meta_ads_deployment"],"title":"AdsPerformanceSubjectType"},"AdsTargetingProfileData":{"type":"object","properties":{"schemaVersion":{"type":"integer"},"canonical":{"$ref":"#/components/schemas/CanonicalAdsTargetingData"},"googleAds":{"$ref":"#/components/schemas/PlatformAdsTargetingData"},"metaAds":{"$ref":"#/components/schemas/PlatformAdsTargetingData"},"linkedInAds":{"$ref":"#/components/schemas/PlatformAdsTargetingData"},"tikTokAds":{"$ref":"#/components/schemas/PlatformAdsTargetingData"}},"required":["schemaVersion","canonical","googleAds","metaAds","linkedInAds","tikTokAds"],"title":"AdsTargetingProfileData"},"AiActionPricesOutputData":{"type":"object","properties":{"prices":{"type":"object","additionalProperties":{"type":"integer"},"description":"The price in credits of each AI action, by its name, like image-generation (one picture) or campaign-ai-plan (planning a whole campaign)."},"creditBalance":{"type":"number","description":"How many AI credits your company has now."}},"required":["prices","creditBalance"],"title":"AiActionPricesOutputData"},"AiAdjustResponseData":{"type":"object","properties":{"toolCalls":{"type":"array","items":{"$ref":"#/components/schemas/AiAdjustToolCallData"}},"summary":{"type":"string"},"appliedCount":{"type":"integer"},"skippedOperations":{}},"required":["toolCalls","summary","appliedCount","skippedOperations"],"title":"AiAdjustResponseData"},"AiAdjustToolCallData":{"type":"object","properties":{"tool":{"type":"string"},"args":{}},"required":["tool","args"],"title":"AiAdjustToolCallData"},"AiCreditEstimateKind":{"type":"string","enum":["google_ad_group","google_texts","social_ad","seo_audit_market","seo_google_ads_search_refresh","worker_instructions","meta_ads_campaign","meta_ads_texts","meta_ads_targets","meta_ads_images","meta_ads_ad_set_ads"],"title":"AiCreditEstimateKind"},"AiCreditEstimateOutputData":{"type":"object","properties":{"minimum":{"type":"integer","description":"About how many credits it usually costs, from the last runs. At least 1 and never above maximum."},"maximum":{"type":"integer","description":"The most credits it can cost."},"balance":{"type":"number","description":"How many AI credits your company has now."},"sources":{"type":"array","items":{"$ref":"#/components/schemas/AiCreditEstimateSourceData"},"description":"What AI reads about your company for this work."},"parts":{"type":"array","items":{"$ref":"#/components/schemas/AiCreditEstimatePartData"},"description":"The steps of the work with their prices."}},"required":["minimum","maximum","balance","sources","parts"],"title":"AiCreditEstimateOutputData"},"AiCreditEstimatePartData":{"type":"object","properties":{"prompt":{"type":"string","description":"The name of the step."},"maximum":{"type":"integer","description":"The most credits the step can cost."}},"required":["prompt","maximum"],"title":"AiCreditEstimatePartData"},"AiCreditEstimateSourceData":{"type":"object","properties":{"scope":{"type":"string","description":"The part of your company profile: product, brand_voice, customers, competitors or seo_audit."},"isAvailable":{"type":"boolean","description":"true when you have filled that part in."}},"required":["scope","isAvailable"],"title":"AiCreditEstimateSourceData"},"AiGenerationRunStatusOutputData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the job."},"kind":{"type":"string","description":"What the job makes: article, email, social_post or ad."},"status":{"type":"string","description":"pending (waits), in_progress (runs), completed (done), failed (did not work) or partial (only part worked)."},"step":{"type":["string","null"],"description":"The name of the last step AI did, or null."},"label":{"type":["string","null"],"description":"A short name of the job, or null."},"entityType":{"type":["string","null"],"description":"What was made: article, email or social_post. null for ads."},"entityId":{"type":["integer","null"],"description":"The number of what was made, once status is completed or partial. null before that and for ads."},"createdAt":{"type":["string","null"],"description":"When the job was made, in UTC."},"startedAt":{"type":["string","null"],"description":"When the job started, in UTC, or null."},"finishedAt":{"type":["string","null"],"description":"When the job ended, in UTC, or null."}},"required":["id","kind","status","step","label","entityType","entityId","createdAt","startedAt","finishedAt"],"title":"AiGenerationRunStatusOutputData"},"AiImageGenerationFormat":{"type":"string","enum":["square","portrait","landscape","portrait_tall","story","widescreen","banner","wide"],"title":"AiImageGenerationFormat"},"AiImageGenerationStatus":{"type":"string","enum":["pending","processing","completed","failed"],"title":"AiImageGenerationStatus"},"AiImageGenerationStatusData":{"type":"object","properties":{"id":{"type":"integer"},"status":{"$ref":"#/components/schemas/AiImageGenerationStatus","description":"How the work goes. It starts as pending."},"format":{"$ref":"#/components/schemas/AiImageGenerationFormat"},"variantCount":{"type":"integer","description":"How many pictures AI makes."},"failureReason":{"type":["string","null"]},"processedJobs":{"type":"integer"},"totalJobs":{"type":"integer"},"progress":{"type":"integer","description":"How far it is, from 0 to 100."},"variants":{"type":"array","items":{"$ref":"#/components/schemas/AiImageGenerationVariantOutputData"},"description":"The pictures made so far."}},"required":["id","status","format","variantCount","failureReason","processedJobs","totalJobs","progress","variants"],"title":"AiImageGenerationStatusData"},"AiImageGenerationVariantOutputData":{"type":"object","properties":{"id":{"type":"integer"},"mimeType":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"url":{"type":"string"}},"required":["id","mimeType","width","height","url"],"title":"AiImageGenerationVariantOutputData"},"AlternativesData":{"type":"object","properties":{"alternative":{"type":"string"},"why":{"type":"string"}},"required":["alternative","why"],"title":"AlternativesData"},"AnalyticsCampaignOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"mode":{"$ref":"#/components/schemas/CampaignMode","description":"How the campaign runs."},"sentAt":{"type":["string","null"],"description":"When the first email of the campaign went to this person."}},"required":["id","name","mode","sentAt"],"title":"AnalyticsCampaignOutputData"},"AresFilterOptionData":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"],"title":"AresFilterOptionData"},"AresMunicipalityOptionData":{"type":"object","properties":{"code":{"type":"integer"},"level":{"type":"string"},"label":{"type":"string"}},"required":["code","level","label"],"title":"AresMunicipalityOptionData"},"AresRegisterPersonData":{"type":"object","properties":{"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"position":{"type":["string","null"]},"isPrimary":{"type":"boolean"}},"required":["firstName","lastName","position","isPrimary"],"title":"AresRegisterPersonData"},"AresRegistrationsData":{"type":"object","properties":{"vr":{"type":["string","null"]},"res":{"type":["string","null"]},"rzp":{"type":["string","null"]},"dph":{"type":["string","null"]},"ir":{"type":["string","null"]}},"required":["vr","res","rzp","dph","ir"],"title":"AresRegistrationsData"},"AresRegistryCodeData":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":["string","null"]}},"required":["value","label"],"title":"AresRegistryCodeData"},"ArticleAlternateData":{"type":"object","properties":{"locale":{"type":"string"},"slug":{"type":"string"},"languageTag":{"type":"string"},"languageCode":{"type":"string"},"categorySlug":{"type":["string","null"]}},"required":["locale","slug","languageTag","languageCode","categorySlug"],"title":"ArticleAlternateData"},"ArticleBannerCreditData":{"type":"object","properties":{"name":{"type":"string"},"photographerUrl":{"type":"string"},"photoUrl":{"type":"string"}},"required":["name","photographerUrl","photoUrl"],"title":"ArticleBannerCreditData"},"ArticleBannerType":{"type":"string","enum":["photo","text","cutout"],"title":"ArticleBannerType"},"ArticleCategoryColor":{"type":"string","enum":["ai","email","social","strategie","case","navody","trendy","srovnani"],"title":"ArticleCategoryColor"},"ArticleCategoryIcon":{"type":"string","enum":["sparkles","mail","messageCircle","target","trophy","bookOpen","trendingUp","folder","scale"],"title":"ArticleCategoryIcon"},"ArticleCategoryTranslationInputData":{"type":"object","properties":{"id":{"type":["integer","null"]},"locale":{"type":"string"},"name":{"type":["string","null"]},"slug":{"type":["string","null"]},"description":{"type":["string","null"]},"breadcrumbTitle":{"type":["string","null"]},"metaTitle":{"type":["string","null"]},"metaDescription":{"type":["string","null"]},"canonicalUrl":{"type":["string","null"]},"ogTitle":{"type":["string","null"]},"ogDescription":{"type":["string","null"]},"ogImageId":{"type":["integer","null"]}},"required":["id","locale"],"title":"ArticleCategoryTranslationInputData"},"ArticleImagePurpose":{"type":"string","enum":["article_banner","article_content"],"title":"ArticleImagePurpose"},"ArticleIntegrationType":{"type":"string","enum":["webhook","api","hosted"],"title":"ArticleIntegrationType"},"ArticleOverviewCategoryData":{"type":"object","properties":{"id":{"type":["integer","null"]},"name":{"type":["string","null"]},"views":{"type":"integer"}},"required":["id","name","views"],"title":"ArticleOverviewCategoryData"},"ArticleOverviewData":{"type":"object","properties":{"kpis":{"$ref":"#/components/schemas/ArticleOverviewKpisData","description":"The main numbers: published articles, views, reads, clicks and leads."},"bestArticles":{"type":"array","items":{"$ref":"#/components/schemas/ArticleOverviewRankItemData"}},"leadArticles":{"type":"array","items":{"$ref":"#/components/schemas/ArticleOverviewRankItemData"}},"countByState":{"type":"object","additionalProperties":{"type":"integer"},"description":"How many articles are in each state. The key is the state."},"viewsByCategory":{"type":"array","items":{"$ref":"#/components/schemas/ArticleOverviewCategoryData"}},"staleArticles":{"type":"array","items":{"$ref":"#/components/schemas/ArticleOverviewStaleItemData"},"description":"Articles that get fewer views than before. Update them."},"categories":{"type":"array","items":{"$ref":"#/components/schemas/ArticleOverviewFilterOptionData"}},"locales":{"type":"array","items":{"type":"string"}},"ready":{"type":"boolean","description":"false while Fusio is still counting the numbers. Then the lists are empty; try again later."},"rolledUpAt":{"type":["string","null"],"description":"When Fusio last counted the numbers."},"range":{"$ref":"#/components/schemas/OverviewRangeData"},"previousRange":{"anyOf":[{"$ref":"#/components/schemas/OverviewRangeData"},{"type":"null"}],"description":"The range just before, when you sent compare=true. Otherwise null."},"dates":{"type":"array","items":{"type":"string"},"description":"Every day of the range. Day lists in the answer follow this order."}},"required":["kpis","bestArticles","leadArticles","countByState","viewsByCategory","staleArticles","categories","locales","ready","rolledUpAt","range","previousRange","dates"],"title":"ArticleOverviewData"},"ArticleOverviewFilterOptionData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"],"title":"ArticleOverviewFilterOptionData"},"ArticleOverviewKpisData":{"type":"object","properties":{"published":{"$ref":"#/components/schemas/OverviewKpiData"},"views":{"$ref":"#/components/schemas/OverviewKpiData"},"reads":{"$ref":"#/components/schemas/OverviewKpiData"},"clicks":{"$ref":"#/components/schemas/OverviewKpiData"},"leads":{"$ref":"#/components/schemas/OverviewKpiData"}},"required":["published","views","reads","clicks","leads"],"title":"ArticleOverviewKpisData"},"ArticleOverviewRankItemData":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"count":{"type":"integer"}},"required":["id","title","count"],"title":"ArticleOverviewRankItemData"},"ArticleOverviewStaleItemData":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"publishedAt":{"type":"string"},"recentViews":{"type":"integer"},"previousViews":{"type":"integer"}},"required":["id","title","publishedAt","recentViews","previousViews"],"title":"ArticleOverviewStaleItemData"},"ArticleSchemaType":{"type":"string","enum":["Article","NewsArticle","BlogPosting"],"title":"ArticleSchemaType"},"ArticleSiteMode":{"type":"string","enum":["snippet","subdomain","subdirectory"],"title":"ArticleSiteMode"},"ArticleSiteSummaryData":{"type":"object","properties":{"publicId":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArticleSiteMode"},"path":{"type":["string","null"]},"baseUrl":{"type":"string"},"leadFormId":{"type":["integer","null"]},"publicKey":{"type":["string","null"]},"cnameTarget":{"type":["string","null"]},"dnsVerifiedAt":{"type":["string","null"]},"tlsReadyAt":{"type":["string","null"]},"firstSeenAt":{"type":["string","null"]}},"required":["publicId","mode","path","baseUrl","leadFormId","publicKey","cnameTarget","dnsVerifiedAt","tlsReadyAt","firstSeenAt"],"title":"ArticleSiteSummaryData"},"ArticleState":{"type":"string","enum":["drafted","approved","rejected","scheduled","published","failed"],"title":"ArticleState"},"ArticleUrlLocalePatternData":{"type":"object","properties":{"locale":{"type":"string"},"template":{"type":"string"},"categoryFallback":{"type":["string","null"]}},"required":["locale","template","categoryFallback"],"title":"ArticleUrlLocalePatternData"},"AssetBriefData":{"type":"object","properties":{"buyerStage":{"type":["string","null"],"description":"How far the buyer is in buying, or null."},"painToAddress":{"type":["string","null"],"description":"The trouble of the buyer the piece talks about, or null."},"proofToCite":{"type":["string","null"],"description":"The proof the piece mentions, or null."},"copyFramework":{"type":["string","null"],"description":"The writing pattern to follow, like AIDA, or null."}},"required":["buyerStage","painToAddress","proofToCite","copyFramework"],"title":"AssetBriefData"},"AssetGenerationOrigin":{"type":"string","enum":["standalone","campaign"],"title":"AssetGenerationOrigin"},"AuthMeOutputData":{"type":"object","properties":{"user":{"anyOf":[{"$ref":"#/components/schemas/UpdateUserData"},{"$ref":"#/components/schemas/EmbedMeUserOutputData"}]},"tenant":{"anyOf":[{"$ref":"#/components/schemas/UpdateTenantData"},{"$ref":"#/components/schemas/SuspendedTenantOutputData"}]},"twoFactorSetupRequired":{"type":"boolean","description":"true when the company asks for two-step sign-in and this person has not set it up yet."},"membershipSuspension":{"anyOf":[{"$ref":"#/components/schemas/MembershipSuspensionOutputData"},{"type":"null"}],"description":"Always null for a key. A key stops working when its owner is suspended."}},"required":["user","tenant","twoFactorSetupRequired","membershipSuspension"],"title":"AuthMeOutputData"},"AvailableEntityData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"state":{"type":"string"},"assignedToCampaign":{"type":"boolean","description":"true when the item already belongs to a campaign."},"campaignId":{"type":["integer","null"]},"campaignName":{"type":["string","null"]},"campaignOrigin":{"type":["string","null"]}},"required":["id","name","state","assignedToCampaign","campaignId","campaignName","campaignOrigin"],"title":"AvailableEntityData"},"BoardColumnCountData":{"type":"object","properties":{"status":{"type":"string"},"count":{"type":"integer"}},"required":["status","count"],"title":"BoardColumnCountData"},"BoardSummaryData":{"type":"object","properties":{"columns":{"type":"array","items":{"$ref":"#/components/schemas/BoardColumnCountData"}},"total":{"type":"integer"}},"required":["columns","total"],"title":"BoardSummaryData"},"BrandColorsData":{"type":"object","properties":{"primary":{"type":["string","null"]},"accent":{"type":["string","null"]},"secondary":{"type":["string","null"]},"additional":{"type":"array","items":{"type":"string"}}},"required":["primary","accent","secondary","additional"],"title":"BrandColorsData"},"BrandVoiceOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"tenantSequence":{"type":"integer","description":"The number of the voice within your company."},"name":{"type":"string"},"description":{"type":["string","null"]},"toneDescriptor":{"anyOf":[{"$ref":"#/components/schemas/TenantBrandVoiceTone"},{"type":"null"}]},"readingLevel":{"anyOf":[{"$ref":"#/components/schemas/TenantBrandVoiceReadingLevel"},{"type":"null"}]},"persona":{"type":["string","null"]},"sampleContent":{"type":["string","null"]},"isDefault":{"type":"boolean","description":"true for the voice AI uses when you pick none."},"derivedFromAnalysisId":{"type":["integer","null"]},"createdBy":{"type":"integer"},"phrases":{"description":"Phrases to use or avoid."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"],"description":"When the voice was removed. null for a voice in use."}},"required":["id","tenantId","tenantSequence","name","description","toneDescriptor","readingLevel","persona","sampleContent","isDefault","derivedFromAnalysisId","createdBy","phrases","createdAt","updatedAt","deletedAt"],"title":"BrandVoiceOutputData"},"BrowserDiscoveryLeadData":{"type":"object","properties":{"leadId":{"type":"integer","description":"The number of the new lead."},"profileId":{"type":"integer","description":"The number of its discovery profile."},"reviewStatus":{"type":"string","description":"Where the review is. It is always new."}},"required":["leadId","profileId","reviewStatus"],"title":"BrowserDiscoveryLeadData"},"CadenceDueTaskContactData":{"type":"object","properties":{"name":{"type":["string","null"]},"linkedinUrl":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","linkedinUrl","phone"],"title":"CadenceDueTaskContactData"},"CadenceDueTaskItemData":{"type":"object","properties":{"leadCadenceTaskId":{"type":"integer"},"leadId":{"type":"integer"},"leadName":{"type":["string","null"]},"channel":{"type":"string"},"stepTitle":{"type":"string"},"stepPosition":{"type":"integer"},"dueAt":{"type":["string","null"]},"scheduledAt":{"type":["string","null"]},"body":{"type":["string","null"]},"preparedMessageId":{"type":["integer","null"]},"contact":{"anyOf":[{"$ref":"#/components/schemas/CadenceDueTaskContactData"},{"type":"null"}]},"outreachTask":{"type":"string"}},"required":["leadCadenceTaskId","leadId","leadName","channel","stepTitle","stepPosition","dueAt","scheduledAt","body","preparedMessageId","contact","outreachTask"],"title":"CadenceDueTaskItemData"},"CadenceDueTasksData":{"type":"object","properties":{"toSend":{"type":"array","items":{"$ref":"#/components/schemas/CadenceDueTaskItemData"},"description":"Approved LinkedIn and WhatsApp messages whose send time has come, at most one per enrollment: its earliest approved message, and none while that one is not due yet. Ordered by enrollment. Each item has the message text in `body`, its `preparedMessageId` and the lead's main contact."},"toPrepare":{"type":"array","items":{"$ref":"#/components/schemas/CadenceDueTaskItemData"},"description":"Open cadence steps that have no content yet, at most 50, by due time, enrollment and step order. They have no `body` and no `preparedMessageId`."}},"required":["toSend","toPrepare"],"title":"CadenceDueTasksData"},"CadenceOutreachResultData":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"integer"},"channel":{"type":"string"},"status":{"type":"string"},"scheduledAt":{"type":["string","null"]},"leadId":{"type":"integer"},"leadCadenceTaskId":{"type":"integer"}},"required":["type","id","channel","status","scheduledAt","leadId","leadCadenceTaskId"],"title":"CadenceOutreachResultData"},"Campaign.Ai.SuggestedCtaData":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":["string","null"]},"suggestedEventName":{"type":["string","null"]},"linksToLeadForm":{"type":"boolean"},"destinationUrl":{"type":["string","null"]},"isPrimary":{"type":"boolean"},"offerRole":{"type":["string","null"]}},"required":["label","description","suggestedEventName","linksToLeadForm","destinationUrl","isPrimary","offerRole"],"title":"Campaign.Ai.SuggestedCtaData"},"CampaignAiPlanApprovalRecommendationData":{"type":"object","properties":{"requiresApproval":{"type":"boolean"},"reasoning":{"type":"string"}},"required":["requiresApproval","reasoning"],"title":"CampaignAiPlanApprovalRecommendationData"},"CampaignAiPlanData":{"type":"object","properties":{"suggestedName":{"type":"string"},"suggestedDescription":{"type":["string","null"]},"mode":{"type":"string"},"durationDays":{"type":"integer"},"phases":{"type":"array","items":{"$ref":"#/components/schemas/CampaignAiPlanPhaseData"}},"destinations":{"type":"array","items":{"$ref":"#/components/schemas/CampaignAiPlanDestinationData"}},"sourcesSuggested":{"type":"array","items":{"$ref":"#/components/schemas/CampaignAiPlanSourceSuggestionData"}},"autonomyRecommendation":{"type":"string"},"approvalRecommendation":{"$ref":"#/components/schemas/CampaignAiPlanApprovalRecommendationData"},"sequence":{"anyOf":[{"$ref":"#/components/schemas/CampaignAiPlanNurtureSequenceData"},{"type":"null"}]},"suggestedCtas":{"type":"array","items":{"$ref":"#/components/schemas/Campaign.Ai.SuggestedCtaData"}},"suggestedLeadForm":{"anyOf":[{"$ref":"#/components/schemas/SuggestedLeadFormData"},{"type":"null"}]},"suggestedEvents":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedEventData"}},"askRatio":{"type":["number","null"]},"profile":{"anyOf":[{"$ref":"#/components/schemas/CampaignProfileData"},{"type":"null"}]},"suggestedAudience":{"anyOf":[{"$ref":"#/components/schemas/SuggestedAudienceData"},{"type":"null"}]}},"required":["suggestedName","suggestedDescription","mode","durationDays","phases","destinations","sourcesSuggested","autonomyRecommendation","approvalRecommendation","sequence","suggestedCtas","suggestedLeadForm","suggestedEvents","askRatio","profile","suggestedAudience"],"title":"CampaignAiPlanData"},"CampaignAiPlanDestinationData":{"type":"object","properties":{"destination":{"type":"string"},"itemsPerGeneration":{"type":"integer"},"recurrenceRule":{"type":["string","null"]},"draftTitleOrSubject":{"type":"string"},"draftOutline":{"type":"string"},"scheduleOffsetDays":{"type":"integer"},"aiRationale":{"type":"string"},"angle":{"type":["string","null"]},"format":{"type":["string","null"]},"buyerStage":{"type":["string","null"]},"hookAngle":{"type":["string","null"]},"painToAddress":{"type":["string","null"]},"proofToCite":{"type":["string","null"]},"copyFramework":{"type":["string","null"]},"tenantAnchor":{"anyOf":[{"$ref":"#/components/schemas/TenantAnchorData"},{"type":"null"}]}},"required":["destination","itemsPerGeneration","recurrenceRule","draftTitleOrSubject","draftOutline","scheduleOffsetDays","aiRationale","angle","format","buyerStage","hookAngle","painToAddress","proofToCite","copyFramework","tenantAnchor"],"title":"CampaignAiPlanDestinationData"},"CampaignAiPlanDispatchOutputData":{"type":"object","properties":{"campaignId":{"type":"integer","description":"The number of the draft campaign."},"resume":{"type":["boolean","null"],"description":"True when AI goes on from the step where it stopped."}},"required":["campaignId","resume"],"title":"CampaignAiPlanDispatchOutputData"},"CampaignAiPlanKnowledgeDocData":{"type":"object","properties":{"title":{"type":"string"},"markdown":{"type":"string"}},"required":["title","markdown"],"title":"CampaignAiPlanKnowledgeDocData"},"CampaignAiPlanNurtureSequenceData":{"type":"object","properties":{"entryEventSlug":{"type":"string"},"template":{"type":"string"},"exitEventSlugs":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/CampaignAiPlanStepData"}},"recommendationRationale":{"type":["string","null"]}},"required":["entryEventSlug","template","exitEventSlugs","steps","recommendationRationale"],"title":"CampaignAiPlanNurtureSequenceData"},"CampaignAiPlanPhaseData":{"type":"object","properties":{"name":{"type":"string"},"startOffsetDays":{"type":"integer"},"endOffsetDays":{"type":"integer"},"focus":{"type":"string"},"buyerStage":{"type":["string","null"]}},"required":["name","startOffsetDays","endOffsetDays","focus","buyerStage"],"title":"CampaignAiPlanPhaseData"},"CampaignAiPlanSourceSuggestionData":{"type":"object","properties":{"uuid":{"type":"string"},"destination":{"type":"string"},"sourceType":{"type":"string"},"name":{"type":"string"},"targetCustomerIds":{"type":"array","items":{"type":"integer"}},"configHint":{"type":"string"},"briefText":{"type":"string"},"urls":{"type":"array","items":{"type":"string"}},"suggestedDocuments":{"type":"array","items":{"$ref":"#/components/schemas/CampaignAiPlanKnowledgeDocData"}},"documentFileIds":{"type":"array","items":{"type":"integer"}},"topicId":{"type":["integer","null"]},"topicProposal":{"anyOf":[{"$ref":"#/components/schemas/CampaignAiPlanSourceTopicProposalData"},{"type":"null"}]},"seedArticleIds":{"type":"array","items":{"type":"integer"}},"seedAngles":{"type":"array","items":{"type":"string"}},"completionHints":{"type":"array","items":{"type":"string"}},"status":{"type":"string"}},"required":["uuid","destination","sourceType","name","targetCustomerIds","configHint","briefText","urls","suggestedDocuments","documentFileIds","topicId","topicProposal","seedArticleIds","seedAngles","completionHints","status"],"title":"CampaignAiPlanSourceSuggestionData"},"CampaignAiPlanSourceTopicProposalData":{"type":"object","properties":{"name":{"type":"string"},"topicType":{"type":"string"},"query":{"type":"string"},"timeRange":{"type":"string"},"language":{"type":"string"},"includeWebsites":{"type":"array","items":{"type":"string"}},"excludeWebsites":{"type":"array","items":{"type":"string"}}},"required":["name","topicType","query","timeRange","language","includeWebsites","excludeWebsites"],"title":"CampaignAiPlanSourceTopicProposalData"},"CampaignAiPlanStage":{"type":"string","enum":["pending","classifying","strategy_burst_push","strategy_evergreen_authority","strategy_evergreen_retention","strategy_nurture_cold","strategy_nurture_warm","strategy_custom","channel_mix","asset_briefs","conversion","merging","completed","failed_classify","failed_strategy","failed_channel_mix","failed_asset_briefs","failed_conversion","profiling","failed_profiling","researching_sources","failed_sources_research","failed_merge"],"title":"CampaignAiPlanStage"},"CampaignAiPlanStepData":{"type":"object","properties":{"sortOrder":{"type":"integer"},"delayHours":{"type":"integer"},"emailSubject":{"type":"string"},"emailBodyOutline":{"type":"string"},"rationale":{"type":"string"},"stepRole":{"type":["string","null"]},"hookAngle":{"type":["string","null"]},"tenantAnchor":{"anyOf":[{"$ref":"#/components/schemas/TenantAnchorData"},{"type":"null"}]}},"required":["sortOrder","delayHours","emailSubject","emailBodyOutline","rationale","stepRole","hookAngle","tenantAnchor"],"title":"CampaignAiPlanStepData"},"CampaignAlertData":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/CampaignAlertType"},"destination":{"type":["string","null"]},"percent":{"type":["integer","null"]},"spentCredits":{"type":["integer","null"]},"budgetCredits":{"type":["integer","null"]},"creditBalance":{"type":["number","null"]},"remainingBlueprints":{"type":["integer","null"]},"estimatedDryAt":{"type":["string","null"]}},"required":["type","destination","percent","spentCredits","budgetCredits","creditBalance","remainingBlueprints","estimatedDryAt"],"title":"CampaignAlertData"},"CampaignAlertType":{"type":"string","enum":["credits_exhausted","budget_exhausted","budget_warning","blueprint_depletion","blueprint_exhaustion"],"title":"CampaignAlertType"},"CampaignAngle":{"type":"string","enum":["educational","industry_insights","thought_leadership","brand_story","use_case","promo","contrarian","behind_the_scenes","personal_story","case_study","community_engagement","curated_resources","lead_magnet","comparison","continuity"],"title":"CampaignAngle"},"CampaignApprovalRole":{"type":"string","enum":["primary","backup"],"title":"CampaignApprovalRole"},"CampaignApprovalTimeoutAction":{"type":"string","enum":["skip","publish"],"title":"CampaignApprovalTimeoutAction"},"CampaignApproveResultData":{"type":"object","properties":{"campaignId":{"type":"integer","description":"The number of the campaign."},"approvedCount":{"type":"integer","description":"How many pieces of content were approved."},"status":{"type":"string","description":"The new status of the campaign."}},"required":["campaignId","approvedCount","status"],"title":"CampaignApproveResultData"},"CampaignApproverOutputData":{"type":"object","properties":{"userId":{"type":"integer"},"name":{"type":"string"},"role":{"$ref":"#/components/schemas/CampaignApprovalRole"}},"required":["userId","name","role"],"title":"CampaignApproverOutputData"},"CampaignAssetFormat":{"type":"string","enum":["single_post","thread","carousel","reel"],"title":"CampaignAssetFormat"},"CampaignAssetSummaryData":{"type":"object","properties":{"id":{"type":"integer"},"campaignId":{"type":"integer"},"campaignName":{"type":"string"},"destination":{"type":"string"},"assetStatus":{"type":"string"},"aiRationale":{"type":["string","null"]},"aiConfidence":{"type":["number","null"]},"containsClaims":{"type":["boolean","null"]},"containsLinks":{"type":["boolean","null"]},"brandVoiceDriftScore":{"type":["number","null"]},"similarityScore":{"type":["number","null"]},"matchedSimilarAssetType":{"type":["string","null"]},"matchedSimilarAssetId":{"type":["integer","null"]},"matchedApprovalRuleId":{"type":["integer","null"]}},"required":["id","campaignId","campaignName","destination","assetStatus","aiRationale","aiConfidence","containsClaims","containsLinks","brandVoiceDriftScore","similarityScore","matchedSimilarAssetType","matchedSimilarAssetId","matchedApprovalRuleId"],"title":"CampaignAssetSummaryData"},"CampaignAudienceWarmth":{"type":"string","enum":["cold","warm","owned"],"title":"CampaignAudienceWarmth"},"CampaignAutonomyLevel":{"type":"string","enum":["l0_manual","l1_approval","l2_auto_publish","l3_autopilot"],"title":"CampaignAutonomyLevel"},"CampaignBlueprintConsumptionMode":{"type":"string","enum":["mix","strict_fallback","strict_stop"],"title":"CampaignBlueprintConsumptionMode"},"CampaignBriefAnalysisResponseData":{"type":"object","properties":{"extracted":{"$ref":"#/components/schemas/ExtractedData"},"confidence":{"type":"object","additionalProperties":{"type":"number"}},"missingCritical":{"type":"array","items":{"type":"string"}},"missingOptional":{"type":"array","items":{"type":"string"}},"readyToPlan":{"type":"boolean"},"followUpQuestions":{"type":"array","items":{"$ref":"#/components/schemas/FollowUpQuestionData"}},"suggestedName":{"type":["string","null"]},"suggestedDescription":{"type":["string","null"]}},"required":["extracted","confidence","missingCritical","missingOptional","readyToPlan","followUpQuestions","suggestedName","suggestedDescription"],"title":"CampaignBriefAnalysisResponseData"},"CampaignBriefCompositionData":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"],"title":"CampaignBriefCompositionData"},"CampaignBuyerStage":{"type":"string","enum":["awareness","consideration","decision","retention","implementation"],"title":"CampaignBuyerStage"},"CampaignContentMixData":{"type":"object","properties":{"give":{"type":"integer"},"softAsk":{"type":"integer"},"ask":{"type":"integer"}},"required":["give","softAsk","ask"],"title":"CampaignContentMixData"},"CampaignConversionActionData":{"type":"object","properties":{"id":{"type":"integer"},"conversionActionId":{"type":"integer"},"name":{"type":"string"},"category":{"$ref":"#/components/schemas/ConversionActionCategory"},"eventName":{"type":"string"},"isSystem":{"type":"boolean"},"isDeleted":{"type":"boolean"},"countsTowardGoal":{"type":"boolean"},"position":{"type":"integer"}},"required":["id","conversionActionId","name","category","eventName","isSystem","isDeleted","countsTowardGoal","position"],"title":"CampaignConversionActionData"},"CampaignCopyFramework":{"type":"string","enum":["PAS","AIDA","BAB","FAB","STAR","narrative","fact_led"],"title":"CampaignCopyFramework"},"CampaignCtaOfferRole":{"type":"string","enum":["attraction","upsell","downsell","continuity"],"title":"CampaignCtaOfferRole"},"CampaignDestination":{"type":"string","enum":["blog_article","facebook_post","instagram_post","x_post","linkedin_post","email_broadcast","email_sequence"],"title":"CampaignDestination"},"CampaignGenerationSlotOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"campaignId":{"type":"integer"},"destination":{"$ref":"#/components/schemas/CampaignDestination"},"recurrenceRule":{"type":["string","null"]},"oneOffAt":{"type":["string","null"]},"startOffsetDays":{"type":["integer","null"]},"sourceSelectionStrategy":{"$ref":"#/components/schemas/CampaignSourceSelectionStrategy"},"itemsPerGeneration":{"type":"integer"},"active":{"type":"boolean"},"angle":{"anyOf":[{"$ref":"#/components/schemas/CampaignAngle"},{"type":"null"}]},"buyerStage":{"anyOf":[{"$ref":"#/components/schemas/CampaignBuyerStage"},{"type":"null"}]},"preferredFormat":{"anyOf":[{"$ref":"#/components/schemas/CampaignAssetFormat"},{"type":"null"}]},"lastGeneratedAt":{"type":["string","null"]},"nextScheduledAt":{"type":["string","null"]},"sources":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CampaignGenerationSlotSourceData"}},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"remainingBlueprints":{"type":"integer"},"usedBlueprints":{"type":"integer"},"depletionRatio":{"type":["number","null"]},"exhaustedAt":{"type":["string","null"]},"estimatedDryAt":{"type":["string","null"]},"publishingOffAngle":{"type":"boolean"},"blueprintConsumptionMode":{"$ref":"#/components/schemas/CampaignBlueprintConsumptionMode"}},"required":["id","tenantId","campaignId","destination","recurrenceRule","oneOffAt","startOffsetDays","sourceSelectionStrategy","itemsPerGeneration","active","angle","buyerStage","preferredFormat","lastGeneratedAt","nextScheduledAt","sources","createdAt","updatedAt","remainingBlueprints","usedBlueprints","depletionRatio","exhaustedAt","estimatedDryAt","publishingOffAngle","blueprintConsumptionMode"],"title":"CampaignGenerationSlotOutputData"},"CampaignGenerationSlotSourceData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"sourceType":{"$ref":"#/components/schemas/CampaignSourceType"},"brief":{"anyOf":[{"$ref":"#/components/schemas/CampaignBriefCompositionData"},{"type":"null"}]},"nicheTopic":{"type":["string","null"]},"feedUrl":{"type":["string","null"]},"topicId":{"type":["integer","null"]},"sortOrder":{"type":"integer"}},"required":["id","name","sourceType","brief","nicheTopic","feedUrl","topicId","sortOrder"],"title":"CampaignGenerationSlotSourceData"},"CampaignGoal":{"type":"string","enum":["awareness","traffic","leads","sales","retention","custom"],"title":"CampaignGoal"},"CampaignGoalMetricType":{"type":"string","enum":["leads","reach","clicks","conversions","engagement","revenue","custom"],"title":"CampaignGoalMetricType"},"CampaignGoalTargetData":{"type":"object","properties":{"position":{"type":"integer"},"metric":{"$ref":"#/components/schemas/CampaignGoalTargetMetric"},"conversionActionId":{"type":["integer","null"]},"operator":{"$ref":"#/components/schemas/CampaignGoalTargetOperator"},"value":{"type":"number"}},"required":["position","metric","conversionActionId","operator","value"],"title":"CampaignGoalTargetData"},"CampaignGoalTargetGroupData":{"type":"object","properties":{"position":{"type":"integer"},"operator":{"$ref":"#/components/schemas/ConditionGroupOperator"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CampaignGoalTargetData"}}},"required":["position","operator","targets"],"title":"CampaignGoalTargetGroupData"},"CampaignGoalTargetMetric":{"type":"string","enum":["all","money","reach","visits","unsubscribes","conversion_action"],"title":"CampaignGoalTargetMetric"},"CampaignGoalTargetOperator":{"type":"string","enum":["gte","lte"],"title":"CampaignGoalTargetOperator"},"CampaignGoalTargetsData":{"type":"object","properties":{"operator":{"$ref":"#/components/schemas/ConditionGroupOperator"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CampaignGoalTargetData"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/CampaignGoalTargetGroupData"}}},"required":["operator","targets","groups"],"title":"CampaignGoalTargetsData"},"CampaignHashtagStrategy":{"type":"string","enum":["none","minimal","trending","branded"],"title":"CampaignHashtagStrategy"},"CampaignMode":{"type":"string","enum":["burst","evergreen","nurture"],"title":"CampaignMode"},"CampaignOrigin":{"type":"string","enum":["manual","ai","standalone_entity","autopilot_articles","autopilot_emails","autopilot_social_posts"],"title":"CampaignOrigin"},"CampaignOverviewData":{"type":"object","properties":{"kpis":{"$ref":"#/components/schemas/CampaignOverviewKpisData","description":"The main numbers: active campaigns, reach, clicks, leads, deals and won deals. A number you may not read is null."},"revenue":{"type":["array","null"],"items":{"$ref":"#/components/schemas/OverviewMoneyKpiData"},"description":"Money from won deals, one item per currency. null without deals.read."},"bestCampaigns":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CampaignOverviewRankItemData"},"description":"The campaigns that brought the most leads. null without leads.read."},"goals":{"type":"array","items":{"$ref":"#/components/schemas/CampaignOverviewGoalData"},"description":"How far each campaign is with its main number."},"countByOrigin":{"type":"object","additionalProperties":{"type":"integer"},"description":"How many campaigns come from each origin. The key is the origin."},"ready":{"type":"boolean","description":"false while Fusio is still counting the numbers. Then the lists are empty; try again later."},"rolledUpAt":{"type":["string","null"],"description":"When Fusio last counted the numbers."},"range":{"$ref":"#/components/schemas/OverviewRangeData"},"previousRange":{"anyOf":[{"$ref":"#/components/schemas/OverviewRangeData"},{"type":"null"}],"description":"The range just before, when you sent compare=true. Otherwise null."},"dates":{"type":"array","items":{"type":"string"},"description":"Every day of the range. Day lists in the answer follow this order."}},"required":["kpis","revenue","bestCampaigns","goals","countByOrigin","ready","rolledUpAt","range","previousRange","dates"],"title":"CampaignOverviewData"},"CampaignOverviewGoalData":{"type":"object","properties":{"campaignId":{"type":"integer"},"campaignName":{"type":"string"},"metricType":{"$ref":"#/components/schemas/CampaignGoalMetricType"},"label":{"type":["string","null"]},"target":{"type":"number"},"value":{"type":"number"},"currency":{"type":["string","null"]}},"required":["campaignId","campaignName","metricType","label","target","value","currency"],"title":"CampaignOverviewGoalData"},"CampaignOverviewKpisData":{"type":"object","properties":{"active":{"$ref":"#/components/schemas/OverviewKpiData"},"reach":{"anyOf":[{"$ref":"#/components/schemas/OverviewKpiData"},{"type":"null"}]},"clicks":{"anyOf":[{"$ref":"#/components/schemas/OverviewKpiData"},{"type":"null"}]},"leads":{"anyOf":[{"$ref":"#/components/schemas/OverviewKpiData"},{"type":"null"}]},"deals":{"anyOf":[{"$ref":"#/components/schemas/OverviewKpiData"},{"type":"null"}]},"wonDeals":{"anyOf":[{"$ref":"#/components/schemas/OverviewKpiData"},{"type":"null"}]}},"required":["active","reach","clicks","leads","deals","wonDeals"],"title":"CampaignOverviewKpisData"},"CampaignOverviewRankItemData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string"},"leads":{"type":"integer"}},"required":["id","name","status","leads"],"title":"CampaignOverviewRankItemData"},"CampaignOverviewTimelineData":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CampaignOverviewTimelineItemData"},"description":"The campaigns that run at some point in the range, with their start, end and number of content pieces."},"total":{"type":"integer","description":"How many campaigns there are in all."}},"required":["items","total"],"title":"CampaignOverviewTimelineData"},"CampaignOverviewTimelineItemData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"assetCount":{"type":"integer"}},"required":["id","name","status","startDate","endDate","assetCount"],"title":"CampaignOverviewTimelineItemData"},"CampaignPrePlanEstimateData":{"type":"object","properties":{"planCredits":{"type":"integer"},"assetCredits":{"type":"integer"},"sourceCredits":{"type":"integer"},"firstBatchCredits":{"type":"integer"},"totalCredits":{"type":"integer","description":"The credits the whole plan would cost."},"lines":{"type":"array","items":{"$ref":"#/components/schemas/CampaignPrePlanEstimateLineData"}}},"required":["planCredits","assetCredits","sourceCredits","firstBatchCredits","totalCredits","lines"],"title":"CampaignPrePlanEstimateData"},"CampaignPrePlanEstimateLineData":{"type":"object","properties":{"destination":{"type":"string"},"assetCredits":{"type":"integer"},"sourceCredits":{"type":"integer"}},"required":["destination","assetCredits","sourceCredits"],"title":"CampaignPrePlanEstimateLineData"},"CampaignProfileCompetitorStanceData":{"type":"object","properties":{"competitorId":{"type":["integer","null"]},"competitorName":{"type":"string"},"tier":{"type":"string"},"fallsShort":{"type":"string"},"ourWedge":{"type":"string"}},"required":["competitorId","competitorName","tier","fallsShort","ourWedge"],"title":"CampaignProfileCompetitorStanceData"},"CampaignProfileData":{"type":"object","properties":{"targetPersona":{"$ref":"#/components/schemas/CampaignProfilePersonaData"},"positioning":{"$ref":"#/components/schemas/CampaignProfilePositioningData"},"switchingForces":{"$ref":"#/components/schemas/CampaignProfileSwitchingForcesData"},"brandVoiceId":{"type":["integer","null"]},"brandVoiceRationale":{"type":"string"},"productId":{"type":["integer","null"]},"productFraming":{"type":"string"},"proofBank":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProfileProofData"}},"selectedCustomerIds":{"type":"array","items":{"type":"integer"}},"selectedCompetitorIds":{"type":"array","items":{"type":"integer"}}},"required":["targetPersona","positioning","switchingForces","brandVoiceId","brandVoiceRationale","productId","productFraming","proofBank","selectedCustomerIds","selectedCompetitorIds"],"title":"CampaignProfileData"},"CampaignProfilePersonaData":{"type":"object","properties":{"role":{"type":"string"},"companyContext":{"type":"string"},"primaryJtbd":{"type":"string"},"topObjections":{"type":"array","items":{"type":"string"}},"keyVocabulary":{"type":"array","items":{"type":"string"}},"confidence":{"type":"string"}},"required":["role","companyContext","primaryJtbd","topObjections","keyVocabulary","confidence"],"title":"CampaignProfilePersonaData"},"CampaignProfilePositioningData":{"type":"object","properties":{"perCompetitor":{"type":"array","items":{"$ref":"#/components/schemas/CampaignProfileCompetitorStanceData"}},"differentiationAngle":{"type":"string"},"avoidList":{"type":"array","items":{"type":"string"}}},"required":["perCompetitor","differentiationAngle","avoidList"],"title":"CampaignProfilePositioningData"},"CampaignProfileProofData":{"type":"object","properties":{"valueTheme":{"type":"string"},"evidence":{"type":"string"}},"required":["valueTheme","evidence"],"title":"CampaignProfileProofData"},"CampaignProfileSwitchingForcesData":{"type":"object","properties":{"push":{"type":"string"},"pull":{"type":"string"},"habit":{"type":"string"},"anxiety":{"type":"string"}},"required":["push","pull","habit","anxiety"],"title":"CampaignProfileSwitchingForcesData"},"CampaignReferenceData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"origin":{"$ref":"#/components/schemas/CampaignOrigin"}},"required":["id","name","origin"],"title":"CampaignReferenceData"},"CampaignSimilarityAction":{"type":"string","enum":["skip","require_approval"],"title":"CampaignSimilarityAction"},"CampaignSocialNetwork":{"type":"string","enum":["facebook","instagram","x","linkedin"],"title":"CampaignSocialNetwork"},"CampaignSourceBlueprintSummaryData":{"type":"object","properties":{"id":{"type":"integer"},"workingTitle":{"type":"string"},"angle":{"type":"string"},"angleType":{"type":["string","null"]},"primaryHook":{"type":"string"},"sourceId":{"type":["integer","null"]},"sourceName":{"type":["string","null"]}},"required":["id","workingTitle","angle","angleType","primaryHook","sourceId","sourceName"],"title":"CampaignSourceBlueprintSummaryData"},"CampaignSourceDocumentOutputData":{"type":"object","properties":{"id":{"type":"integer"},"campaignSourceId":{"type":"integer"},"fileId":{"type":"integer"},"name":{"type":["string","null"]},"extension":{"type":["string","null"]},"size":{"type":["integer","null"]}},"required":["id","campaignSourceId","fileId","name","extension","size"],"title":"CampaignSourceDocumentOutputData"},"CampaignSourceOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"campaignId":{"type":"integer"},"sourceType":{"$ref":"#/components/schemas/CampaignSourceType"},"name":{"type":"string"},"brief":{"anyOf":[{"$ref":"#/components/schemas/CampaignBriefCompositionData"},{"type":"null"}]},"seedAngles":{"type":"array","items":{"type":"string"}},"angleType":{"anyOf":[{"$ref":"#/components/schemas/CampaignAngle"},{"type":"null"}]},"nicheTopic":{"type":["string","null"]},"feedUrl":{"type":["string","null"]},"pollingIntervalMinutes":{"type":["integer","null"]},"topicId":{"type":["integer","null"]},"topicFeedId":{"type":["integer","null"]},"topicPickMode":{"anyOf":[{"$ref":"#/components/schemas/CampaignTopicPickMode"},{"type":"null"}]},"topicPickWindowSize":{"type":["integer","null"]},"lastPolledAt":{"type":["string","null"]},"lastItemHash":{"type":["string","null"]},"keywords":{},"urls":{},"documents":{"type":"array","items":{"$ref":"#/components/schemas/CampaignSourceDocumentOutputData"}},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","campaignId","sourceType","name","brief","seedAngles","angleType","nicheTopic","feedUrl","pollingIntervalMinutes","topicId","topicFeedId","topicPickMode","topicPickWindowSize","lastPolledAt","lastItemHash","keywords","urls","documents","createdAt","updatedAt"],"title":"CampaignSourceOutputData"},"CampaignSourceSelectionStrategy":{"type":"string","enum":["newest","random","round_robin"],"title":"CampaignSourceSelectionStrategy"},"CampaignSourceType":{"type":"string","enum":["brief","url_list","knowledge_base","topic_ref","topic_feed_ref","article_ref"],"title":"CampaignSourceType"},"CampaignStatus":{"type":"string","enum":["draft","approved","scheduled","active","paused","completed","cancelled","archived"],"title":"CampaignStatus"},"CampaignTopicPickMode":{"type":"string","enum":["latest_relevant","newest_unused"],"title":"CampaignTopicPickMode"},"CanonicalAdsTargetingData":{"type":"object","properties":{"locations":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"ageRanges":{"type":"array","items":{"type":"string"}},"genders":{"type":"array","items":{"type":"string"}},"interests":{"type":"array","items":{"type":"string"}},"behaviors":{"type":"array","items":{"type":"string"}},"jobTitles":{"type":"array","items":{"type":"string"}},"seniorities":{"type":"array","items":{"type":"string"}},"industries":{"type":"array","items":{"type":"string"}},"companySizes":{"type":"array","items":{"type":"string"}},"purchaseSignals":{"type":"array","items":{"type":"string"}},"searchThemes":{"type":"array","items":{"type":"string"}},"exclusions":{"type":"array","items":{"type":"string"}}},"required":["locations","languages","ageRanges","genders","interests","behaviors","jobTitles","seniorities","industries","companySizes","purchaseSignals","searchThemes","exclusions"],"title":"CanonicalAdsTargetingData"},"CapabilitiesData":{"type":"object","properties":{"capability":{"type":"string"},"description":{"type":"string"}},"required":["capability","description"],"title":"CapabilitiesData"},"CaptionVoice":{"type":"string","enum":["company","mascot"],"title":"CaptionVoice"},"ChildDocumentOutputData":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"relationType":{"$ref":"#/components/schemas/DocumentRelationType"},"status":{"$ref":"#/components/schemas/DocumentStatus"}},"required":["id","title","relationType","status"],"title":"ChildDocumentOutputData"},"ClarificationQuestionData":{"type":"object","properties":{"key":{"type":"string","description":"The key to use for your answer in priorAnswers."},"label":{"type":"string","description":"A short name of the question."},"question":{"type":"string","description":"The question."},"inputType":{"$ref":"#/components/schemas/FollowUpInputType","description":"How to answer: single_choice (pick one), multi_choice (pick some), text or date."},"options":{"type":["array","null"],"items":{"$ref":"#/components/schemas/FollowUpQuestionOptionData"},"description":"The choices for single_choice and multi_choice, or null."},"allowSkip":{"type":"boolean","description":"true when you may skip the question."},"suggestedValue":{"type":["string","null"],"description":"The answer AI suggests, or null."}},"required":["key","label","question","inputType","options","allowSkip","suggestedValue"],"title":"ClarificationQuestionData"},"ClarificationResultData":{"type":"object","properties":{"proceed":{"type":"boolean","description":"true when AI knows enough; then contextBundle is ready. false when AI has questions first."},"contextBundle":{"anyOf":[{"$ref":"#/components/schemas/ContextBundleData"},{"type":"null"}],"description":"The brief to send to generate when proceed is true, or null when questions come first."},"questions":{"type":"array","items":{"$ref":"#/components/schemas/ClarificationQuestionData"},"description":"The questions of AI when proceed is false. Empty when proceed is true."}},"required":["proceed","contextBundle","questions"],"title":"ClarificationResultData"},"CommunicationPreferenceEmailFormat":{"type":"string","enum":["html","text"],"title":"CommunicationPreferenceEmailFormat"},"CommunicationPreferenceOwnerType":{"type":"string","enum":["contact","lead"],"title":"CommunicationPreferenceOwnerType"},"CompanyAgeBand":{"type":"string","enum":["new","young","established","mature"],"title":"CompanyAgeBand"},"ConditionGroupOperator":{"type":"string","enum":["and","or"],"title":"ConditionGroupOperator"},"ConditionGroupOutputData":{"type":"object","properties":{"id":{"type":["integer","null"]},"position":{"type":"integer"},"operator":{"type":"string"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionOutputData"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/ConditionGroupOutputData"}}},"required":["id","position","operator","conditions","groups"],"title":"ConditionGroupOutputData"},"ConditionOperator":{"type":"string","enum":["equals","not_equals","less_than","greater_than","less_or_equal","greater_or_equal","in","not_in","before","after","within_days","older_than_days"],"title":"ConditionOperator"},"ConditionOutputData":{"type":"object","properties":{"id":{"type":"integer"},"position":{"type":"integer"},"property":{"type":"string"},"customFieldId":{"type":["integer","null"]},"customFieldLabel":{"type":["string","null"]},"operator":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"valueLabels":{"type":"array","items":{}}},"required":["id","position","property","customFieldId","customFieldLabel","operator","values","valueLabels"],"title":"ConditionOutputData"},"ConditionProperty":{"type":"string","enum":["stage","engagement_score","user_id","source","name","city","last_activity_at","created_at","has_email","is_unsubscribed","tags","segments","custom_field","lead_id"],"title":"ConditionProperty"},"ConsentSource":{"type":"string","enum":["mail_provider","preference_center","admin_panel","api","form_submission","crm_import"],"title":"ConsentSource"},"ConsentStatus":{"type":"string","enum":["subscribed","unsubscribed","not_specified"],"title":"ConsentStatus"},"ContactAnalyticsHistoryItemOutputData":{"type":"object","properties":{"type":{"type":"string"},"source":{"type":"string"},"channel":{"type":["string","null"]},"eventName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"date":{"type":"string"},"context":{"type":["string","null"]},"url":{"type":["string","null"]},"country":{"type":["string","null"]},"deviceType":{"type":["string","null"]},"trackableId":{"type":"integer"},"trackableType":{"anyOf":[{"$ref":"#/components/schemas/TrackableType"},{"type":"null"}]},"leadFormId":{"type":["integer","null"]},"leadFormName":{"type":["string","null"]},"submissionId":{"type":["integer","null"]},"browser":{"type":["string","null"]},"operatingSystem":{"type":["string","null"]},"locale":{"type":["string","null"]},"referer":{"type":["string","null"]},"path":{"type":["string","null"]},"hostname":{"type":["string","null"]},"origin":{"type":["string","null"]},"utmSource":{"type":["string","null"]},"utmMedium":{"type":["string","null"]},"utmCampaign":{"type":["string","null"]},"utmTerm":{"type":["string","null"]},"utmContent":{"type":["string","null"]},"clickIdSource":{"type":["string","null"]},"clickIdValue":{"type":["string","null"]},"consentState":{"type":["string","null"]},"ingestSource":{"type":["string","null"]},"result":{"type":["string","null"]},"visitorSessionId":{"type":["integer","null"]},"payload":{"type":["string","null"]},"recipientEmail":{"type":["string","null"]},"deliveryStatus":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"bouncedAt":{"type":["string","null"]},"bounceReason":{"type":["string","null"]},"bounceType":{"type":["string","null"]},"bounceCode":{"type":["string","null"]},"smtpCode":{"type":["string","null"]},"unsubscribedAt":{"type":["string","null"]},"unsubscribeReason":{"type":["string","null"]},"spamComplaintAt":{"type":["string","null"]},"envelopeId":{"type":["string","null"]},"sourceId":{"type":"integer"}},"required":["type","source","channel","eventName","campaignName","date","context","url","country","deviceType","trackableId","trackableType","leadFormId","leadFormName","submissionId","browser","operatingSystem","locale","referer","path","hostname","origin","utmSource","utmMedium","utmCampaign","utmTerm","utmContent","clickIdSource","clickIdValue","consentState","ingestSource","result","visitorSessionId","payload","recipientEmail","deliveryStatus","deliveredAt","bouncedAt","bounceReason","bounceType","bounceCode","smtpCode","unsubscribedAt","unsubscribeReason","spamComplaintAt","envelopeId","sourceId"],"title":"ContactAnalyticsHistoryItemOutputData"},"ContactAnalyticsOutputData":{"type":"object","properties":{"stats":{"anyOf":[{"$ref":"#/components/schemas/ContactAnalyticsStatsOutputData"},{"type":"null"}],"description":"Counts of sent, opened and clicked emails. null when Fusio has no numbers for the contact yet."},"history":{"type":"array","items":{"$ref":"#/components/schemas/ContactAnalyticsHistoryItemOutputData"},"description":"What happened with the emails and the web, newest first."}},"required":["stats","history"],"title":"ContactAnalyticsOutputData"},"ContactAnalyticsStatsOutputData":{"type":"object","properties":{"totalSent":{"type":"integer"},"totalOpens":{"type":"integer"},"totalClicks":{"type":"integer"},"lastOpenAt":{"type":["string","null"]},"lastClickAt":{"type":["string","null"]},"engagementScore":{"type":"integer","description":"How much the person reacts, as points. More is better."},"heatStatus":{"$ref":"#/components/schemas/HeatStatus","description":"How warm the person is right now, from the reactions."},"frequencyRatio":{"type":"number"},"respondedCampaigns":{"type":"integer"},"totalCampaigns":{"type":"integer"}},"required":["totalSent","totalOpens","totalClicks","lastOpenAt","lastClickAt","engagementScore","heatStatus","frequencyRatio","respondedCampaigns","totalCampaigns"],"title":"ContactAnalyticsStatsOutputData"},"ContactEmailsData":{"type":"object","properties":{"sequences":{"type":"array","items":{"$ref":"#/components/schemas/PrivateOutreachSequenceData"},"description":"The email sequences the person is in."},"scheduledEmails":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledPersonalEmailData"},"description":"Emails planned to go out later."},"drafts":{"type":"array","items":{"$ref":"#/components/schemas/PersonalEmailDraftData"},"description":"Drafts that are not sent yet. You see only your own."},"conversations":{"type":"array","items":{"$ref":"#/components/schemas/EmailConversationData"},"description":"Email talks with the person."},"nextCursor":{"$ref":"#/components/schemas/ContactEmailsNextCursorData","description":"Where the next page of each part starts. null when there is no more."}},"required":["sequences","scheduledEmails","drafts","conversations","nextCursor"],"title":"ContactEmailsData"},"ContactEmailsNextCursorData":{"type":"object","properties":{"sequences":{"type":["string","null"]},"scheduledEmails":{"type":["string","null"]},"drafts":{"type":["string","null"]},"conversations":{"type":["string","null"]}},"required":["sequences","scheduledEmails","drafts","conversations"],"title":"ContactEmailsNextCursorData"},"ContactHistoryPageOutputData":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadHistoryRowData"},"description":"The events, newest first."},"path":{"type":["string","null"]},"per_page":{"type":"integer"},"next_cursor":{"type":["string","null"],"description":"Send it as cursor to get the next page. null on the last page."},"next_page_url":{"type":["string","null"]},"prev_cursor":{"type":["string","null"],"description":"Send it as cursor to go one page back. null on the first page."},"prev_page_url":{"type":["string","null"]},"typeCounts":{"anyOf":[{"$ref":"#/components/schemas/ContactHistoryTypeCountsData"},{"type":"null"}],"description":"How many events of each type there are. Only on the first page; later pages have null."}},"required":["data","path","per_page","next_cursor","next_page_url","prev_cursor","prev_page_url","typeCounts"],"title":"ContactHistoryPageOutputData"},"ContactHistoryTypeCountsData":{"type":"object","properties":{"click":{"type":"integer"},"open":{"type":"integer"},"sent":{"type":"integer"},"web":{"type":"integer"},"booking":{"type":"integer"},"deal":{"type":"integer"},"note":{"type":"integer"},"task":{"type":"integer"},"inquiry":{"type":"integer"},"email":{"type":"integer"},"form":{"type":"integer"},"ad":{"type":"integer"}},"required":["click","open","sent","web","booking","deal","note","task","inquiry","email","form","ad"],"title":"ContactHistoryTypeCountsData"},"ContactOutreachSummaryData":{"type":"object","properties":{"activeSequenceName":{"type":["string","null"]},"currentStep":{"type":["integer","null"]},"stepCount":{"type":["integer","null"]},"nextTouchAt":{"type":["string","null"]},"scheduledCount":{"type":"integer"}},"required":["activeSequenceName","currentStep","stepCount","nextTouchAt","scheduledCount"],"title":"ContactOutreachSummaryData"},"ContactTimeSeriesItemOutputData":{"type":"object","properties":{"date":{"type":"string","description":"The day."},"sent":{"type":"integer","description":"Emails sent that day."},"opens":{"type":"integer","description":"Opens that day."},"clicks":{"type":"integer","description":"Clicks that day."}},"required":["date","sent","opens","clicks"],"title":"ContactTimeSeriesItemOutputData"},"ContactType":{"type":"string","enum":["company","personal"],"title":"ContactType"},"ContextBundleData":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/AssetGenerationOrigin","description":"standalone (a piece on its own) or campaign (a piece for a campaign)."},"goal":{"type":"string","description":"What the piece should do."},"audience":{"type":"string","description":"Who the piece is for."},"topicOrAngle":{"type":"string","description":"The topic, or the side of it the piece looks at."},"hookCategory":{"$ref":"#/components/schemas/HookCategory","description":"How the start grabs attention, one of the values the kind of piece allows."},"formatHint":{"type":["string","null"],"description":"A hint about the shape, like a list or a story, or null."},"contentAtom":{"type":"string","description":"The one main idea the piece carries."},"campaignSummary":{"type":["string","null"],"description":"A short summary of the campaign, or null."},"sourceDigest":{"type":["string","null"],"description":"A short summary of the sources to write from, or null."},"recentAssets":{"type":["string","null"],"description":"What you published lately, so AI does not repeat it, or null."},"audienceWarmth":{"anyOf":[{"$ref":"#/components/schemas/CampaignAudienceWarmth"},{"type":"null"}],"description":"For emails, how well the people know you: cold, warm or owned (they signed up). null for other pieces."},"emailKind":{"type":["string","null"],"description":"For emails: broadcast. null for other pieces."},"assetBrief":{"anyOf":[{"$ref":"#/components/schemas/AssetBriefData"},{"type":"null"}],"description":"Extra hints from a campaign, or null."},"citableSources":{"description":"Sources the piece may cite, each with title and url."},"sourceMaterial":{"type":["string","null"],"description":"Text to write from, or null."},"allowWebResearch":{"type":"boolean","description":"true when AI may look things up on the web."},"internalLinkTargets":{"description":"Pages of your website the piece may link to, each with title, url and keyword."},"offerRole":{"type":["string","null"],"description":"The role of the offer: attraction, upsell, downsell or continuity, or null."},"hashtagStrategy":{"anyOf":[{"$ref":"#/components/schemas/CampaignHashtagStrategy"},{"type":"null"}],"description":"For social posts, how hashtags are used: none, minimal, trending or branded. null for other pieces."},"generateFirstComment":{"type":"boolean","description":"true when AI also writes the first comment under the post."},"firstCommentGuidance":{"type":["string","null"],"description":"What the first comment should say, or null."},"ctaUrl":{"type":["string","null"],"description":"The page the button of an email leads to, or null."}},"required":["origin","goal","audience","topicOrAngle","hookCategory","formatHint","contentAtom","campaignSummary","sourceDigest","recentAssets","audienceWarmth","emailKind","assetBrief","citableSources","sourceMaterial","allowWebResearch","internalLinkTargets","offerRole","hashtagStrategy","generateFirstComment","firstCommentGuidance","ctaUrl"],"title":"ContextBundleData"},"ContractType":{"type":"string","enum":["subscription","services","nda","dpa","framework","other"],"title":"ContractType"},"ConversionActionCategory":{"type":"string","enum":["lead","meeting","reply","purchase","subscription","deal","visit","other"],"title":"ConversionActionCategory"},"ConversionValueTotalData":{"type":"object","properties":{"currencyCode":{"type":"string"},"amount":{"type":"string"}},"required":["currencyCode","amount"],"title":"ConversionValueTotalData"},"CustomFieldType":{"type":"string","enum":["text","number","date","boolean","select","multi_select"],"title":"CustomFieldType"},"CustomerRevenueData":{"type":"object","properties":{"deals":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ConversionValueTotalData"}},"invoices":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ConversionValueTotalData"}}},"required":["deals","invoices"],"title":"CustomerRevenueData"},"CustomerType":{"type":"string","enum":["business","consumer","both"],"title":"CustomerType"},"CzechRegion":{"type":"string","enum":["Hlavní město Praha","Středočeský kraj","Jihočeský kraj","Plzeňský kraj","Karlovarský kraj","Ústecký kraj","Liberecký kraj","Královéhradecký kraj","Pardubický kraj","Kraj Vysočina","Jihomoravský kraj","Olomoucký kraj","Zlínský kraj","Moravskoslezský kraj"],"title":"CzechRegion"},"DealBillingInterval":{"type":"string","enum":["one_time","monthly","yearly"],"title":"DealBillingInterval"},"DealBoardData":{"type":"object","properties":{"activeCount":{"type":"integer"},"pipelineValues":{"type":"array","items":{"$ref":"#/components/schemas/DealCurrencyValueData"}},"pipelineByStage":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DealPipelineStageData"}}},"required":["activeCount","pipelineValues","pipelineByStage"],"title":"DealBoardData"},"DealClientLinkOutputData":{"type":"object","properties":{"url":{"type":"string"},"leadContactId":{"type":["integer","null"]},"recipientName":{"type":"string"},"recipientEmail":{"type":"string"},"mode":{"$ref":"#/components/schemas/DealClosingMode"},"requiresPayment":{"type":"boolean"},"remindsClient":{"type":"boolean"},"reminderOn":{"type":["string","null"]},"remindedAt":{"type":["string","null"]},"sentAt":{"type":"string"},"lastSentAt":{"type":"string"},"viewedAt":{"type":["string","null"]},"acceptedAt":{"type":["string","null"]},"paymentClaimedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"invoiceId":{"type":["integer","null"]},"invoiceNumber":{"type":["string","null"]},"signingEnvelopeId":{"type":["integer","null"]},"invoiceFailedAt":{"type":["string","null"]}},"required":["url","leadContactId","recipientName","recipientEmail","mode","requiresPayment","remindsClient","reminderOn","remindedAt","sentAt","lastSentAt","viewedAt","acceptedAt","paymentClaimedAt","paidAt","invoiceId","invoiceNumber","signingEnvelopeId","invoiceFailedAt"],"title":"DealClientLinkOutputData"},"DealClosingCheck":{"type":"string","enum":["items","contact","document","account"],"title":"DealClosingCheck"},"DealClosingCheckOutputData":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/DealClosingCheck"},"isOk":{"type":"boolean"},"issues":{"type":"array","items":{"$ref":"#/components/schemas/DealClosingIssue"}},"documentId":{"type":["integer","null"]},"title":{"type":["string","null"]},"isSigned":{"type":"boolean"},"missingFields":{"type":"array","items":{"type":"string"}},"templateId":{"type":["integer","null"]},"productName":{"type":["string","null"]},"contractScope":{"anyOf":[{"$ref":"#/components/schemas/DealProductContractScope"},{"type":"null"}]}},"required":["key","isOk","issues","documentId","title","isSigned","missingFields","templateId","productName","contractScope"],"title":"DealClosingCheckOutputData"},"DealClosingIssue":{"type":"string","enum":["no_items","no_primary_contact","no_contact_email","no_document_version","document_not_ready","missing_fields","missing_client_signature_place","missing_organization_signature_place","no_account","account_currency_mismatch","account_incomplete","fakturoid_account_missing","account_not_from_fakturoid","invoice_supplier_missing","invoice_buyer_missing","invoice_currency_mismatch","invoice_vat_invalid","invoice_issuer_forbidden"],"title":"DealClosingIssue"},"DealClosingMode":{"type":"string","enum":["confirm","sign"],"title":"DealClosingMode"},"DealClosingOutputData":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/DealClosingMode"},"effectiveMode":{"$ref":"#/components/schemas/DealClosingMode"},"isSignForced":{"type":"boolean"},"requiresPayment":{"type":"boolean"},"bankAccountId":{"type":["integer","null"]},"paymentAccount":{"anyOf":[{"$ref":"#/components/schemas/TenantBankAccountOutputData"},{"type":"null"}]},"paymentIban":{"type":["string","null"]},"isReady":{"type":"boolean"},"missingCount":{"type":"integer"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/DealClosingCheckOutputData"}},"recipient":{"anyOf":[{"$ref":"#/components/schemas/DealClosingRecipientOutputData"},{"type":"null"}]},"clientLink":{"anyOf":[{"$ref":"#/components/schemas/DealClientLinkOutputData"},{"type":"null"}]},"hasFakturoid":{"type":"boolean"}},"required":["mode","effectiveMode","isSignForced","requiresPayment","bankAccountId","paymentAccount","paymentIban","isReady","missingCount","checks","recipient","clientLink","hasFakturoid"],"title":"DealClosingOutputData"},"DealClosingRecipientOutputData":{"type":"object","properties":{"leadContactId":{"type":"integer"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["leadContactId","name","email","phone"],"title":"DealClosingRecipientOutputData"},"DealContactOutputData":{"type":"object","properties":{"leadContactId":{"type":"integer"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/DealContactRole"}},"leadContact":{"$ref":"#/components/schemas/LeadContact.IndexLeadContactData"}},"required":["leadContactId","roles","leadContact"],"title":"DealContactOutputData"},"DealContactRole":{"type":"string","enum":["primary","decision_maker","billing","technical","legal","other"],"title":"DealContactRole"},"DealCurrencyValueData":{"type":"object","properties":{"currency":{"type":"string"},"value":{"type":"string"}},"required":["currency","value"],"title":"DealCurrencyValueData"},"DealForecastData":{"type":"object","properties":{"currency":{"type":"string"},"won":{"type":"string"},"weighted":{"type":"string"},"estimate":{"type":"string"},"bestCase":{"type":"string"}},"required":["currency","won","weighted","estimate","bestCase"],"title":"DealForecastData"},"DealLineItemOutputData":{"type":"object","properties":{"id":{"type":"integer"},"sortOrder":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"quantity":{"type":"string"},"unit":{"type":"string"},"unitPrice":{"type":"string"},"discountPercent":{"type":"string"},"vatRate":{"type":"string"},"net":{"type":"string"},"tax":{"type":"string"},"gross":{"type":"string"},"productId":{"type":["integer","null"]},"billingInterval":{"$ref":"#/components/schemas/DealBillingInterval"},"giftPeriods":{"type":["integer","null"],"description":"How many billing cycles the item is free. null for no gift."},"listUnitPrice":{"type":["string","null"]}},"required":["id","sortOrder","name","description","quantity","unit","unitPrice","discountPercent","vatRate","net","tax","gross","productId","billingInterval","giftPeriods","listUnitPrice"],"title":"DealLineItemOutputData"},"DealLostReason":{"type":"string","enum":["budget","timing","competitor","no_decision","poor_fit","other"],"title":"DealLostReason"},"DealMoneyTotalsData":{"type":"object","properties":{"net":{"type":"string"},"tax":{"type":"string"},"gross":{"type":"string"}},"required":["net","tax","gross"],"title":"DealMoneyTotalsData"},"DealNoteOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"user":{"anyOf":[{"$ref":"#/components/schemas/UserSummaryData"},{"type":"null"}]},"noteableType":{"anyOf":[{"$ref":"#/components/schemas/NoteableType"},{"type":"null"}]},"noteableId":{"type":"integer"},"body":{"type":"string"},"leadOutreachTouchId":{"type":["integer","null"]},"outreachTouch":{"anyOf":[{"$ref":"#/components/schemas/NoteOutreachTouchData"},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"pinnedAt":{"type":["string","null"]}},"required":["id","tenantId","userId","user","noteableType","noteableId","body","leadOutreachTouchId","outreachTouch","createdAt","updatedAt","pinnedAt"],"title":"DealNoteOutputData"},"DealOutputData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the deal."},"leadId":{"type":"integer","description":"The number of the lead you sell to."},"userId":{"type":"integer","description":"The member who added the deal."},"tenantId":{"type":"integer"},"name":{"type":"string"},"stage":{"$ref":"#/components/schemas/DealStage","description":"Where the deal is: discovery, qualification, proposal, negotiation, won or lost."},"estimatedValue":{"type":["string","null"],"description":"The value you guessed, as text. null when you have none."},"winProbability":{"type":"integer","description":"The chance to win in percent."},"currency":{"type":"string"},"priceInputMode":{"$ref":"#/components/schemas/PriceInputMode"},"defaultVatRate":{"type":"string"},"totals":{"$ref":"#/components/schemas/DealMoneyTotalsData","description":"The sum of all items without VAT (net), the VAT (tax) and with VAT (gross)."},"value":{"type":["string","null"],"description":"The value of the deal: the total with VAT when it has items, otherwise estimatedValue."},"lineItems":{"type":"array","items":{"$ref":"#/components/schemas/DealLineItemOutputData"},"description":"The items, in order."},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/DealContactOutputData"},"description":"The contacts of the deal with their roles."},"documents":{"type":"array","items":{"$ref":"#/components/schemas/DocumentOutputData"},"description":"The documents of the deal."},"requiredDocuments":{"type":"array","items":{"$ref":"#/components/schemas/DocumentOutputData"},"description":"The documents that must be signed before you can win the deal."},"expectedCloseDate":{"type":["string","null"]},"closedAt":{"type":["string","null"],"description":"When the deal was won or lost. null while it is open."},"lostReason":{"anyOf":[{"$ref":"#/components/schemas/DealLostReason"},{"type":"null"}]},"lostReasonNote":{"type":["string","null"]},"lead":{"$ref":"#/components/schemas/UpdateLeadData","description":"The lead of the deal."},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/DealTaskOutputData"},"description":"The tasks of your team about the deal."},"notes":{"type":"array","items":{"$ref":"#/components/schemas/DealNoteOutputData"},"description":"The notes about the deal."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"activityCount":{"type":["integer","null"],"description":"How many entries the deal history has. Only this endpoint counts them; answers to changes send null."},"documentsCount":{"type":"integer","description":"How many documents the deal has."},"documentKinds":{"type":"array","items":{"$ref":"#/components/schemas/DocumentKind"},"description":"The kinds of documents the deal has, each once."},"billingDetailsComplete":{"type":["boolean","null"],"description":"true when the client has a name, a company number and a full address for a Fusio subscription invoice. null for deals outside Fusio."},"hasSubscriptionOrder":{"type":["boolean","null"],"description":"true when a subscription order was made from the deal. null for deals outside Fusio."},"closing":{"anyOf":[{"$ref":"#/components/schemas/DealClosingOutputData"},{"type":"null"}]},"userName":{"type":["string","null"]},"invoicesCount":{"type":["integer","null"]}},"required":["id","leadId","userId","tenantId","name","stage","estimatedValue","winProbability","currency","priceInputMode","defaultVatRate","totals","value","lineItems","contacts","documents","requiredDocuments","expectedCloseDate","closedAt","lostReason","lostReasonNote","lead","tasks","notes","createdAt","updatedAt","activityCount","documentsCount","documentKinds","billingDetailsComplete","hasSubscriptionOrder","closing","userName","invoicesCount"],"title":"DealOutputData"},"DealOverviewData":{"type":"object","properties":{"defaultCurrency":{"type":"string","description":"The main currency of your company."},"kpis":{"$ref":"#/components/schemas/DealOverviewKpisData","description":"The main numbers: open, won and lost deals, the share of wins and how many days a deal takes to close."},"pipelineValues":{"type":"array","items":{"$ref":"#/components/schemas/OverviewMoneyKpiData"},"description":"The value of open deals, for each currency."},"wonValues":{"type":"array","items":{"$ref":"#/components/schemas/OverviewMoneyKpiData"},"description":"The value of won deals, for each currency."},"lostValues":{"type":"array","items":{"$ref":"#/components/schemas/OverviewMoneyKpiData"},"description":"The value of lost deals, for each currency."},"pipelineByStage":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DealPipelineStageData"},"description":"How many open deals are in each stage."},"lostReasonCounts":{"type":"object","additionalProperties":{"type":"integer"},"description":"How many deals were lost for each reason."},"forecast":{"type":"array","items":{"$ref":"#/components/schemas/DealForecastData"},"description":"What you may still win, for each currency: won, weighted by chance, estimated and best case."},"board":{"$ref":"#/components/schemas/DealBoardData","description":"The numbers of the board right now, not only for the range."},"ready":{"type":"boolean","description":"false while Fusio is still counting the numbers. Then the lists are empty; try again later."},"rolledUpAt":{"type":["string","null"],"description":"When Fusio last counted the numbers."},"range":{"$ref":"#/components/schemas/OverviewRangeData"},"previousRange":{"anyOf":[{"$ref":"#/components/schemas/OverviewRangeData"},{"type":"null"}],"description":"The range just before, when you sent compare=true. Otherwise null."},"dates":{"type":"array","items":{"type":"string"},"description":"Every day of the range. Day lists in the answer follow this order."}},"required":["defaultCurrency","kpis","pipelineValues","wonValues","lostValues","pipelineByStage","lostReasonCounts","forecast","board","ready","rolledUpAt","range","previousRange","dates"],"title":"DealOverviewData"},"DealOverviewKpisData":{"type":"object","properties":{"active":{"$ref":"#/components/schemas/OverviewKpiData"},"won":{"$ref":"#/components/schemas/OverviewKpiData"},"lost":{"$ref":"#/components/schemas/OverviewKpiData"},"winRate":{"$ref":"#/components/schemas/OverviewKpiData"},"averageClosingDays":{"$ref":"#/components/schemas/OverviewKpiData"}},"required":["active","won","lost","winRate","averageClosingDays"],"title":"DealOverviewKpisData"},"DealOwnerScope":{"type":"string","enum":["all","mine"],"title":"DealOwnerScope"},"DealPipelineStageData":{"type":"object","properties":{"count":{"type":"integer"},"values":{"type":"array","items":{"$ref":"#/components/schemas/DealCurrencyValueData"}}},"required":["count","values"],"title":"DealPipelineStageData"},"DealProductContractScope":{"type":"string","enum":["once_per_client","per_deal"],"title":"DealProductContractScope"},"DealProductContractTemplateOutputData":{"type":"object","properties":{"documentTemplateId":{"type":"integer"},"title":{"type":"string"},"contractType":{"anyOf":[{"$ref":"#/components/schemas/ContractType"},{"type":"null"}]},"scope":{"$ref":"#/components/schemas/DealProductContractScope"}},"required":["documentTemplateId","title","contractType","scope"],"title":"DealProductContractTemplateOutputData"},"DealProductData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"name":{"type":"string"},"sku":{"type":["string","null"]},"description":{"type":["string","null"]},"unit":{"type":"string"},"unitPrice":{"type":"string","description":"The price of one unit as text, like 1500.000000."},"currency":{"type":"string"},"vatRate":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"billingInterval":{"$ref":"#/components/schemas/DealBillingInterval"},"defaultQuantity":{"type":"string"},"defaultDiscountPercent":{"type":"string"},"dealsCount":{"type":"integer","description":"How many deals use the product."},"activeBillingPlansCount":{"type":"integer","description":"How many running payment plans use the product."},"contractTemplates":{"type":"array","items":{"$ref":"#/components/schemas/DealProductContractTemplateOutputData"}}},"required":["id","tenantId","name","sku","description","unit","unitPrice","currency","vatRate","isActive","createdAt","updatedAt","billingInterval","defaultQuantity","defaultDiscountPercent"],"title":"DealProductData"},"DealProductDealOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"companyName":{"type":["string","null"],"description":"The name of the lead of the deal."},"stage":{"$ref":"#/components/schemas/DealStage"},"totalGross":{"type":"string","description":"The total of the deal with VAT."},"currency":{"type":"string"}},"required":["id","name","companyName","stage","totalGross","currency"],"title":"DealProductDealOutputData"},"DealStage":{"type":"string","enum":["discovery","qualification","proposal","negotiation","won","lost"],"title":"DealStage"},"DealTaskOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"assigneeId":{"type":"integer"},"assignee":{"anyOf":[{"$ref":"#/components/schemas/UserSummaryData"},{"type":"null"}]},"taskableType":{"$ref":"#/components/schemas/TaskableType"},"taskableId":{"type":"integer"},"noteId":{"type":["integer","null"]},"title":{"type":"string"},"description":{"type":["string","null"]},"dueAt":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/TaskStatus"},"completedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","userId","assigneeId","assignee","taskableType","taskableId","noteId","title","description","dueAt","status","completedAt","createdAt","updatedAt"],"title":"DealTaskOutputData"},"DecisionMakersData":{"type":"object","properties":{"role":{"type":"string"},"department":{"type":["string","null"]}},"required":["role","department"],"title":"DecisionMakersData"},"DetectedAvatarData":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"],"title":"DetectedAvatarData"},"DiscoveryAresLookupData":{"type":"object","properties":{"leadId":{"type":"integer","description":"The number of the lead."},"registrationNumber":{"type":"string","description":"The company number (IČO) that was saved."},"vatNumber":{"type":["string","null"],"description":"The VAT number (DIČ), or null."},"legalForm":{"type":["string","null"],"description":"The code of the legal form, or null."},"czNace":{"type":["string","null"],"description":"The CZ-NACE code of the main business, or null."},"naceCategory":{"type":["string","null"],"description":"The business area, or null."},"employeeBand":{"type":["string","null"],"description":"How many people work there, or null."},"region":{"type":["string","null"],"description":"The Czech region, or null."},"fitGrade":{"type":"string","description":"The grade of how well the lead fits, after the new data."},"fitScore":{"type":["integer","null"],"description":"How well the lead fits as a number, or null."}},"required":["leadId","registrationNumber","vatNumber","legalForm","czNace","naceCategory","employeeBand","region","fitGrade","fitScore"],"title":"DiscoveryAresLookupData"},"DiscoveryLeadClaimItemData":{"type":"object","properties":{"leadId":{"type":"integer","description":"The number of the lead."},"name":{"type":["string","null"],"description":"The name of the company, or null."},"website":{"type":["string","null"],"description":"The website, or null."},"registrationNumber":{"type":["string","null"],"description":"The company number (IČO), or null."},"city":{"type":["string","null"],"description":"The city, or null."},"discoverySource":{"type":"string","description":"Where Fusio found the lead: ares, eshopy_cz or browser."},"browserSource":{"type":["string","null"],"description":"The site a browser lead came from, or null for other leads."},"sourceRef":{"type":["string","null"],"description":"The reference of the source, like the address of the profile, or null."},"fitScore":{"type":"integer","description":"How well the lead fits, as a number."},"reviewStatus":{"type":"string","description":"Where the review is. It is always in_review."},"claimedAt":{"type":["string","null"],"description":"When you took the lead, or null."},"hasResearchProfile":{"type":"boolean","description":"True when the lead already has a research profile."}},"required":["leadId","name","website","registrationNumber","city","discoverySource","browserSource","sourceRef","fitScore","reviewStatus","claimedAt","hasResearchProfile"],"title":"DiscoveryLeadClaimItemData"},"DiscoveryLeadReviewData":{"type":"object","properties":{"leadId":{"type":"integer","description":"The number of the lead."},"reviewStatus":{"type":"string","description":"Where the review is. It is ready_for_approval."},"reviewRecommendation":{"type":"string","description":"Your advice: approve or dismiss."},"reviewReason":{"type":"string","description":"Your reason."},"fitScore":{"type":"integer","description":"How well the lead fits now, as a number."},"previousFitScore":{"type":"integer","description":"How well it fitted before this call."},"matchedPersonaName":{"type":["string","null"],"description":"The name of the customer persona that fits the lead best, or null."}},"required":["leadId","reviewStatus","reviewRecommendation","reviewReason","fitScore","previousFitScore","matchedPersonaName"],"title":"DiscoveryLeadReviewData"},"DispatchedGenerationRunData":{"type":"object","properties":{"runId":{"type":"integer","description":"The number of the AI job. Ask `ai.generation-runs.show` with it to see how it goes."}},"required":["runId"],"title":"DispatchedGenerationRunData"},"DocumentContentOutputData":{"type":"object","properties":{"size":{"type":"integer"},"revision":{"type":"integer"},"updatedAt":{"type":["string","null"]}},"required":["size","revision","updatedAt"],"title":"DocumentContentOutputData"},"DocumentFileData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"extension":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"integer"}},"required":["id","name","extension","mimeType","size"],"title":"DocumentFileData"},"DocumentKind":{"type":"string","enum":["contract","offer","payment_proof","other"],"title":"DocumentKind"},"DocumentOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"fileId":{"type":["integer","null"]},"leadId":{"type":["integer","null"]},"dealId":{"type":["integer","null"]},"kind":{"$ref":"#/components/schemas/DocumentKind"},"title":{"type":"string"},"isTemplate":{"type":"boolean"},"sourceTemplateId":{"type":["integer","null"]},"createdBy":{"type":["integer","null"]},"file":{"anyOf":[{"$ref":"#/components/schemas/DocumentFileData"},{"type":"null"}]},"source":{"$ref":"#/components/schemas/DocumentSourceData"},"capabilities":{"$ref":"#/components/schemas/EntityActionCapabilitiesData"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"tenantSignedAt":{"type":["string","null"]},"tenantSignedByUserId":{"type":["integer","null"]},"clientSignedAt":{"type":["string","null"]},"clientSignedByName":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"contractType":{"anyOf":[{"$ref":"#/components/schemas/ContractType"},{"type":"null"}]},"activeSigningEnvelopeId":{"type":["integer","null"]},"parentDocumentId":{"type":["integer","null"]},"relationType":{"anyOf":[{"$ref":"#/components/schemas/DocumentRelationType"},{"type":"null"}]},"templateRelationType":{"anyOf":[{"$ref":"#/components/schemas/DocumentRelationType"},{"type":"null"}]},"parentDocumentTitle":{"type":["string","null"]},"childDocuments":{"type":"array","items":{"$ref":"#/components/schemas/ChildDocumentOutputData"}},"createdByName":{"type":["string","null"]},"sourceTemplateTitle":{"type":["string","null"]},"content":{"anyOf":[{"$ref":"#/components/schemas/DocumentContentOutputData"},{"type":"null"}]}},"required":["id","tenantId","fileId","leadId","dealId","kind","title","isTemplate","sourceTemplateId","createdBy","file","source","status","tenantSignedAt","tenantSignedByUserId","clientSignedAt","clientSignedByName","createdAt","contractType","activeSigningEnvelopeId","parentDocumentId","relationType","templateRelationType","parentDocumentTitle","childDocuments","createdByName","sourceTemplateTitle","content"],"title":"DocumentOutputData"},"DocumentRelationType":{"type":"string","enum":["amendment","call_off"],"title":"DocumentRelationType"},"DocumentSourceData":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/DocumentSourceType"},"leadId":{"type":["integer","null"]},"dealId":{"type":["integer","null"]},"dealName":{"type":["string","null"]}},"required":["type","leadId","dealId","dealName"],"title":"DocumentSourceData"},"DocumentSourceType":{"type":"string","enum":["tenant","lead","deal"],"title":"DocumentSourceType"},"DocumentStatus":{"type":"string","enum":["draft","signed"],"title":"DocumentStatus"},"DraftSourceData":{"type":"object","properties":{"start":{"type":"integer"},"end":{"type":"integer"},"type":{"type":"string"},"label":{"type":"string"},"quote":{"type":["string","null"]},"url":{"type":["string","null"]},"confidence":{"type":["number","null"]},"messageFrameworkId":{"type":["string","null"]}},"required":["start","end","type","label","quote","url","confidence","messageFrameworkId"],"title":"DraftSourceData"},"EmailContactOverrideData":{"type":"object","properties":{"contactId":{"type":"integer"},"isExcluded":{"type":"boolean"}},"required":["contactId","isExcluded"],"title":"EmailContactOverrideData"},"EmailConversationData":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":["string","null"]},"status":{"type":"string"},"contactId":{"type":["string","null"]},"contactName":{"type":["string","null"]},"contactEmail":{"type":["string","null"]},"contactPosition":{"type":["string","null"]},"leadId":{"type":["string","null"]},"leadName":{"type":["string","null"]},"leadStage":{"type":["string","null"]},"userId":{"type":["integer","null"]},"lastMessageAt":{"type":["string","null"]},"unread":{"type":"boolean"},"closedAt":{"type":["string","null"]},"closedByUserName":{"type":["string","null"]},"messagesCount":{"type":"integer"},"stalwartThreadId":{"type":["string","null"]},"senderEmail":{"type":["string","null"]},"senderName":{"type":["string","null"]},"lastMessageDirection":{"type":["string","null"]},"lastMessagePreview":{"type":["string","null"]},"awaitingReply":{"type":"boolean"},"deliveryIssue":{"type":["string","null"]},"runningSequence":{"anyOf":[{"$ref":"#/components/schemas/EmailConversationSequenceSummaryData"},{"type":"null"}]},"nextScheduledAt":{"type":["string","null"]},"assigneeName":{"type":["string","null"]},"signatureExtract":{"anyOf":[{"$ref":"#/components/schemas/SignatureExtractData"},{"type":"null"}]},"isIgnored":{"type":"boolean"},"cadenceLogged":{"type":["boolean","null"]},"channel":{"type":"string"},"waId":{"type":["string","null"]},"whatsappReplyWindowEndsAt":{"type":["string","null"]},"ignoredSenderRuleId":{"type":["string","null"]},"categoryIds":{"type":"array","items":{"type":"string"}},"trashedAt":{"type":["string","null"]},"isFusioReading":{"type":"boolean"},"awayUntil":{"type":["string","null"]},"isUnsubscribed":{"type":"boolean"}},"required":["id","subject","status","contactId","contactName","contactEmail","contactPosition","leadId","leadName","leadStage","userId","lastMessageAt","unread","closedAt","closedByUserName","messagesCount","stalwartThreadId","senderEmail","senderName","lastMessageDirection","lastMessagePreview","awaitingReply","deliveryIssue","runningSequence","nextScheduledAt","assigneeName","signatureExtract","isIgnored","cadenceLogged","channel","waId","whatsappReplyWindowEndsAt","ignoredSenderRuleId","categoryIds","trashedAt","isFusioReading","awayUntil","isUnsubscribed"],"title":"EmailConversationData"},"EmailConversationSequenceSummaryData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer"},"stepCount":{"type":"integer"},"status":{"type":"string"}},"required":["id","name","position","stepCount","status"],"title":"EmailConversationSequenceSummaryData"},"EmailGridTemplateData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"],"title":"EmailGridTemplateData"},"EmailMessageDirection":{"type":"string","enum":["in","out"],"title":"EmailMessageDirection"},"EmailRecipientContactScope":{"type":"string","enum":["primary","all"],"title":"EmailRecipientContactScope"},"EmailSignatureSource":{"type":"string","enum":["organization","user"],"title":"EmailSignatureSource"},"EmailState":{"type":"string","enum":["drafted","approved","rejected","scheduled","published","failed"],"title":"EmailState"},"EmailTemplateCategory":{"type":"string","enum":["article_newsletter","general_newsletter","promotion","re_engagement","warm_followup","lead_nurture","product_announcement","seasonal_campaign","survey","referral","event_invitation","welcome","onboarding","win_back","transactional","warm_announcement_cta","abandoned_action","general_update","lead_form_confirmation","sequence_opener","sequence_teach","sequence_proof","sequence_objection","sequence_close"],"title":"EmailTemplateCategory"},"EmailTemplateLayout":{"type":"string","enum":["announcement","newsletter","offer","invitation","letter","welcome","feedback","confirmation"],"title":"EmailTemplateLayout"},"EmailTemplateUsage":{"type":"string","enum":["marketing","private_outreach","whatsapp_outreach","invoice"],"title":"EmailTemplateUsage"},"EmbedCampaignDestinationData":{"type":"object","properties":{"id":{"type":"integer"},"destination":{"$ref":"#/components/schemas/CampaignDestination"},"priority":{"type":"integer"}},"required":["id","destination","priority"],"title":"EmbedCampaignDestinationData"},"EmbedMeUserOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"roles":{"type":"array","items":{"type":"string"}},"permissions":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"isFallbackIdentity":{"type":"boolean"}},"required":["id","name","roles","permissions","scopes","isFallbackIdentity"],"title":"EmbedMeUserOutputData"},"EmployeeBand":{"type":"string","enum":["micro","small","medium","large","enterprise"],"title":"EmployeeBand"},"EngagementSignalClass":{"type":"string","enum":["low","mid","high","sticky","sticky_cleared"],"title":"EngagementSignalClass"},"EngagementSignalKey":{"type":"string","enum":["email_open","email_quick_open","email_click_cta","email_click_link","email_reply","whatsapp_reply","form_submission","soft_bounce_streak","spam_complaint","hard_bounce","unsubscribe","suppression_cleared","web_intent_hand_raiser","web_intent_standard","web_intent_subscription"],"title":"EngagementSignalKey"},"EntityActionCapabilitiesData":{"type":"object","properties":{"canShow":{"type":"boolean"},"canUpdate":{"type":"boolean"},"canDelete":{"type":"boolean"},"canUseTemplate":{"type":"boolean"},"canSign":{"type":"boolean"}},"required":["canShow","canUpdate","canDelete"],"title":"EntityActionCapabilitiesData"},"EntityAssignmentOutputData":{"type":"object","properties":{"id":{"type":"integer"},"userId":{"type":"integer","description":"The member who looks after the lead."},"userFirstName":{"type":["string","null"],"description":"The first name of that member."},"userLastName":{"type":["string","null"],"description":"The last name of that member."},"isOwner":{"type":"boolean","description":"Whether this member handles it."},"assignableType":{"type":"string"},"assignableId":{"type":"integer"},"createdAt":{"type":["string","null"],"description":"When the member got the lead."}},"required":["id","userId","userFirstName","userLastName","isOwner","assignableType","assignableId","createdAt"],"title":"EntityAssignmentOutputData"},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","const":"error"},"message":{"type":"string"},"errorId":{"type":"string"},"payload":{"type":"object","properties":{"error":{"type":"string"}},"additionalProperties":{}}},"required":["message"],"title":"ErrorResponse"},"ExternalAdAccountDsaRecommendationsData":{"type":"object","properties":{"recommendations":{"type":"array","items":{"type":"string"},"description":"Names you can use as the beneficiary and the payer of the ads. The names saved on the ad account come first."}},"required":["recommendations"],"title":"ExternalAdAccountDsaRecommendationsData"},"ExternalAdAccountInstagramData":{"type":"object","properties":{"id":{"type":"string","description":"The number of the Instagram account in the ad network."},"username":{"type":"string","description":"The Instagram username."},"pageId":{"type":["string","null"],"description":"The Facebook page the account is linked to, or null."}},"required":["id","username","pageId"],"title":"ExternalAdAccountInstagramData"},"ExternalAdAccountPageData":{"type":"object","properties":{"id":{"type":"string","description":"The number of the page in the ad network."},"name":{"type":"string","description":"The name of the page."},"canAdvertise":{"type":"boolean","description":"true when ads may run for this page."}},"required":["id","name","canAdvertise"],"title":"ExternalAdAccountPageData"},"ExternalAdAccountPixelData":{"type":"object","properties":{"id":{"type":"string","description":"The number of the pixel in the ad network."},"name":{"type":["string","null"],"description":"The name of the pixel, or null."}},"required":["id","name"],"title":"ExternalAdAccountPixelData"},"ExtractedBrandVoiceData":{"type":"object","properties":{"tone":{"anyOf":[{"$ref":"#/components/schemas/TenantBrandVoiceTone"},{"type":"null"}],"description":"The tone the AI found."},"readingLevel":{"anyOf":[{"$ref":"#/components/schemas/TenantBrandVoiceReadingLevel"},{"type":"null"}],"description":"How hard the texts are to read."},"persona":{"type":["string","null"],"description":"Who seems to speak."},"preferPhrases":{"type":"array","items":{"type":"string"},"description":"Phrases the texts like to use."},"avoidPhrases":{"type":"array","items":{"type":"string"},"description":"Phrases the texts should avoid."},"description":{"type":["string","null"],"description":"How the voice sounds."},"rationale":{"type":["string","null"],"description":"Why the AI thinks so."}},"required":["tone","readingLevel","persona","preferPhrases","avoidPhrases","description","rationale"],"title":"ExtractedBrandVoiceData"},"ExtractedData":{"type":"object","properties":{"goal":{"$ref":"#/components/schemas/CampaignGoal"},"goalMetricType":{"anyOf":[{"$ref":"#/components/schemas/CampaignGoalMetricType"},{"type":"null"}]},"goalMetricTarget":{"type":["number","null"]},"goalMetricLabel":{"type":["string","null"]},"product":{"type":["string","null"]},"audience":{"type":["string","null"]},"timing":{"$ref":"#/components/schemas/TimingData"},"mode":{"$ref":"#/components/schemas/CampaignMode"},"tone":{"anyOf":[{"$ref":"#/components/schemas/TenantBrandVoiceTone"},{"type":"null"}]},"destinations":{"type":"array","items":{"$ref":"#/components/schemas/CampaignDestination"}},"suggestedCtas":{"type":"array","items":{"$ref":"#/components/schemas/Campaign.Ai.SuggestedCtaData"}}},"required":["goal","goalMetricType","goalMetricTarget","goalMetricLabel","product","audience","timing","mode","tone","destinations","suggestedCtas"],"title":"ExtractedData"},"FileDerivativeData":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/UpdateFileData"},"profile":{"type":["string","null"]},"usageCount":{"type":"integer"},"isInUse":{"type":"boolean"},"usage":{"type":"array","items":{"$ref":"#/components/schemas/FileUsageData"}}},"required":["file","profile","usageCount","isInUse","usage"],"title":"FileDerivativeData"},"FileDetailData":{"type":"object","properties":{"file":{"$ref":"#/components/schemas/UpdateFileData"},"usageCount":{"type":"integer"},"isInUse":{"type":"boolean"},"canDelete":{"type":"boolean","description":"true when you may delete the file."},"canReplace":{"type":"boolean"},"usage":{"type":"array","items":{"$ref":"#/components/schemas/FileUsageData"},"description":"Where the file is used, like in an article."},"derivatives":{"type":"array","items":{"$ref":"#/components/schemas/FileDerivativeData"}}},"required":["file","usageCount","isInUse","canDelete","canReplace","usage","derivatives"],"title":"FileDetailData"},"FileExtensionsData":{"type":"object","properties":{"extensions":{"type":"array","items":{"type":"string"},"description":"The file endings, like jpg or pdf, at most 200."}},"required":["extensions"],"title":"FileExtensionsData"},"FileUsageData":{"type":"object","properties":{"fileId":{"type":"integer"},"entityType":{"type":"string"},"entityId":{"type":"integer"},"entityName":{"type":"string"},"role":{"type":"string"}},"required":["fileId","entityType","entityId","entityName","role"],"title":"FileUsageData"},"FollowUpInputType":{"type":"string","enum":["single_choice","multi_choice","text","date"],"title":"FollowUpInputType"},"FollowUpQuestionData":{"type":"object","properties":{"field":{"type":"string"},"question":{"type":"string"},"inputType":{"$ref":"#/components/schemas/FollowUpInputType"},"options":{"type":["array","null"],"items":{"$ref":"#/components/schemas/FollowUpQuestionOptionData"}},"allowSkip":{"type":"boolean"},"suggestedValue":{"type":["string","null"]}},"required":["field","question","inputType","options","allowSkip","suggestedValue"],"title":"FollowUpQuestionData"},"FollowUpQuestionOptionData":{"type":"object","properties":{"value":{"type":"string","description":"The value to send as the answer."},"label":{"type":"string","description":"The text to show."}},"required":["value","label"],"title":"FollowUpQuestionOptionData"},"GlossaryData":{"type":"object","properties":{"term":{"type":"string"},"meaning":{"type":"string"}},"required":["term","meaning"],"title":"GlossaryData"},"GoogleAdsCategoryData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"],"title":"GoogleAdsCategoryData"},"GoogleAdsDeploymentAdData":{"type":"object","properties":{"id":{"type":"string"},"resourceName":{"type":"string"},"status":{"type":"string"},"finalUrls":{"type":"array","items":{"type":"string"}},"headlines":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"path1":{"type":["string","null"]},"path2":{"type":["string","null"]}},"required":["id","resourceName","status","finalUrls","headlines","descriptions","path1","path2"],"title":"GoogleAdsDeploymentAdData"},"GoogleAdsDeploymentAssetData":{"type":"object","properties":{"linkResourceName":{"type":"string"},"status":{"type":"string"},"fieldType":{"type":"string","description":"sitelink (an extra link) or callout (a short text)."},"assetResourceName":{"type":"string"},"name":{"type":["string","null"]},"finalUrls":{"type":"array","items":{"type":"string"}},"linkText":{"type":["string","null"]},"description1":{"type":["string","null"]},"description2":{"type":["string","null"]},"calloutText":{"type":["string","null"]},"ownedByDeployment":{"type":"boolean","description":"true when Fusio made it."}},"required":["linkResourceName","status","fieldType","assetResourceName","name","finalUrls","linkText","description1","description2","calloutText","ownedByDeployment"],"title":"GoogleAdsDeploymentAssetData"},"GoogleAdsDeploymentCampaignData":{"type":"object","properties":{"id":{"type":"string","description":"The number of the campaign in Google Ads."},"resourceName":{"type":"string","description":"The full Google Ads name of the campaign, like customers/1/campaigns/2."},"name":{"type":"string","description":"The name of the campaign."},"status":{"type":"string","description":"enabled (it runs) or paused."},"channelType":{"type":"string","description":"The kind of campaign in Google Ads, like search."},"biddingStrategyType":{"type":"string","description":"How Google bids for clicks."},"enhancedCpcEnabled":{"type":"boolean","description":"true when Google may raise bids for likely results."},"dailyBudgetAmount":{"type":"string","description":"How much the campaign may spend in a day."},"currencyCode":{"type":"string","description":"The currency, like CZK."},"networks":{"description":"Where the ads show, like Google Search and search partners."},"targeting":{"description":"The places and languages of the campaign."},"groups":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsDeploymentGroupData"},"description":"The ad groups, each with its ad, keywords and extra links and texts."},"budgetResourceName":{"type":["string","null"],"description":"The full Google Ads name of the budget, or null."},"adScheduleCriteria":{"type":"array","items":{"type":"string"},"description":"The times of the week when the ads show. Empty for always."}},"required":["id","resourceName","name","status","channelType","biddingStrategyType","enhancedCpcEnabled","dailyBudgetAmount","currencyCode","networks","targeting","groups","budgetResourceName","adScheduleCriteria"],"title":"GoogleAdsDeploymentCampaignData"},"GoogleAdsDeploymentDetailData":{"type":"object","properties":{"deployment":{"$ref":"#/components/schemas/AdDeploymentData","description":"The deployment as Fusio knows it."},"campaign":{"$ref":"#/components/schemas/GoogleAdsDeploymentCampaignData","description":"The campaign as Google Ads has it now."}},"required":["deployment","campaign"],"title":"GoogleAdsDeploymentDetailData"},"GoogleAdsDeploymentGroupData":{"type":"object","properties":{"id":{"type":"string"},"resourceName":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","description":"enabled or paused."},"ad":{"$ref":"#/components/schemas/GoogleAdsDeploymentAdData","description":"The search ad of the group."},"keywords":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsDeploymentKeywordData"},"description":"The keywords of the group."},"assets":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsDeploymentAssetData"},"description":"The extra links and short texts of the group."}},"required":["id","resourceName","name","status","ad","keywords","assets"],"title":"GoogleAdsDeploymentGroupData"},"GoogleAdsDeploymentKeywordData":{"type":"object","properties":{"id":{"type":"string"},"resourceName":{"type":"string"},"status":{"type":"string"},"text":{"type":"string"},"matchType":{"type":"string"},"negative":{"type":"boolean","description":"true for a negative keyword."}},"required":["id","resourceName","status","text","matchType","negative"],"title":"GoogleAdsDeploymentKeywordData"},"GoogleAdsDeploymentPreflightData":{"type":"object","properties":{"enabled":{"type":"boolean","description":"false when sending to Google Ads is turned off for your company."},"canDeploy":{"type":"boolean","description":"true when you can send the campaign now."},"createsPausedCampaign":{"type":"boolean","description":"true: the campaign arrives in Google Ads paused, so nothing is spent until you start it."},"blockers":{"type":"array","items":{"type":"string"},"description":"What stops the sending. Empty when nothing."},"adAccountId":{"type":["integer","null"],"description":"The number of your Google Ads account in Fusio, or null."},"customerId":{"type":["string","null"],"description":"The number of your account in Google Ads, or null."},"currencyCode":{"type":["string","null"],"description":"The currency of the account, or null."},"dailyBudgetAmount":{"type":"string","description":"How much the campaign would spend in a day."},"planRevision":{"type":"string","description":"The version of the plan. Send it to `google-ads-search-campaigns.google-ads.deploy`."}},"required":["enabled","canDeploy","createsPausedCampaign","blockers","adAccountId","customerId","currencyCode","dailyBudgetAmount","planRevision"],"title":"GoogleAdsDeploymentPreflightData"},"GoogleAdsSearchAdData":{"type":"object","properties":{"headlines":{"description":"The headlines of the ad."},"descriptions":{"description":"The descriptions of the ad."},"sitelinks":{"description":"The extra links under the ad, each with text, two lines and an address."},"callouts":{"description":"The short extra texts under the ad."},"headlinePins":{"description":"Where each headline must stay: 1, 2, 3 or null (Google chooses)."},"descriptionPins":{"description":"Where each description must stay: 1, 2 or null (Google chooses)."},"snippets":{"description":"The items of the list of things you offer."},"path1":{"type":"string","description":"The first word of the path after your domain."},"path2":{"type":"string","description":"The second word of the path after your domain."},"snippetHeader":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchSnippetHeader"},{"type":"null"}],"description":"The heading of the list, or null for no list."}},"required":["headlines","descriptions","sitelinks","callouts","headlinePins","descriptionPins","snippets","path1","path2","snippetHeader"],"title":"GoogleAdsSearchAdData"},"GoogleAdsSearchAdGroupData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the ad group."},"googleAdsSearchCampaignId":{"type":"integer","description":"The number of the campaign it belongs to."},"name":{"type":"string","description":"The name of the ad group."},"description":{"type":["string","null"],"description":"A note about the ad group."},"searchIntent":{"type":["string","null"],"description":"What people want when they search for these keywords."},"status":{"type":"string","description":"draft, approved or archived."},"priorityScore":{"type":["string","null"],"description":"How important the ad group is, from 0 to 999.99."},"rationale":{"type":["string","null"],"description":"Why the ad group is in the campaign."},"researchQuality":{"type":["string","null"],"description":"How good the keyword research was: sufficient, partial or insufficient. null before research."},"researchQualityReason":{"type":["string","null"],"description":"Why the research was not sufficient, like limited_candidate_pool or low_metric_coverage."},"researchDiagnostics":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchResearchDiagnosticsData"},{"type":"null"}],"description":"Numbers from the keyword research, like how many words it found and picked."},"landingPageDecision":{"type":"string","description":"Where the ad leads: homepage, existing_page, new_landing_page or insufficient_data (AI did not know)."},"destinationUrl":{"type":["string","null"],"description":"The page the ad leads to."},"mobileFinalUrl":{"type":["string","null"],"description":"Another address for phones, or null."},"verifiedUrls":{"type":"array","items":{"type":"string"},"description":"Pages of your website the ad and its links may lead to."},"searchAd":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchAdData"},{"type":"null"}],"description":"The texts of the search ad, or null before they are written."},"searchAdGenerationStatus":{"type":"string","description":"How AI writing of the ad goes: missing, queued, generating, ready or failed."},"searchAdGenerationError":{"type":["string","null"],"description":"Why AI could not write the ad, or null."},"searchAdGeneratedAt":{"type":["string","null"],"description":"When AI last wrote the ad, or null."},"landingPageFitScore":{"type":["integer","null"],"description":"How well the page fits the keywords, from 0 to 100."},"landingPageReason":{"type":["string","null"],"description":"Why this page was picked."},"landingPageBrief":{"type":["string","null"],"description":"What a new landing page should say."},"forecastImpressions":{"type":["integer","null"],"description":"How many times Google thinks the ads show in a month."},"forecastClicks":{"type":["integer","null"],"description":"How many clicks Google expects in a month."},"forecastCost":{"type":["string","null"],"description":"How much Google thinks it costs in a month."},"forecastAverageCpc":{"type":["string","null"],"description":"The price of one click Google expects."},"forecastedAt":{"type":["string","null"],"description":"When Google made the forecast, or null."},"sortOrder":{"type":"integer","description":"Its place in the campaign, from 0."},"updatedAt":{"type":"string","description":"When it last changed."},"revision":{"type":"string","description":"The version of the ad group. Send it as expectedRevision when you save the ad."},"keywords":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchAdGroupKeywordData"},"description":"The keywords of the ad group."},"excludedSearchAdTexts":{"$ref":"#/components/schemas/GoogleAdsSearchExcludedAdTextsData","description":"Texts AI must not write again."}},"required":["id","googleAdsSearchCampaignId","name","description","searchIntent","status","priorityScore","rationale","researchQuality","researchQualityReason","researchDiagnostics","landingPageDecision","destinationUrl","mobileFinalUrl","verifiedUrls","searchAd","searchAdGenerationStatus","searchAdGenerationError","searchAdGeneratedAt","landingPageFitScore","landingPageReason","landingPageBrief","forecastImpressions","forecastClicks","forecastCost","forecastAverageCpc","forecastedAt","sortOrder","updatedAt","revision","keywords","excludedSearchAdTexts"],"title":"GoogleAdsSearchAdGroupData"},"GoogleAdsSearchAdGroupKeywordData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the keyword."},"googleAdsSearchAdGroupId":{"type":"integer","description":"The number of the ad group it belongs to."},"tenantKeywordOpportunityId":{"type":["integer","null"],"description":"The SEO keyword chance it came from, or null."},"keyword":{"type":"string","description":"The keyword."},"matchType":{"type":"string","description":"exact, phrase or broad."},"keywordRole":{"type":"string","description":"positive (the ads show for it) or negative (the ads never show for it)."},"intent":{"type":["string","null"],"description":"What people want when they search for it."},"searchVolume":{"type":["integer","null"],"description":"How many people search for it in a month, from Google."},"isVolumeUnknown":{"type":["boolean","null"],"description":"true when Google does not know how many people search for it."},"cpcLow":{"type":["string","null"],"description":"The low usual price of one click."},"cpcHigh":{"type":["string","null"],"description":"The high usual price of one click."},"currencyCode":{"type":["string","null"],"description":"The currency of the prices, like CZK."},"competitionIndex":{"type":["integer","null"],"description":"How many advertisers want it, from 0 to 100."},"status":{"type":"string","description":"proposed, approved or excluded."},"priorityScore":{"type":["string","null"],"description":"How important it is, from 0 to 999.99."},"budgetFit":{"type":"string","description":"If your budget is enough for it: viable, limited, infeasible or unknown."},"rationale":{"type":["string","null"],"description":"Why it is in the ad group."},"evidenceSource":{"type":["string","null"],"description":"Where it came from: google_idea, seo_portfolio or deterministic_identity (your name or the name of the competitor)."},"isSeoRecommended":{"type":"boolean","description":"true when your SEO audit recommends it."},"seedFamily":{"type":["string","null"],"description":"The group of first words it grew from, or null."},"negativeSource":{"type":["string","null"],"description":"Why it is negative: business_exclusion, campaign_routing, category_collision or review_suggestion. null for a positive one."},"sortOrder":{"type":"integer","description":"Its place in the list, from 0."}},"required":["id","googleAdsSearchAdGroupId","tenantKeywordOpportunityId","keyword","matchType","keywordRole","intent","searchVolume","isVolumeUnknown","cpcLow","cpcHigh","currencyCode","competitionIndex","status","priorityScore","budgetFit","rationale","evidenceSource","isSeoRecommended","seedFamily","negativeSource","sortOrder"],"title":"GoogleAdsSearchAdGroupKeywordData"},"GoogleAdsSearchAdSchedule":{"type":"string","enum":["always","business_hours"],"title":"GoogleAdsSearchAdSchedule"},"GoogleAdsSearchAdSuggestionData":{"type":"object","properties":{"destinationUrl":{"type":"string","description":"The page the ad leads to."},"searchAd":{"$ref":"#/components/schemas/GoogleAdsSearchAdData"}},"required":["destinationUrl","searchAd"],"title":"GoogleAdsSearchAdSuggestionData"},"GoogleAdsSearchAdTextSource":{"type":"string","enum":["offer","website","keywords","seo_audit","company"],"title":"GoogleAdsSearchAdTextSource"},"GoogleAdsSearchAdTextSuggestionData":{"type":"object","properties":{"text":{"type":"string","description":"The suggested text."},"description1":{"type":["string","null"],"description":"For sitelinks: the first line under the link. null otherwise."},"description2":{"type":["string","null"],"description":"For sitelinks: the second line under the link. null otherwise."},"finalUrl":{"type":["string","null"],"description":"For sitelinks: the page the link leads to. null otherwise."},"source":{"$ref":"#/components/schemas/GoogleAdsSearchAdTextSource","description":"Where AI took it from: offer, website, keywords, seo_audit or company."},"matchType":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchKeywordMatchType"},{"type":"null"}],"description":"For keywords: exact, phrase or broad. null otherwise."},"reason":{"type":["string","null"],"description":"Why AI suggests it, or null."}},"required":["text","description1","description2","finalUrl","source","matchType","reason"],"title":"GoogleAdsSearchAdTextSuggestionData"},"GoogleAdsSearchAdTextSuggestionsData":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/GoogleAdsSearchSuggestionField","description":"What the suggestions are for."},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchAdTextSuggestionData"},"description":"The suggested texts."}},"required":["field","suggestions"],"title":"GoogleAdsSearchAdTextSuggestionsData"},"GoogleAdsSearchBiddingStrategy":{"type":"string","enum":["manual_cpc","maximize_clicks","maximize_conversions","target_cpa"],"title":"GoogleAdsSearchBiddingStrategy"},"GoogleAdsSearchBriefConversionGoalPickOutputData":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/GoogleAdsSearchConversionGoalMode","description":"account or own."},"trackingEventIds":{"type":"array","items":{"type":"integer"},"description":"The numbers of your Fusio events for own. Empty for account."},"reason":{"type":"string","description":"Why AI picked it."}},"required":["mode","trackingEventIds","reason"],"title":"GoogleAdsSearchBriefConversionGoalPickOutputData"},"GoogleAdsSearchBriefLandingPagePickOutputData":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string"},"fitScore":{"type":"integer","description":"How well the page fits, from 0 to 100."},"reason":{"type":"string","description":"Why AI picked it."}},"required":["url","title","fitScore","reason"],"title":"GoogleAdsSearchBriefLandingPagePickOutputData"},"GoogleAdsSearchBriefPicksOutputData":{"type":"object","properties":{"landingPage":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchBriefLandingPagePickOutputData"},{"type":"null"}],"description":"The page of your website AI picked, or null when none fits."},"conversionGoal":{"$ref":"#/components/schemas/GoogleAdsSearchBriefConversionGoalPickOutputData","description":"What AI thinks should count as success."}},"required":["landingPage","conversionGoal"],"title":"GoogleAdsSearchBriefPicksOutputData"},"GoogleAdsSearchBudgetAllocationMode":{"type":"string","enum":["auto","manual"],"title":"GoogleAdsSearchBudgetAllocationMode"},"GoogleAdsSearchCampaignConversionGoalModeData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the campaign."},"usesOwnConversionGoals":{"type":"boolean","description":"true when the campaign counts your own Fusio events."}},"required":["id","usesOwnConversionGoals"],"title":"GoogleAdsSearchCampaignConversionGoalModeData"},"GoogleAdsSearchCampaignData":{"type":"object","properties":{"id":{"type":"integer"},"sourceSeoAuditId":{"type":["integer","null"],"description":"The SEO audit the campaign was made from, or null."},"name":{"type":"string"},"utmSlug":{"type":"string","description":"The short name used in UTM links of the campaign."},"campaignKind":{"type":"string","description":"brand (searches for your name), non_brand (searches for what you sell) or competitor (searches for a competitor)."},"origin":{"type":"string","description":"How the campaign started: initial_analysis, manual_ai (you asked AI) or manual (you made it)."},"status":{"type":"string","description":"draft (you still work on it), approved (ready to go to Google Ads) or archived."},"isDetachedFromAccount":{"type":"boolean"},"adAccountId":{"type":["integer","null"]},"adAccountName":{"type":["string","null"]},"viability":{"type":"string","description":"How much people search for it: recommended, limited or insufficient_demand."},"monthlyBudgetAmount":{"type":["string","null"],"description":"How much the campaign may spend in a month, as text like \"15000.00\"."},"budgetCurrencyCode":{"type":["string","null"]},"budgetAllocationMode":{"type":"string","description":"auto (Fusio splits the budget) or manual (you do)."},"biddingStrategy":{"type":"string","description":"How Google bids: manual_cpc, maximize_clicks, maximize_conversions or target_cpa."},"bidLimitAmount":{"type":["string","null"]},"startsOn":{"type":["string","null"]},"endsOn":{"type":["string","null"]},"adSchedule":{"type":"string","description":"When ads show: always or business_hours."},"targetsSearchPartners":{"type":"boolean"},"trackingUrlTemplate":{"type":["string","null"]},"businessName":{"type":["string","null"]},"businessLogo":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchLogoData"},{"type":"null"}]},"businessLandscapeLogo":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchLogoData"},{"type":"null"}]},"callPhoneNumber":{"type":["string","null"]},"images":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchImageData"}},"skippedOptionalAssets":{"type":"array","items":{"type":"string"}},"createOnlySettingsLocked":{"type":"boolean"},"targeting":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchTargetingData"},{"type":"null"}],"description":"Where the ads show and in what language."},"targetingResearchCurrent":{"type":"boolean"},"rationale":{"type":["string","null"]},"googleFinalUrlSuffix":{"type":"string"},"googleUrlSuffixState":{"type":"string"},"googleUrlSuffixError":{"type":["string","null"]},"usesOwnConversionGoals":{"type":"boolean"},"generationStage":{"type":["string","null"],"description":"What AI does right now when it builds the campaign, like researching_keywords. null when it does nothing."},"generationBrief":{"type":["string","null"]},"generationError":{"type":["string","null"],"description":"Why AI could not build the campaign."},"competitorId":{"type":["integer","null"]},"conversionGoalMode":{"type":"string","description":"account (goals of your Google Ads account) or own (your own Fusio events)."},"ownTrackingEventIds":{"type":"array","items":{"type":"integer"}},"conversionGoalReason":{"type":["string","null"]},"adScheduleReason":{"type":["string","null"]},"isAiGenerated":{"type":"boolean"},"adGroups":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchAdGroupData"},"description":"The ad groups, each with its keywords and ad."},"latestDeployment":{"anyOf":[{"$ref":"#/components/schemas/AdDeploymentData"},{"type":"null"}],"description":"The newest sending of the campaign to Google Ads, or null."},"approvalBlockers":{"type":"array","items":{"type":"string"},"description":"What must be fixed before you can approve the campaign. Empty when nothing."},"issue":{"anyOf":[{"$ref":"#/components/schemas/AdIssueData"},{"type":"null"}],"description":"A problem Google Ads has with the campaign, or null."},"tenantSequence":{"type":["integer","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","sourceSeoAuditId","name","utmSlug","campaignKind","origin","status","isDetachedFromAccount","adAccountId","adAccountName","viability","monthlyBudgetAmount","budgetCurrencyCode","budgetAllocationMode","biddingStrategy","bidLimitAmount","startsOn","endsOn","adSchedule","targetsSearchPartners","trackingUrlTemplate","businessName","businessLogo","businessLandscapeLogo","callPhoneNumber","images","skippedOptionalAssets","createOnlySettingsLocked","targeting","targetingResearchCurrent","rationale","googleFinalUrlSuffix","googleUrlSuffixState","googleUrlSuffixError","usesOwnConversionGoals","generationStage","generationBrief","generationError","competitorId","conversionGoalMode","ownTrackingEventIds","conversionGoalReason","adScheduleReason","isAiGenerated","adGroups","latestDeployment","approvalBlockers","issue","tenantSequence","createdAt","updatedAt"],"title":"GoogleAdsSearchCampaignData"},"GoogleAdsSearchCampaignKind":{"type":"string","enum":["brand","non_brand","competitor"],"title":"GoogleAdsSearchCampaignKind"},"GoogleAdsSearchCampaignViability":{"type":"string","enum":["recommended","limited","insufficient_demand"],"title":"GoogleAdsSearchCampaignViability"},"GoogleAdsSearchConversionGoalMode":{"type":"string","enum":["account","own"],"title":"GoogleAdsSearchConversionGoalMode"},"GoogleAdsSearchDeploymentMode":{"type":"string","enum":["api","editor_file"],"title":"GoogleAdsSearchDeploymentMode"},"GoogleAdsSearchExcludedAdTextsData":{"type":"object","properties":{"headlines":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"sitelinks":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchSitelinkData"}},"callouts":{"type":"array","items":{"type":"string"}}},"required":["headlines","descriptions","sitelinks","callouts"],"title":"GoogleAdsSearchExcludedAdTextsData"},"GoogleAdsSearchForecastPreviewOutputData":{"type":"object","properties":{"forecastImpressions":{"type":["integer","null"],"description":"How many times the ads may show in a month, or null."},"forecastClicks":{"type":["integer","null"],"description":"How many clicks the ads may get in a month, or null."},"forecastCost":{"type":["string","null"],"description":"How much it may cost in a month, or null."},"forecastAverageCpc":{"type":["string","null"],"description":"The price of one click to expect, or null."}},"required":["forecastImpressions","forecastClicks","forecastCost","forecastAverageCpc"],"title":"GoogleAdsSearchForecastPreviewOutputData"},"GoogleAdsSearchImageData":{"type":"object","properties":{"id":{"type":"integer"},"url":{"type":"string"},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"ratio":{"type":["string","null"]}},"required":["id","url","width","height","ratio"],"title":"GoogleAdsSearchImageData"},"GoogleAdsSearchKeywordMatchType":{"type":"string","enum":["exact","phrase","broad"],"title":"GoogleAdsSearchKeywordMatchType"},"GoogleAdsSearchKeywordMetricOutputData":{"type":"object","properties":{"keyword":{"type":"string","description":"The keyword."},"avgMonthlySearches":{"type":["integer","null"],"description":"How many people search for it in a month, or null when Google does not know."},"cpcLow":{"type":["number","null"],"description":"The low usual price of one click, or null."},"cpcHigh":{"type":["number","null"],"description":"The high usual price of one click, or null."},"competition":{"type":["integer","null"],"description":"How many advertisers want it, from 0 to 100, or null."}},"required":["keyword","avgMonthlySearches","cpcLow","cpcHigh","competition"],"title":"GoogleAdsSearchKeywordMetricOutputData"},"GoogleAdsSearchKeywordRole":{"type":"string","enum":["positive","negative"],"title":"GoogleAdsSearchKeywordRole"},"GoogleAdsSearchLandingPageCheckOutputData":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/GoogleAdsSearchLandingPageCheckStatus","description":"ok (the page works), not_found (404 or 410), not_allowed (it is not on your website) or unreachable (it does not answer or sends you away too often)."},"httpStatus":{"type":["integer","null"],"description":"The HTTP code the page answered with, or null."},"title":{"type":["string","null"],"description":"The title of the page, or null."}},"required":["status","httpStatus","title"],"title":"GoogleAdsSearchLandingPageCheckOutputData"},"GoogleAdsSearchLandingPageCheckStatus":{"type":"string","enum":["ok","not_found","not_allowed","unreachable"],"title":"GoogleAdsSearchLandingPageCheckStatus"},"GoogleAdsSearchLandingPageDecision":{"type":"string","enum":["homepage","existing_page","new_landing_page","insufficient_data"],"title":"GoogleAdsSearchLandingPageDecision"},"GoogleAdsSearchLandingPageOutputData":{"type":"object","properties":{"url":{"type":"string","description":"The address of the page."},"title":{"type":"string","description":"The title of the page."},"isHomepage":{"type":"boolean","description":"true for your homepage."}},"required":["url","title","isHomepage"],"title":"GoogleAdsSearchLandingPageOutputData"},"GoogleAdsSearchLogoData":{"type":"object","properties":{"id":{"type":"integer"},"url":{"type":"string"}},"required":["id","url"],"title":"GoogleAdsSearchLogoData"},"GoogleAdsSearchOperationData":{"type":"object","properties":{"id":{"type":"string","description":"The code of the job, a long text like 9d1c6c7e-4f0b-4a51-9a3e-2c1f0b7d5e21. Send it to `google-ads-search-operations.show` to see how the job goes."},"type":{"type":"string","description":"What kind of job it is."},"status":{"type":"string","description":"How the job goes: pending, processing, completed or failed."},"outcomeCode":{"type":["string","null"],"description":"How a finished job ended: created, insufficient_evidence (too little data to build a campaign) or missing_required_context (Fusio misses facts about your company). null before the end."},"outcomeMessage":{"type":["string","null"],"description":"The end of the job in words, or null."},"failureCode":{"type":["string","null"],"description":"Why the job failed, as a code. null when it did not fail."},"failureMessage":{"type":["string","null"],"description":"Why the job failed, in words. null when it did not fail."},"startedAt":{"type":["string","null"],"description":"When the job started, or null while it waits."},"finishedAt":{"type":["string","null"],"description":"When the job ended, or null while it runs."},"targeting":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchTargetingData"},{"type":"null"}],"description":"The places and language the job works with, or null."},"adAccountId":{"type":["integer","null"],"description":"The number of the Google Ads account the job works with, or null."},"plannerCustomerId":{"type":["string","null"],"description":"The Google Ads customer used for search numbers, or null."},"budgetCurrencyCode":{"type":["string","null"],"description":"The currency of the budget, like CZK, or null."}},"required":["id","type","status","outcomeCode","outcomeMessage","failureCode","failureMessage","startedAt","finishedAt","targeting","adAccountId","plannerCustomerId","budgetCurrencyCode"],"title":"GoogleAdsSearchOperationData"},"GoogleAdsSearchOverviewCampaignData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the campaign."},"name":{"type":"string","description":"The name of the campaign."},"google":{"$ref":"#/components/schemas/GoogleAdsSearchPerformanceGoogleData","description":"The numbers of this campaign from Google Ads."},"fusio":{"$ref":"#/components/schemas/AdCampaignOverviewFusioData","description":"What Fusio saw on your website from this campaign."}},"required":["id","name","google","fusio"],"title":"GoogleAdsSearchOverviewCampaignData"},"GoogleAdsSearchOverviewData":{"type":"object","properties":{"campaignOptions":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaignOverviewCampaignOptionData"},"description":"Your campaigns you can filter by."},"totals":{"$ref":"#/components/schemas/GoogleAdsSearchOverviewTotalsData","description":"The totals of the range for all chosen campaigns."},"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchOverviewCampaignData"},"description":"The same numbers for each chosen campaign."},"kpis":{"$ref":"#/components/schemas/GoogleAdsSearchOverviewKpisData","description":"The main numbers: impressions, clicks, Google conversions, visits, conversions, leads and clients, each with the value before and a line by day."},"spend":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaignOverviewSpendData"},"description":"What you spent, one entry for each currency, with a line by day."},"acquisition":{"$ref":"#/components/schemas/AdAcquisitionData","description":"What the ads brought: spend, leads, clients and their revenue."},"funnel":{"$ref":"#/components/schemas/AdCampaignFunnelData","description":"How many visitors became leads, deals and clients, and where they left."},"ready":{"type":"boolean","description":"false while Fusio is still counting the numbers. Then the lists are empty; try again later."},"rolledUpAt":{"type":["string","null"],"description":"When Fusio last counted the numbers."},"range":{"$ref":"#/components/schemas/OverviewRangeData","description":"The days the numbers are for."},"previousRange":{"anyOf":[{"$ref":"#/components/schemas/OverviewRangeData"},{"type":"null"}],"description":"The range just before, when you sent compare=true. Otherwise null."},"dates":{"type":"array","items":{"type":"string"},"description":"Every day of the range. Day lists in the answer follow this order."}},"required":["campaignOptions","totals","campaigns","kpis","spend","acquisition","funnel","ready","rolledUpAt","range","previousRange","dates"],"title":"GoogleAdsSearchOverviewData"},"GoogleAdsSearchOverviewKpisData":{"type":"object","properties":{"impressions":{"$ref":"#/components/schemas/OverviewKpiData"},"clicks":{"$ref":"#/components/schemas/OverviewKpiData"},"googleConversions":{"$ref":"#/components/schemas/OverviewKpiData"},"sessions":{"$ref":"#/components/schemas/OverviewKpiData"},"conversions":{"$ref":"#/components/schemas/OverviewKpiData"},"leads":{"$ref":"#/components/schemas/OverviewKpiData"},"customers":{"$ref":"#/components/schemas/OverviewKpiData"}},"required":["impressions","clicks","googleConversions","sessions","conversions","leads","customers"],"title":"GoogleAdsSearchOverviewKpisData"},"GoogleAdsSearchOverviewTotalsData":{"type":"object","properties":{"google":{"$ref":"#/components/schemas/GoogleAdsSearchPerformanceGoogleData","description":"The numbers from Google Ads."},"fusio":{"$ref":"#/components/schemas/AdCampaignOverviewFusioData","description":"What Fusio saw on your website."}},"required":["google","fusio"],"title":"GoogleAdsSearchOverviewTotalsData"},"GoogleAdsSearchPerformanceGoogleData":{"type":"object","properties":{"impressions":{"type":"integer"},"clicks":{"type":"integer"},"conversions":{"type":"number"},"money":{},"hasData":{"type":"boolean"},"lastSyncedAt":{"type":["string","null"]},"timezones":{"type":"array","items":{"type":"string"}},"searchImpressionShare":{"type":["number","null"]},"searchBudgetLostImpressionShare":{"type":["number","null"]}},"required":["impressions","clicks","conversions","money","hasData","lastSyncedAt","timezones","searchImpressionShare","searchBudgetLostImpressionShare"],"title":"GoogleAdsSearchPerformanceGoogleData"},"GoogleAdsSearchProfileData":{"type":"object","properties":{"businessName":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"logo":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchLogoData"},{"type":"null"}]},"landscapeLogo":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchLogoData"},{"type":"null"}]}},"required":["businessName","phoneNumber","logo","landscapeLogo"],"title":"GoogleAdsSearchProfileData"},"GoogleAdsSearchResearchDiagnosticsData":{"type":"object","properties":{"seedCount":{"type":"integer"},"candidateCount":{"type":"integer"},"eligibleCandidateCount":{"type":"integer"},"selectedKeywordCount":{"type":"integer"},"familyCount":{"type":"integer"},"coveredFamilyCount":{"type":"integer"},"uncoveredFamilies":{"type":"array","items":{"type":"string"}}},"required":["seedCount","candidateCount","eligibleCandidateCount","selectedKeywordCount","familyCount","coveredFamilyCount","uncoveredFamilies"],"title":"GoogleAdsSearchResearchDiagnosticsData"},"GoogleAdsSearchSeoKeywordSetOutputData":{"type":"object","properties":{"key":{"type":"string","description":"The key of the set. Send it as sets.key to `seo-audits.google-ads-search-campaign.store`."},"name":{"type":"string","description":"The name of the set."},"status":{"type":"string","description":"When to use it: now, after_page (once the landing page is ready) or later."},"keywords":{"type":"array","items":{"type":"string"},"description":"The keywords of the set."},"matchType":{"type":"string","description":"exact, phrase or broad."},"landingUrl":{"type":["string","null"],"description":"The page the ads should lead to, or null."},"landingState":{"type":"string","description":"How ready that page is: missing, weak or ready."},"findingPriority":{"type":["integer","null"],"description":"The number of the SEO finding the set belongs to, or null."},"rationale":{"type":"string","description":"Why the audit recommends the set."},"negativeKeywords":{"type":"array","items":{"type":"string"},"description":"Keywords for which these ads should not show."}},"required":["key","name","status","keywords","matchType","landingUrl","landingState","findingPriority","rationale","negativeKeywords"],"title":"GoogleAdsSearchSeoKeywordSetOutputData"},"GoogleAdsSearchSeoRecommendationData":{"type":"object","properties":{"id":{"type":"integer"},"keyword":{"type":"string"},"intent":{"type":["string","null"]},"cluster":{"type":["string","null"]},"priorityRank":{"type":"integer"},"rationale":{"type":["string","null"]},"eligibleForGoogleAdsSearch":{"type":"boolean","description":"true when it can go into a campaign."},"usedInGoogleAdsSearch":{"type":"boolean","description":"true when a campaign already uses it."},"searchVolume":{"type":["integer","null"]},"cpcLow":{"type":["string","null"]},"cpcHigh":{"type":["string","null"]},"currencyCode":{"type":["string","null"]}},"required":["id","keyword","intent","cluster","priorityRank","rationale","eligibleForGoogleAdsSearch","usedInGoogleAdsSearch","searchVolume","cpcLow","cpcHigh","currencyCode"],"title":"GoogleAdsSearchSeoRecommendationData"},"GoogleAdsSearchSeoRefreshOutputData":{"type":"object","properties":{"operationId":{"type":"string","description":"The code of the job, a long text like 9d1c6c7e-4f0b-4a51-9a3e-2c1f0b7d5e21. Send it to `google-ads-search-operations.show` to see how the job goes."},"type":{"type":"string","description":"What kind of job it is, here seo_google_ads_search_refresh."},"status":{"type":"string","description":"How the job goes. It starts as pending."}},"required":["operationId","type","status"],"title":"GoogleAdsSearchSeoRefreshOutputData"},"GoogleAdsSearchSettingsData":{"type":"object","properties":{"monthlyBudgetAmount":{"type":["string","null"],"description":"Your monthly budget for all Google Search campaigns, or null when you did not set it."},"currencyCode":{"type":["string","null"],"description":"The currency of the budget, like CZK."},"adAccountId":{"type":["integer","null"],"description":"The number of your Google Ads account in Fusio, or null."},"plannerConfigured":{"type":"boolean","description":"true when Fusio can ask Google for search numbers."},"googleReconnectRequired":{"type":"boolean","description":"true when you must connect Google Ads again."},"allocatedMonthlyBudgetAmount":{"type":["string","null"],"description":"How much of the monthly budget campaigns already use."},"remainingMonthlyBudgetAmount":{"type":["string","null"],"description":"How much of the monthly budget is still free."},"deploymentMode":{"$ref":"#/components/schemas/GoogleAdsSearchDeploymentMode","description":"api (Fusio sends campaigns to Google Ads) or editor_file (you get a file for Google Ads Editor)."},"profile":{"$ref":"#/components/schemas/GoogleAdsSearchProfileData","description":"What Fusio knows about your company for the campaigns."}},"required":["monthlyBudgetAmount","currencyCode","adAccountId","plannerConfigured","googleReconnectRequired","allocatedMonthlyBudgetAmount","remainingMonthlyBudgetAmount","deploymentMode","profile"],"title":"GoogleAdsSearchSettingsData"},"GoogleAdsSearchSharedNegativeKeywordData":{"type":"object","properties":{"text":{"type":"string","description":"The keyword."},"matchType":{"type":"string","description":"exact, phrase or broad."}},"required":["text","matchType"],"title":"GoogleAdsSearchSharedNegativeKeywordData"},"GoogleAdsSearchSharedNegativeKeywordsData":{"type":"object","properties":{"keywords":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchSharedNegativeKeywordData"},"description":"The negative keywords shared by all your campaigns."}},"required":["keywords"],"title":"GoogleAdsSearchSharedNegativeKeywordsData"},"GoogleAdsSearchSitelinkData":{"type":"object","properties":{"text":{"type":"string"},"description1":{"type":"string"},"description2":{"type":"string"},"finalUrl":{"type":"string"}},"required":["text","description1","description2","finalUrl"],"title":"GoogleAdsSearchSitelinkData"},"GoogleAdsSearchSnippetHeader":{"type":"string","enum":["brands","amenities","styles","types","destinations","services","courses","neighborhoods","shows","insurance_coverage","degree_programs","featured_hotels","models"],"title":"GoogleAdsSearchSnippetHeader"},"GoogleAdsSearchSuggestionField":{"type":"string","enum":["headlines","descriptions","sitelinks","callouts","snippets","name","keywords","negativeKeywords"],"title":"GoogleAdsSearchSuggestionField"},"GoogleAdsSearchSummaryData":{"type":"object","properties":{"campaignCount":{"type":"integer"},"adGroupCount":{"type":"integer"},"keywordCount":{"type":"integer"}},"required":["campaignCount","adGroupCount","keywordCount"],"title":"GoogleAdsSearchSummaryData"},"GoogleAdsSearchTargetingData":{"type":"object","properties":{"schemaVersion":{"type":"integer"},"scope":{"$ref":"#/components/schemas/GoogleAdsSearchTargetingScope"},"countryCodes":{"type":"array","items":{"type":"string"}},"languageCode":{"type":"string"},"geoTargets":{"type":"array","items":{"$ref":"#/components/schemas/GoogleGeoTargetData"}},"excludedGeoTargets":{"type":"array","items":{"$ref":"#/components/schemas/GoogleGeoTargetData"}},"locationMatching":{"type":"string"}},"required":["schemaVersion","scope","countryCodes","languageCode","geoTargets","excludedGeoTargets","locationMatching"],"title":"GoogleAdsSearchTargetingData"},"GoogleAdsSearchTargetingScope":{"type":"string","enum":["countries","global","locations"],"title":"GoogleAdsSearchTargetingScope"},"GoogleAdsSearchTreeData":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/GoogleAdsSearchSettingsData","description":"Your Google Search settings: monthly budget, currency, ad account and how campaigns go to Google Ads."},"summary":{"$ref":"#/components/schemas/GoogleAdsSearchSummaryData","description":"How many campaigns, ad groups and keywords you have."},"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchCampaignData"},"description":"Your campaigns, each with its ad groups, keywords and ads."},"seoRecommendations":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsSearchSeoRecommendationData"},"description":"Keywords your newest SEO audit recommends, with Google search numbers."},"initialGenerationStatus":{"type":"string","description":"How the first AI building of your campaigns goes: idle (it never ran), pending, processing, completed or failed."},"seoRefreshStatus":{"type":"string","description":"How the newest refresh from your SEO audit goes: idle, pending, processing, completed or failed."},"activeOperation":{"anyOf":[{"$ref":"#/components/schemas/GoogleAdsSearchOperationData"},{"type":"null"}],"description":"The job that runs now, or null."}},"required":["settings","summary","campaigns","seoRecommendations","initialGenerationStatus","seoRefreshStatus","activeOperation"],"title":"GoogleAdsSearchTreeData"},"GoogleGeoTargetData":{"type":"object","properties":{"id":{"type":"string","description":"The Google number of the place. Send it in targeting.geoTargets."},"name":{"type":"string","description":"The name of the place."},"countryCode":{"type":"string","description":"The country of the place, as two capital letters."},"targetType":{"type":"string","description":"What kind of place it is, like City, Region or Country."}},"required":["id","name","countryCode","targetType"],"title":"GoogleGeoTargetData"},"GridAdConnectionData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]}},"required":["id","name"],"title":"GridAdConnectionData"},"GridDealData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"stage":{"$ref":"#/components/schemas/DealStage"},"leadId":{"type":"integer"},"leadName":{"type":"string"},"ownerName":{"type":["string","null"]},"currency":{"type":"string"},"estimatedValue":{"type":["string","null"]},"value":{"type":["string","null"]},"lineItemsGross":{"type":["string","null"]},"winProbability":{"type":"integer"},"expectedCloseDate":{"type":["string","null"]},"closedAt":{"type":["string","null"]},"proformaGross":{"type":["string","null"]},"requiredDocumentIds":{"type":"array","items":{"type":"integer"}},"capabilities":{"$ref":"#/components/schemas/EntityActionCapabilitiesData"},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","name","stage","leadId","leadName","ownerName","currency","estimatedValue","value","lineItemsGross","winProbability","expectedCloseDate","closedAt","proformaGross","requiredDocumentIds","capabilities","createdAt","updatedAt"],"title":"GridDealData"},"GridIndexAdData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/AdType"},"state":{"$ref":"#/components/schemas/AdState","description":"Where the ad is: drafted, rejected, approved, published, scheduled or failed."},"budget":{"type":"number"},"budgetType":{"$ref":"#/components/schemas/AdBudgetType"},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":"string"},"issue":{"anyOf":[{"$ref":"#/components/schemas/AdIssueData"},{"type":"null"}],"description":"A problem of the ad, or null when there is none."},"pendingNetworkChange":{"$ref":"#/components/schemas/AdPendingNetworkChange","description":"What waits to go to the ad network: none, settings or creative (texts and image)."},"connection":{"$ref":"#/components/schemas/GridAdConnectionData","description":"The connection to the ad network, with id and name."},"platformName":{"type":["string","null"],"description":"The name of the ad network, like LinkedIn."},"currencyCode":{"type":["string","null"]},"last30Days":{"anyOf":[{"$ref":"#/components/schemas/AdMetricTotalsData"},{"type":"null"}],"description":"The numbers of the last 30 days, or null."}},"required":["id","name","type","state","budget","budgetType","startsAt","endsAt","createdAt","updatedAt","issue","pendingNetworkChange","connection","platformName","currencyCode","last30Days"],"title":"GridIndexAdData"},"GridIndexArticleData":{"type":"object","properties":{"id":{"type":"integer"},"tenantSequence":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"state":{"$ref":"#/components/schemas/ArticleState"},"rejectReason":{"type":["string","null"]},"campaign":{"anyOf":[{"$ref":"#/components/schemas/CampaignReferenceData"},{"type":"null"}]},"availableLocales":{"type":"array","items":{"type":"string"}},"articleCategoryId":{"type":["integer","null"]},"categorySlug":{"type":["string","null"]},"isVisible":{"type":"boolean"},"isCornerstone":{"type":"boolean"},"publication":{"anyOf":[{"$ref":"#/components/schemas/UpdatePublicationData"},{"type":"null"}]},"publishedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":"string"},"wordCount":{"type":["integer","null"]},"readingTime":{"type":["integer","null"]},"ownerName":{"type":["string","null"]},"helperNames":{"type":"array","items":{"type":"string"}}},"required":["id","tenantSequence","name","slug","state","rejectReason","campaign","availableLocales","articleCategoryId","categorySlug","isVisible","isCornerstone","publication","publishedAt","createdAt","updatedAt","wordCount","readingTime","ownerName","helperNames"],"title":"GridIndexArticleData"},"GridIndexCampaignData":{"type":"object","properties":{"id":{"type":"integer"},"tenantSequence":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"origin":{"$ref":"#/components/schemas/CampaignOrigin"},"mode":{"$ref":"#/components/schemas/CampaignMode"},"autonomyLevel":{"$ref":"#/components/schemas/CampaignAutonomyLevel"},"goal":{"$ref":"#/components/schemas/CampaignGoal"},"goalMetricType":{"anyOf":[{"$ref":"#/components/schemas/CampaignGoalMetricType"},{"type":"null"}]},"goalMetricTarget":{"type":["string","null"]},"goalMetricLabel":{"type":["string","null"]},"generationBudgetCredits":{"type":["integer","null"]},"generationSpentCredits":{"type":"integer"},"status":{"$ref":"#/components/schemas/CampaignStatus"},"startAt":{"type":["string","null"]},"endsOn":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":"string"},"destinationsCount":{"type":"integer"},"plannedDestinationsCount":{"type":["integer","null"]},"destinations":{"type":"array","items":{"$ref":"#/components/schemas/EmbedCampaignDestinationData"}}},"required":["id","tenantSequence","name","description","origin","mode","autonomyLevel","goal","goalMetricType","goalMetricTarget","goalMetricLabel","generationBudgetCredits","generationSpentCredits","status","startAt","endsOn","createdAt","updatedAt","destinationsCount","plannedDestinationsCount","destinations"],"title":"GridIndexCampaignData"},"GridIndexDealProductData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"sku":{"type":["string","null"]},"description":{"type":["string","null"]},"unit":{"type":"string"},"unitPrice":{"type":"string"},"currency":{"type":"string"},"vatRate":{"type":"string"},"billingInterval":{"$ref":"#/components/schemas/DealBillingInterval"},"defaultQuantity":{"type":"string"},"defaultDiscountPercent":{"type":"string"},"isActive":{"type":"boolean"},"dealsCount":{"type":"integer"},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","name","sku","description","unit","unitPrice","currency","vatRate","billingInterval","defaultQuantity","defaultDiscountPercent","isActive","dealsCount","createdAt","updatedAt"],"title":"GridIndexDealProductData"},"GridIndexEmailData":{"type":"object","properties":{"id":{"type":"integer"},"tenantSequence":{"type":"integer"},"name":{"type":"string"},"subject":{"type":"string"},"state":{"$ref":"#/components/schemas/EmailState"},"rejectReason":{"type":["string","null"]},"campaign":{"anyOf":[{"$ref":"#/components/schemas/CampaignReferenceData"},{"type":"null"}]},"template":{"anyOf":[{"$ref":"#/components/schemas/EmailGridTemplateData"},{"type":"null"}]},"fromEmail":{"type":["string","null"]},"replyTo":{"type":["string","null"]},"publication":{"anyOf":[{"$ref":"#/components/schemas/UpdatePublicationData"},{"type":"null"}]},"publishedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":"string"}},"required":["id","tenantSequence","name","subject","state","rejectReason","campaign","template","fromEmail","replyTo","publication","publishedAt","createdAt","updatedAt"],"title":"GridIndexEmailData"},"GridIndexFileData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"alt":{"type":["string","null"]},"slug":{"type":"string"},"extension":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"integer"},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"ratio":{"type":["number","null"]},"path":{"type":"string"},"url":{"type":"string"},"hash":{"type":"string"},"isAiGenerated":{"type":"boolean"},"isImageEdited":{"type":"boolean"},"isCroppable":{"type":"boolean"},"createdAt":{"type":["string","null"]},"isInUse":{"type":"boolean"},"canDelete":{"type":"boolean"}},"required":["id","name","alt","slug","extension","mimeType","size","width","height","ratio","path","url","hash","isAiGenerated","isImageEdited","isCroppable","createdAt","isInUse","canDelete"],"title":"GridIndexFileData"},"GridIndexLeadData":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"countryId":{"type":["integer","null"]},"countryIso":{"type":["string","null"]},"name":{"type":["string","null"]},"registrationNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"street":{"type":["string","null"]},"city":{"type":["string","null"]},"zip":{"type":["string","null"]},"stage":{"$ref":"#/components/schemas/LeadStage"},"personType":{"$ref":"#/components/schemas/LeadPersonType"},"source":{"anyOf":[{"$ref":"#/components/schemas/LeadSource"},{"type":"null"}]},"website":{"type":["string","null"]},"firmographicEnrichmentEligibility":{"$ref":"#/components/schemas/LeadFirmographicEnrichmentEligibilityData"},"engagementScore":{"type":"integer"},"heatStatus":{"$ref":"#/components/schemas/HeatStatus"},"countryName":{"type":["string","null"]},"primaryContactName":{"type":["string","null"]},"primaryContactEmail":{"type":["string","null"]},"userName":{"type":["string","null"]},"helperNames":{"type":"array","items":{"type":"string"}},"contactsCount":{"type":"integer"},"segmentsCount":{"type":"integer"},"tagsCount":{"type":"integer"},"pendingChangeCount":{"type":"integer"},"fitScore":{"type":["integer","null"]},"fitGrade":{"$ref":"#/components/schemas/LeadFitGrade"},"fitBasis":{"anyOf":[{"$ref":"#/components/schemas/LeadFitBasis"},{"type":"null"}]},"leadCustomFields":{"type":"array","items":{"$ref":"#/components/schemas/IndexLeadCustomFieldData"}},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/Lead.IndexLeadContactData"}},"outreachSummary":{"anyOf":[{"$ref":"#/components/schemas/ContactOutreachSummaryData"},{"type":"null"}]},"hasResearchProfile":{"type":"boolean"},"outreachStatus":{"$ref":"#/components/schemas/LeadOutreachStatus"},"predictedConversion":{"type":["integer","null"]},"predictionFactors":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadPredictionFactorData"}},"capabilities":{"$ref":"#/components/schemas/EntityActionCapabilitiesData"},"origin":{"$ref":"#/components/schemas/LeadOriginData"},"createdAt":{"type":["string","null"]}},"required":["id","tenantId","userId","countryId","countryIso","name","registrationNumber","vatNumber","street","city","zip","stage","personType","source","website","firmographicEnrichmentEligibility","engagementScore","heatStatus","countryName","primaryContactName","primaryContactEmail","userName","helperNames","contactsCount","segmentsCount","tagsCount","pendingChangeCount","fitScore","fitGrade","fitBasis","leadCustomFields","contacts","outreachSummary","hasResearchProfile","outreachStatus","predictedConversion","predictionFactors","createdAt"],"title":"GridIndexLeadData"},"GridIndexSocialPostData":{"type":"object","properties":{"id":{"type":"integer"},"batchId":{"type":"integer"},"name":{"type":"string"},"state":{"$ref":"#/components/schemas/SocialPostState"},"tenantSequence":{"type":"integer"},"socialPlatform":{"anyOf":[{"$ref":"#/components/schemas/SocialPostGridPlatformData"},{"type":"null"}]},"tenantOAuthPlatform":{"anyOf":[{"$ref":"#/components/schemas/SocialPostGridAccountData"},{"type":"null"}]},"campaign":{"anyOf":[{"$ref":"#/components/schemas/CampaignReferenceData"},{"type":"null"}]},"sourceArticle":{"anyOf":[{"$ref":"#/components/schemas/SocialPostSourceArticleOutputData"},{"type":"null"}]},"isAwaitingArticle":{"type":"boolean"},"commentsCount":{"type":"integer"},"threadItemsCount":{"type":"integer"},"files":{"type":"array","items":{"$ref":"#/components/schemas/SocialPostGridFileData"}},"publication":{"anyOf":[{"$ref":"#/components/schemas/UpdatePublicationData"},{"type":"null"}]},"publishedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":"string"}},"required":["id","batchId","name","state","tenantSequence","socialPlatform","tenantOAuthPlatform","campaign","sourceArticle","isAwaitingArticle","commentsCount","threadItemsCount","files","publication","publishedAt","createdAt","updatedAt"],"title":"GridIndexSocialPostData"},"GridIndexTenantCompetitorData":{"type":"object","properties":{"id":{"type":"integer"},"tenantProductId":{"type":["integer","null"]},"name":{"type":"string"},"competitorType":{"anyOf":[{"$ref":"#/components/schemas/TenantCompetitorType"},{"type":"null"}]},"websiteUrl":{"type":["string","null"]},"analyzedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]}},"required":["id","tenantProductId","name","competitorType","websiteUrl","analyzedAt","createdAt"],"title":"GridIndexTenantCompetitorData"},"GridIndexTenantCustomerData":{"type":"object","properties":{"id":{"type":"integer"},"tenantProductId":{"type":["integer","null"]},"name":{"type":"string"},"personaTitle":{"type":["string","null"]},"employeeBand":{"type":["string","null"]},"analyzedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]}},"required":["id","tenantProductId","name","personaTitle","employeeBand","analyzedAt","createdAt"],"title":"GridIndexTenantCustomerData"},"GridIndexTenantStrategyData":{"type":"object","properties":{"id":{"type":"integer"},"tenantProductId":{"type":["integer","null"]},"name":{"type":"string"},"category":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyCategory"},{"type":"null"}]},"phase":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyPhase"},{"type":"null"}]},"implementationType":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyImplementationType"},{"type":"null"}]},"stage":{"anyOf":[{"$ref":"#/components/schemas/TenantStrategyStage"},{"type":"null"}]},"priorityScore":{"type":["integer","null"]},"effectiveStatus":{"$ref":"#/components/schemas/TenantStrategyStatus"},"targetedPersonaIds":{"type":"array","items":{"type":"integer"}},"targetedCompetitorIds":{"type":"array","items":{"type":"integer"}},"createdAt":{"type":["string","null"]}},"required":["id","tenantProductId","name","category","phase","implementationType","stage","priorityScore","effectiveStatus","targetedPersonaIds","targetedCompetitorIds","createdAt"],"title":"GridIndexTenantStrategyData"},"GridIndexTopicData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"query":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/TopicType"},"frequency":{"$ref":"#/components/schemas/TopicFrequency"},"state":{"$ref":"#/components/schemas/TopicState"},"usedBySocialPostId":{"type":["integer","null"]},"usedByArticleId":{"type":["integer","null"]},"usedByEmailId":{"type":["integer","null"]},"lastCrawledAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":"string"},"ownerName":{"type":["string","null"]},"helperNames":{"type":"array","items":{"type":"string"}}},"required":["id","name","query","type","frequency","state","usedBySocialPostId","usedByArticleId","usedByEmailId","lastCrawledAt","createdAt","updatedAt","ownerName","helperNames"],"title":"GridIndexTopicData"},"HeatStatus":{"type":"string","enum":["cold","warm","hot"],"title":"HeatStatus"},"HookCategory":{"type":"string","enum":["curiosity","story","value","contrarian","social_proof","trigger_event","question","observation","poll","data_led","vivid_story","prediction","data_drop","pattern_interrupt","personal_stake"],"title":"HookCategory"},"ImageDestinationPreferenceOutputData":{"type":"object","properties":{"destination":{"$ref":"#/components/schemas/CampaignDestination","description":"The place where pictures go."},"profileId":{"type":["integer","null"],"description":"The number of the preset used there."},"imageShape":{"$ref":"#/components/schemas/ImageShape"},"mascotPresence":{"$ref":"#/components/schemas/MascotPresence"},"mascotBackground":{"$ref":"#/components/schemas/MascotBackground"},"isImageShapeEditable":{"type":"boolean"},"imageOverlay":{"anyOf":[{"$ref":"#/components/schemas/ImageOverlay"},{"type":"null"}]},"imageOverlayPresetId":{"type":["integer","null"]},"imageOverlays":{"type":"array","items":{"$ref":"#/components/schemas/ImageOverlay"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/ImageGroupPreferenceOutputData"}}},"required":["destination","profileId","imageShape","mascotPresence","mascotBackground","isImageShapeEditable","imageOverlay","imageOverlayPresetId","imageOverlays","groups"],"title":"ImageDestinationPreferenceOutputData"},"ImageGenerationStyle":{"type":"string","enum":["realistic","photographic","illustration","digital_art","3d_render","flat","minimalist","sketch","custom"],"title":"ImageGenerationStyle"},"ImageGenerationType":{"type":"string","enum":["generic","branded","personal","style_reference"],"title":"ImageGenerationType"},"ImageGroupPreferenceOutputData":{"type":"object","properties":{"goal":{"$ref":"#/components/schemas/ImageOverlayGoal"},"mascotPresence":{"$ref":"#/components/schemas/MascotPresence"},"captionVoice":{"$ref":"#/components/schemas/CaptionVoice"},"mascotBackground":{"$ref":"#/components/schemas/MascotBackground"},"mascotPlace":{"type":["string","null"]},"mascotFriend":{"type":["string","null"]},"isMascotAlone":{"type":"boolean"},"imageOverlay":{"anyOf":[{"$ref":"#/components/schemas/ImageOverlay"},{"type":"null"}]},"imageOverlayPresetId":{"type":["integer","null"]},"instruction":{"type":"string"}},"required":["goal","mascotPresence","captionVoice","mascotBackground","mascotPlace","mascotFriend","isMascotAlone","imageOverlay","imageOverlayPresetId","instruction"],"title":"ImageGroupPreferenceOutputData"},"ImageModelOptionData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the model."},"label":{"type":"string","description":"The name of the model."},"credits":{"type":"integer","description":"What one picture costs in credits."},"isDefault":{"type":"boolean","description":"true for the model AI uses when nothing else is chosen."}},"required":["id","label","credits","isDefault"],"title":"ImageModelOptionData"},"ImageOverlay":{"type":"string","enum":["poster","highlighter","notification","sticker","cover","date","ribbon","band","part","path","cinema","passepartout","none"],"title":"ImageOverlay"},"ImageOverlayGoal":{"type":"string","enum":["sell","teach","story","invite"],"title":"ImageOverlayGoal"},"ImageProfileMascotOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"file":{"anyOf":[{"$ref":"#/components/schemas/UpdateFileData"},{"type":"null"}]}},"required":["id","name","description","file"],"title":"ImageProfileMascotOutputData"},"ImageShape":{"type":"string","enum":["portrait","square","landscape"],"title":"ImageShape"},"ImageStyleAnalysisStatus":{"type":"string","enum":["pending","processing","completed","failed"],"title":"ImageStyleAnalysisStatus"},"InboxReplyResultData":{"type":"object","properties":{"scheduledPersonalEmailId":{"type":"integer"},"inboxTriageId":{"type":"integer"},"leadId":{"type":"integer"},"emailConversationId":{"type":"integer"},"subject":{"type":"string"},"body":{"type":"string"},"status":{"type":"string"}},"required":["scheduledPersonalEmailId","inboxTriageId","leadId","emailConversationId","subject","body","status"],"title":"InboxReplyResultData"},"InboxTriageData":{"type":"object","properties":{"id":{"type":"integer"},"emailConversationId":{"type":"integer"},"leadId":{"type":"integer"},"inboundMessageId":{"type":"integer"},"replyGoal":{"type":["string","null"]},"replyBrief":{"type":["string","null"]},"triagedAt":{"type":"string"},"recommendationId":{"type":["integer","null"]}},"required":["id","emailConversationId","leadId","inboundMessageId","replyGoal","replyBrief","triagedAt","recommendationId"],"title":"InboxTriageData"},"InboxTriagePreviousData":{"type":"object","properties":{"replyGoal":{"type":["string","null"]},"triagedAt":{"type":"string"}},"required":["replyGoal","triagedAt"],"title":"InboxTriagePreviousData"},"InboxTriageQueueContactData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","email"],"title":"InboxTriageQueueContactData"},"InboxTriageQueueData":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/InboxTriageQueueItemData"},"description":"Threads that wait for triage, the oldest answer first. Each one has the latest messages in `thread`, the manageable `leads` linked to the sender, and `previousTriage` when the thread was triaged before."}},"required":["items"],"title":"InboxTriageQueueData"},"InboxTriageQueueItemData":{"type":"object","properties":{"conversationId":{"type":"integer"},"subject":{"type":["string","null"]},"contact":{"$ref":"#/components/schemas/InboxTriageQueueContactData"},"leads":{"type":"array","items":{"$ref":"#/components/schemas/InboxTriageQueueLeadData"}},"latestInboundMessageId":{"type":"integer"},"latestInboundAt":{"type":"string"},"thread":{"type":"array","items":{"$ref":"#/components/schemas/InboxTriageThreadMessageData"}},"previousTriage":{"anyOf":[{"$ref":"#/components/schemas/InboxTriagePreviousData"},{"type":"null"}]}},"required":["conversationId","subject","contact","leads","latestInboundMessageId","latestInboundAt","thread","previousTriage"],"title":"InboxTriageQueueItemData"},"InboxTriageQueueLeadData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"stage":{"type":"string"}},"required":["id","name","stage"],"title":"InboxTriageQueueLeadData"},"InboxTriageThreadMessageData":{"type":"object","properties":{"direction":{"$ref":"#/components/schemas/EmailMessageDirection"},"sentAt":{"type":["string","null"]},"subject":{"type":["string","null"]},"text":{"type":"string"}},"required":["direction","sentAt","subject","text"],"title":"InboxTriageThreadMessageData"},"IndexContactCustomFieldData":{"type":"object","properties":{"customFieldId":{"type":"integer"},"customFieldLabel":{"type":"string"},"customFieldType":{"$ref":"#/components/schemas/CustomFieldType"},"value":{"type":["string","null"]}},"required":["customFieldId","customFieldLabel","customFieldType","value"],"title":"IndexContactCustomFieldData"},"IndexContactData":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"integer"},"tenantId":{"type":"integer"},"type":{"$ref":"#/components/schemas/ContactType"},"email":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"position":{"type":["string","null"]},"preferredContactChannel":{"anyOf":[{"$ref":"#/components/schemas/PreferredContactChannel"},{"type":"null"}]},"lastActivityAt":{"type":["string","null"]},"emailVerifiedAt":{"type":["string","null"]},"communicationPreference":{"anyOf":[{"$ref":"#/components/schemas/UpdateCommunicationPreferenceData"},{"type":"null"}]},"lead":{"anyOf":[{"$ref":"#/components/schemas/UpdateLeadData"},{"type":"null"}]},"segmentsCount":{"type":"integer"},"tagsCount":{"type":"integer"},"pendingChangeCount":{"type":"integer"},"contactCustomFields":{"type":"array","items":{"$ref":"#/components/schemas/IndexContactCustomFieldData"}},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","userId","tenantId","type","email","firstName","lastName","name","phone","position","preferredContactChannel","lastActivityAt","emailVerifiedAt","communicationPreference","lead","segmentsCount","tagsCount","pendingChangeCount","contactCustomFields","createdAt","updatedAt"],"title":"IndexContactData"},"IndexLeadCustomFieldData":{"type":"object","properties":{"customFieldId":{"type":"integer"},"customFieldLabel":{"type":"string"},"customFieldType":{"$ref":"#/components/schemas/CustomFieldType"},"value":{"type":["string","null"]}},"required":["customFieldId","customFieldLabel","customFieldType","value"],"title":"IndexLeadCustomFieldData"},"IndexLeadResearchProfileData":{"type":"object","properties":{"tenantId":{"type":"integer","description":"The number of your company."},"url":{"type":"string","description":"The web address of the company."},"batchId":{"type":["string","null"],"description":"The number of the research run, or null."},"companyName":{"type":["string","null"],"description":"The name of the company, or null."},"logoIconUrl":{"type":["string","null"],"description":"The address of the small logo, or null."},"logoFullUrl":{"type":["string","null"],"description":"The address of the full logo, or null."},"description":{"type":["string","null"],"description":"A short description of the company, or null."},"websiteLanguageId":{"type":["integer","null"],"description":"The language of the website, or null."},"leadId":{"type":"integer","description":"The number of the lead."},"sourceFileId":{"type":["integer","null"],"description":"The number of the uploaded source file, or null."},"fitScore":{"type":["integer","null"],"description":"How well the lead fits, or null."},"createdAt":{"type":["string","null"],"description":"When the profile was created."},"updatedAt":{"type":["string","null"],"description":"When the profile last changed."}},"title":"IndexLeadResearchProfileData"},"IndexTaskData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"assigneeId":{"type":"integer"},"assignee":{"anyOf":[{"$ref":"#/components/schemas/UserSummaryData"},{"type":"null"}]},"taskableType":{"anyOf":[{"$ref":"#/components/schemas/TaskableType"},{"type":"null"}]},"taskableId":{"type":["integer","null"]},"noteId":{"type":["integer","null"]},"title":{"type":"string"},"description":{"type":["string","null"]},"dueAt":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/TaskStatus"},"completedAt":{"type":["string","null"]},"pinnedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"taskableLabel":{"type":["string","null"]},"cadenceStep":{"anyOf":[{"$ref":"#/components/schemas/TaskCadenceStepData"},{"type":"null"}]},"outreachTouchId":{"type":["integer","null"]}},"required":["id","tenantId","userId","assigneeId","assignee","taskableType","taskableId","noteId","title","description","dueAt","status","completedAt","pinnedAt","createdAt","updatedAt","taskableLabel","cadenceStep","outreachTouchId"],"title":"IndexTaskData"},"InsufficientScopeResponse":{"type":"object","properties":{"status":{"type":"string","const":"error"},"message":{"type":"string"},"payload":{"type":"object","properties":{"error":{"type":"string","enum":["insufficient_scope","route_outside_surface"]},"requiredScopes":{"type":"array","items":{"type":"string"}},"route":{"type":"string"}},"required":["error"]}},"required":["status","message","payload"],"title":"InsufficientScopeResponse"},"IntegrationsData":{"type":"object","properties":{"count":{"type":["integer","null"]},"keyIntegrations":{"type":"array","items":{"type":"string"}}},"required":["count","keyIntegrations"],"title":"IntegrationsData"},"InvoiceMailType":{"type":"string","enum":["invoice","pre_due_reminder","first_reminder","second_reminder","final_reminder","thank_you","cancellation","correction","proforma","tax_document","final_invoice"],"title":"InvoiceMailType"},"JobsToBeDoneData":{"type":"object","properties":{"kind":{"type":"string"},"label":{"type":"string"}},"required":["kind","label"],"title":"JobsToBeDoneData"},"Lead.IndexLeadContactData":{"type":"object","properties":{"id":{"type":"string"},"leadId":{"type":"string"},"contactId":{"type":"string"},"isPrimary":{"type":"boolean"},"type":{"$ref":"#/components/schemas/ContactType"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"position":{"type":["string","null"]},"lastActivityAt":{"type":["string","null"]},"emailVerifiedAt":{"type":["string","null"]},"communicationPreference":{"anyOf":[{"$ref":"#/components/schemas/UpdateCommunicationPreferenceData"},{"type":"null"}]},"pendingChangeCount":{"type":"integer"},"contactCustomFields":{"type":"array","items":{"$ref":"#/components/schemas/IndexContactCustomFieldData"}},"outreachSummary":{"anyOf":[{"$ref":"#/components/schemas/ContactOutreachSummaryData"},{"type":"null"}]}},"required":["id","leadId","contactId","isPrimary","type","firstName","lastName","name","email","phone","position","lastActivityAt","emailVerifiedAt","communicationPreference","pendingChangeCount","contactCustomFields","outreachSummary"],"title":"Lead.IndexLeadContactData"},"LeadAcquisitionDayData":{"type":"object","properties":{"date":{"type":"string"},"spend":{"type":"array","items":{"$ref":"#/components/schemas/ConversionValueTotalData"}},"leads":{"type":"integer"},"customers":{"type":"integer"},"customerRevenue":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ConversionValueTotalData"}}},"required":["date","spend","leads","customers","customerRevenue"],"title":"LeadAcquisitionDayData"},"LeadAcquisitionSectionData":{"type":"object","properties":{"days":{"type":"array","items":{"$ref":"#/components/schemas/LeadAcquisitionDayData"}},"previousDays":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadAcquisitionDayData"}}},"required":["days","previousDays"],"title":"LeadAcquisitionSectionData"},"LeadAnalyticsAbandonedFieldData":{"type":"object","properties":{"label":{"type":"string"},"status":{"$ref":"#/components/schemas/AbandonedFieldStatus"}},"required":["label","status"],"title":"LeadAnalyticsAbandonedFieldData"},"LeadAnalyticsAbandonedFormData":{"type":"object","properties":{"formId":{"type":"integer"},"formName":{"type":"string"},"startedAt":{"type":"string"},"lastField":{"type":["string","null"]},"filledFields":{"type":"integer"},"totalFields":{"type":"integer"},"contactName":{"type":["string","null"]},"fields":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsAbandonedFieldData"}}},"required":["formId","formName","startedAt","lastField","filledFields","totalFields","contactName","fields"],"title":"LeadAnalyticsAbandonedFormData"},"LeadAnalyticsAdsAcquisitionSourceData":{"type":"object","properties":{"platform":{"type":"string"},"campaignId":{"type":["integer","null"]},"campaignName":{"type":["string","null"]},"spend":{"type":"array","items":{"$ref":"#/components/schemas/ConversionValueTotalData"}},"customers":{"type":"integer"}},"required":["platform","campaignId","campaignName","spend","customers"],"title":"LeadAnalyticsAdsAcquisitionSourceData"},"LeadAnalyticsAdsClickData":{"type":"object","properties":{"click":{"$ref":"#/components/schemas/AdClickOutputData"},"contactName":{"type":["string","null"]}},"required":["click","contactName"],"title":"LeadAnalyticsAdsClickData"},"LeadAnalyticsAdsData":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/LeadAnalyticsAdsSummaryData","description":"How many ad clicks there were and what Fusio sent back to the ad networks."},"clicks":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsAdsClickData"},"description":"Each click on an ad."},"sources":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsAdsSourceData"}},"milestones":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsAdsMilestoneData"}},"hasAdConsent":{"type":"boolean","description":"true when the lead agreed to ad tracking."},"revenue":{"$ref":"#/components/schemas/CustomerRevenueData","description":"Money from deals and invoices of the lead."},"acquisitionSource":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsAdsAcquisitionSourceData"},{"type":"null"}]}},"required":["summary","clicks","sources","milestones","hasAdConsent","revenue","acquisitionSource"],"title":"LeadAnalyticsAdsData"},"LeadAnalyticsAdsMilestoneData":{"type":"object","properties":{"event":{"type":"string"},"detail":{"type":["string","null"]},"occurredAt":{"type":"string"},"status":{"type":"string"},"ineligibleReason":{"type":["string","null"]},"value":{"type":["string","null"]},"currency":{"type":["string","null"]}},"required":["event","detail","occurredAt","status","ineligibleReason","value","currency"],"title":"LeadAnalyticsAdsMilestoneData"},"LeadAnalyticsAdsSourceData":{"type":"object","properties":{"source":{"type":"string"},"platform":{"type":["string","null"]},"campaignId":{"type":["integer","null"]},"campaignName":{"type":["string","null"]},"utmCampaign":{"type":["string","null"]},"clicks":{"type":"integer"}},"required":["source","platform","campaignId","campaignName","utmCampaign","clicks"],"title":"LeadAnalyticsAdsSourceData"},"LeadAnalyticsAdsSummaryData":{"type":"object","properties":{"clicksTotal":{"type":"integer"},"firstClickAt":{"type":["string","null"]},"conversionsUploaded":{"type":"integer"},"valueTotals":{"type":"array","items":{"$ref":"#/components/schemas/ConversionValueTotalData"}}},"required":["clicksTotal","firstClickAt","conversionsUploaded","valueTotals"],"title":"LeadAnalyticsAdsSummaryData"},"LeadAnalyticsBuyingCommitteeMemberData":{"type":"object","properties":{"leadContactId":{"type":"integer"},"contactId":{"type":"integer"},"name":{"type":"string"},"role":{"type":"string"}},"required":["leadContactId","contactId","name","role"],"title":"LeadAnalyticsBuyingCommitteeMemberData"},"LeadAnalyticsCadenceStepData":{"type":"object","properties":{"enrollmentId":{"type":"integer"},"templateName":{"type":"string"},"stepTitle":{"type":["string","null"]},"dueAt":{"type":["string","null"]}},"required":["enrollmentId","templateName","stepTitle","dueAt"],"title":"LeadAnalyticsCadenceStepData"},"LeadAnalyticsCampaignChannelData":{"type":"object","properties":{"sent":{"type":"integer"},"opens":{"type":"integer"},"clicks":{"type":"integer"}},"required":["sent","opens","clicks"],"title":"LeadAnalyticsCampaignChannelData"},"LeadAnalyticsConversionData":{"type":"object","properties":{"kind":{"type":"string"},"at":{"type":"string"},"formId":{"type":["integer","null"]},"formName":{"type":["string","null"]},"submissionId":{"type":["integer","null"]},"bookingId":{"type":["integer","null"]}},"required":["kind","at","formId","formName","submissionId","bookingId"],"title":"LeadAnalyticsConversionData"},"LeadAnalyticsConversionsData":{"type":"object","properties":{"count":{"type":"integer"},"first":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsConversionData"},{"type":"null"}]},"last":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsConversionData"},{"type":"null"}]}},"required":["count","first","last"],"title":"LeadAnalyticsConversionsData"},"LeadAnalyticsData":{"type":"object","properties":{"stats":{"$ref":"#/components/schemas/LeadAnalyticsStatsData","description":"Counts of campaign and personal emails, with opens and clicks, for the whole lead."},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/LeadContactAnalyticsData"},"description":"The same numbers for each contact."},"contactOptions":{"type":"array","items":{"$ref":"#/components/schemas/LeadContactAnalyticsOptionData"},"description":"The contacts you can send as contact_id."}},"required":["stats","contacts","contactOptions"],"title":"LeadAnalyticsData"},"LeadAnalyticsDealContactData":{"type":"object","properties":{"contactId":{"type":"integer"},"name":{"type":"string"},"role":{"type":["string","null"]}},"required":["contactId","name","role"],"title":"LeadAnalyticsDealContactData"},"LeadAnalyticsDealData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"stage":{"type":"string"},"value":{"type":["string","null"]},"currency":{"type":"string"},"winProbability":{"type":"integer"},"expectedCloseDate":{"type":["string","null"]},"closedAt":{"type":["string","null"]},"lostReason":{"type":["string","null"]},"createdAt":{"type":"string"},"stageEnteredAt":{"type":"string"},"owner":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsDealOwnerData"},{"type":"null"}]},"origin":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsDealOriginData"},{"type":"null"}]},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsDealContactData"}},"nextTask":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsTaskLinkData"},{"type":"null"}]},"documents":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadAnalyticsDealDocumentData"}},"stageHistory":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsDealStageChangeData"}},"notes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadAnalyticsDealNoteData"}},"notesCount":{"type":["integer","null"]},"openTasks":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadAnalyticsDealTaskData"}},"openTasksCount":{"type":["integer","null"]}},"required":["id","name","stage","value","currency","winProbability","expectedCloseDate","closedAt","lostReason","createdAt","stageEnteredAt","owner","origin","contacts","nextTask","documents","stageHistory","notes","notesCount","openTasks","openTasksCount"],"title":"LeadAnalyticsDealData"},"LeadAnalyticsDealDocumentData":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"}},"required":["id","title","kind","status"],"title":"LeadAnalyticsDealDocumentData"},"LeadAnalyticsDealNoteData":{"type":"object","properties":{"id":{"type":"integer"},"excerpt":{"type":"string"},"authorName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","excerpt","authorName","createdAt"],"title":"LeadAnalyticsDealNoteData"},"LeadAnalyticsDealOriginData":{"type":"object","properties":{"inquiryId":{"type":["integer","null"]},"submissionId":{"type":["integer","null"]}},"required":["inquiryId","submissionId"],"title":"LeadAnalyticsDealOriginData"},"LeadAnalyticsDealOwnerData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"],"title":"LeadAnalyticsDealOwnerData"},"LeadAnalyticsDealStageChangeData":{"type":"object","properties":{"stage":{"type":"string"},"previousStage":{"type":["string","null"]},"at":{"type":"string"},"userName":{"type":["string","null"]}},"required":["stage","previousStage","at","userName"],"title":"LeadAnalyticsDealStageChangeData"},"LeadAnalyticsDealTaskData":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"dueAt":{"type":["string","null"]},"status":{"type":"string"},"assigneeName":{"type":["string","null"]}},"required":["id","title","dueAt","status","assigneeName"],"title":"LeadAnalyticsDealTaskData"},"LeadAnalyticsDealsData":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/LeadAnalyticsDealsSummaryData","description":"Open, won and lost deals with their value."},"deals":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsDealData"},"description":"Each deal with its stage, people, tasks and notes."}},"required":["summary","deals"],"title":"LeadAnalyticsDealsData"},"LeadAnalyticsDealsSummaryData":{"type":"object","properties":{"openCount":{"type":"integer"},"openValue":{"type":["string","null"]},"weightedValue":{"type":["string","null"]},"currency":{"type":["string","null"]},"wonCount":{"type":"integer"},"wonValue":{"type":["string","null"]},"lostCount":{"type":"integer"},"nextExpectedCloseDate":{"type":["string","null"]}},"required":["openCount","openValue","weightedValue","currency","wonCount","wonValue","lostCount","nextExpectedCloseDate"],"title":"LeadAnalyticsDealsSummaryData"},"LeadAnalyticsEmailData":{"type":"object","properties":{"id":{"type":"integer"},"channel":{"type":"string"},"subject":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"sentAt":{"type":"string"},"recipientEmail":{"type":["string","null"]},"contactName":{"type":["string","null"]},"opens":{"type":"integer"},"clicks":{"type":"integer"},"replied":{"type":"boolean"},"bouncedAt":{"type":["string","null"]},"deliveryStatus":{"type":["string","null"]},"conversationId":{"type":["integer","null"]},"unsubscribedAt":{"type":["string","null"]}},"required":["id","channel","subject","campaignName","sentAt","recipientEmail","contactName","opens","clicks","replied","bouncedAt","deliveryStatus","conversationId","unsubscribedAt"],"title":"LeadAnalyticsEmailData"},"LeadAnalyticsEmailsData":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/LeadAnalyticsEmailsSummaryData","description":"How many emails were sent, delivered, opened, clicked, answered and bounced."},"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsEmailData"},"description":"The emails, newest first."},"nextCursor":{"type":["string","null"],"description":"Send it as cursor to get the next page. null on the last page."}},"required":["summary","data","nextCursor"],"title":"LeadAnalyticsEmailsData"},"LeadAnalyticsEmailsSummaryData":{"type":"object","properties":{"sent":{"type":"integer"},"delivered":{"type":"integer"},"opened":{"type":"integer"},"clicked":{"type":"integer"},"replied":{"type":"integer"},"bounced":{"type":"integer"}},"required":["sent","delivered","opened","clicked","replied","bounced"],"title":"LeadAnalyticsEmailsSummaryData"},"LeadAnalyticsFormFunnelData":{"type":"object","properties":{"formId":{"type":"integer"},"formName":{"type":"string"},"views":{"type":"integer"},"starts":{"type":"integer"},"submits":{"type":"integer"},"lastActivityAt":{"type":["string","null"]}},"required":["formId","formName","views","starts","submits","lastActivityAt"],"title":"LeadAnalyticsFormFunnelData"},"LeadAnalyticsFormSubmissionData":{"type":"object","properties":{"id":{"type":"integer"},"formId":{"type":"integer"},"formName":{"type":"string"},"createdAt":{"type":"string"},"contact":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsSubmissionContactData"},{"type":"null"}]},"source":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsSubmissionSourceData"},{"type":"null"}]},"answers":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsSubmissionAnswerData"}},"inquiry":{"anyOf":[{"$ref":"#/components/schemas/LeadHistorySubmissionInquiryData"},{"type":"null"}]},"booking":{"anyOf":[{"$ref":"#/components/schemas/LeadHistorySubmissionBookingData"},{"type":"null"}]},"deal":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsSubmissionDealData"},{"type":"null"}]},"points":{"type":["integer","null"]},"tasks":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadAnalyticsDealTaskData"}}},"required":["id","formId","formName","createdAt","contact","source","answers","inquiry","booking","deal","points","tasks"],"title":"LeadAnalyticsFormSubmissionData"},"LeadAnalyticsFormsData":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/LeadAnalyticsFormsSummaryData","description":"How many forms were sent and what came out of them."},"byForm":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsFormFunnelData"},"description":"The numbers for each form: views, starts and sends."},"abandoned":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsAbandonedFormData"},"description":"Forms the people of the lead started and did not send."},"submissions":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsFormSubmissionData"},"description":"The sent forms with the answers."}},"required":["summary","byForm","abandoned","submissions"],"title":"LeadAnalyticsFormsData"},"LeadAnalyticsFormsSummaryData":{"type":"object","properties":{"submissions":{"type":"integer"},"forms":{"type":"integer"},"inquiries":{"type":"integer"},"bookings":{"type":"integer"},"deals":{"type":"integer"},"abandoned":{"type":"integer"}},"required":["submissions","forms","inquiries","bookings","deals","abandoned"],"title":"LeadAnalyticsFormsSummaryData"},"LeadAnalyticsJourneyData":{"type":"object","properties":{"stages":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsJourneyStageData"}},"currentStage":{"anyOf":[{"$ref":"#/components/schemas/LeadJourneyStage"},{"type":"null"}]},"openDealName":{"type":["string","null"]}},"required":["stages","currentStage","openDealName"],"title":"LeadAnalyticsJourneyData"},"LeadAnalyticsJourneyStageData":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/LeadJourneyStage"},"count":{"type":"integer"},"firstAt":{"type":["string","null"]}},"required":["stage","count","firstAt"],"title":"LeadAnalyticsJourneyStageData"},"LeadAnalyticsOriginData":{"type":"object","properties":{"channel":{"type":"string"},"utmSource":{"type":["string","null"]},"utmMedium":{"type":["string","null"]},"utmCampaign":{"type":["string","null"]},"referer":{"type":["string","null"]},"landingPath":{"type":["string","null"]},"firstSeenAt":{"type":"string"}},"required":["channel","utmSource","utmMedium","utmCampaign","referer","landingPath","firstSeenAt"],"title":"LeadAnalyticsOriginData"},"LeadAnalyticsOverviewData":{"type":"object","properties":{"firstTouchAt":{"type":["string","null"],"description":"When the lead first showed up."},"lastTouchAt":{"type":["string","null"],"description":"When something last happened with the lead."},"origin":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsOriginData"},{"type":"null"}],"description":"Where the lead first came from. null when Fusio does not know."},"conversions":{"$ref":"#/components/schemas/LeadAnalyticsConversionsData"},"upcoming":{"$ref":"#/components/schemas/LeadAnalyticsUpcomingData","description":"What is planned next: bookings, tasks, the next cadence step and planned emails."},"pendingOutcomeBookings":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsPendingOutcomeBookingData"}},"journey":{"$ref":"#/components/schemas/LeadAnalyticsJourneyData","description":"The stages the lead went through and where it is now."},"pinnedNote":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsPinnedNoteData"},{"type":"null"}]},"buyingCommittee":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsBuyingCommitteeMemberData"}}},"required":["firstTouchAt","lastTouchAt","origin","conversions","upcoming","pendingOutcomeBookings","journey","pinnedNote","buyingCommittee"],"title":"LeadAnalyticsOverviewData"},"LeadAnalyticsPendingOutcomeBookingData":{"type":"object","properties":{"id":{"type":"integer"},"startsAtUtc":{"type":"string"},"hostName":{"type":["string","null"]}},"required":["id","startsAtUtc","hostName"],"title":"LeadAnalyticsPendingOutcomeBookingData"},"LeadAnalyticsPersonalChannelData":{"type":"object","properties":{"sent":{"type":"integer"},"opens":{"type":"integer"}},"required":["sent","opens"],"title":"LeadAnalyticsPersonalChannelData"},"LeadAnalyticsPinnedNoteData":{"type":"object","properties":{"id":{"type":"integer"},"excerpt":{"type":"string"},"authorName":{"type":["string","null"]},"pinnedAt":{"type":"string"}},"required":["id","excerpt","authorName","pinnedAt"],"title":"LeadAnalyticsPinnedNoteData"},"LeadAnalyticsRelatedData":{"type":"object","properties":{"matchedBy":{"type":["string","null"],"description":"What the leads share: the same company number, or the same domain of the web or of emails. null when nothing matched."},"leads":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsRelatedLeadData"},"description":"The related leads."}},"required":["matchedBy","leads"],"title":"LeadAnalyticsRelatedData"},"LeadAnalyticsRelatedLeadData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"stage":{"type":"string"},"ownerName":{"type":["string","null"]},"dealsCount":{"type":"integer"},"wonDealsCount":{"type":"integer"},"lastActivityAt":{"type":["string","null"]}},"required":["id","name","stage","ownerName","dealsCount","wonDealsCount","lastActivityAt"],"title":"LeadAnalyticsRelatedLeadData"},"LeadAnalyticsStatsData":{"type":"object","properties":{"campaign":{"$ref":"#/components/schemas/LeadAnalyticsCampaignChannelData"},"personal":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsPersonalChannelData"},{"type":"null"}]},"engagementScore":{"type":"integer"},"heatStatus":{"type":"string"},"frequencyRatio":{"type":"number"},"respondedCampaigns":{"type":"integer"},"totalCampaigns":{"type":"integer"}},"required":["campaign","personal","engagementScore","heatStatus","frequencyRatio","respondedCampaigns","totalCampaigns"],"title":"LeadAnalyticsStatsData"},"LeadAnalyticsSubmissionAnswerData":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"title":"LeadAnalyticsSubmissionAnswerData"},"LeadAnalyticsSubmissionContactData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"email":{"type":["string","null"]}},"required":["id","name","email"],"title":"LeadAnalyticsSubmissionContactData"},"LeadAnalyticsSubmissionDealData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"stage":{"type":"string"},"relation":{"type":"string"}},"required":["id","name","stage","relation"],"title":"LeadAnalyticsSubmissionDealData"},"LeadAnalyticsSubmissionSourceData":{"type":"object","properties":{"utmSource":{"type":["string","null"]},"utmMedium":{"type":["string","null"]},"utmCampaign":{"type":["string","null"]},"referer":{"type":["string","null"]}},"required":["utmSource","utmMedium","utmCampaign","referer"],"title":"LeadAnalyticsSubmissionSourceData"},"LeadAnalyticsTaskLinkData":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"dueAt":{"type":["string","null"]}},"required":["id","title","dueAt"],"title":"LeadAnalyticsTaskLinkData"},"LeadAnalyticsTimeSeriesDayData":{"type":"object","properties":{"date":{"type":"string","description":"The day."},"campaignSent":{"type":"integer"},"campaignOpens":{"type":"integer"},"campaignClicks":{"type":"integer"},"personalSent":{"type":"integer"},"personalOpens":{"type":"integer"},"replies":{"type":"integer"},"visits":{"type":"integer","description":"Web visits that day."},"pageViews":{"type":"integer"},"formViews":{"type":"integer"},"formStarts":{"type":"integer"},"formSubmits":{"type":"integer","description":"Forms sent that day."},"bookings":{"type":"integer"},"adClicks":{"type":"integer"},"steps":{"type":"integer"},"strongSteps":{"type":"integer"},"points":{"type":"integer","description":"Points the lead got that day."}},"required":["date","campaignSent","campaignOpens","campaignClicks","personalSent","personalOpens","replies","visits","pageViews","formViews","formStarts","formSubmits","bookings","adClicks","steps","strongSteps","points"],"title":"LeadAnalyticsTimeSeriesDayData"},"LeadAnalyticsUpcomingBookingData":{"type":"object","properties":{"id":{"type":"integer"},"startsAtUtc":{"type":"string"},"status":{"type":"string"},"hostName":{"type":["string","null"]}},"required":["id","startsAtUtc","status","hostName"],"title":"LeadAnalyticsUpcomingBookingData"},"LeadAnalyticsUpcomingData":{"type":"object","properties":{"bookings":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsUpcomingBookingData"}},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsTaskLinkData"}},"cadenceStep":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsCadenceStepData"},{"type":"null"}]},"scheduledEmails":{"type":"integer"}},"required":["bookings","tasks","cadenceStep","scheduledEmails"],"title":"LeadAnalyticsUpcomingData"},"LeadAnalyticsWebActivityCellData":{"type":"object","properties":{"weekday":{"type":"integer"},"hour":{"type":"integer"},"count":{"type":"integer"}},"required":["weekday","hour","count"],"title":"LeadAnalyticsWebActivityCellData"},"LeadAnalyticsWebData":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/LeadAnalyticsWebSummaryData","description":"Visits, page views and how long the visits took."},"pages":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsWebPageData"},"description":"The pages the people of the lead looked at."},"sources":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsWebSourceData"},"description":"Where the visits came from."},"activity":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsWebActivityCellData"},"description":"Visits by day of the week and hour."}},"required":["summary","pages","sources","activity"],"title":"LeadAnalyticsWebData"},"LeadAnalyticsWebPageData":{"type":"object","properties":{"path":{"type":"string"},"url":{"type":["string","null"]},"title":{"type":["string","null"]},"views":{"type":"integer"},"lastViewedAt":{"type":"string"}},"required":["path","url","title","views","lastViewedAt"],"title":"LeadAnalyticsWebPageData"},"LeadAnalyticsWebSourceData":{"type":"object","properties":{"channel":{"type":"string"},"visits":{"type":"integer"}},"required":["channel","visits"],"title":"LeadAnalyticsWebSourceData"},"LeadAnalyticsWebSummaryData":{"type":"object","properties":{"visits":{"type":"integer"},"pageViews":{"type":"integer"},"uniquePages":{"type":"integer"},"lastVisitAt":{"type":["string","null"]},"averageVisitDurationSeconds":{"type":["integer","null"]},"measuredVisits":{"type":"integer"},"totalVisitDurationSeconds":{"type":["integer","null"]},"lastPagePath":{"type":["string","null"]},"lastPageTitle":{"type":["string","null"]}},"required":["visits","pageViews","uniquePages","lastVisitAt","averageVisitDurationSeconds","measuredVisits","totalVisitDurationSeconds","lastPagePath","lastPageTitle"],"title":"LeadAnalyticsWebSummaryData"},"LeadBillingAddressData":{"type":"object","properties":{"name":{"type":["string","null"]},"street":{"type":["string","null"]},"city":{"type":["string","null"]},"zip":{"type":["string","null"]},"countryIso":{"type":["string","null"]}},"required":["name","street","city","zip","countryIso"],"title":"LeadBillingAddressData"},"LeadCadenceBouncedStepData":{"type":"object","properties":{"leadCadenceStepId":{"type":"integer"},"deliveryFailedAt":{"type":["string","null"]},"bounceReason":{"type":["string","null"]},"bouncedEmail":{"type":"string"},"contactId":{"type":["integer","null"]}},"required":["leadCadenceStepId","deliveryFailedAt","bounceReason","bouncedEmail","contactId"],"title":"LeadCadenceBouncedStepData"},"LeadCadenceDelayUnit":{"type":"string","enum":["minutes","hours","days"],"title":"LeadCadenceDelayUnit"},"LeadCadenceEnrollmentData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"leadId":{"type":"integer"},"leadCadenceTemplateId":{"type":"integer"},"leadAssigneeId":{"type":"integer","description":"The user who runs the plan."},"userId":{"type":"integer"},"state":{"$ref":"#/components/schemas/LeadCadenceEnrollmentState","description":"Whether the cadence still runs."},"template":{"$ref":"#/components/schemas/LeadCadenceTemplateData","description":"The cadence the lead is in."},"currentStep":{"anyOf":[{"$ref":"#/components/schemas/LeadCadenceStepData"},{"type":"null"}],"description":"The step the lead is at now. null when there is none."},"currentTask":{"anyOf":[{"$ref":"#/components/schemas/IndexTaskData"},{"type":"null"}]},"startedAt":{"type":"string"},"pausedAt":{"type":["string","null"]},"stoppedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"replyDueAt":{"type":["string","null"]},"stopReason":{"anyOf":[{"$ref":"#/components/schemas/LeadCadenceStopReason"},{"type":"null"}]},"stopNote":{"type":["string","null"]},"stopSource":{"anyOf":[{"$ref":"#/components/schemas/LeadCadenceStopSourceData"},{"type":"null"}]},"stoppedSequencesCount":{"type":["integer","null"]},"stoppedByUserId":{"type":["integer","null"]},"resolution":{"anyOf":[{"$ref":"#/components/schemas/LeadCadenceResolution"},{"type":"null"}]},"resolvedAt":{"type":["string","null"]},"resolvedByUserId":{"type":["integer","null"]},"currentPathId":{"type":["integer","null"]},"leadCadenceReactionId":{"type":["integer","null"]},"resumesAt":{"type":["string","null"]},"outreachAction":{"anyOf":[{"$ref":"#/components/schemas/PrivateOutreachAction"},{"type":"null"}],"description":"The goal of the outreach. null when none was given."},"messageFrameworkId":{"type":["integer","null"],"description":"The message framework the plan's messages follow. null when none was given."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"scheduledEmails":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceScheduledEmailData"}},"bouncedSteps":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceBouncedStepData"}},"skippedSteps":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceSkippedStepData"}}},"required":["id","tenantId","leadId","leadCadenceTemplateId","leadAssigneeId","userId","state","template","currentStep","currentTask","startedAt","pausedAt","stoppedAt","completedAt","replyDueAt","stopReason","stopNote","stopSource","stoppedSequencesCount","stoppedByUserId","resolution","resolvedAt","resolvedByUserId","currentPathId","leadCadenceReactionId","resumesAt","outreachAction","messageFrameworkId","createdAt","updatedAt","scheduledEmails","bouncedSteps","skippedSteps"],"title":"LeadCadenceEnrollmentData"},"LeadCadenceEnrollmentState":{"type":"string","enum":["active","paused","stopped","completed"],"title":"LeadCadenceEnrollmentState"},"LeadCadenceNoReplyActionData":{"type":"object","properties":{"id":{"type":"integer"},"position":{"type":"integer"},"type":{"$ref":"#/components/schemas/LeadCadenceNoReplyActionType"},"stage":{"anyOf":[{"$ref":"#/components/schemas/LeadStage"},{"type":"null"}]},"tagId":{"type":["integer","null"]},"segmentId":{"type":["integer","null"]},"customFieldId":{"type":["integer","null"]},"emailSequenceId":{"type":["integer","null"]},"startLeadCadenceTemplateId":{"type":["integer","null"]},"value":{"type":["string","null"]}},"required":["id","position","type","stage","tagId","segmentId","customFieldId","emailSequenceId","startLeadCadenceTemplateId","value"],"title":"LeadCadenceNoReplyActionData"},"LeadCadenceNoReplyActionType":{"type":"string","enum":["set_stage","add_tag","add_to_segment","set_custom_field","start_email_sequence","create_task","start_cadence"],"title":"LeadCadenceNoReplyActionType"},"LeadCadenceNoReplyScenarioData":{"type":"object","properties":{"id":{"type":"integer"},"position":{"type":"integer"},"name":{"type":"string"},"conditions":{"anyOf":[{"$ref":"#/components/schemas/ConditionGroupOutputData"},{"type":"null"}]},"actions":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceNoReplyActionData"}}},"required":["id","position","name","conditions","actions"],"title":"LeadCadenceNoReplyScenarioData"},"LeadCadencePathData":{"type":"object","properties":{"id":{"type":"integer"},"kind":{"$ref":"#/components/schemas/LeadCadencePathKind"},"name":{"type":["string","null"]},"position":{"type":"integer"},"stageAfter":{"anyOf":[{"$ref":"#/components/schemas/LeadStage"},{"type":"null"}]}},"required":["id","kind","name","position","stageAfter"],"title":"LeadCadencePathData"},"LeadCadencePathKind":{"type":"string","enum":["main","branch"],"title":"LeadCadencePathKind"},"LeadCadenceReactionAction":{"type":"string","enum":["go_to_path","continue","snooze","postpone_to_date","create_task","end"],"title":"LeadCadenceReactionAction"},"LeadCadenceReactionData":{"type":"object","properties":{"id":{"type":"integer"},"position":{"type":"integer"},"kind":{"$ref":"#/components/schemas/LeadCadenceReactionKind"},"label":{"type":["string","null"]},"action":{"$ref":"#/components/schemas/LeadCadenceReactionAction"},"targetPathId":{"type":["integer","null"]},"snoozeValue":{"type":["integer","null"]},"snoozeUnit":{"anyOf":[{"$ref":"#/components/schemas/LeadCadenceDelayUnit"},{"type":"null"}]},"endStage":{"anyOf":[{"$ref":"#/components/schemas/LeadStage"},{"type":"null"}]}},"required":["id","position","kind","label","action","targetPathId","snoozeValue","snoozeUnit","endStage"],"title":"LeadCadenceReactionData"},"LeadCadenceReactionKind":{"type":"string","enum":["interested","not_interested","opt_out","undecided","call_later","out_of_office","question","forwarded","other_supplier","send_offer","custom"],"title":"LeadCadenceReactionKind"},"LeadCadenceResolution":{"type":"string","enum":["interested","not_interested"],"title":"LeadCadenceResolution"},"LeadCadenceRuleAction":{"type":"string","enum":["continue","go_to_step","repeat","go_to_path","end"],"title":"LeadCadenceRuleAction"},"LeadCadenceScheduledEmailData":{"type":"object","properties":{"id":{"type":"integer"},"userId":{"type":"integer"},"leadCadenceStepId":{"type":"integer"},"scheduledAt":{"type":"string"},"status":{"$ref":"#/components/schemas/ScheduledPersonalEmailStatus"},"failureMessage":{"type":["string","null"]},"emailConversationId":{"type":["integer","null"]}},"required":["id","userId","leadCadenceStepId","scheduledAt","status","failureMessage","emailConversationId"],"title":"LeadCadenceScheduledEmailData"},"LeadCadenceSkippedStepData":{"type":"object","properties":{"leadCadenceStepId":{"type":"integer"},"reason":{"$ref":"#/components/schemas/LeadCadenceStepSkipReason"},"skippedAt":{"type":"string"}},"required":["leadCadenceStepId","reason","skippedAt"],"title":"LeadCadenceSkippedStepData"},"LeadCadenceStepData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"leadCadenceTemplateId":{"type":"integer"},"pathId":{"type":"integer"},"parentStepId":{"type":["integer","null"]},"position":{"type":"integer"},"channel":{"$ref":"#/components/schemas/LeadOutreachChannel"},"title":{"type":"string"},"instructions":{"type":["string","null"]},"delayValue":{"type":"integer"},"delayUnit":{"$ref":"#/components/schemas/LeadCadenceDelayUnit"},"replyWaitValue":{"type":"integer"},"replyWaitUnit":{"$ref":"#/components/schemas/LeadCadenceDelayUnit"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceStepRuleData"}},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","leadCadenceTemplateId","pathId","parentStepId","position","channel","title","instructions","delayValue","delayUnit","replyWaitValue","replyWaitUnit","rules","createdAt","updatedAt"],"title":"LeadCadenceStepData"},"LeadCadenceStepRuleData":{"type":"object","properties":{"id":{"type":"integer"},"outcome":{"$ref":"#/components/schemas/LeadOutreachOutcome"},"action":{"$ref":"#/components/schemas/LeadCadenceRuleAction"},"targetStepId":{"type":["integer","null"]},"targetPathId":{"type":["integer","null"]},"repeatAfterValue":{"type":["integer","null"]},"repeatAfterUnit":{"anyOf":[{"$ref":"#/components/schemas/LeadCadenceDelayUnit"},{"type":"null"}]},"repeatMax":{"type":["integer","null"]},"endStage":{"anyOf":[{"$ref":"#/components/schemas/LeadStage"},{"type":"null"}]}},"required":["id","outcome","action","targetStepId","targetPathId","repeatAfterValue","repeatAfterUnit","repeatMax","endStage"],"title":"LeadCadenceStepRuleData"},"LeadCadenceStepSkipReason":{"type":"string","enum":["missing_channel","not_needed"],"title":"LeadCadenceStepSkipReason"},"LeadCadenceStopReason":{"type":"string","enum":["manual","reply","email_reply","meeting_booked","form_submitted","connected","not_interested","unsubscribed","whatsapp_reply","rule_end","opt_out"],"title":"LeadCadenceStopReason"},"LeadCadenceStopSourceData":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/LeadCadenceStopSourceType"},"id":{"type":["integer","null"]},"occurredAt":{"type":"string"},"title":{"type":["string","null"]},"excerpt":{"type":["string","null"]},"touchId":{"type":["integer","null"]},"startsAtUtc":{"type":["string","null"]},"timezone":{"type":["string","null"]},"inquiryId":{"type":["integer","null"]}},"required":["type","id","occurredAt","title","excerpt","touchId","startsAtUtc","timezone","inquiryId"],"title":"LeadCadenceStopSourceData"},"LeadCadenceStopSourceType":{"type":"string","enum":["email_reply","whatsapp_reply","booking","lead_form","touch","unsubscribe"],"title":"LeadCadenceStopSourceType"},"LeadCadenceTemplateData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"isSystem":{"type":"boolean"},"isPrimary":{"type":"boolean"},"purpose":{"$ref":"#/components/schemas/LeadCadenceTemplatePurpose"},"stepCount":{"type":"integer"},"spanDays":{"type":"integer"},"paths":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadencePathData"},"description":"The plan's paths. `kind` is `main` for the main line and `branch` for steps that follow a reaction."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceStepData"},"description":"The plan's steps in order, each with its channel, delay and `pathId`, the path it belongs to."},"reactions":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceReactionData"}},"noReplyScenarios":{"type":"array","items":{"$ref":"#/components/schemas/LeadCadenceNoReplyScenarioData"}},"noReplyStage":{"anyOf":[{"$ref":"#/components/schemas/LeadStage"},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]}},"required":["id","tenantId","userId","name","description","isActive","isSystem","isPrimary","purpose","stepCount","spanDays","paths","steps","reactions","noReplyScenarios","noReplyStage","createdAt","updatedAt","deletedAt"],"title":"LeadCadenceTemplateData"},"LeadCadenceTemplatePurpose":{"type":"string","enum":["outreach","follow_up"],"title":"LeadCadenceTemplatePurpose"},"LeadContact.IndexLeadContactData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the link. Send it as leadContact to change or remove the link."},"leadId":{"type":"integer"},"contactId":{"type":"integer"},"isPrimary":{"type":"boolean","description":"true for the main contact."},"contactName":{"type":["string","null"]},"contactEmail":{"type":["string","null"]},"contactType":{"$ref":"#/components/schemas/ContactType"}},"required":["id","leadId","contactId","isPrimary","contactName","contactEmail","contactType"],"title":"LeadContact.IndexLeadContactData"},"LeadContactAnalyticsData":{"type":"object","properties":{"leadContactId":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":"string"},"contactEmail":{"type":["string","null"]},"isPrimary":{"type":"boolean"},"buyingRole":{"type":["string","null"]},"campaign":{"$ref":"#/components/schemas/LeadAnalyticsCampaignChannelData"},"personal":{"anyOf":[{"$ref":"#/components/schemas/LeadAnalyticsPersonalChannelData"},{"type":"null"}]},"engagementScore":{"type":"integer"},"heatStatus":{"type":"string"},"frequencyRatio":{"type":"number"}},"required":["leadContactId","contactId","contactName","contactEmail","isPrimary","buyingRole","campaign","personal","engagementScore","heatStatus","frequencyRatio"],"title":"LeadContactAnalyticsData"},"LeadContactAnalyticsOptionData":{"type":"object","properties":{"contactId":{"type":"string"},"contactName":{"type":"string"},"contactEmail":{"type":["string","null"]},"engagementScore":{"type":"integer"},"heatStatus":{"type":"string"}},"required":["contactId","contactName","contactEmail","engagementScore","heatStatus"],"title":"LeadContactAnalyticsOptionData"},"LeadContactBuyingRole":{"type":"string","enum":["decision_maker","champion","influencer","user","blocker"],"title":"LeadContactBuyingRole"},"LeadConversionModelStatus":{"type":"string","enum":["collecting","ready","rejected"],"title":"LeadConversionModelStatus"},"LeadConversionModelStatusOutputData":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/LeadConversionModelStatus","description":"collecting (Fusio still needs more decided leads), ready (the model works) or rejected (it was not good enough)."},"decidedCount":{"type":"integer","description":"How many leads ended as won or lost."},"positiveCount":{"type":"integer","description":"How many of them were won."},"requiredDecided":{"type":"integer","description":"How many decided leads the model needs."},"requiredPerClass":{"type":"integer","description":"How many won and how many lost leads it needs at least."},"minimumHoldoutAuc":{"type":"number","description":"How good a test score must be to use the model, from 0 to 1."},"trainedAt":{"type":["string","null"],"description":"When the model last learned. null before the first time."},"holdoutAuc":{"type":["number","null"],"description":"The test score of the model, from 0 to 1. Higher is better."},"baselineAuc":{"type":["number","null"],"description":"The test score of simple scoring, for comparison."},"isEntitled":{"type":"boolean","description":"true when your plan has predictions."},"isPredictionVisible":{"type":"boolean","description":"true when people see the predictions."},"hasModelInForce":{"type":"boolean","description":"true when a model is in use right now."}},"required":["status","decidedCount","positiveCount","requiredDecided","requiredPerClass","minimumHoldoutAuc","trainedAt","holdoutAuc","baselineAuc","isEntitled","isPredictionVisible","hasModelInForce"],"title":"LeadConversionModelStatusOutputData"},"LeadConversionRatesData":{"type":"object","properties":{"coldToWarm":{"type":"number"},"warmToQualified":{"type":"number"},"qualifiedToClient":{"type":"number"}},"required":["coldToWarm","warmToQualified","qualifiedToClient"],"title":"LeadConversionRatesData"},"LeadDiscoveryBrowserSource":{"type":"string","enum":["instagram","facebook","linkedin","x","google_maps","firmy_cz","web"],"title":"LeadDiscoveryBrowserSource"},"LeadDiscoveryRecommendation":{"type":"string","enum":["approve","dismiss"],"title":"LeadDiscoveryRecommendation"},"LeadDiscoverySource":{"type":"string","enum":["ares","eshopy_cz","browser"],"title":"LeadDiscoverySource"},"LeadDuplicateCheckOutputData":{"type":"object","properties":{"duplicate":{"anyOf":[{"$ref":"#/components/schemas/LeadDuplicateOutputData"},{"type":"null"}],"description":"The lead that is already there: its number, name, company number, stage and when it was added. null when there is none."},"field":{"anyOf":[{"$ref":"#/components/schemas/LeadDuplicateField"},{"type":"null"}],"description":"Which value matched: registrationNumber or email. null when nothing matched."}},"required":["duplicate","field"],"title":"LeadDuplicateCheckOutputData"},"LeadDuplicateField":{"type":"string","enum":["registrationNumber","email"],"title":"LeadDuplicateField"},"LeadDuplicateOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"registrationNumber":{"type":["string","null"]},"stage":{"$ref":"#/components/schemas/LeadStage"},"createdAt":{"type":["string","null"]}},"required":["id","name","registrationNumber","stage","createdAt"],"title":"LeadDuplicateOutputData"},"LeadEmailsContactData":{"type":"object","properties":{"contact":{"$ref":"#/components/schemas/IndexContactData"},"unsubscribedAt":{"type":["string","null"]},"sequences":{"type":"array","items":{"$ref":"#/components/schemas/PrivateOutreachSequenceData"}},"scheduledEmails":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledPersonalEmailData"}},"drafts":{"type":"array","items":{"$ref":"#/components/schemas/PersonalEmailDraftData"}}},"required":["contact","unsubscribedAt","sequences","scheduledEmails","drafts"],"title":"LeadEmailsContactData"},"LeadEmailsData":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/LeadEmailsSummaryData","description":"How many sequences run and emails are planned for the whole lead, and when the next one goes out."},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/LeadEmailsContactData"},"description":"Each contact of the lead with its sequences, planned emails and drafts. You see only your own drafts."}},"required":["summary","contacts"],"title":"LeadEmailsData"},"LeadEmailsSummaryData":{"type":"object","properties":{"runningSequences":{"type":"integer"},"scheduledEmails":{"type":"integer"},"nextTouchAt":{"type":["string","null"]}},"required":["runningSequences","scheduledEmails","nextTouchAt"],"title":"LeadEmailsSummaryData"},"LeadEngagementLedgerEntryData":{"type":"object","properties":{"id":{"type":"integer"},"contactId":{"type":"integer"},"signalKey":{"$ref":"#/components/schemas/EngagementSignalKey"},"signalClass":{"$ref":"#/components/schemas/EngagementSignalClass"},"points":{"type":"integer"},"occurredAt":{"type":"string"},"currentWeight":{"type":"number"},"currentPoints":{"type":"number"},"formName":{"type":["string","null"]},"eventName":{"type":["string","null"]}},"required":["id","contactId","signalKey","signalClass","points","occurredAt","currentWeight","currentPoints","formName","eventName"],"title":"LeadEngagementLedgerEntryData"},"LeadEngagementWindowData":{"type":"object","properties":{"windowDays":{"type":"integer"},"limit":{"type":"integer"},"returnedCount":{"type":"integer"},"truncated":{"type":"boolean"}},"required":["windowDays","limit","returnedCount","truncated"],"title":"LeadEngagementWindowData"},"LeadFirmographicCoverageData":{"type":"object","properties":{"resolved":{"type":"integer"},"freemail":{"type":"integer"},"unresolved":{"type":"integer"}},"required":["resolved","freemail","unresolved"],"title":"LeadFirmographicCoverageData"},"LeadFirmographicData":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/LeadFirmographicSource"},"fetchedAt":{"type":["string","null"]},"isActive":{"type":["boolean","null"]},"czNace":{"type":["string","null"]},"czNaceLabel":{"type":["string","null"]},"naceCategory":{"anyOf":[{"$ref":"#/components/schemas/AresFilterOptionData"},{"type":"null"}]},"legalForm":{"anyOf":[{"$ref":"#/components/schemas/AresRegistryCodeData"},{"type":"null"}]},"employeeBand":{"anyOf":[{"$ref":"#/components/schemas/AresRegistryCodeData"},{"type":"null"}]},"region":{"type":["string","null"]},"registeredOn":{"type":["string","null"]},"shareCapital":{"type":["integer","null"]},"businessActivities":{"type":["array","null"],"items":{"type":"string"}},"foundedOn":{"type":["string","null"]},"taxOffice":{"anyOf":[{"$ref":"#/components/schemas/AresRegistryCodeData"},{"type":"null"}]},"registrations":{"anyOf":[{"$ref":"#/components/schemas/AresRegistrationsData"},{"type":"null"}]},"naceCodes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AresRegistryCodeData"}},"institutionalSector":{"anyOf":[{"$ref":"#/components/schemas/AresRegistryCodeData"},{"type":"null"}]},"deliveryAddress":{"type":["string","null"]},"fileNumber":{"type":["string","null"]},"registryCourt":{"anyOf":[{"$ref":"#/components/schemas/AresRegistryCodeData"},{"type":"null"}]},"registerPeople":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AresRegisterPersonData"}},"czNaceExpired":{"type":"boolean"},"legalFormExpired":{"type":"boolean"}},"required":["source","fetchedAt","isActive","czNace","czNaceLabel","naceCategory","legalForm","employeeBand","region","registeredOn","shareCapital","businessActivities","foundedOn","taxOffice","registrations","naceCodes","institutionalSector","deliveryAddress","fileNumber","registryCourt","registerPeople","czNaceExpired","legalFormExpired"],"title":"LeadFirmographicData"},"LeadFirmographicEnrichmentEligibilityData":{"type":"object","properties":{"eligible":{"type":"boolean","description":"True when the facts can be filled."},"reason":{"type":["string","null"],"description":"Why they cannot be filled, or null."}},"required":["eligible","reason"],"title":"LeadFirmographicEnrichmentEligibilityData"},"LeadFirmographicSource":{"type":"string","enum":["ares","ares_form"],"title":"LeadFirmographicSource"},"LeadFitBasis":{"type":"string","enum":["business","consumer"],"title":"LeadFitBasis"},"LeadFitBreakdownData":{"type":"object","properties":{"fitScore":{"type":["integer","null"]},"fitGrade":{"$ref":"#/components/schemas/LeadFitGrade"},"fitBasis":{"anyOf":[{"$ref":"#/components/schemas/LeadFitBasis"},{"type":"null"}]},"personType":{"$ref":"#/components/schemas/LeadPersonType"},"criteria":{"type":"array","items":{"$ref":"#/components/schemas/LeadFitCriterionData"}},"earnedWeight":{"type":"integer"},"possibleWeight":{"type":"integer"},"isAssessed":{"type":"boolean"},"missing":{"anyOf":[{"$ref":"#/components/schemas/LeadFitMissing"},{"type":"null"}]}},"required":["fitScore","fitGrade","fitBasis","personType","criteria","earnedWeight","possibleWeight","isAssessed","missing"],"title":"LeadFitBreakdownData"},"LeadFitCriterionData":{"type":"object","properties":{"key":{"type":"string"},"matched":{"type":"boolean"},"earnedWeight":{"type":"integer"},"possibleWeight":{"type":"integer"}},"required":["key","matched","earnedWeight","possibleWeight"],"title":"LeadFitCriterionData"},"LeadFitGrade":{"type":"string","enum":["A","B","C","unknown"],"title":"LeadFitGrade"},"LeadFitIntentCellData":{"type":"object","properties":{"cell":{"type":"string"},"fitGrade":{"$ref":"#/components/schemas/LeadFitGrade"},"heatStatus":{"$ref":"#/components/schemas/HeatStatus"},"intentLevel":{"type":"integer"},"isMql":{"type":"boolean"},"count":{"type":"integer"}},"required":["cell","fitGrade","heatStatus","intentLevel","isMql","count"],"title":"LeadFitIntentCellData"},"LeadFitMissing":{"type":"string","enum":["company","customers"],"title":"LeadFitMissing"},"LeadFormIntentTierCountsData":{"type":"object","properties":{"handRaiser":{"type":"integer"},"standard":{"type":"integer"},"subscription":{"type":"integer"},"passive":{"type":"integer"},"withoutForm":{"type":"integer"}},"required":["handRaiser","standard","subscription","passive","withoutForm"],"title":"LeadFormIntentTierCountsData"},"LeadFunnelBreakdownData":{"type":"object","properties":{"dimension":{"$ref":"#/components/schemas/LeadFunnelSegmentDimension"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/LeadFunnelRateData"}}},"required":["dimension","rows"],"title":"LeadFunnelBreakdownData"},"LeadFunnelCountData":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":["string","null"]},"count":{"type":"integer"}},"required":["key","name","count"],"title":"LeadFunnelCountData"},"LeadFunnelData":{"type":"object","properties":{"visitors":{"type":"integer"},"leads":{"type":"integer"},"qualified":{"type":"integer"},"withDeal":{"type":"integer"},"won":{"type":"integer"}},"required":["visitors","leads","qualified","withDeal","won"],"title":"LeadFunnelData"},"LeadFunnelRateData":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":["string","null"]},"people":{"type":"integer"},"passed":{"type":"integer"}},"required":["key","name","people","passed"],"title":"LeadFunnelRateData"},"LeadFunnelSegmentDimension":{"type":"string","enum":["channel","device","source","platform","form"],"title":"LeadFunnelSegmentDimension"},"LeadFunnelStep":{"type":"string","enum":["leads","qualified","with_deal","won"],"title":"LeadFunnelStep"},"LeadFunnelStepDetailData":{"type":"object","properties":{"step":{"$ref":"#/components/schemas/LeadFunnelStep"},"composition":{"type":"array","items":{"$ref":"#/components/schemas/LeadFunnelCountData"}},"breakdowns":{"type":"array","items":{"$ref":"#/components/schemas/LeadFunnelBreakdownData"}}},"required":["step","composition","breakdowns"],"title":"LeadFunnelStepDetailData"},"LeadHandoffData":{"type":"object","properties":{"cell":{"type":"string"},"handedOffAt":{"type":"string"},"notifiedAt":{"type":["string","null"]},"notifiedRecipientCount":{"type":"integer"},"firstResponseAt":{"type":["string","null"]},"responseSeconds":{"type":["integer","null"]}},"required":["cell","handedOffAt","notifiedAt","notifiedRecipientCount","firstResponseAt","responseSeconds"],"title":"LeadHandoffData"},"LeadHistoryCadenceStepData":{"type":"object","properties":{"templateName":{"type":["string","null"]},"position":{"type":"integer"},"title":{"type":"string"},"channel":{"type":"string"},"touches":{"type":"array","items":{"$ref":"#/components/schemas/LeadHistoryCadenceTouchData"}}},"required":["templateName","position","title","channel","touches"],"title":"LeadHistoryCadenceStepData"},"LeadHistoryCadenceTouchData":{"type":"object","properties":{"id":{"type":"integer"},"channel":{"$ref":"#/components/schemas/LeadOutreachChannel"},"direction":{"$ref":"#/components/schemas/LeadOutreachDirection"},"outcome":{"$ref":"#/components/schemas/LeadOutreachOutcome"},"occurredAt":{"type":"string"},"note":{"type":["string","null"]},"actorName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"conversationId":{"type":["integer","null"]},"voidedAt":{"type":["string","null"]}},"required":["id","channel","direction","outcome","occurredAt","note","actorName","contactName","conversationId","voidedAt"],"title":"LeadHistoryCadenceTouchData"},"LeadHistoryCommonPathData":{"type":"object","properties":{"channel":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/LeadHistoryCommonPathStepData"}},"visits":{"type":"integer"},"totalVisits":{"type":"integer"}},"required":["channel","steps","visits","totalVisits"],"title":"LeadHistoryCommonPathData"},"LeadHistoryCommonPathStepData":{"type":"object","properties":{"path":{"type":"string"},"title":{"type":["string","null"]}},"required":["path","title"],"title":"LeadHistoryCommonPathStepData"},"LeadHistoryPageOutputData":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadHistoryRowData"},"description":"The events, newest first."},"path":{"type":["string","null"]},"per_page":{"type":"integer"},"next_cursor":{"type":["string","null"],"description":"Send it as cursor to get the next page. null on the last page."},"next_page_url":{"type":["string","null"]},"prev_cursor":{"type":["string","null"],"description":"Send it as cursor to go one page back. null on the first page."},"prev_page_url":{"type":["string","null"]},"typeCounts":{"anyOf":[{"$ref":"#/components/schemas/ContactHistoryTypeCountsData"},{"type":"null"}],"description":"How many events of each type there are. Only on the first page; later pages have null."},"commonPath":{"anyOf":[{"$ref":"#/components/schemas/LeadHistoryCommonPathData"},{"type":"null"}],"description":"The pages people of the lead visit most often in a row. Only on the first page with group_sessions=true; otherwise null."}},"required":["data","path","per_page","next_cursor","next_page_url","prev_cursor","prev_page_url","typeCounts","commonPath"],"title":"LeadHistoryPageOutputData"},"LeadHistoryRecordData":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"integer"},"event":{"type":"string"},"title":{"type":["string","null"]},"detail":{"type":["string","null"]},"status":{"type":["string","null"]},"previousStatus":{"type":["string","null"]},"startsAtUtc":{"type":["string","null"]},"actorName":{"type":["string","null"]},"parent":{"anyOf":[{"$ref":"#/components/schemas/LeadHistoryRecordParentData"},{"type":"null"}]}},"required":["kind","id","event","title","detail","status","previousStatus","startsAtUtc","actorName","parent"],"title":"LeadHistoryRecordData"},"LeadHistoryRecordParentData":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"integer"},"label":{"type":["string","null"]}},"required":["kind","id","label"],"title":"LeadHistoryRecordParentData"},"LeadHistoryRowData":{"type":"object","properties":{"type":{"type":"string"},"source":{"type":"string"},"channel":{"type":["string","null"]},"eventName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"trackableType":{"anyOf":[{"$ref":"#/components/schemas/TrackableType"},{"type":"null"}]},"trackableId":{"type":["integer","null"]},"date":{"type":["string","null"],"format":"date-time"},"context":{"type":["string","null"]},"url":{"type":["string","null"]},"country":{"type":["string","null"]},"deviceType":{"type":["string","null"]},"leadFormId":{"type":["integer","null"]},"leadFormName":{"type":["string","null"]},"submissionId":{"type":["string","null"]},"browser":{"type":["string","null"]},"operatingSystem":{"type":["string","null"]},"locale":{"type":["string","null"]},"referer":{"type":["string","null"]},"path":{"type":["string","null"]},"hostname":{"type":["string","null"]},"origin":{"type":["string","null"]},"utmSource":{"type":["string","null"]},"utmMedium":{"type":["string","null"]},"utmCampaign":{"type":["string","null"]},"utmTerm":{"type":["string","null"]},"utmContent":{"type":["string","null"]},"clickIdSource":{"type":["string","null"]},"clickIdValue":{"type":["string","null"]},"consentState":{"type":["string","null"]},"ingestSource":{"type":["string","null"]},"result":{"type":["string","null"]},"visitorSessionId":{"type":["integer","null"]},"payload":{"type":["string","null"]},"recipientEmail":{"type":["string","null"]},"deliveryStatus":{"type":["string","null"]},"deliveredAt":{"type":["string","null"],"format":"date-time"},"bouncedAt":{"type":["string","null"],"format":"date-time"},"bounceReason":{"type":["string","null"]},"bounceType":{"type":["string","null"]},"bounceCode":{"type":["string","null"]},"smtpCode":{"type":["string","null"]},"unsubscribedAt":{"type":["string","null"],"format":"date-time"},"unsubscribeReason":{"type":["string","null"]},"spamComplaintAt":{"type":["string","null"],"format":"date-time"},"envelopeId":{"type":["string","null"]},"sourceId":{"type":"integer"},"submission":{"anyOf":[{"$ref":"#/components/schemas/LeadHistorySubmissionData"},{"type":"null"}]},"record":{"anyOf":[{"$ref":"#/components/schemas/LeadHistoryRecordData"},{"type":"null"}]},"cadenceStep":{"anyOf":[{"$ref":"#/components/schemas/LeadHistoryCadenceStepData"},{"type":"null"}]},"session":{"anyOf":[{"$ref":"#/components/schemas/LeadHistoryWebSessionData"},{"type":"null"}]}},"required":["type","source","channel","eventName","campaignName","trackableType","trackableId","date","context","url","country","deviceType","leadFormId","leadFormName","submissionId","browser","operatingSystem","locale","referer","path","hostname","origin","utmSource","utmMedium","utmCampaign","utmTerm","utmContent","clickIdSource","clickIdValue","consentState","ingestSource","result","visitorSessionId","payload","recipientEmail","deliveryStatus","deliveredAt","bouncedAt","bounceReason","bounceType","bounceCode","smtpCode","unsubscribedAt","unsubscribeReason","spamComplaintAt","envelopeId","sourceId","submission","record","cadenceStep","session"],"title":"LeadHistoryRowData"},"LeadHistorySubmissionBookingData":{"type":"object","properties":{"id":{"type":"integer"},"startsAtUtc":{"type":"string"},"status":{"type":"string"}},"required":["id","startsAtUtc","status"],"title":"LeadHistorySubmissionBookingData"},"LeadHistorySubmissionData":{"type":"object","properties":{"id":{"type":"integer"},"answers":{"type":"array","items":{"$ref":"#/components/schemas/LeadAnalyticsSubmissionAnswerData"}},"inquiry":{"anyOf":[{"$ref":"#/components/schemas/LeadHistorySubmissionInquiryData"},{"type":"null"}]},"booking":{"anyOf":[{"$ref":"#/components/schemas/LeadHistorySubmissionBookingData"},{"type":"null"}]}},"required":["id","answers","inquiry","booking"],"title":"LeadHistorySubmissionData"},"LeadHistorySubmissionInquiryData":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"string"}},"required":["id","title","status"],"title":"LeadHistorySubmissionInquiryData"},"LeadHistoryWebSessionData":{"type":"object","properties":{"id":{"type":"integer"},"startedAt":{"type":"string"},"endedAt":{"type":"string"},"durationSeconds":{"type":"integer"},"pageViews":{"type":"integer"},"entryPath":{"type":["string","null"]},"channel":{"type":"string"},"deviceType":{"type":["string","null"]},"pages":{"type":"array","items":{"$ref":"#/components/schemas/LeadHistoryWebSessionPageData"}}},"required":["id","startedAt","endedAt","durationSeconds","pageViews","entryPath","channel","deviceType","pages"],"title":"LeadHistoryWebSessionData"},"LeadHistoryWebSessionPageData":{"type":"object","properties":{"id":{"type":"integer"},"path":{"type":"string"},"title":{"type":["string","null"]},"url":{"type":["string","null"]},"occurredAt":{"type":"string"},"secondsOnPage":{"type":["integer","null"]}},"required":["id","path","title","url","occurredAt","secondsOnPage"],"title":"LeadHistoryWebSessionPageData"},"LeadIntentBreakdownData":{"type":"object","properties":{"engagementScore":{"type":"integer"},"heatStatus":{"$ref":"#/components/schemas/HeatStatus"},"classes":{"type":"array","items":{"$ref":"#/components/schemas/LeadIntentClassBreakdownData"}},"sticky":{"$ref":"#/components/schemas/LeadIntentStickyData"},"suppressedRepeats":{"type":"array","items":{"$ref":"#/components/schemas/LeadIntentSuppressedRepeatData"}}},"required":["engagementScore","heatStatus","classes","sticky","suppressedRepeats"],"title":"LeadIntentBreakdownData"},"LeadIntentClassBreakdownData":{"type":"object","properties":{"signalClass":{"$ref":"#/components/schemas/EngagementSignalClass"},"eventCount":{"type":"integer"},"recordedPoints":{"type":"integer"},"currentPoints":{"type":"number"}},"required":["signalClass","eventCount","recordedPoints","currentPoints"],"title":"LeadIntentClassBreakdownData"},"LeadIntentStickyData":{"type":"object","properties":{"suppressed":{"type":"boolean"},"suppressedContactCount":{"type":"integer"},"eventCount":{"type":"integer"},"clearedEventCount":{"type":"integer"},"latestOccurredAt":{"type":["string","null"]}},"required":["suppressed","suppressedContactCount","eventCount","clearedEventCount","latestOccurredAt"],"title":"LeadIntentStickyData"},"LeadIntentSuppressedRepeatData":{"type":"object","properties":{"signalKey":{"type":"string"},"repeatCount":{"type":"integer"}},"required":["signalKey","repeatCount"],"title":"LeadIntentSuppressedRepeatData"},"LeadInterestDayData":{"type":"object","properties":{"date":{"type":"string"},"points":{"type":"integer"}},"required":["date","points"],"title":"LeadInterestDayData"},"LeadJourneyStage":{"type":"string","enum":["visit","form","inquiry","booking","deal","customer"],"title":"LeadJourneyStage"},"LeadLostReason":{"type":"string","enum":["spam","test_submission","duplicate","wrong_contact","job_seeker","vendor_pitch","existing_customer","outside_target_segment","company_too_small","outside_service_area","service_not_offered","no_real_need","not_interested","no_response","no_budget","price_too_high","chose_competitor","already_has_supplier","bad_timing","no_decision_maker","other"],"title":"LeadLostReason"},"LeadNoteOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"user":{"anyOf":[{"$ref":"#/components/schemas/UserSummaryData"},{"type":"null"}]},"noteableType":{"anyOf":[{"$ref":"#/components/schemas/NoteableType"},{"type":"null"}]},"noteableId":{"type":"integer"},"body":{"type":"string"},"leadOutreachTouchId":{"type":["integer","null"]},"outreachTouch":{"anyOf":[{"$ref":"#/components/schemas/NoteOutreachTouchData"},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"pinnedAt":{"type":["string","null"]}},"required":["id","tenantId","userId","user","noteableType","noteableId","body","leadOutreachTouchId","outreachTouch","createdAt","updatedAt","pinnedAt"],"title":"LeadNoteOutputData"},"LeadOriginCountData":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/LeadOriginData"},"count":{"type":"integer"}},"required":["origin","count"],"title":"LeadOriginCountData"},"LeadOriginData":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/LeadOriginKind"},"key":{"type":"string"},"name":{"type":["string","null"]}},"required":["kind","key","name"],"title":"LeadOriginData"},"LeadOriginKind":{"type":"string","enum":["platform","form","source"],"title":"LeadOriginKind"},"LeadOutreachChannel":{"type":"string","enum":["email","linkedin","instagram","messenger","phone","voice_message","whatsapp","sms","meeting","other","form"],"title":"LeadOutreachChannel"},"LeadOutreachDirection":{"type":"string","enum":["outbound","inbound"],"title":"LeadOutreachDirection"},"LeadOutreachOutcome":{"type":"string","enum":["attempted","sent","connected","replied","no_reply","meeting_booked","not_interested","submitted","unsubscribed","resubscribed","bounced"],"title":"LeadOutreachOutcome"},"LeadOutreachQueueContactData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"linkedinUrl":{"type":["string","null"]}},"required":["id","name","email","phone","linkedinUrl"],"title":"LeadOutreachQueueContactData"},"LeadOutreachQueueItemData":{"type":"object","properties":{"leadId":{"type":"integer","description":"The number of the lead. Pass it as `{lead}` when you enroll the lead into a plan."},"name":{"type":["string","null"]},"website":{"type":["string","null"]},"stage":{"type":"string"},"fitScore":{"type":["integer","null"],"description":"How well the prospect fits your ideal customer, as a number. null when it has no score yet."},"ownerUserId":{"type":"integer","description":"You, as one of the people the lead is assigned to. Pass it as `leadAssigneeId` when you enroll the lead."},"primaryContact":{"anyOf":[{"$ref":"#/components/schemas/LeadOutreachQueueContactData"},{"type":"null"}],"description":"The lead's main contact, or null when the lead has none. `linkedinUrl` is set when Fusio found the lead on LinkedIn."},"suggestedGoal":{"type":"string","description":"The outreach goal to start with. Always `initial_outreach` for a first contact."},"defaultMessageFrameworkId":{"type":["integer","null"],"description":"The tenant's default message framework for the suggested goal. null when the tenant has none."}},"required":["leadId","name","website","stage","fitScore","ownerUserId","primaryContact","suggestedGoal","defaultMessageFrameworkId"],"title":"LeadOutreachQueueItemData"},"LeadOutreachStatus":{"type":"string","enum":["meeting_booked","replied","stopped","no_reply","waiting_reply","active","not_contacted"],"title":"LeadOutreachStatus"},"LeadOutreachTouchOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"leadId":{"type":"integer"},"leadContactId":{"type":["integer","null"]},"taskId":{"type":["integer","null"]},"leadCadenceStepId":{"type":["integer","null"]},"stepPosition":{"type":["integer","null"]},"stepTitle":{"type":["string","null"]},"userId":{"type":["integer","null"]},"userName":{"type":["string","null"]},"userEmail":{"type":["string","null"]},"source":{"$ref":"#/components/schemas/LeadOutreachTouchSource"},"sourceId":{"type":["integer","null"]},"conversationId":{"type":["integer","null"]},"messageSubject":{"type":["string","null"]},"messagePreview":{"type":["string","null"]},"channel":{"$ref":"#/components/schemas/LeadOutreachChannel","description":"How you reached out, like email or a phone call."},"direction":{"$ref":"#/components/schemas/LeadOutreachDirection","description":"Who reached out: you or the lead."},"outcome":{"$ref":"#/components/schemas/LeadOutreachOutcome","description":"How it went."},"occurredAt":{"type":"string","description":"When it happened."},"note":{"type":["string","null"]},"noteId":{"type":["integer","null"]},"followUpTaskId":{"type":["integer","null"]},"taskCompleted":{"type":"boolean"},"voidedAt":{"type":["string","null"],"description":"When someone marked it as a mistake. null when it counts."},"voidedById":{"type":["integer","null"]},"voidReason":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","leadId","leadContactId","taskId","leadCadenceStepId","stepPosition","stepTitle","userId","userName","userEmail","source","sourceId","conversationId","messageSubject","messagePreview","channel","direction","outcome","occurredAt","note","noteId","followUpTaskId","taskCompleted","voidedAt","voidedById","voidReason","createdAt","updatedAt"],"title":"LeadOutreachTouchOutputData"},"LeadOutreachTouchSource":{"type":"string","enum":["manual","email_sent","email_reply","booking","lead_form","unsubscribe","resubscribe","email_bounce","whatsapp_sent","whatsapp_reply","cadence_message"],"title":"LeadOutreachTouchSource"},"LeadOverviewData":{"type":"object","properties":{"kpis":{"$ref":"#/components/schemas/LeadOverviewKpisData","description":"The main numbers, each with the value before and a line by day."},"countByStage":{"type":"object","additionalProperties":{"type":"integer"},"description":"How many leads are in each stage."},"countBySource":{"type":"object","additionalProperties":{"type":"integer"},"description":"How many leads came from each source."},"conversionRates":{"$ref":"#/components/schemas/LeadConversionRatesData","description":"How many leads moved on to the next stage, as a share from 0 to 1."},"fitIntentMatrix":{"type":"array","items":{"$ref":"#/components/schemas/LeadFitIntentCellData"}},"firmographicCoverage":{"$ref":"#/components/schemas/LeadFirmographicCoverageData"},"tierByForm":{"$ref":"#/components/schemas/LeadFormIntentTierCountsData"},"funnel":{"$ref":"#/components/schemas/LeadFunnelData","description":"How many visitors became leads, qualified leads, leads with a deal and clients."},"funnelDetails":{"type":"array","items":{"$ref":"#/components/schemas/LeadFunnelStepDetailData"}},"countByOrigin":{"type":"array","items":{"$ref":"#/components/schemas/LeadOriginCountData"}},"countByForm":{"type":"array","items":{"$ref":"#/components/schemas/LeadFunnelCountData"}},"wonByOrigin":{"type":"array","items":{"$ref":"#/components/schemas/LeadOriginCountData"}},"acquisition":{"anyOf":[{"$ref":"#/components/schemas/LeadAcquisitionSectionData"},{"type":"null"}]},"ready":{"type":"boolean","description":"false while Fusio is still counting the numbers. Then the lists are empty; try again later."},"rolledUpAt":{"type":["string","null"],"description":"When Fusio last counted the numbers."},"range":{"$ref":"#/components/schemas/OverviewRangeData"},"previousRange":{"anyOf":[{"$ref":"#/components/schemas/OverviewRangeData"},{"type":"null"}],"description":"The range just before, when you sent compare=true. Otherwise null."},"dates":{"type":"array","items":{"type":"string"},"description":"Every day of the range. Day lists in the answer follow this order."}},"required":["kpis","countByStage","countBySource","conversionRates","fitIntentMatrix","firmographicCoverage","tierByForm","funnel","funnelDetails","countByOrigin","countByForm","wonByOrigin","acquisition","ready","rolledUpAt","range","previousRange","dates"],"title":"LeadOverviewData"},"LeadOverviewKpisData":{"type":"object","properties":{"total":{"$ref":"#/components/schemas/OverviewKpiData"},"mql":{"$ref":"#/components/schemas/OverviewKpiData"},"fitResolved":{"$ref":"#/components/schemas/OverviewKpiData"},"qualified":{"$ref":"#/components/schemas/OverviewKpiData"},"firmographicResolved":{"$ref":"#/components/schemas/OverviewKpiData"},"awaitingContact":{"$ref":"#/components/schemas/OverviewKpiData"}},"required":["total","mql","fitResolved","qualified","firmographicResolved","awaitingContact"],"title":"LeadOverviewKpisData"},"LeadPersonType":{"type":"string","enum":["physical","legal"],"title":"LeadPersonType"},"LeadPredictionFactorData":{"type":"object","properties":{"feature":{"type":"string"},"contribution":{"type":"number"}},"required":["feature","contribution"],"title":"LeadPredictionFactorData"},"LeadPredictionVisibilityOutputData":{"type":"object","properties":{"isPredictionVisible":{"type":"boolean","description":"true when your plan and settings allow predictions and a model is ready."}},"required":["isPredictionVisible"],"title":"LeadPredictionVisibilityOutputData"},"LeadRegisterLookupStatus":{"type":"string","enum":["processing","completed","not_found","failed"],"title":"LeadRegisterLookupStatus"},"LeadResearchProfileFitAssessmentData":{"type":"object","properties":{"matchedSignals":{"type":"array","items":{"type":"string"}},"reasoning":{"type":"string"}},"required":["matchedSignals","reasoning"],"title":"LeadResearchProfileFitAssessmentData"},"LeadResearchProfileResearchDossierData":{"type":"object","properties":{"tenantId":{"type":"integer"},"url":{"type":"string"},"companyName":{"type":["string","null"],"description":"The name of the company, or null."},"logoIconUrl":{"type":["string","null"]},"logoFullUrl":{"type":["string","null"]},"description":{"type":["string","null"]},"websiteLanguageId":{"type":["integer","null"]},"fitScore":{"type":["integer","null"],"description":"How well the lead fits, or null."},"fitAssessment":{"anyOf":[{"$ref":"#/components/schemas/LeadResearchProfileFitAssessmentData"},{"type":"null"}]},"leadId":{"type":"integer","description":"The number of the lead."},"products":{"type":"array","items":{"$ref":"#/components/schemas/TenantProductData"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/TenantCustomerData"}},"competitors":{"type":"array","items":{"$ref":"#/components/schemas/TenantCompetitorData"}},"strategies":{"type":"array","items":{"$ref":"#/components/schemas/TenantStrategyData"}},"seoAudit":{"anyOf":[{"$ref":"#/components/schemas/TenantSeoAuditData"},{"type":"null"}]},"keywordOpportunities":{"type":"array","items":{"$ref":"#/components/schemas/TenantKeywordOpportunityData"}},"brandVoice":{"type":"array","items":{"$ref":"#/components/schemas/BrandVoiceOutputData"}},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"profilingTenantId":{"type":["integer","null"]},"profilingTenantName":{"type":["string","null"]},"promotedTenantId":{"type":["integer","null"]},"promotedTenantName":{"type":["string","null"]},"promotedAt":{"type":["string","null"]}},"required":["tenantId","url","companyName","logoIconUrl","logoFullUrl","description","websiteLanguageId","fitScore","fitAssessment","leadId","products","customers","competitors","strategies","seoAudit","keywordOpportunities","brandVoice","createdAt","updatedAt","profilingTenantId","profilingTenantName","promotedTenantId","promotedTenantName","promotedAt"],"title":"LeadResearchProfileResearchDossierData"},"LeadResearchSourceSubmitData":{"type":"object","properties":{"leadId":{"type":"integer","description":"The number of the lead."},"analysisId":{"type":"integer","description":"The number of the research run that holds the text."},"pagesSaved":{"type":"integer","description":"How many pages were saved."},"completedSteps":{"type":"array","items":{"type":"string"},"description":"The research steps that are done."},"missingSteps":{"type":"array","items":{"type":"string"},"description":"The research steps that are still missing."}},"required":["leadId","analysisId","pagesSaved","completedSteps","missingSteps"],"title":"LeadResearchSourceSubmitData"},"LeadScoringCellData":{"type":"object","properties":{"cell":{"type":"string"},"fitGrade":{"$ref":"#/components/schemas/LeadFitGrade"},"heatStatus":{"$ref":"#/components/schemas/HeatStatus"},"intentLevel":{"type":"integer"},"isMql":{"type":"boolean"}},"required":["cell","fitGrade","heatStatus","intentLevel","isMql"],"title":"LeadScoringCellData"},"LeadScoringContactData":{"type":"object","properties":{"contactId":{"type":"integer"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"isPrimary":{"type":"boolean"},"engagementScore":{"type":"integer"},"heatStatus":{"$ref":"#/components/schemas/HeatStatus"},"suppressed":{"type":"boolean"}},"required":["contactId","name","email","isPrimary","engagementScore","heatStatus","suppressed"],"title":"LeadScoringContactData"},"LeadScoringData":{"type":"object","properties":{"leadId":{"type":"integer"},"fit":{"$ref":"#/components/schemas/LeadFitBreakdownData","description":"How well the lead fits your ideal client, with each rule and its points."},"firmographic":{"anyOf":[{"$ref":"#/components/schemas/LeadFirmographicData"},{"type":"null"}],"description":"Facts about the company from the business register. null when Fusio has none."},"intent":{"$ref":"#/components/schemas/LeadIntentBreakdownData"},"ledger":{"type":"array","items":{"$ref":"#/components/schemas/LeadEngagementLedgerEntryData"}},"ledgerWindow":{"$ref":"#/components/schemas/LeadEngagementWindowData"},"cell":{"$ref":"#/components/schemas/LeadScoringCellData"},"handoff":{"anyOf":[{"$ref":"#/components/schemas/LeadHandoffData"},{"type":"null"}]},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/LeadScoringContactData"}},"interestHistory":{"type":"array","items":{"$ref":"#/components/schemas/LeadInterestDayData"}},"heatThresholds":{"$ref":"#/components/schemas/ScoringHeatThresholdsData"},"gradeThresholds":{"$ref":"#/components/schemas/ScoringGradeThresholdsData"},"peerCells":{"type":"array","items":{"$ref":"#/components/schemas/LeadFitIntentCellData"}},"predictedConversion":{"type":["integer","null"]},"predictionFactors":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LeadPredictionFactorData"}}},"required":["leadId","fit","firmographic","intent","ledger","ledgerWindow","cell","handoff","contacts","interestHistory","heatThresholds","gradeThresholds","peerCells","predictedConversion","predictionFactors"],"title":"LeadScoringData"},"LeadSource":{"type":"string","enum":["web","cold_call","referral","campaign","event","partner","lead_form","ares","eshopy_cz","crm","import","social_discovery"],"title":"LeadSource"},"LeadStage":{"type":"string","enum":["cold","warm","qualified","client","lost"],"title":"LeadStage"},"LeadTaskOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"assigneeId":{"type":"integer"},"assignee":{"anyOf":[{"$ref":"#/components/schemas/UserSummaryData"},{"type":"null"}]},"taskableType":{"$ref":"#/components/schemas/TaskableType"},"taskableId":{"type":"integer"},"noteId":{"type":["integer","null"]},"title":{"type":"string"},"description":{"type":["string","null"]},"dueAt":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/TaskStatus"},"completedAt":{"type":["string","null"]},"pinnedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"cadenceStep":{"anyOf":[{"$ref":"#/components/schemas/TaskCadenceStepData"},{"type":"null"}]},"outreachTouchId":{"type":["integer","null"]}},"required":["id","tenantId","userId","assigneeId","assignee","taskableType","taskableId","noteId","title","description","dueAt","status","completedAt","pinnedAt","createdAt","updatedAt","cadenceStep","outreachTouchId"],"title":"LeadTaskOutputData"},"LinkedCampaignSummaryData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"title":"LinkedCampaignSummaryData"},"LinkedInAdTargetingEntityData":{"type":"object","properties":{"urn":{"type":"string","description":"The LinkedIn URN of the value."},"facetUrn":{"type":"string","description":"The LinkedIn URN of its kind."},"name":{"type":"string","description":"The name of the value."}},"required":["urn","facetUrn","name"],"title":"LinkedInAdTargetingEntityData"},"LinkedInGeoTypeaheadData":{"type":"object","properties":{"displayText":{"type":"string","description":"The name of the place to show."},"entity":{"type":"string","description":"The LinkedIn URN of the place."}},"required":["displayText","entity"],"title":"LinkedInGeoTypeaheadData"},"LinkedInTargetingFacetCategoryOutputData":{"type":"object","properties":{"basic_demographics":{"description":"Kinds about people, like age and gender. Each item maps the name of a kind to its LinkedIn URN."},"professional_information":{"description":"Kinds about work, like job titles and skills."},"education":{"description":"Kinds about school, like schools and degrees."},"company_information":{"description":"Kinds about companies, like industry and size."},"location":{"description":"Kinds about places."},"social_behavioral":{"description":"Kinds about interests and groups."},"advanced_targeting":{"description":"Other kinds, like your own audiences."}},"title":"LinkedInTargetingFacetCategoryOutputData"},"MascotBackground":{"type":"string","enum":["auto","real","drawn","plain"],"title":"MascotBackground"},"MascotDescriptionOutputData":{"type":"object","properties":{"description":{"type":"string","description":"What the mascot looks like, written by AI."},"personality":{"type":"string","description":"How the mascot behaves, written by AI."}},"required":["description","personality"],"title":"MascotDescriptionOutputData"},"MascotPresence":{"type":"string","enum":["main","small","none"],"title":"MascotPresence"},"MembershipSuspenderOutputData":{"type":"object","properties":{"name":{"type":"string"},"roleName":{"type":["string","null"]}},"required":["name","roleName"],"title":"MembershipSuspenderOutputData"},"MembershipSuspensionOutputData":{"type":"object","properties":{"suspendedAt":{"type":"string"},"reason":{"type":["string","null"]},"suspendedBy":{"anyOf":[{"$ref":"#/components/schemas/MembershipSuspenderOutputData"},{"type":"null"}]},"otherMemberships":{"type":"array","items":{"$ref":"#/components/schemas/OtherMembershipOutputData"}}},"required":["suspendedAt","reason","suspendedBy","otherMemberships"],"title":"MembershipSuspensionOutputData"},"MessageFrameworkExampleData":{"type":"object","properties":{"situation":{"type":"string"},"message":{"type":"string"},"rating":{"type":"string"},"whyBad":{"type":["string","null"]}},"required":["situation","message","rating","whyBad"],"title":"MessageFrameworkExampleData"},"MessageFrameworkOutputData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"goals":{"type":"array","items":{"type":"string"},"description":"The outreach goals the framework can be used for."},"preconditions":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/MessageFrameworkStepData"}},"rules":{"type":"array","items":{"type":"string"}},"examples":{"type":"array","items":{"$ref":"#/components/schemas/MessageFrameworkExampleData"}},"tenantProductId":{"type":["string","null"]},"valueTheme":{"type":["string","null"]},"differentiators":{"type":"array","items":{"type":"string"}},"proofRefs":{"type":"array","items":{"$ref":"#/components/schemas/MessageFrameworkProofRefData"}},"cta":{"type":["string","null"]},"isOfferCustomized":{"type":"boolean"},"isOfferStale":{"type":"boolean"},"isSystem":{"type":"boolean","description":"Whether Fusio provides the framework, rather than the tenant."},"basedOnId":{"type":["string","null"]},"defaultForGoals":{"type":"array","items":{"type":"string"},"description":"The goals for which this framework is the tenant's default."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","name","description","goals","preconditions","steps","rules","examples","tenantProductId","valueTheme","differentiators","proofRefs","cta","isOfferCustomized","isOfferStale","isSystem","basedOnId","defaultForGoals","createdAt","updatedAt"],"title":"MessageFrameworkOutputData"},"MessageFrameworkProofRefData":{"type":"object","properties":{"type":{"type":"string"},"ref":{"type":"string"}},"required":["type","ref"],"title":"MessageFrameworkProofRefData"},"MessageFrameworkStepData":{"type":"object","properties":{"name":{"type":"string"},"instruction":{"type":"string"},"example":{"type":["string","null"]}},"required":["name","instruction","example"],"title":"MessageFrameworkStepData"},"MetaAdsAdCardData":{"type":"object","properties":{"position":{"type":"integer"},"fileId":{"type":["integer","null"]},"mediaType":{"type":["string","null"]},"thumbnailFileId":{"type":["integer","null"]},"thumbnailUrl":{"type":["string","null"],"description":"The address of the preview picture of a video, or null."},"headline":{"type":["string","null"]},"description":{"type":["string","null"]},"destinationUrl":{"type":["string","null"]},"url":{"type":["string","null"],"description":"The address of the picture or video of the card, or null."}},"required":["position","fileId","mediaType","thumbnailFileId","thumbnailUrl","headline","description","destinationUrl","url"],"title":"MetaAdsAdCardData"},"MetaAdsAdData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string"},"position":{"type":"integer"},"source":{"type":"string","description":"new (a new ad) or existing_post (a post from your page or profile)."},"format":{"type":["string","null"],"description":"single_image, single_video or carousel, or null."},"destinationUrl":{"type":["string","null"]},"displayLink":{"type":["string","null"]},"callToAction":{"type":["string","null"]},"urlTags":{"type":["string","null"]},"generationStatus":{"type":"string","description":"How AI makes the pictures of the ad: missing, queued, generating, ready or failed."},"concept":{"type":["string","null"],"description":"The short idea of the ad from AI, or null."},"angle":{"type":["string","null"],"description":"The main point the ad makes, from AI, or null."},"persona":{"type":["string","null"],"description":"Who the ad talks to, from AI, or null."},"hook":{"type":["string","null"],"description":"What catches the eye first, from AI, or null."},"look":{"type":["string","null"],"description":"How the picture of the ad should look, from AI, or null."},"revision":{"type":"string","description":"The version of the ad. Send it as expectedRevision when you change the ad."},"sourcePostPlatform":{"type":["string","null"]},"sourcePostExternalId":{"type":["string","null"]},"sourcePostPreviewText":{"type":["string","null"]},"sourcePostPreviewImageUrl":{"type":["string","null"]},"texts":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdTextData"},"description":"The texts of the ad: primary_text, headline and description."},"media":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdMediaData"},"description":"The pictures or videos of the ad: feed (square or wide) and vertical."},"cards":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdCardData"},"description":"The cards of a carousel ad. Empty for other formats."},"updatedAt":{"type":["string","null"]}},"required":["id","name","status","position","source","format","destinationUrl","displayLink","callToAction","urlTags","generationStatus","concept","angle","persona","hook","look","revision","sourcePostPlatform","sourcePostExternalId","sourcePostPreviewText","sourcePostPreviewImageUrl","texts","media","cards","updatedAt"],"title":"MetaAdsAdData"},"MetaAdsAdFormat":{"type":"string","enum":["single_image","single_video","carousel"],"title":"MetaAdsAdFormat"},"MetaAdsAdMediaData":{"type":"object","properties":{"slot":{"type":"string"},"fileId":{"type":"integer"},"mediaType":{"type":"string"},"thumbnailFileId":{"type":["integer","null"]},"url":{"type":"string","description":"The address of the picture or video."},"thumbnailUrl":{"type":["string","null"],"description":"The address of the preview picture of a video, or null."}},"required":["slot","fileId","mediaType","thumbnailFileId","url","thumbnailUrl"],"title":"MetaAdsAdMediaData"},"MetaAdsAdReviewIssueData":{"type":"object","properties":{"code":{"type":"string","description":"Meta's code of the problem."},"level":{"type":"string","description":"Where Meta found it, like AD."},"summary":{"type":"string","description":"A short text from Meta."},"body":{"type":["string","null"],"description":"A longer text from Meta, or null."}},"required":["code","level","summary","body"],"title":"MetaAdsAdReviewIssueData"},"MetaAdsAdSetAudienceData":{"type":"object","properties":{"externalAudienceId":{"type":"string"},"name":{"type":"string"},"subtype":{"type":"string"},"mode":{"type":"string"}},"required":["externalAudienceId","name","subtype","mode"],"title":"MetaAdsAdSetAudienceData"},"MetaAdsAdSetData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"position":{"type":"integer"},"optimizationGoal":{"type":"string","description":"What Meta tries to get for the money, like reach or quality_lead. It follows the objective of the campaign."},"billingEvent":{"type":"string"},"budgetType":{"type":["string","null"]},"budgetAmount":{"type":["string","null"],"description":"The budget of the ad set as text, or null when the campaign holds the budget."},"advantageAudienceEnabled":{"type":"boolean","description":"true when Meta may also reach people outside your targeting when it helps."},"ageMin":{"type":"integer"},"ageMax":{"type":"integer"},"gender":{"type":"string","description":"Who to reach: all, male or female."},"advantagePlacementsEnabled":{"type":"boolean","description":"true when Meta picks where the ads show. false when they show only in placements."},"frequencyCapImpressions":{"type":["integer","null"]},"frequencyCapDays":{"type":["integer","null"]},"attributionWindow":{"type":"string","description":"How long after a click or a view a result still counts: click_1d, click_7d or click_7d_view_1d."},"audienceSizeLower":{"type":["integer","null"],"description":"The lower end of the newest estimate of how many people the ad set reaches, or null."},"audienceSizeUpper":{"type":["integer","null"],"description":"The upper end of the newest estimate of how many people the ad set reaches, or null."},"audienceEstimatedAt":{"type":["string","null"],"description":"When the newest estimate was made, or null."},"audienceHypothesis":{"type":["string","null"],"description":"Why AI picked these people for the ad set, or null."},"placementsReason":{"type":["string","null"],"description":"Why AI picked these places for the ads, or null."},"status":{"type":"string"},"locations":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdSetLocationData"},"description":"The places to reach or to leave out."},"targets":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdSetTargetData"},"description":"The interests, behaviors and demographics to reach."},"languages":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdSetLanguageData"},"description":"The languages people must speak. Empty means any language."},"audiences":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdSetAudienceData"},"description":"Your own Meta audiences to reach or to leave out."},"placements":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdSetPlacementData"},"description":"The places where the ads show when Meta does not pick them."},"ads":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdData"},"description":"The ads of the ad set."}},"required":["id","name","position","optimizationGoal","billingEvent","budgetType","budgetAmount","advantageAudienceEnabled","ageMin","ageMax","gender","advantagePlacementsEnabled","frequencyCapImpressions","frequencyCapDays","attributionWindow","audienceSizeLower","audienceSizeUpper","audienceEstimatedAt","audienceHypothesis","placementsReason","status","locations","targets","languages","audiences","placements","ads"],"title":"MetaAdsAdSetData"},"MetaAdsAdSetLanguageData":{"type":"object","properties":{"localeKey":{"type":"integer"},"name":{"type":"string"}},"required":["localeKey","name"],"title":"MetaAdsAdSetLanguageData"},"MetaAdsAdSetLocationData":{"type":"object","properties":{"kind":{"type":"string"},"externalKey":{"type":"string"},"name":{"type":"string"},"radiusKm":{"type":["integer","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"mode":{"type":"string"}},"required":["kind","externalKey","name","radiusKm","latitude","longitude","mode"],"title":"MetaAdsAdSetLocationData"},"MetaAdsAdSetPlacementData":{"type":"object","properties":{"publisherPlatform":{"type":"string"},"position":{"type":"string"}},"required":["publisherPlatform","position"],"title":"MetaAdsAdSetPlacementData"},"MetaAdsAdSetTargetData":{"type":"object","properties":{"kind":{"type":"string"},"externalId":{"type":"string"},"name":{"type":"string"},"graphField":{"type":["string","null"]},"source":{"type":"string"}},"required":["kind","externalId","name","graphField","source"],"title":"MetaAdsAdSetTargetData"},"MetaAdsAdSource":{"type":"string","enum":["new","existing_post"],"title":"MetaAdsAdSource"},"MetaAdsAdTextData":{"type":"object","properties":{"kind":{"type":"string"},"position":{"type":"integer"},"text":{"type":"string"}},"required":["kind","position","text"],"title":"MetaAdsAdTextData"},"MetaAdsAdTextKind":{"type":"string","enum":["primary_text","headline","description"],"title":"MetaAdsAdTextKind"},"MetaAdsAdTextSuggestionData":{"type":"object","properties":{"text":{"type":"string","description":"The suggested text."}},"required":["text"],"title":"MetaAdsAdTextSuggestionData"},"MetaAdsAdTextSuggestionsData":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/MetaAdsAdTextKind","description":"What the suggestions are for: primary_text, headline or description."},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdTextSuggestionData"},"description":"The suggested texts."}},"required":["kind","suggestions"],"title":"MetaAdsAdTextSuggestionsData"},"MetaAdsAttributionWindow":{"type":"string","enum":["click_1d","click_7d","click_7d_view_1d"],"title":"MetaAdsAttributionWindow"},"MetaAdsAudienceData":{"type":"object","properties":{"externalId":{"type":"string","description":"The Meta code of the audience. Send it as externalAudienceId in audiences of an ad set."},"name":{"type":"string"},"subtype":{"type":"string","description":"custom (your own list) or lookalike (people like your list)."},"sizeLower":{"type":["integer","null"],"description":"The lower end of how many people the audience has, or null."},"sizeUpper":{"type":["integer","null"],"description":"The upper end of how many people the audience has, or null."},"usable":{"type":"boolean","description":"true when Meta can already show ads to the audience."}},"required":["externalId","name","subtype","sizeLower","sizeUpper","usable"],"title":"MetaAdsAudienceData"},"MetaAdsAudienceEstimateData":{"type":"object","properties":{"available":{"type":"boolean","description":"true when Meta gave an estimate. false when it could not."},"lower":{"type":["integer","null"],"description":"The lower end of the estimate, or null."},"upper":{"type":["integer","null"],"description":"The upper end of the estimate, or null."},"estimatedAt":{"type":["string","null"],"description":"When the estimate was made, or null."}},"required":["available","lower","upper","estimatedAt"],"title":"MetaAdsAudienceEstimateData"},"MetaAdsAudienceSubtype":{"type":"string","enum":["custom","lookalike"],"title":"MetaAdsAudienceSubtype"},"MetaAdsBidStrategy":{"type":"string","enum":["lowest_cost","cost_cap","bid_cap","min_roas"],"title":"MetaAdsBidStrategy"},"MetaAdsBriefPicksData":{"type":"object","properties":{"landingPage":{"anyOf":[{"$ref":"#/components/schemas/AdBriefLandingPagePickData"},{"type":"null"}],"description":"The page of your website AI picked, or null when none fits."},"objective":{"$ref":"#/components/schemas/MetaAdsObjective","description":"The goal AI picked: awareness, traffic, engagement, leads or sales. When you sent one, it is yours."},"objectiveReason":{"type":"string","description":"Why AI picked the goal."},"destination":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsDestination"},{"type":"null"}],"description":"Where people go after a click: website, instant_form or on_post. null when the goal has no destination."},"conversionEvent":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsConversionEvent"},{"type":"null"}],"description":"The pixel event AI thinks should count as a result, like purchase, or null."},"conversionEventReason":{"type":["string","null"],"description":"Why AI picked the event, or null."},"specialAdCategory":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsSpecialAdCategory"},{"type":"null"}],"description":"A special category when the brief is about credit, employment, housing, financial_products_services or online_gambling_and_gaming, or null."},"accountPixelExternalId":{"type":["string","null"],"description":"The Meta pixel of your ad account, or null."}},"required":["landingPage","objective","objectiveReason","destination","conversionEvent","conversionEventReason","specialAdCategory","accountPixelExternalId"],"title":"MetaAdsBriefPicksData"},"MetaAdsBudgetType":{"type":"string","enum":["daily","lifetime"],"title":"MetaAdsBudgetType"},"MetaAdsCallToAction":{"type":"string","enum":["learn_more","shop_now","buy_now","order_now","book_now","sign_up","subscribe","apply_now","contact_us","get_quote","get_offer","download","inquire_now","request_time","buy_tickets","donate_now","get_started","see_more","watch_more","listen_now","no_button"],"title":"MetaAdsCallToAction"},"MetaAdsCampaignData":{"type":"object","properties":{"id":{"type":"integer"},"tenantSequence":{"type":["integer","null"],"description":"The number of the campaign within your company."},"name":{"type":"string"},"utmSlug":{"type":"string","description":"The short name used in UTM links of the campaign."},"origin":{"type":"string","description":"How the campaign started: manual (you made it) or manual_ai (you asked AI)."},"status":{"type":"string","description":"draft (you still work on it), approved (ready to upload to Meta) or archived."},"detachedStatus":{"type":["string","null"],"description":"The status the campaign had before you picked another ad account, or null. It comes back when you pick that account again."},"objective":{"type":"string","description":"What the campaign wants to get: awareness, traffic, engagement, leads or sales."},"destination":{"type":["string","null"],"description":"Where people go after a click: website, instant_form (a form right in Facebook or Instagram) or on_post (the post itself). null when the objective has no destination."},"specialAdCategory":{"type":["string","null"],"description":"A special category for ads about credit, employment, housing, financial_products_services or online_gambling_and_gaming, or null. Such ads can be targeted less."},"campaignBudgetEnabled":{"type":"boolean","description":"true when the campaign holds one budget for all its ad sets. false when each ad set has its own budget."},"budgetType":{"type":"string","description":"daily (the budget is for one day) or lifetime (for the whole run)."},"budgetAmount":{"type":["string","null"],"description":"The budget of the campaign as text like \"500.00\", or null."},"budgetCurrencyCode":{"type":["string","null"],"description":"The currency of the budget, like CZK."},"bidStrategy":{"type":"string","description":"How Meta bids: lowest_cost, cost_cap, bid_cap or min_roas."},"bidAmount":{"type":["string","null"],"description":"The bid or the cost limit as text like \"25.00\". null when the strategy needs none."},"roasFloor":{"type":["string","null"],"description":"The lowest return on the money for min_roas, as text like \"2.5000\". null for other strategies."},"startsAt":{"type":["string","null"],"description":"When the campaign starts, or null."},"endsAt":{"type":["string","null"],"description":"When the campaign ends, or null when it runs without an end."},"conversionPixelExternalId":{"type":["string","null"],"description":"The Meta pixel that counts the results, or null."},"conversionEvent":{"type":["string","null"],"description":"The pixel event that counts as a result, like purchase or lead. null when the objective needs none."},"leadFormId":{"type":["integer","null"],"description":"The number of the lead form for instant_form, or null."},"creativeEnhancementsEnabled":{"type":"boolean","description":"true when Meta may change the look of the ads a little to get better results."},"generationStage":{"type":["string","null"],"description":"What AI does right now when it builds the campaign, like writing_ads. null when it does nothing."},"generationError":{"type":["string","null"],"description":"Why AI could not build the campaign, or null."},"adAccountId":{"type":["integer","null"],"description":"The number of your Meta ad account in Fusio, or null."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"adSets":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdSetData"},"description":"The ad sets, each with its targeting and ads."},"blockers":{"type":"array","items":{"type":"string"},"description":"What must be fixed before you can approve the campaign, as codes like missing_meta_account. Empty when nothing."},"checks":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsCheckData"},"description":"Tips that would make the campaign better. They do not stop the approval."},"deployment":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsDeploymentSummaryData"},{"type":"null"}],"description":"How the campaign is doing in Meta, or null when you have not uploaded it to Meta yet."}},"required":["id","tenantSequence","name","utmSlug","origin","status","detachedStatus","objective","destination","specialAdCategory","campaignBudgetEnabled","budgetType","budgetAmount","budgetCurrencyCode","bidStrategy","bidAmount","roasFloor","startsAt","endsAt","conversionPixelExternalId","conversionEvent","leadFormId","creativeEnhancementsEnabled","generationStage","generationError","adAccountId","createdAt","updatedAt","adSets","blockers","checks","deployment"],"title":"MetaAdsCampaignData"},"MetaAdsCheckData":{"type":"object","properties":{"code":{"type":"string","description":"What the tip is about, as a code like too_few_ads."},"level":{"type":"string","description":"How serious the tip is. Now always warning."},"adSetId":{"type":["integer","null"],"description":"The ad set the tip is about, or null."},"adId":{"type":["integer","null"],"description":"The ad the tip is about, or null."}},"required":["code","level","adSetId","adId"],"title":"MetaAdsCheckData"},"MetaAdsConversionEvent":{"type":"string","enum":["purchase","lead","complete_registration","contact","schedule","submit_application","start_trial","subscribe","add_to_cart","add_to_wishlist","initiated_checkout","add_payment_info","content_view","search","customize_product","donate","find_location"],"title":"MetaAdsConversionEvent"},"MetaAdsDemographicField":{"type":"string","enum":["life_events","industries","income","family_statuses","education_statuses","education_schools","education_majors","work_positions","work_employers"],"title":"MetaAdsDemographicField"},"MetaAdsDeploymentAdData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the ad row. Send it as targetId to `meta-ads-deployments.status`."},"sourceAdId":{"type":["integer","null"],"description":"The number of the Fusio ad it came from, or null."},"externalAdId":{"type":["string","null"],"description":"The number of the ad in Meta, or null before it is there."},"externalCreativeId":{"type":["string","null"],"description":"The number of the ad look in Meta, or null."},"remoteStatus":{"type":["string","null"],"description":"The state in Meta: active, paused, archived or deleted, or null."},"effectiveStatus":{"type":["string","null"],"description":"What Meta says about showing the ad, or null."},"reviewStatus":{"type":["string","null"],"description":"What Meta's check says: pending, approved, rejected or with_issues. null before the check."},"userPaused":{"type":"boolean","description":"true when you paused this ad yourself. Starting the campaign keeps it paused."},"issues":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsAdReviewIssueData"},"description":"What Meta found wrong with the ad. Empty when nothing."}},"required":["id","sourceAdId","externalAdId","externalCreativeId","remoteStatus","effectiveStatus","reviewStatus","userPaused","issues"],"title":"MetaAdsDeploymentAdData"},"MetaAdsDeploymentAdSetData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the ad set row. Send it as targetId to `meta-ads-deployments.status`."},"sourceAdSetId":{"type":["integer","null"],"description":"The number of the Fusio ad set it came from, or null."},"externalAdSetId":{"type":["string","null"],"description":"The number of the ad set in Meta, or null before it is there."},"remoteStatus":{"type":["string","null"],"description":"The state in Meta: active, paused, archived or deleted, or null."},"effectiveStatus":{"type":["string","null"],"description":"What Meta says about showing the ad set, or null."},"learningStage":{"type":["string","null"],"description":"How far Meta is with learning: learning, success or fail. null when Meta does not say."},"userPaused":{"type":"boolean","description":"true when you paused this ad set yourself. Starting the campaign keeps it paused."},"ads":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsDeploymentAdData"},"description":"The ads of the ad set in Meta."}},"required":["id","sourceAdSetId","externalAdSetId","remoteStatus","effectiveStatus","learningStage","userPaused","ads"],"title":"MetaAdsDeploymentAdSetData"},"MetaAdsDeploymentChangeSummaryData":{"type":"object","properties":{"campaign":{"type":"boolean","description":"true when the campaign itself changed."},"adSetsCreated":{"type":"integer","description":"How many new ad sets wait to be made."},"adSetsUpdated":{"type":"integer","description":"How many ad sets changed."},"adSetsRemoved":{"type":"integer","description":"How many ad sets you removed."},"adsCreated":{"type":"integer","description":"How many new ads wait to be made."},"adsUpdated":{"type":"integer","description":"How many ads changed."},"creativesReplaced":{"type":"integer","description":"How many ads get new pictures, videos or texts."},"adsRemoved":{"type":"integer","description":"How many ads you removed."},"leadForm":{"type":"boolean","description":"true when the form changed."},"total":{"type":"integer","description":"All changes together."}},"required":["campaign","adSetsCreated","adSetsUpdated","adSetsRemoved","adsCreated","adsUpdated","creativesReplaced","adsRemoved","leadForm","total"],"title":"MetaAdsDeploymentChangeSummaryData"},"MetaAdsDeploymentData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the deployment. Use it with the meta-ads-deployments routes."},"campaignId":{"type":"integer","description":"The number of the Fusio campaign it came from."},"status":{"type":"string","description":"How far the upload is: draft, validating, publishing, paused, active, failed, reconciliation_required (Fusio must check what Meta has) or drifted (Meta has something else than Fusio)."},"mode":{"type":"string","description":"How it got to Meta. Always api (Fusio uploaded it)."},"managementState":{"type":"string","description":"managed (Fusio may change it) or read_only (Fusio only reads it)."},"progressStep":{"type":["string","null"],"description":"The step the upload is on. It is media, lead_form, validate, campaign, ad_sets, ads or completed. null until the upload starts. After it finishes, it stays completed. After a failure, it keeps the last step."},"planRevision":{"type":"string","description":"The version of the plan that was uploaded."},"currentPlanRevision":{"type":"string","description":"The version of the plan in Fusio now. When it differs from planRevision, you changed something."},"hasUnsynchronizedChanges":{"type":"boolean","description":"true when you changed the campaign in Fusio and Meta does not have it yet."},"changeSummary":{"$ref":"#/components/schemas/MetaAdsDeploymentChangeSummaryData","description":"How many things of each kind changed and wait to be uploaded."},"canApplyChanges":{"type":"boolean","description":"true when you can upload the waiting changes with `meta-ads-deployments.apply`."},"learningRestartWarnings":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsLearningWarningData"},"description":"Changes after which Meta has to learn again. While the list is not empty, send `confirmLearningRestart` true."},"idempotencyKey":{"type":"string","description":"The key the upload used."},"externalCampaignId":{"type":["string","null"],"description":"The number of the campaign in Meta, or null before it is there."},"remoteStatus":{"type":["string","null"],"description":"The state in Meta: active, paused, archived or deleted. null before Meta has the campaign."},"effectiveStatus":{"type":["string","null"],"description":"What Meta says about showing the campaign, like active, campaign_paused or with_issues, or null."},"currencyCode":{"type":"string","description":"The currency, like CZK."},"failureCode":{"type":["string","null"],"description":"Why the last upload failed, as a code like upload_interrupted, campaign_not_approved or generic. null when nothing failed."},"failureReason":{"type":["string","null"],"description":"A short reason in your language why the last upload failed, or null."},"deployedAt":{"type":["string","null"],"description":"When the campaign got to Meta, or null."},"lastSyncedAt":{"type":["string","null"],"description":"When Fusio last read the campaign from Meta, or null."},"adSets":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsDeploymentAdSetData"},"description":"The ad sets in Meta, each with its ads."}},"required":["id","campaignId","status","mode","managementState","progressStep","planRevision","currentPlanRevision","hasUnsynchronizedChanges","changeSummary","canApplyChanges","learningRestartWarnings","idempotencyKey","externalCampaignId","remoteStatus","effectiveStatus","currencyCode","failureCode","failureReason","deployedAt","lastSyncedAt","adSets"],"title":"MetaAdsDeploymentData"},"MetaAdsDeploymentLevel":{"type":"string","enum":["campaign","ad_set","ad"],"title":"MetaAdsDeploymentLevel"},"MetaAdsDeploymentPreflightData":{"type":"object","properties":{"enabled":{"type":"boolean","description":"true when uploading campaigns to Meta is turned on."},"canDeploy":{"type":"boolean","description":"true when nothing blocks the upload."},"createsPausedCampaign":{"type":"boolean","description":"Always true. The campaign gets to Meta paused, so it spends nothing."},"blockers":{"type":"array","items":{"type":"string"},"description":"What must be fixed before the upload, as codes like missing_meta_account, feature_disabled, meta_ads_sandbox_account_required or plan_incomplete. Empty when nothing."},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsCheckData"},"description":"Tips that would make the campaign better. They do not stop the upload. The code leadgen_subscription_failed means Meta may not send new contacts from forms to Fusio."},"adAccountId":{"type":["integer","null"],"description":"The number of your Meta ad account in Fusio, or null."},"externalAccountId":{"type":["string","null"],"description":"The number of the ad account in Meta, like act_123, or null."},"currencyCode":{"type":["string","null"],"description":"The currency of the ad account, like CZK, or null."},"planRevision":{"type":"string","description":"The version of the plan. Send it as planRevision to `meta-ads-campaigns.meta-ads.deploy`."}},"required":["enabled","canDeploy","createsPausedCampaign","blockers","warnings","adAccountId","externalAccountId","currencyCode","planRevision"],"title":"MetaAdsDeploymentPreflightData"},"MetaAdsDeploymentSummaryData":{"type":"object","properties":{"id":{"type":"integer"},"status":{"type":"string","description":"Where the upload stands, like publishing, active, paused or failed."},"remoteStatus":{"type":["string","null"],"description":"The state in Meta: active, paused, archived or deleted. null before Meta has the campaign."},"progressStep":{"type":["string","null"],"description":"The step the upload is on, like media or ads. null until the upload starts. After it finishes, it stays completed. After a failure, it keeps the last step."},"hasUnsynchronizedChanges":{"type":"boolean","description":"true when you changed the campaign and Meta does not have the changes yet."},"pendingChangeCount":{"type":"integer","description":"How many changes still wait to be uploaded to Meta."},"failureCode":{"type":["string","null"],"description":"Why the last upload failed, as a code like upload_interrupted, campaign_not_approved or generic. null when nothing failed."},"failureReason":{"type":["string","null"],"description":"A short explanation in your language of why the last upload failed, or null."}},"required":["id","status","remoteStatus","progressStep","hasUnsynchronizedChanges","pendingChangeCount","failureCode","failureReason"],"title":"MetaAdsDeploymentSummaryData"},"MetaAdsDestination":{"type":"string","enum":["website","instant_form","on_post"],"title":"MetaAdsDestination"},"MetaAdsGender":{"type":"string","enum":["all","male","female"],"title":"MetaAdsGender"},"MetaAdsImageSource":{"type":"string","enum":["library","generate","mixed"],"title":"MetaAdsImageSource"},"MetaAdsLeadData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the lead in Fusio. Send it to `meta-ads-leads.retry`."},"status":{"type":"string","description":"pending (waits to load), ingested (it is in Fusio), rejected (needs your fix) or failed (loading failed). We retry a failed lead ourselves, up to five attempts in total. We never retry it for recipients_missing. After five attempts or for recipients_missing, send it to `meta-ads-leads.retry`."},"lastError":{"type":["string","null"],"description":"Why the lead did not load, or null. Like target_form_missing, validation_failed, page_unavailable, meta_reconnect_required, graph_failed, submission_failed, recipients_missing or answers_unmapped."},"errorField":{"type":["string","null"],"description":"The field of your form that did not pass, or null."},"attempts":{"type":"integer","description":"How many times loading failed."},"externalLeadId":{"type":"string","description":"The number of the lead at Meta."},"leadCreatedAt":{"type":"string","description":"When the person filled in the form at Meta."},"formName":{"type":["string","null"],"description":"The name of the Meta form, or null."},"campaignId":{"type":["integer","null"],"description":"The number of the Meta campaign the lead came from, or null."},"leadId":{"type":["integer","null"],"description":"The number of the lead in the CRM, or null."},"inquiryId":{"type":["integer","null"],"description":"The number of the inquiry, or null."},"ingestedAt":{"type":["string","null"],"description":"When the lead loaded into Fusio, or null."}},"required":["id","status","lastError","errorField","attempts","externalLeadId","leadCreatedAt","formName","campaignId","leadId","inquiryId","ingestedAt"],"title":"MetaAdsLeadData"},"MetaAdsLeadFormData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the lead form. Send it as leadFormId of a campaign."},"name":{"type":"string"},"status":{"type":"string","description":"active (campaigns can use it) or archived."},"formType":{"type":"string","description":"more_volume (more answers) or higher_intent (fewer but surer answers), or null."},"introHeadline":{"type":["string","null"]},"introText":{"type":["string","null"]},"privacyPolicyUrl":{"type":"string","description":"The address of your privacy policy."},"thankYouTitle":{"type":["string","null"]},"thankYouText":{"type":["string","null"]},"thankYouUrl":{"type":["string","null"]},"phoneOtpVerification":{"type":"string","description":"Whether people confirm their phone with a code: disabled, optional or required. It is never null."},"tenantLeadFormId":{"type":["integer","null"],"description":"Your Fusio form where the answers go, or null."},"questions":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsLeadFormQuestionData"},"description":"The questions of the form in order."}},"required":["id","name","status","formType","introHeadline","introText","privacyPolicyUrl","thankYouTitle","thankYouText","thankYouUrl","phoneOtpVerification","tenantLeadFormId","questions"],"title":"MetaAdsLeadFormData"},"MetaAdsLeadFormQuestionData":{"type":"object","properties":{"id":{"type":"integer"},"position":{"type":"integer"},"kind":{"type":"string","description":"full_name, email, phone, city, company_name, job_title or custom (your own question with options)."},"label":{"type":["string","null"],"description":"The text of a custom question, or null."},"options":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsLeadFormQuestionOptionData"},"description":"The options of a custom question. Empty for other kinds."}},"required":["id","position","kind","label","options"],"title":"MetaAdsLeadFormQuestionData"},"MetaAdsLeadFormQuestionKind":{"type":"string","enum":["full_name","email","phone","city","company_name","job_title","custom"],"title":"MetaAdsLeadFormQuestionKind"},"MetaAdsLeadFormQuestionOptionData":{"type":"object","properties":{"position":{"type":"integer"},"label":{"type":"string"}},"required":["position","label"],"title":"MetaAdsLeadFormQuestionOptionData"},"MetaAdsLeadFormType":{"type":"string","enum":["more_volume","higher_intent"],"title":"MetaAdsLeadFormType"},"MetaAdsLearningWarningData":{"type":"object","properties":{"code":{"type":"string","description":"What makes Meta learn again: targeting_change, optimization_change, creative_swap or budget_change_large."},"adSetId":{"type":["integer","null"],"description":"The number of the Fusio ad set it is about, or null."},"adId":{"type":["integer","null"],"description":"The number of the Fusio ad it is about, or null."}},"required":["code","adSetId","adId"],"title":"MetaAdsLearningWarningData"},"MetaAdsLocationKind":{"type":"string","enum":["country","region","city","zip","custom_radius"],"title":"MetaAdsLocationKind"},"MetaAdsMediaType":{"type":"string","enum":["image","video"],"title":"MetaAdsMediaType"},"MetaAdsObjective":{"type":"string","enum":["awareness","traffic","engagement","leads","sales"],"title":"MetaAdsObjective"},"MetaAdsOperationData":{"type":"object","properties":{"id":{"type":"string","description":"The code of the job, a long text like 9d1c6c7e-4f0b-4a51-9a3e-2c1f0b7d5e21."},"type":{"type":"string","description":"What kind of job it is: manual_generation, retry_generation or audience_refresh."},"status":{"type":"string","description":"How the job goes: pending, processing, completed or failed."},"outcomeCode":{"type":["string","null"],"description":"How a finished job ended, as a code. null before the end."},"outcomeMessage":{"type":["string","null"],"description":"The end of the job in words, or null."},"failureCode":{"type":["string","null"],"description":"Why the job failed, as a code. null when it did not fail."},"failureMessage":{"type":["string","null"],"description":"Why the job failed, in words. null when it did not fail."},"startedAt":{"type":["string","null"],"description":"When the job started, or null while it waits."},"finishedAt":{"type":["string","null"],"description":"When the job ended, or null while it runs."},"campaignId":{"type":["integer","null"],"description":"The campaign the job works on, or null."},"adAccountId":{"type":["integer","null"],"description":"The number of the Meta ad account the job works with, or null."},"budgetCurrencyCode":{"type":["string","null"],"description":"The currency of the budget, like CZK, or null."}},"required":["id","type","status","outcomeCode","outcomeMessage","failureCode","failureMessage","startedAt","finishedAt","campaignId","adAccountId","budgetCurrencyCode"],"title":"MetaAdsOperationData"},"MetaAdsOverviewCampaignData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the campaign."},"name":{"type":"string","description":"The name of the campaign."},"meta":{"$ref":"#/components/schemas/MetaAdsPerformanceMetaData","description":"The numbers of this campaign from Meta. Reach shows for the same ranges as in the totals."},"fusio":{"$ref":"#/components/schemas/AdCampaignOverviewFusioData","description":"What Fusio saw on your website from this campaign."}},"required":["id","name","meta","fusio"],"title":"MetaAdsOverviewCampaignData"},"MetaAdsOverviewData":{"type":"object","properties":{"campaignOptions":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaignOverviewCampaignOptionData"},"description":"Your campaigns you can filter by."},"totals":{"$ref":"#/components/schemas/MetaAdsOverviewTotalsData","description":"The totals of the range for all chosen campaigns."},"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsOverviewCampaignData"},"description":"The same numbers for each chosen campaign."},"kpis":{"$ref":"#/components/schemas/MetaAdsOverviewKpisData","description":"The main numbers: impressions, link clicks, results, visits, conversions, leads and clients, each with the value before and a line by day. Results are empty when the campaigns want different kinds of results in the range. For results, the value before is missing when the range before had another kind. Conversions are empty until Meta goals come."},"spend":{"type":"array","items":{"$ref":"#/components/schemas/AdCampaignOverviewSpendData"},"description":"What you spent, one entry for each currency, with a line by day."},"acquisition":{"$ref":"#/components/schemas/AdAcquisitionData","description":"What the ads brought: spend, leads, clients and their revenue."},"funnel":{"$ref":"#/components/schemas/AdCampaignFunnelData","description":"How many visitors became leads, deals and clients, and where they left. You also see it for each ad."},"ready":{"type":"boolean","description":"false while Fusio is still counting the numbers. Then the lists are empty; try again later."},"rolledUpAt":{"type":["string","null"],"description":"When Fusio last counted the numbers."},"range":{"$ref":"#/components/schemas/OverviewRangeData","description":"The days the numbers are for."},"previousRange":{"anyOf":[{"$ref":"#/components/schemas/OverviewRangeData"},{"type":"null"}],"description":"The range just before, when you sent compare=true. Otherwise null."},"dates":{"type":"array","items":{"type":"string"},"description":"Every day of the range. Day lists in the answer follow this order."}},"required":["campaignOptions","totals","campaigns","kpis","spend","acquisition","funnel","ready","rolledUpAt","range","previousRange","dates"],"title":"MetaAdsOverviewData"},"MetaAdsOverviewKpisData":{"type":"object","properties":{"impressions":{"$ref":"#/components/schemas/OverviewKpiData"},"linkClicks":{"$ref":"#/components/schemas/OverviewKpiData"},"results":{"$ref":"#/components/schemas/OverviewKpiData"},"sessions":{"$ref":"#/components/schemas/OverviewKpiData"},"conversions":{"$ref":"#/components/schemas/OverviewKpiData"},"leads":{"$ref":"#/components/schemas/OverviewKpiData"},"customers":{"$ref":"#/components/schemas/OverviewKpiData"}},"required":["impressions","linkClicks","results","sessions","conversions","leads","customers"],"title":"MetaAdsOverviewKpisData"},"MetaAdsOverviewTotalsData":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/MetaAdsPerformanceMetaData","description":"The numbers from Meta, for Facebook and Instagram."},"fusio":{"$ref":"#/components/schemas/AdCampaignOverviewFusioData","description":"What Fusio saw on your website."}},"required":["meta","fusio"],"title":"MetaAdsOverviewTotalsData"},"MetaAdsPerformanceMetaData":{"type":"object","properties":{"impressions":{"type":"integer","description":"How many times people saw the ads."},"reach":{"type":["integer","null"],"description":"How many different people saw the ads. Only for one campaign and the ranges of the last 7, 30 or 90 days, or the same long range before. Otherwise null."},"frequency":{"type":["number","null"],"description":"How many times one person saw the ads on average. null when reach is null."},"clicks":{"type":"integer","description":"All clicks on the ads."},"linkClicks":{"type":"integer","description":"Clicks that led to your website or form."},"results":{"type":["string","null"],"description":"The results Meta counted, like leads or website visits. null when the chosen campaigns want different kinds of results in the range."},"resultType":{"type":["string","null"],"description":"What one result is, like lead. null when it is not one kind."},"leads":{"type":"integer","description":"How many leads Meta counted."},"purchases":{"type":"integer","description":"How many purchases Meta counted."},"videoThruplays":{"type":"integer","description":"How many times people watched a video to the end, or at least 15 seconds."},"money":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsPerformanceMoneyData"},"description":"What you spent, one entry for each currency."},"hasData":{"type":"boolean","description":"false while Meta sent no numbers yet."},"lastSyncedAt":{"type":["string","null"],"description":"When Fusio last got numbers from Meta."},"timezones":{"type":"array","items":{"type":"string"},"description":"The time zones of your ad accounts. Meta counts the days in them."}},"required":["impressions","reach","frequency","clicks","linkClicks","results","resultType","leads","purchases","videoThruplays","money","hasData","lastSyncedAt","timezones"],"title":"MetaAdsPerformanceMetaData"},"MetaAdsPerformanceMoneyData":{"type":"object","properties":{"currencyCode":{"type":"string","description":"The currency."},"spend":{"type":"string","description":"What you spent in this currency."},"purchaseValue":{"type":"string","description":"The value of the purchases Meta counted."}},"required":["currencyCode","spend","purchaseValue"],"title":"MetaAdsPerformanceMoneyData"},"MetaAdsPhoneOtpVerification":{"type":"string","enum":["disabled","optional","required"],"title":"MetaAdsPhoneOtpVerification"},"MetaAdsPlacementPosition":{"type":"string","enum":["feed","right_hand_column","marketplace","story","search","instream_video","facebook_reels","facebook_reels_overlay","profile_feed","notification","stream","reels","ig_search","profile_reels","classic","rewarded_video"],"title":"MetaAdsPlacementPosition"},"MetaAdsPostData":{"type":"object","properties":{"id":{"type":"string","description":"The Meta code of the post. Send it as sourcePostExternalId of an ad."},"platform":{"type":"string"},"text":{"type":["string","null"],"description":"The text of the post, or null."},"imageUrl":{"type":["string","null"],"description":"The address of the picture of the post, or null."},"createdAt":{"type":["string","null"]},"mediaType":{"type":["string","null"]},"eligible":{"type":["boolean","null"],"description":"true when the post can be promoted. false when not. null when Meta did not say."},"ineligibleReason":{"type":["string","null"],"description":"Why the post cannot be promoted, in words, or null."}},"required":["id","platform","text","imageUrl","createdAt","mediaType","eligible","ineligibleReason"],"title":"MetaAdsPostData"},"MetaAdsPublisherPlatform":{"type":"string","enum":["facebook","instagram","audience_network"],"title":"MetaAdsPublisherPlatform"},"MetaAdsSettingsData":{"type":"object","properties":{"monthlyBudgetAmount":{"type":["string","null"],"description":"Your monthly budget for all Meta campaigns, or null when you did not set it."},"budgetCurrencyCode":{"type":["string","null"],"description":"The currency of the budget, like CZK, or null."},"adAccountId":{"type":["integer","null"],"description":"The number of your Meta ad account in Fusio, or null."},"accountComplete":{"type":"boolean","description":"true when the ad account has everything campaigns need."},"reconnectRequired":{"type":"boolean","description":"true when you must connect Meta again."},"allocatedMonthlyBudgetAmount":{"type":["string","null"],"description":"How much of the monthly budget campaigns already use."},"remainingMonthlyBudgetAmount":{"type":["string","null"],"description":"How much of the monthly budget is still free."},"deploymentEnabled":{"type":"boolean","description":"true when Fusio can already upload campaigns to Meta."},"minimumAudienceSize":{"type":"integer","description":"The smallest audience Meta can learn from, in people. Default 100000."}},"required":["monthlyBudgetAmount","budgetCurrencyCode","adAccountId","accountComplete","reconnectRequired","allocatedMonthlyBudgetAmount","remainingMonthlyBudgetAmount","deploymentEnabled","minimumAudienceSize"],"title":"MetaAdsSettingsData"},"MetaAdsSpecialAdCategory":{"type":"string","enum":["credit","employment","housing","financial_products_services","online_gambling_and_gaming"],"title":"MetaAdsSpecialAdCategory"},"MetaAdsSummaryData":{"type":"object","properties":{"campaignCount":{"type":"integer"},"adSetCount":{"type":"integer"},"adCount":{"type":"integer"}},"required":["campaignCount","adSetCount","adCount"],"title":"MetaAdsSummaryData"},"MetaAdsTargetKind":{"type":"string","enum":["interest","behavior","demographic"],"title":"MetaAdsTargetKind"},"MetaAdsTargetSource":{"type":"string","enum":["ai","user"],"title":"MetaAdsTargetSource"},"MetaAdsTargetSuggestionData":{"type":"object","properties":{"adSetId":{"type":"integer","description":"The number of the ad set the suggestion is for."},"kind":{"$ref":"#/components/schemas/MetaAdsTargetKind","description":"What kind of targeting it is: interest, behavior or demographic."},"externalId":{"type":"string","description":"The Meta code of the targeting. Send it as externalId in targets of the ad set."},"graphField":{"anyOf":[{"$ref":"#/components/schemas/MetaAdsDemographicField"},{"type":"null"}],"description":"For demographic: the Meta group it belongs to, like life_events or income. null otherwise."},"name":{"type":"string","description":"The name of the targeting at Meta, in English."},"localizedName":{"type":["string","null"],"description":"The name in your language, or null."},"path":{"type":["string","null"],"description":"Where it sits in the Meta list, like \"Interests > Fitness\", or null."},"audienceSizeLower":{"type":["integer","null"],"description":"The lower end of how many people it reaches, or null."},"audienceSizeUpper":{"type":["integer","null"],"description":"The upper end of how many people it reaches, or null."},"reason":{"type":"string","description":"Why AI suggests it."}},"required":["adSetId","kind","externalId","graphField","name","localizedName","path","audienceSizeLower","audienceSizeUpper","reason"],"title":"MetaAdsTargetSuggestionData"},"MetaAdsTargetingMode":{"type":"string","enum":["include","exclude"],"title":"MetaAdsTargetingMode"},"MetaAdsTargetingOptionData":{"type":"object","properties":{"type":{"type":"string","description":"What the option is: interest, behavior, location or language. For a demographic it is the Meta group: life_events, industries, income, family_statuses, education_statuses, education_schools, education_majors, work_positions or work_employers. Send it as graphField of the target."},"externalId":{"type":"string","description":"The Meta code of the option. Send it in targets, locations or languages of an ad set."},"name":{"type":"string","description":"The name of the option, as Meta shows it."},"path":{"type":"array","items":{"type":"string"},"description":"Where the option sits in the Meta list, from the top, like Interests and Yoga."},"audienceSizeLower":{"type":["integer","null"],"description":"The lower end of how many people the option has, or null."},"audienceSizeUpper":{"type":["integer","null"],"description":"The upper end of how many people the option has, or null."},"locationKind":{"type":["string","null"],"description":"For a place: country, region, city or zip. null otherwise."},"countryCode":{"type":["string","null"],"description":"For a place: its country as two capital letters. null otherwise."}},"required":["type","externalId","name","path","audienceSizeLower","audienceSizeUpper","locationKind","countryCode"],"title":"MetaAdsTargetingOptionData"},"MetaAdsTargetingSearchType":{"type":"string","enum":["interest","behavior","demographic","location","language"],"title":"MetaAdsTargetingSearchType"},"MetaAdsTreeData":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/MetaAdsSettingsData","description":"Your Meta settings: monthly budget, currency and ad account."},"summary":{"$ref":"#/components/schemas/MetaAdsSummaryData","description":"How many campaigns, ad sets and ads you have."},"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/MetaAdsCampaignData"},"description":"Your campaigns, each with its ad sets and ads."}},"required":["settings","summary","campaigns"],"title":"MetaAdsTreeData"},"MunicipalityLevel":{"type":"string","enum":["obec","city_district"],"title":"MunicipalityLevel"},"NaceCodeData":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"],"title":"NaceCodeData"},"NoteOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"user":{"anyOf":[{"$ref":"#/components/schemas/UserSummaryData"},{"type":"null"}]},"noteableType":{"anyOf":[{"$ref":"#/components/schemas/NoteableType"},{"type":"null"}]},"noteableId":{"type":"integer"},"body":{"type":"string"},"leadOutreachTouchId":{"type":["integer","null"]},"outreachTouch":{"anyOf":[{"$ref":"#/components/schemas/NoteOutreachTouchData"},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"pinnedAt":{"type":["string","null"]}},"required":["id","tenantId","userId","user","noteableType","noteableId","body","leadOutreachTouchId","outreachTouch","createdAt","updatedAt","pinnedAt"],"title":"NoteOutputData"},"NoteOutreachTouchData":{"type":"object","properties":{"id":{"type":"integer"},"leadCadenceStepId":{"type":["integer","null"]},"stepPosition":{"type":["integer","null"]},"stepTitle":{"type":["string","null"]},"channel":{"$ref":"#/components/schemas/LeadOutreachChannel"}},"required":["id","leadCadenceStepId","stepPosition","stepTitle","channel"],"title":"NoteOutreachTouchData"},"NoteableType":{"type":"string","enum":["lead","deal","lead_contact"],"title":"NoteableType"},"ObjectionsData":{"type":"object","properties":{"objection":{"type":"string"},"response":{"type":"string"}},"required":["objection","response"],"title":"ObjectionsData"},"OptionAdData":{"type":"object","properties":{"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["id","label","description","badge","disabled","disabledReason"],"title":"OptionAdData"},"OptionArticleData":{"type":"object","properties":{"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["id","label","description","badge","disabled","disabledReason"],"title":"OptionArticleData"},"OptionBadgeData":{"type":"object","properties":{"label":{"type":"string"},"tone":{"$ref":"#/components/schemas/OptionBadgeTone"}},"required":["label","tone"],"title":"OptionBadgeData"},"OptionBadgeTone":{"type":"string","enum":["muted"],"title":"OptionBadgeTone"},"OptionCampaignData":{"type":"object","properties":{"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["id","label","description","badge","disabled","disabledReason"],"title":"OptionCampaignData"},"OptionContactData":{"type":"object","properties":{"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"position":{"type":["string","null"]},"leadId":{"type":["string","null"]},"leadName":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/ContactType"},"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["email","phone","position","leadId","leadName","type","id","label","description","badge","disabled","disabledReason"],"title":"OptionContactData"},"OptionDealData":{"type":"object","properties":{"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["id","label","description","badge","disabled","disabledReason"],"title":"OptionDealData"},"OptionDealProductData":{"type":"object","properties":{"sku":{"type":["string","null"]},"productDescription":{"type":["string","null"]},"unit":{"type":"string"},"unitPrice":{"type":"string"},"currency":{"type":"string"},"vatRate":{"type":"string"},"billingInterval":{"$ref":"#/components/schemas/DealBillingInterval"},"defaultQuantity":{"type":"string"},"defaultDiscountPercent":{"type":"string"},"isActive":{"type":"boolean"},"acceptsGift":{"type":"boolean"},"isCatalog":{"type":"boolean"},"catalogItemType":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionCatalogItemType"},{"type":"null"}]},"contractTemplates":{"type":"array","items":{"$ref":"#/components/schemas/DealProductContractTemplateOutputData"}},"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["sku","productDescription","unit","unitPrice","currency","vatRate","billingInterval","defaultQuantity","defaultDiscountPercent","isActive","acceptsGift","isCatalog","catalogItemType","contractTemplates","id","label","description","badge","disabled","disabledReason"],"title":"OptionDealProductData"},"OptionEmailData":{"type":"object","properties":{"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["id","label","description","badge","disabled","disabledReason"],"title":"OptionEmailData"},"OptionFileData":{"type":"object","properties":{"mimeType":{"type":"string"},"extension":{"type":"string"},"size":{"type":"integer"},"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["mimeType","extension","size","id","label","description","badge","disabled","disabledReason"],"title":"OptionFileData"},"OptionLeadData":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/LeadStage"},"primaryContactEmail":{"type":["string","null"]},"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["stage","primaryContactEmail","id","label","description","badge","disabled","disabledReason"],"title":"OptionLeadData"},"OptionSocialPostData":{"type":"object","properties":{"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["id","label","description","badge","disabled","disabledReason"],"title":"OptionSocialPostData"},"OptionTopicData":{"type":"object","properties":{"id":{"type":"integer"},"label":{"type":"string"},"description":{"type":["string","null"]},"badge":{"anyOf":[{"$ref":"#/components/schemas/OptionBadgeData"},{"type":"null"}]},"disabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]}},"required":["id","label","description","badge","disabled","disabledReason"],"title":"OptionTopicData"},"OtherMembershipOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"roleName":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["id","name","slug","roleName","logoUrl"],"title":"OtherMembershipOutputData"},"OverviewKpiData":{"type":"object","properties":{"value":{"type":["number","null"]},"previousValue":{"type":["number","null"]},"series":{"type":"array","items":{}},"previousSeries":{"type":"array","items":{}}},"required":["value","previousValue","series","previousSeries"],"title":"OverviewKpiData"},"OverviewMoneyKpiData":{"type":"object","properties":{"currency":{"type":"string"},"value":{"type":"string"},"previousValue":{"type":["string","null"]},"series":{},"previousSeries":{}},"required":["currency","value","previousValue","series","previousSeries"],"title":"OverviewMoneyKpiData"},"OverviewRangeData":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"title":"OverviewRangeData"},"PainsData":{"type":"object","properties":{"pain":{"type":"string"},"verbatimQuote":{"type":["string","null"]}},"required":["pain","verbatimQuote"],"title":"PainsData"},"PersonalEmailDraftData":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"channel":{"type":"string"},"name":{"type":["string","null"]},"contactId":{"type":["string","null"]},"contactName":{"type":["string","null"]},"contactEmail":{"type":["string","null"]},"emailConversationId":{"type":["string","null"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"includeOptOut":{"type":"boolean"},"scheduledAt":{"type":["string","null"]},"outreachAction":{"type":["string","null"]},"leadId":{"type":["string","null"]},"messageFrameworkId":{"type":["string","null"]},"tenantProductId":{"type":["string","null"]},"brandVoiceId":{"type":["string","null"]},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/PersonalEmailDraftStepData"}},"sources":{"type":"array","items":{"$ref":"#/components/schemas/DraftSourceData"}},"angleLabel":{"type":["string","null"]}},"required":["id","kind","channel","name","contactId","contactName","contactEmail","emailConversationId","subject","body","includeOptOut","scheduledAt","outreachAction","leadId","messageFrameworkId","tenantProductId","brandVoiceId","updatedAt","steps","sources","angleLabel"],"title":"PersonalEmailDraftData"},"PersonalEmailDraftStepData":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer"},"title":{"type":["string","null"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"delayValue":{"type":"integer"},"delayUnit":{"type":"string"},"sources":{"type":"array","items":{"$ref":"#/components/schemas/DraftSourceData"}},"messageFrameworkId":{"type":["string","null"]},"angleLabel":{"type":["string","null"]}},"required":["id","position","title","subject","body","delayValue","delayUnit","sources","messageFrameworkId","angleLabel"],"title":"PersonalEmailDraftStepData"},"PlatformAdsTargetingData":{"type":"object","properties":{"recommendedSignals":{"type":"array","items":{"type":"string"}},"excludedSignals":{"type":"array","items":{"type":"string"}},"searchThemes":{"type":"array","items":{"type":"string"}},"notes":{"type":"array","items":{"type":"string"}}},"required":["recommendedSignals","excludedSignals","searchThemes","notes"],"title":"PlatformAdsTargetingData"},"PreferredContactChannel":{"type":"string","enum":["email","phone","whatsapp"],"title":"PreferredContactChannel"},"PriceInputMode":{"type":"string","enum":["net","gross"],"title":"PriceInputMode"},"PricingTiersData":{"type":"object","properties":{"tier":{"type":"string"},"price":{"type":["string","null"]},"inclusions":{"type":"array","items":{"type":"string"}},"billing":{"type":["string","null"]}},"required":["tier","price","inclusions","billing"],"title":"PricingTiersData"},"PrivateOutreachAction":{"type":"string","enum":["initial_outreach","book_meeting","revive_conversation","followup_new_value","followup_proof","objection_response","breakup_email","meeting_recap","negotiation","upsell"],"title":"PrivateOutreachAction"},"PrivateOutreachSequenceData":{"type":"object","properties":{"id":{"type":"string"},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"contactEmail":{"type":["string","null"]},"leadId":{"type":["string","null"]},"emailConversationId":{"type":["string","null"]},"outreachAction":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"stopReason":{"type":["string","null"]},"includeOptOut":{"type":"boolean"},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"stoppedAt":{"type":["string","null"]},"currentPosition":{"type":"integer"},"stepCount":{"type":"integer"},"nextScheduledAt":{"type":["string","null"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/PrivateOutreachSequenceStepData"}}},"required":["id","contactId","contactName","contactEmail","leadId","emailConversationId","outreachAction","name","status","stopReason","includeOptOut","startedAt","completedAt","stoppedAt","currentPosition","stepCount","nextScheduledAt","steps"],"title":"PrivateOutreachSequenceData"},"PrivateOutreachSequenceStepData":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer"},"title":{"type":["string","null"]},"subject":{"type":"string"},"body":{"type":"string"},"delayValue":{"type":"integer"},"delayUnit":{"type":"string"},"status":{"type":"string"},"scheduledAt":{"type":["string","null"]},"sentAt":{"type":["string","null"]},"messageId":{"type":["string","null"]},"failureMessage":{"type":["string","null"]}},"required":["id","position","title","subject","body","delayValue","delayUnit","status","scheduledAt","sentAt","messageId","failureMessage"],"title":"PrivateOutreachSequenceStepData"},"ProofMetricsData":{"type":"object","properties":{"metric":{"type":"string"},"value":{"type":"string"}},"required":["metric","value"],"title":"ProofMetricsData"},"PublicTenantArticleAuthorData":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"type":{"$ref":"#/components/schemas/TenantArticleAuthorType"},"name":{"type":"string"},"jobTitle":{"type":["string","null"]},"bio":{"type":["string","null"]},"metaDescription":{"type":["string","null"]},"avatar":{"anyOf":[{"$ref":"#/components/schemas/UpdateFileData"},{"type":"null"}]},"websiteUrl":{"type":["string","null"]},"facebookUrl":{"type":["string","null"]},"instagramUrl":{"type":["string","null"]},"linkedinUrl":{"type":["string","null"]},"xUrl":{"type":["string","null"]},"youtubeUrl":{"type":["string","null"]},"tiktokUrl":{"type":["string","null"]},"githubUrl":{"type":["string","null"]},"email":{"type":["string","null"]},"sameAs":{"type":"array","items":{"type":"string"}},"knowsAbout":{"type":"array","items":{"type":"string"}},"articleCount":{"type":["integer","null"]},"isActive":{"type":"boolean"}},"required":["id","slug","type","name","jobTitle","bio","metaDescription","avatar","websiteUrl","facebookUrl","instagramUrl","linkedinUrl","xUrl","youtubeUrl","tiktokUrl","githubUrl","email","sameAs","knowsAbout","articleCount","isActive"],"title":"PublicTenantArticleAuthorData"},"PublicationStatus":{"type":"string","enum":["pending","processing","published","failed","cancelled","scheduled","in_progress","retrying","expired","skipped","paused"],"title":"PublicationStatus"},"ResearchCountrySource":{"type":"string","enum":["target_markets","registered_address","business_register","domain"],"title":"ResearchCountrySource"},"RobotsMaxImagePreview":{"type":"string","enum":["none","standard","large"],"title":"RobotsMaxImagePreview"},"SampleQuotesData":{"type":"object","properties":{"quote":{"type":"string"},"source":{"type":["string","null"]},"date":{"type":["string","null"]}},"required":["quote","source","date"],"title":"SampleQuotesData"},"ScheduledPersonalEmailData":{"type":"object","properties":{"id":{"type":"string"},"emailConversationId":{"type":["string","null"]},"leadCadenceStepId":{"type":["string","null"]},"contactId":{"type":"string"},"contactName":{"type":["string","null"]},"contactEmail":{"type":["string","null"]},"subject":{"type":"string"},"body":{"type":"string"},"includeOptOut":{"type":"boolean"},"scheduledAt":{"type":"string"},"status":{"type":"string"},"sentAt":{"type":["string","null"]},"failureMessage":{"type":["string","null"]},"isOwnedByViewer":{"type":"boolean"},"ownerName":{"type":["string","null"]}},"required":["id","emailConversationId","leadCadenceStepId","contactId","contactName","contactEmail","subject","body","includeOptOut","scheduledAt","status","sentAt","failureMessage","isOwnedByViewer","ownerName"],"title":"ScheduledPersonalEmailData"},"ScheduledPersonalEmailStatus":{"type":"string","enum":["scheduled","sending","sent","canceled","failed","awaiting_approval"],"title":"ScheduledPersonalEmailStatus"},"SchedulingAvailableEntitiesOutputData":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AvailableEntityData"}},"path":{"type":["string","null"]},"per_page":{"type":"integer"},"next_cursor":{"type":["string","null"]},"next_page_url":{"type":["string","null"]},"prev_cursor":{"type":["string","null"]},"prev_page_url":{"type":["string","null"]}},"required":["data","path","per_page","next_cursor","next_page_url","prev_cursor","prev_page_url"],"title":"SchedulingAvailableEntitiesOutputData"},"SchedulingPublicationData":{"type":"object","properties":{"id":{"type":"integer"},"entityId":{"type":"integer"},"entityType":{"type":"string"},"entityName":{"type":"string"},"status":{"$ref":"#/components/schemas/PublicationStatus","description":"Where the publication is now, like scheduled, published or failed."},"useOptimalPublishingTime":{"type":"boolean"},"scheduledAt":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"failedAt":{"type":["string","null"]},"failureReason":{"type":["string","null"]},"canResetForScheduling":{"type":"boolean"},"campaignName":{"type":["string","null"]}},"required":["id","entityId","entityType","entityName","status","useOptimalPublishingTime","scheduledAt","startedAt","completedAt","failedAt","failureReason","canResetForScheduling","campaignName"],"title":"SchedulingPublicationData"},"ScoringGradeThresholdsData":{"type":"object","properties":{"gradeA":{"type":"integer"},"gradeB":{"type":"integer"}},"required":["gradeA","gradeB"],"title":"ScoringGradeThresholdsData"},"ScoringHeatThresholdsData":{"type":"object","properties":{"hot":{"type":"integer"},"warm":{"type":"integer"}},"required":["hot","warm"],"title":"ScoringHeatThresholdsData"},"SeoAuditMarketStatus":{"type":"string","enum":["running","completed","failed"],"title":"SeoAuditMarketStatus"},"SeoAuditOverviewData":{"type":"object","properties":{"kpis":{"$ref":"#/components/schemas/SeoAuditOverviewKpisData","description":"The main numbers: markets, search words in the top 10, your share of visibility, the share of rivals and open findings."},"rivals":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditOverviewRivalData"},"description":"Websites that show in the same searches, with their share of visibility."},"quickFixes":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditOverviewQuickFixData"},"description":"The most important open findings, to fix first."},"ready":{"type":"boolean","description":"false while Fusio is still counting the numbers. Then the lists are empty; try again later."},"rolledUpAt":{"type":["string","null"],"description":"When Fusio last counted the numbers."},"range":{"$ref":"#/components/schemas/OverviewRangeData"},"previousRange":{"anyOf":[{"$ref":"#/components/schemas/OverviewRangeData"},{"type":"null"}],"description":"The range just before, when you sent compare=true. Otherwise null."},"dates":{"type":"array","items":{"type":"string"},"description":"Every day of the range. Day lists in the answer follow this order."}},"required":["kpis","rivals","quickFixes","ready","rolledUpAt","range","previousRange","dates"],"title":"SeoAuditOverviewData"},"SeoAuditOverviewKpisData":{"type":"object","properties":{"markets":{"$ref":"#/components/schemas/OverviewKpiData"},"topTenKeywords":{"$ref":"#/components/schemas/OverviewKpiData"},"visibilityShare":{"$ref":"#/components/schemas/OverviewKpiData"},"rivalVisibilityShare":{"$ref":"#/components/schemas/OverviewKpiData"},"findings":{"$ref":"#/components/schemas/OverviewKpiData"}},"required":["markets","topTenKeywords","visibilityShare","rivalVisibilityShare","findings"],"title":"SeoAuditOverviewKpisData"},"SeoAuditPaidStatus":{"type":"string","enum":["available","partial","empty","unavailable"],"title":"SeoAuditPaidStatus"},"SignalDefinitionData":{"type":"object","properties":{"key":{"type":"string","description":"The short name of the signal."},"label":{"type":"string","description":"The name people read."},"type":{"type":"string","description":"The kind of value: enum, number, bool or text."},"weight":{"type":"integer","description":"How much the signal counts."},"stage":{"type":"string","description":"When Fusio looks for it: discovery (when it finds the lead) or research (when it studies it more)."},"sourceOrAiInstruction":{"type":["string","null"],"description":"Where the value comes from, or what the AI should look for."}},"required":["key","label","type","weight","stage","sourceOrAiInstruction"],"title":"SignalDefinitionData"},"SignatureExtractData":{"type":"object","properties":{"name":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"company":{"type":["string","null"]},"position":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"registrationNumber":{"type":["string","null"]},"confidence":{},"extractedAt":{"type":"string"}},"required":["name","firstName","lastName","company","position","phone","website","registrationNumber","confidence","extractedAt"],"title":"SignatureExtractData"},"SocialAdAccountSummaryData":{"type":"object","properties":{"id":{"type":"integer"},"externalId":{"type":"string"},"name":{"type":"string"},"currency":{"type":["string","null"]},"billingStatus":{"type":"string"},"pageName":{"type":["string","null"]},"paymentMethodLabel":{"type":["string","null"]},"paymentStatus":{"type":["string","null"]},"pixelExternalId":{"type":["string","null"]},"accountStatus":{"type":["string","null"]},"lastSyncedAt":{"type":["string","null"]},"lastSyncError":{"type":["string","null"]}},"required":["id","externalId","name","currency","billingStatus","pageName","paymentMethodLabel","paymentStatus","pixelExternalId","accountStatus","lastSyncedAt","lastSyncError"],"title":"SocialAdAccountSummaryData"},"SocialAdLeadSegmentData":{"type":"object","properties":{"key":{"type":["string","null"]},"label":{"type":["string","null"]},"clicks":{"type":"integer"},"leads":{"type":"integer"},"deals":{"type":"integer"}},"required":["key","label","clicks","leads","deals"],"title":"SocialAdLeadSegmentData"},"SocialAdResultData":{"type":"object","properties":{"adId":{"type":["integer","null"]},"externalAdId":{"type":"string"},"name":{"type":"string"},"spend":{"type":"number"},"impressions":{"type":"integer"},"clicks":{"type":"integer"},"conversions":{"type":"number"},"currencyCode":{"type":["string","null"]}},"required":["adId","externalAdId","name","spend","impressions","clicks","conversions","currencyCode"],"title":"SocialAdResultData"},"SocialPostCommentData":{"type":"object","properties":{"id":{"type":"integer"},"socialPostId":{"type":"integer"},"parentCommentId":{"type":["integer","null"]},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"content":{"type":"string"},"commentOrder":{"type":"integer"},"kind":{"$ref":"#/components/schemas/SocialPostCommentKind"},"delayValue":{"type":["integer","null"]},"delayUnit":{"anyOf":[{"$ref":"#/components/schemas/SocialPostCommentDelayUnit"},{"type":"null"}]},"state":{"$ref":"#/components/schemas/SocialPostState"},"externalId":{"type":["string","null"]},"rejectReason":{"type":["string","null"]},"files":{"type":"array","items":{"$ref":"#/components/schemas/UpdateFileData"}},"scheduledAt":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]}},"title":"SocialPostCommentData"},"SocialPostCommentDelayUnit":{"type":"string","enum":["minutes","hours","days"],"title":"SocialPostCommentDelayUnit"},"SocialPostCommentKind":{"type":"string","enum":["thread_item","comment"],"title":"SocialPostCommentKind"},"SocialPostFormat":{"type":"string","enum":["video","carousel","image","text"],"title":"SocialPostFormat"},"SocialPostGridAccountData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"authenticationStatus":{"$ref":"#/components/schemas/TenantOAuthPlatformStatus"},"socialPlatform":{"anyOf":[{"$ref":"#/components/schemas/SocialPostGridPlatformData"},{"type":"null"}]}},"required":["id","name","email","authenticationStatus","socialPlatform"],"title":"SocialPostGridAccountData"},"SocialPostGridFileData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"url":{"type":"string"},"mimeType":{"type":"string"},"alt":{"type":["string","null"]}},"required":["id","name","url","mimeType","alt"],"title":"SocialPostGridFileData"},"SocialPostGridPlatformData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"],"title":"SocialPostGridPlatformData"},"SocialPostOverviewData":{"type":"object","properties":{"kpis":{"$ref":"#/components/schemas/SocialPostOverviewKpisData","description":"The main numbers: posts, impressions, reach, engagement, clicks, likes, comments, shares and saves."},"impressionsByPlatform":{"type":"object","additionalProperties":{"type":"integer"},"description":"How many impressions each network got. The key is the network."},"formats":{"type":"array","items":{"$ref":"#/components/schemas/SocialPostOverviewFormatData"},"description":"How each kind of post did, like text, picture or video."},"publishTimes":{"type":"array","items":{"$ref":"#/components/schemas/SocialPostOverviewPublishTimeData"},"description":"Reach and engagement by weekday and hour of publishing."},"topPosts":{"type":"array","items":{"$ref":"#/components/schemas/SocialPostOverviewTopPostData"},"description":"The posts that did best."},"ready":{"type":"boolean","description":"false while Fusio is still counting the numbers. Then the lists are empty; try again later."},"rolledUpAt":{"type":["string","null"],"description":"When Fusio last counted the numbers."},"range":{"$ref":"#/components/schemas/OverviewRangeData"},"previousRange":{"anyOf":[{"$ref":"#/components/schemas/OverviewRangeData"},{"type":"null"}],"description":"The range just before, when you sent compare=true. Otherwise null."},"dates":{"type":"array","items":{"type":"string"},"description":"Every day of the range. Day lists in the answer follow this order."}},"required":["kpis","impressionsByPlatform","formats","publishTimes","topPosts","ready","rolledUpAt","range","previousRange","dates"],"title":"SocialPostOverviewData"},"SocialPostOverviewFormatData":{"type":"object","properties":{"format":{"$ref":"#/components/schemas/SocialPostFormat"},"postCount":{"type":"integer"},"reach":{"type":"integer"},"engagement":{"type":"integer"}},"required":["format","postCount","reach","engagement"],"title":"SocialPostOverviewFormatData"},"SocialPostOverviewKpisData":{"type":"object","properties":{"posts":{"$ref":"#/components/schemas/OverviewKpiData"},"impressions":{"$ref":"#/components/schemas/OverviewKpiData"},"reach":{"$ref":"#/components/schemas/OverviewKpiData"},"engagement":{"$ref":"#/components/schemas/OverviewKpiData"},"clicks":{"$ref":"#/components/schemas/OverviewKpiData"},"likes":{"$ref":"#/components/schemas/OverviewKpiData"},"comments":{"$ref":"#/components/schemas/OverviewKpiData"},"shares":{"$ref":"#/components/schemas/OverviewKpiData"},"saves":{"$ref":"#/components/schemas/OverviewKpiData"}},"required":["posts","impressions","reach","engagement","clicks","likes","comments","shares","saves"],"title":"SocialPostOverviewKpisData"},"SocialPostOverviewPublishTimeData":{"type":"object","properties":{"weekday":{"type":"integer"},"hour":{"type":"integer"},"postCount":{"type":"integer"},"reach":{"type":"integer"},"engagement":{"type":"integer"}},"required":["weekday","hour","postCount","reach","engagement"],"title":"SocialPostOverviewPublishTimeData"},"SocialPostOverviewTopPostData":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string"},"reach":{"type":"integer"},"engagement":{"type":"integer"}},"required":["id","name","platform","reach","engagement"],"title":"SocialPostOverviewTopPostData"},"SocialPostSourceArticleOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"imageUrl":{"type":["string","null"]}},"required":["id","name","imageUrl"],"title":"SocialPostSourceArticleOutputData"},"SocialPostState":{"type":"string","enum":["drafted","approved","rejected","scheduled","published","failed"],"title":"SocialPostState"},"StandaloneCampaignEntityOutputData":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/StandaloneCampaignEntityType"},"id":{"type":"integer"},"name":{"type":"string"}},"required":["type","id","name"],"title":"StandaloneCampaignEntityOutputData"},"StandaloneCampaignEntityType":{"type":"string","enum":["article","social","email","ad"],"title":"StandaloneCampaignEntityType"},"StrategyIntegrationData":{"type":"object","properties":{"kind":{"type":"string"},"platforms":{"type":"array","items":{"type":"string"}},"leadTemperature":{"type":"array","items":{"type":"string"}},"formatHint":{"type":["string","null"]},"cadenceHint":{"type":["string","null"]},"enabled":{"type":"boolean"}},"required":["kind","platforms","leadTemperature","formatHint","cadenceHint","enabled"],"title":"StrategyIntegrationData"},"StrategyIntegrationKind":{"type":"string","enum":["article","social","email","ads","seo","website","landing_page","lead_form","tracking","crm_scoring"],"title":"StrategyIntegrationKind"},"StrategyResourcesData":{"type":"object","properties":{"time":{"type":"string"},"budget":{"type":"string"},"skills":{"type":"array","items":{"type":"string"}}},"required":["time","budget","skills"],"title":"StrategyResourcesData"},"StrategySourcesData":{"type":"object","properties":{"sourceType":{"type":"string"},"urls":{"type":"array","items":{"type":"string"}},"angles":{"type":"array","items":{"type":"string"}},"topicId":{"type":["integer","null"]},"includeKeywords":{"type":"array","items":{"type":"string"}},"excludeKeywords":{"type":"array","items":{"type":"string"}}},"required":["sourceType","urls","angles","topicId","includeKeywords","excludeKeywords"],"title":"StrategySourcesData"},"StrategyStepsData":{"type":"object","properties":{"step":{"type":"integer"},"description":{"type":"string"}},"required":["step","description"],"title":"StrategyStepsData"},"SubscriptionCatalogItemType":{"type":"string","enum":["module","package","add_on"],"title":"SubscriptionCatalogItemType"},"SubscriptionLimitData":{"type":"object","properties":{"metric":{"$ref":"#/components/schemas/SubscriptionMetric"},"amount":{"type":["integer","null"]}},"required":["metric","amount"],"title":"SubscriptionLimitData"},"SubscriptionMetric":{"type":"string","enum":["credits","emails","crm_records","company_lookups","members","social_platforms","ad_platforms"],"title":"SubscriptionMetric"},"SubscriptionPackageType":{"type":"string","enum":["free","modular","bundle"],"title":"SubscriptionPackageType"},"SubscriptionPriceCycle":{"type":"string","enum":["monthly","yearly","one_time"],"title":"SubscriptionPriceCycle"},"SuggestedAudienceData":{"type":"object","properties":{"segmentIds":{"type":"array","items":{"type":"integer"}},"tagIds":{"type":"array","items":{"type":"integer"}},"rationale":{"type":"string"}},"required":["segmentIds","tagIds","rationale"],"title":"SuggestedAudienceData"},"SuggestedEventData":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"firesWhen":{"type":"string"},"category":{"type":"string"},"rationale":{"type":"string"},"isSystem":{"type":"boolean"}},"required":["name","description","firesWhen","category","rationale","isSystem"],"title":"SuggestedEventData"},"SuggestedLeadFormData":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedLeadFormFieldData"}},"successMessage":{"type":"string"},"eventName":{"type":"string"},"eventDescription":{"type":"string"},"rationale":{"type":"string"},"successRedirectUrl":{"type":["string","null"]}},"required":["name","description","fields","successMessage","eventName","eventDescription","rationale","successRedirectUrl"],"title":"SuggestedLeadFormData"},"SuggestedLeadFormFieldData":{"type":"object","properties":{"label":{"type":"string"},"fieldType":{"type":"string"},"isRequired":{"type":"boolean"},"placeholder":{"type":["string","null"]},"options":{"type":["array","null"],"items":{"type":"string"}},"isLeadName":{"type":"boolean"}},"required":["label","fieldType","isRequired","placeholder","options","isLeadName"],"title":"SuggestedLeadFormFieldData"},"SuspendedTenantOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"logoUrl":{"type":["string","null"]},"completedAt":{"type":["string","null"]}},"required":["id","name","slug","logoUrl","completedAt"],"title":"SuspendedTenantOutputData"},"SwitchingDynamicsData":{"type":"object","properties":{"push":{"type":["string","null"]},"pull":{"type":["string","null"]},"habit":{"type":["string","null"]},"anxiety":{"type":["string","null"]}},"required":["push","pull","habit","anxiety"],"title":"SwitchingDynamicsData"},"SyncAcceptedOutputData":{"type":"object","properties":{"importId":{"type":"integer"},"status":{"$ref":"#/components/schemas/SyncRunStatus"},"total":{"type":"integer"},"links":{"$ref":"#/components/schemas/SyncRunLinksData"}},"required":["importId","status","total","links"],"title":"SyncAcceptedOutputData"},"SyncContactResultData":{"type":"object","properties":{"index":{"type":"integer"},"result":{"$ref":"#/components/schemas/SyncItemResult"},"id":{"type":["integer","null"]},"externalId":{"type":["string","null"]}},"required":["index","result","id","externalId"],"title":"SyncContactResultData"},"SyncItemResult":{"type":"string","enum":["created","updated","unchanged","skipped"],"title":"SyncItemResult"},"SyncItemResultOutputData":{"type":"object","properties":{"index":{"type":"integer","description":"The place of the item in the batch you sent, from 0."},"result":{"$ref":"#/components/schemas/SyncItemResult"},"id":{"type":["integer","null"]},"externalId":{"type":["string","null"]},"name":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"string"},"description":"The fields this item changed."},"contacts":{"type":"array","items":{"$ref":"#/components/schemas/SyncContactResultData"}},"warnings":{},"errors":{}},"required":["index","result","id","externalId","name","changes","contacts","warnings","errors"],"title":"SyncItemResultOutputData"},"SyncItemResultPageOutputData":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SyncItemResultOutputData"}},"nextCursor":{"type":["string","null"],"description":"Send it as cursor to get the next page. null on the last page."}},"required":["data","nextCursor"],"title":"SyncItemResultPageOutputData"},"SyncKind":{"type":"string","enum":["leads","deals"],"title":"SyncKind"},"SyncRunErrorData":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"title":"SyncRunErrorData"},"SyncRunLinksData":{"type":"object","properties":{"self":{"type":"string"},"results":{"type":"string"}},"required":["self","results"],"title":"SyncRunLinksData"},"SyncRunStatus":{"type":"string","enum":["queued","processing","completed","failed"],"title":"SyncRunStatus"},"SyncRunStatusOutputData":{"type":"object","properties":{"importId":{"type":"integer"},"object":{"$ref":"#/components/schemas/SyncKind"},"status":{"$ref":"#/components/schemas/SyncRunStatus"},"total":{"type":"integer"},"processed":{"type":"integer"},"progress":{"type":"integer","description":"How much is done, in percent from 0 to 100."},"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"},"skipped":{"type":"integer","description":"Items Fusio could not save. Their reasons are in the results."},"error":{"anyOf":[{"$ref":"#/components/schemas/SyncRunErrorData"},{"type":"null"}],"description":"Why the whole import failed. null while it runs or when it went well."},"createdAt":{"type":["string","null"]},"finishedAt":{"type":["string","null"]}},"required":["importId","object","status","total","processed","progress","created","updated","unchanged","skipped","error","createdAt","finishedAt"],"title":"SyncRunStatusOutputData"},"TagAssignmentSource":{"type":"string","enum":["manual","automated","import","api"],"title":"TagAssignmentSource"},"TargetCompaniesData":{"type":"object","properties":{"industries":{"type":"array","items":{"type":"string"}},"companySizes":{"type":"array","items":{"type":"string"}},"stages":{"type":"array","items":{"type":"string"}}},"required":["industries","companySizes","stages"],"title":"TargetCompaniesData"},"TargetMarketsData":{"type":"object","properties":{"isGlobal":{"type":"boolean"},"countryCodes":{"type":"array","items":{"type":"string"}}},"required":["isGlobal","countryCodes"],"title":"TargetMarketsData"},"TaskCadenceStepData":{"type":"object","properties":{"stepId":{"type":"integer"},"position":{"type":"integer"},"title":{"type":"string"},"channel":{"$ref":"#/components/schemas/LeadOutreachChannel"},"enrollmentId":{"type":"integer"}},"required":["stepId","position","title","channel","enrollmentId"],"title":"TaskCadenceStepData"},"TaskStatus":{"type":"string","enum":["pending","completed","overdue"],"title":"TaskStatus"},"TaskableType":{"type":"string","enum":["lead","deal"],"title":"TaskableType"},"TenantAnchorData":{"type":"object","properties":{"personaName":{"type":["string","null"]},"competitorName":{"type":["string","null"]},"strategyName":{"type":["string","null"]},"productField":{"type":["string","null"]}},"required":["personaName","competitorName","strategyName","productField"],"title":"TenantAnchorData"},"TenantArticleAuthorData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"type":{"$ref":"#/components/schemas/TenantArticleAuthorType"},"name":{"type":"string"},"slug":{"type":"string"},"avatarFileId":{"type":["integer","null"]},"avatar":{"anyOf":[{"$ref":"#/components/schemas/UpdateFileData"},{"type":"null"}]},"websiteUrl":{"type":["string","null"]},"facebookUrl":{"type":["string","null"]},"instagramUrl":{"type":["string","null"]},"linkedinUrl":{"type":["string","null"]},"xUrl":{"type":["string","null"]},"youtubeUrl":{"type":["string","null"]},"tiktokUrl":{"type":["string","null"]},"githubUrl":{"type":["string","null"]},"email":{"type":["string","null"]},"isEmailPublic":{"type":"boolean"},"sameAs":{"type":"array","items":{"type":"string"}},"knowsAbout":{"type":"array","items":{"type":"string"}},"isDefault":{"type":"boolean","description":"true for the author new articles get."},"isActive":{"type":"boolean"},"articleCount":{"type":"integer","description":"How many articles have this author."},"translations":{"type":"array","items":{"$ref":"#/components/schemas/TenantArticleAuthorTranslationData"},"description":"The texts about the author, one per language."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","type","name","slug","avatarFileId","avatar","websiteUrl","facebookUrl","instagramUrl","linkedinUrl","xUrl","youtubeUrl","tiktokUrl","githubUrl","email","isEmailPublic","sameAs","knowsAbout","isDefault","isActive","articleCount","translations","createdAt","updatedAt"],"title":"TenantArticleAuthorData"},"TenantArticleAuthorTranslationData":{"type":"object","properties":{"id":{"type":"integer"},"tenantArticleAuthorId":{"type":"integer"},"locale":{"type":"string"},"isPrimary":{"type":"boolean"},"jobTitle":{"type":["string","null"]},"bio":{"type":["string","null"]},"metaDescription":{"type":["string","null"]}},"required":["id","tenantArticleAuthorId","locale","isPrimary","jobTitle","bio","metaDescription"],"title":"TenantArticleAuthorTranslationData"},"TenantArticleAuthorType":{"type":"string","enum":["person","organization"],"title":"TenantArticleAuthorType"},"TenantBankAccountOutputData":{"type":"object","properties":{"id":{"type":"integer"},"label":{"type":"string"},"accountNumber":{"type":["string","null"]},"bankCode":{"type":["string","null"]},"iban":{"type":["string","null"]},"swift":{"type":["string","null"]},"currency":{"type":"string"},"isDefault":{"type":"boolean"},"isFromFakturoid":{"type":"boolean"},"paymentPairing":{"type":["boolean","null"]}},"required":["id","label","accountNumber","bankCode","iban","swift","currency","isDefault","isFromFakturoid","paymentPairing"],"title":"TenantBankAccountOutputData"},"TenantBrandVoicePhraseMode":{"type":"string","enum":["prefer","avoid"],"title":"TenantBrandVoicePhraseMode"},"TenantBrandVoiceReadingLevel":{"type":"string","enum":["simple","standard","advanced"],"title":"TenantBrandVoiceReadingLevel"},"TenantBrandVoiceTone":{"type":"string","enum":["professional","friendly","authoritative","casual","playful","inspirational","empathetic","technical","custom"],"title":"TenantBrandVoiceTone"},"TenantCompetitorData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"tenantProductId":{"type":["integer","null"]},"derivedFromAnalysisId":{"type":["integer","null"]},"createdBy":{"type":["integer","null"]},"name":{"type":"string"},"websiteUrl":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"competitorType":{"type":["string","null"]},"tagline":{"type":["string","null"]},"valueProposition":{"type":["string","null"]},"positioningAngle":{"type":["string","null"]},"targetAudienceSummary":{"type":["string","null"]},"freeTrialSummary":{"type":["string","null"]},"contentStrategySignals":{"type":["string","null"],"description":"What its content shows about its plans."},"theirAdvantageOverUs":{"type":["string","null"]},"ourAdvantageOverThem":{"type":["string","null"]},"opportunities":{"type":["string","null"]},"threats":{"type":["string","null"]},"hasFreeTrial":{"type":"boolean"},"estimatedDomainAuthority":{"type":["integer","null"],"description":"How strong its website is in search, from 0 to 100, when known."},"messagingThemes":{"type":"array","items":{"type":"string"}},"coreCapabilities":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CapabilitiesData"},"description":"What its product can do."},"notableDifferentiators":{"type":"array","items":{"type":"string"}},"integrations":{"anyOf":[{"$ref":"#/components/schemas/IntegrationsData"},{"type":"null"}]},"pricingTiers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PricingTiersData"},"description":"Its price plans."},"namedCustomers":{"type":"array","items":{"type":"string"}},"industriesServed":{"type":"array","items":{"$ref":"#/components/schemas/AresFilterOptionData"},"description":"The fields it sells to, each with its code and name."},"caseStudyThemes":{"type":"array","items":{"type":"string"}},"strengths":{"type":"array","items":{"type":"string"}},"weaknesses":{"type":"array","items":{"type":"string"}},"rawSources":{"type":"array","items":{"type":"string"},"description":"Web pages the information came from."},"analyzedAt":{"type":["string","null"],"description":"When AI last studied it."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","tenantProductId","derivedFromAnalysisId","createdBy","name","websiteUrl","logoUrl","competitorType","tagline","valueProposition","positioningAngle","targetAudienceSummary","freeTrialSummary","contentStrategySignals","theirAdvantageOverUs","ourAdvantageOverThem","opportunities","threats","hasFreeTrial","estimatedDomainAuthority","messagingThemes","coreCapabilities","notableDifferentiators","integrations","pricingTiers","namedCustomers","industriesServed","caseStudyThemes","strengths","weaknesses","rawSources","analyzedAt","createdAt","updatedAt"],"title":"TenantCompetitorData"},"TenantCompetitorType":{"type":"string","enum":["direct","secondary","indirect","aspirational"],"title":"TenantCompetitorType"},"TenantCustomerConfidenceLevel":{"type":"string","enum":["high","medium","low"],"title":"TenantCustomerConfidenceLevel"},"TenantCustomerData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"tenantProductId":{"type":["integer","null"]},"derivedFromAnalysisId":{"type":["integer","null"]},"createdBy":{"type":["integer","null"]},"name":{"type":"string"},"personaTitle":{"type":["string","null"]},"segmentSummary":{"type":["string","null"]},"titleRange":{"type":["string","null"]},"reportsTo":{"type":["string","null"]},"teamSizeManaged":{"type":["string","null"]},"primaryJobToBeDone":{"type":["string","null"]},"confidenceLevel":{"type":["string","null"]},"triggerEvents":{"type":"array","items":{"type":"string"}},"topPains":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PainsData"}},"desiredOutcomes":{"type":"array","items":{"type":"string"}},"successMetrics":{"type":"array","items":{"type":"string"}},"objections":{"type":"array","items":{"type":"string"}},"fears":{"type":"array","items":{"type":"string"}},"alternativesConsidered":{"type":"array","items":{"type":"string"}},"keyVocabulary":{"type":"array","items":{"type":"string"}},"functionalJobs":{"type":"array","items":{"type":"string"}},"emotionalJobs":{"type":"array","items":{"type":"string"}},"socialJobs":{"type":"array","items":{"type":"string"}},"channels":{"type":"array","items":{"type":"string"}},"contentConsumed":{"type":"array","items":{"type":"string"}},"trustedCommunities":{"type":"array","items":{"type":"string"}},"sampleQuotes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/SampleQuotesData"}},"adsTargetingProfile":{"anyOf":[{"$ref":"#/components/schemas/AdsTargetingProfileData"},{"type":"null"}],"description":"Who to show ads to, in general and per ad platform."},"naceCodes":{"type":"array","items":{"$ref":"#/components/schemas/AresFilterOptionData"}},"employeeBand":{"type":["string","null"]},"legalForms":{"type":"array","items":{"type":"string"}},"eshopPlatforms":{"type":"array","items":{"type":"string"}},"companyAgeBands":{"type":"array","items":{"type":"string"}},"municipality":{"anyOf":[{"$ref":"#/components/schemas/AresMunicipalityOptionData"},{"type":"null"}]},"targetingClassifiedAt":{"type":["string","null"]},"analyzedAt":{"type":["string","null"],"description":"When AI last filled the profile."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","tenantProductId","derivedFromAnalysisId","createdBy","name","personaTitle","segmentSummary","titleRange","reportsTo","teamSizeManaged","primaryJobToBeDone","confidenceLevel","triggerEvents","topPains","desiredOutcomes","successMetrics","objections","fears","alternativesConsidered","keyVocabulary","functionalJobs","emotionalJobs","socialJobs","channels","contentConsumed","trustedCommunities","sampleQuotes","adsTargetingProfile","naceCodes","employeeBand","legalForms","eshopPlatforms","companyAgeBands","municipality","targetingClassifiedAt","analyzedAt","createdAt","updatedAt"],"title":"TenantCustomerData"},"TenantEntitlementAlertCode":{"type":"string","enum":["renewal_unpaid","renewal_due_without_card","payment_pending","order_awaiting_payment","billing_details_missing"],"title":"TenantEntitlementAlertCode"},"TenantEntitlementAlertData":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/TenantEntitlementAlertCode"},"priority":{"type":"integer"},"chargeId":{"type":["integer","null"]},"orderId":{"type":["integer","null"]}},"required":["code","priority","chargeId","orderId"],"title":"TenantEntitlementAlertData"},"TenantEntitlementLane":{"type":"string","enum":["self","managed","private"],"title":"TenantEntitlementLane"},"TenantEntitlementLockedModuleData":{"type":"object","properties":{"key":{"type":"string"},"permissionNames":{"type":"array","items":{"type":"string"}}},"required":["key","permissionNames"],"title":"TenantEntitlementLockedModuleData"},"TenantEntitlementShopData":{"type":"object","properties":{"available":{"type":"boolean"},"newOrderOnly":{"type":"boolean"}},"required":["available","newOrderOnly"],"title":"TenantEntitlementShopData"},"TenantEntitlementStatus":{"type":"string","enum":["free","pending","active","lapsed","ended"],"title":"TenantEntitlementStatus"},"TenantEntitlementsData":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/TenantEntitlementStatus"},"lane":{"$ref":"#/components/schemas/TenantEntitlementLane"},"packageId":{"type":"integer"},"packageType":{"$ref":"#/components/schemas/SubscriptionPackageType"},"subscriptionId":{"type":["integer","null"]},"billingCycle":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionPriceCycle"},{"type":"null"}]},"periodStartsOn":{"type":["string","null"]},"periodEndsOn":{"type":["string","null"]},"usageResetsAt":{"type":["string","null"]},"moduleIds":{"type":"array","items":{"type":"integer"}},"moduleKeys":{"type":"array","items":{"type":"string"}},"readOnlyModuleIds":{"type":"array","items":{"type":"integer"}},"permissionNames":{"type":"array","items":{"type":"string"}},"limits":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionLimitData"}},"shop":{"$ref":"#/components/schemas/TenantEntitlementShopData"},"alerts":{"type":"array","items":{"$ref":"#/components/schemas/TenantEntitlementAlertData"}},"lockedModules":{"type":"array","items":{"$ref":"#/components/schemas/TenantEntitlementLockedModuleData"}}},"required":["status","lane","packageId","packageType","subscriptionId","billingCycle","periodStartsOn","periodEndsOn","usageResetsAt","moduleIds","moduleKeys","readOnlyModuleIds","permissionNames","limits","shop","alerts","lockedModules"],"title":"TenantEntitlementsData"},"TenantImageProfileOutputData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ImageGenerationType"},"style":{"$ref":"#/components/schemas/ImageGenerationStyle"},"styleCustomValue":{"type":["string","null"]},"instructions":{"type":["string","null"]},"styleAnalysis":{"type":["string","null"]},"styleAnalysisStatus":{"anyOf":[{"$ref":"#/components/schemas/ImageStyleAnalysisStatus"},{"type":"null"}],"description":"How the style description goes: pending, processing, completed or failed. null when there is none."},"styleAnalysisFailureReason":{"type":["string","null"],"description":"Why the style description failed."},"styleAnalyzedAt":{"type":["string","null"],"description":"When AI last described the style."},"styleAnalysisEditedAt":{"type":["string","null"],"description":"When a person last changed the style description."},"styleAnalysisRequestedAt":{"type":["string","null"]},"mascots":{"type":"array","items":{"$ref":"#/components/schemas/ImageProfileMascotOutputData"},"description":"The mascots AI draws with this preset."},"detectedAvatar":{"anyOf":[{"$ref":"#/components/schemas/DetectedAvatarData"},{"type":"null"}],"description":"A person or mascot AI saw in your samples, as a tip."},"detectedAvatarDismissedAt":{"type":["string","null"],"description":"When you hid that tip."},"isPrimary":{"type":"boolean","description":"true for the main preset."},"referenceImages":{"type":"array","items":{"$ref":"#/components/schemas/UpdateFileData"},"description":"Your sample pictures."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","name","type","style","styleCustomValue","instructions","styleAnalysis","styleAnalysisStatus","styleAnalysisFailureReason","styleAnalyzedAt","styleAnalysisEditedAt","styleAnalysisRequestedAt","mascots","detectedAvatar","detectedAvatarDismissedAt","isPrimary","referenceImages","createdAt","updatedAt"],"title":"TenantImageProfileOutputData"},"TenantIntelligenceFactsData":{"type":"object","properties":{"preferredAiLanguage":{"anyOf":[{"$ref":"#/components/schemas/TenantIntelligenceLanguageData"},{"type":"null"}]},"websiteLanguage":{"anyOf":[{"$ref":"#/components/schemas/TenantIntelligenceLanguageData"},{"type":"null"}]},"targetMarkets":{"anyOf":[{"$ref":"#/components/schemas/TargetMarketsData"},{"type":"null"}]},"verifiedDomain":{"type":["string","null"],"description":"Your verified domain, or null when you have none."},"imagePresets":{"type":["array","null"],"items":{"$ref":"#/components/schemas/TenantIntelligenceImagePresetData"}},"socialPlatforms":{"type":"array","items":{"$ref":"#/components/schemas/TenantIntelligencePlatformData"}},"adPlatforms":{"type":"array","items":{"$ref":"#/components/schemas/TenantIntelligencePlatformData"}}},"required":["preferredAiLanguage","websiteLanguage","targetMarkets","verifiedDomain","imagePresets","socialPlatforms","adPlatforms"],"title":"TenantIntelligenceFactsData"},"TenantIntelligenceImagePresetData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"isPrimary":{"type":"boolean"}},"required":["id","name","isPrimary"],"title":"TenantIntelligenceImagePresetData"},"TenantIntelligenceKeywordData":{"type":"object","properties":{"id":{"type":"integer"},"keyword":{"type":"string"},"markdown":{"type":"string"}},"required":["id","keyword","markdown"],"title":"TenantIntelligenceKeywordData"},"TenantIntelligenceLanguageData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"],"title":"TenantIntelligenceLanguageData"},"TenantIntelligenceListData":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TenantIntelligenceListItemData"}},"total":{"type":"integer","description":"How many records there are in all. The list may show fewer."}},"required":["items","total"],"title":"TenantIntelligenceListData"},"TenantIntelligenceListItemData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"summary":{"type":["string","null"]}},"required":["id","name","summary"],"title":"TenantIntelligenceListItemData"},"TenantIntelligencePlatformData":{"type":"object","properties":{"slug":{"type":"string"},"status":{"type":"string"}},"required":["slug","status"],"title":"TenantIntelligencePlatformData"},"TenantIntelligenceRecordData":{"type":"object","properties":{"id":{"type":"integer"},"markdown":{"type":"string","description":"The record written as Markdown text, ready to give to an AI."}},"required":["id","markdown"],"title":"TenantIntelligenceRecordData"},"TenantIntelligenceSeoData":{"type":"object","properties":{"auditId":{"type":"integer"},"marketAuditId":{"type":"integer"},"markdown":{"type":"string"},"keywordOpportunities":{"type":"array","items":{"$ref":"#/components/schemas/TenantIntelligenceKeywordData"},"description":"Search words where you could get more visitors."}},"required":["auditId","marketAuditId","markdown","keywordOpportunities"],"title":"TenantIntelligenceSeoData"},"TenantIntelligenceSummaryArea":{"type":"string","enum":["brand_voice","product","competitors","customers","strategies","seo","ads_performance","facts"],"title":"TenantIntelligenceSummaryArea"},"TenantIntelligenceSummaryData":{"type":"object","properties":{"brandVoice":{"anyOf":[{"$ref":"#/components/schemas/TenantIntelligenceRecordData"},{"type":"null"}],"description":"Your default brand voice as text, or null when it is not in the answer."},"product":{"anyOf":[{"$ref":"#/components/schemas/TenantIntelligenceRecordData"},{"type":"null"}],"description":"Your product as text, or null when it is not in the answer."},"competitors":{"anyOf":[{"$ref":"#/components/schemas/TenantIntelligenceListData"},{"type":"null"}],"description":"Your competitors, or null when they are not in the answer."},"customers":{"anyOf":[{"$ref":"#/components/schemas/TenantIntelligenceListData"},{"type":"null"}],"description":"Your customer profiles, or null when they are not in the answer."},"strategies":{"anyOf":[{"$ref":"#/components/schemas/TenantIntelligenceListData"},{"type":"null"}],"description":"Your strategies, or null when they are not in the answer."},"seo":{"anyOf":[{"$ref":"#/components/schemas/TenantIntelligenceSeoData"},{"type":"null"}],"description":"What your newest SEO audit found, or null."},"adsPerformance":{"anyOf":[{"$ref":"#/components/schemas/AdsPerformanceSnapshotData"},{"type":"null"}],"description":"How your ads did lately, or null."},"facts":{"anyOf":[{"$ref":"#/components/schemas/TenantIntelligenceFactsData"},{"type":"null"}],"description":"Short facts: languages, target markets, your verified domain, image presets and connected platforms."},"unavailable":{"type":"array","items":{"$ref":"#/components/schemas/TenantIntelligenceUnavailableData"},"description":"The parts that are not in the answer, each with a reason."}},"required":["brandVoice","product","competitors","customers","strategies","seo","adsPerformance","facts","unavailable"],"title":"TenantIntelligenceSummaryData"},"TenantIntelligenceUnavailableData":{"type":"object","properties":{"area":{"$ref":"#/components/schemas/TenantIntelligenceSummaryArea","description":"The part that is missing."},"reason":{"$ref":"#/components/schemas/TenantIntelligenceUnavailableReason","description":"Why it is missing: not_requested (you did not ask for it), missing_scope (the key lacks the permission), module_disabled (your plan does not have it), forbidden (your role may not see it) or empty (there is nothing yet)."}},"required":["area","reason"],"title":"TenantIntelligenceUnavailableData"},"TenantIntelligenceUnavailableReason":{"type":"string","enum":["not_requested","missing_scope","module_disabled","forbidden","empty"],"title":"TenantIntelligenceUnavailableReason"},"TenantKeywordOpportunityData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"derivedFromAnalysisId":{"type":["integer","null"]},"createdBy":{"type":["integer","null"]},"keyword":{"type":"string"},"searchVolume":{"type":"integer"},"isVolumeUnknown":{"type":"boolean"},"cpcLow":{"type":"number"},"cpcHigh":{"type":"number"},"currencyCode":{"type":"string"},"competitionIndex":{"type":"integer"},"intent":{"type":["string","null"]},"difficultyEstimate":{"type":"number"},"priorityScore":{"type":"number"},"priorityRank":{"type":"integer"},"priceBand":{"type":["string","null"]},"source":{"type":["string","null"]},"cluster":{"type":["string","null"]},"isGap":{"type":"boolean"},"isRecommended":{"type":"boolean"},"rationale":{"type":["string","null"]},"analyzedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"isCpcUnknown":{"type":"boolean"},"isCompetitionUnknown":{"type":"boolean"}},"required":["id","tenantId","derivedFromAnalysisId","createdBy","keyword","searchVolume","isVolumeUnknown","cpcLow","cpcHigh","currencyCode","competitionIndex","intent","difficultyEstimate","priorityScore","priorityRank","priceBand","source","cluster","isGap","isRecommended","rationale","analyzedAt","createdAt","updatedAt","isCpcUnknown","isCompetitionUnknown"],"title":"TenantKeywordOpportunityData"},"TenantLeadScoringProfileOutputData":{"type":"object","properties":{"signalDefinitions":{"type":"array","items":{"$ref":"#/components/schemas/SignalDefinitionData"},"description":"The signals Fusio looks for when it scores a lead."},"idealLead":{"type":["string","null"],"description":"Your ideal lead in words."},"disqualifiers":{"type":["string","null"],"description":"What makes a lead a bad fit."}},"required":["signalDefinitions","idealLead","disqualifiers"],"title":"TenantLeadScoringProfileOutputData"},"TenantMascotFriendOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"friendMascotId":{"type":["integer","null"]},"file":{"anyOf":[{"$ref":"#/components/schemas/UpdateFileData"},{"type":"null"}]}},"required":["id","name","description","friendMascotId","file"],"title":"TenantMascotFriendOutputData"},"TenantMascotOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","description":"The name of the mascot."},"description":{"type":["string","null"],"description":"What the mascot looks like."},"personality":{"type":["string","null"],"description":"How the mascot behaves."},"file":{"anyOf":[{"$ref":"#/components/schemas/UpdateFileData"},{"type":"null"}],"description":"The picture of the mascot."},"profiles":{"type":"array","items":{"$ref":"#/components/schemas/TenantMascotProfileOutputData"},"description":"The image style presets that use the mascot."},"places":{"type":"array","items":{"$ref":"#/components/schemas/TenantMascotPlaceOutputData"},"description":"Places where the mascot appears."},"friends":{"type":"array","items":{"$ref":"#/components/schemas/TenantMascotFriendOutputData"},"description":"Friends of the mascot. friendMascotId is set when the friend is another of your mascots."},"createdAt":{"type":["string","null"]}},"required":["id","name","description","personality","file","profiles","places","friends","createdAt"],"title":"TenantMascotOutputData"},"TenantMascotPlaceOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]}},"required":["id","name","description"],"title":"TenantMascotPlaceOutputData"},"TenantMascotProfileOutputData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"required":["id","name"],"title":"TenantMascotProfileOutputData"},"TenantOAuthPlatformStatus":{"type":"string","enum":["active","expired","refreshable","reconnect_required"],"title":"TenantOAuthPlatformStatus"},"TenantProductData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"leadId":{"type":["integer","null"],"description":"The lead this product profile is for, when it describes a lead and not your company. Here it is null."},"derivedFromAnalysisId":{"type":["integer","null"]},"createdBy":{"type":["integer","null"]},"name":{"type":"string"},"oneLiner":{"type":["string","null"]},"description":{"type":["string","null"]},"productType":{"type":["string","null"]},"customerType":{"type":"string"},"businessModel":{"type":["string","null"]},"pricingSummary":{"type":["string","null"]},"pricingRationale":{"type":["string","null"]},"primaryUseCase":{"type":["string","null"]},"coreProblem":{"type":["string","null"]},"costOfInaction":{"type":["string","null"]},"emotionalTension":{"type":["string","null"]},"howWeSolveDifferently":{"type":["string","null"]},"whyBetter":{"type":["string","null"]},"antiPersona":{"type":["string","null"]},"businessGoal":{"type":["string","null"]},"conversionAction":{"type":["string","null"]},"logoIconUrl":{"type":["string","null"]},"logoFullUrl":{"type":["string","null"]},"brandColors":{"$ref":"#/components/schemas/BrandColorsData"},"brandKeywords":{"type":"array","items":{"type":"string"}},"targetCompanies":{"anyOf":[{"$ref":"#/components/schemas/TargetCompaniesData"},{"type":"null"}]},"targetIndustries":{"type":"array","items":{"$ref":"#/components/schemas/NaceCodeData"},"description":"Field codes of the companies you sell to, with their names."},"targetDecisionMakers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DecisionMakersData"}},"targetMarkets":{"anyOf":[{"$ref":"#/components/schemas/TargetMarketsData"},{"type":"null"}]},"jobsToBeDone":{"type":["array","null"],"items":{"$ref":"#/components/schemas/JobsToBeDoneData"}},"useCaseScenarios":{"type":"array","items":{"type":"string"}},"alternativesFallingShort":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AlternativesData"}},"keyDifferentiators":{"type":"array","items":{"type":"string"}},"objections":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ObjectionsData"}},"switchingDynamics":{"anyOf":[{"$ref":"#/components/schemas/SwitchingDynamicsData"},{"type":"null"}]},"customerLanguageProblem":{"type":"array","items":{"type":"string"}},"customerLanguageSolution":{"type":"array","items":{"type":"string"}},"wordsToUse":{"type":"array","items":{"type":"string"}},"wordsToAvoid":{"type":"array","items":{"type":"string"}},"glossary":{"type":["array","null"],"items":{"$ref":"#/components/schemas/GlossaryData"}},"proofMetrics":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ProofMetricsData"}},"notableCustomers":{"type":"array","items":{"type":"string"}},"testimonials":{"type":["array","null"],"items":{"$ref":"#/components/schemas/TestimonialsData"}},"valueThemes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ValueThemesData"}},"naceCodes":{"type":"array","items":{"$ref":"#/components/schemas/NaceCodeData"},"description":"Your field codes with their names."},"naceCodeSource":{"type":["string","null"],"description":"Who picked the field codes: ai or manual (you)."},"googleAdsCategories":{"type":"array","items":{"$ref":"#/components/schemas/GoogleAdsCategoryData"},"description":"Google Ads categories that fit your product."},"analyzedAt":{"type":["string","null"],"description":"When the website analysis last filled the product."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","leadId","derivedFromAnalysisId","createdBy","name","oneLiner","description","productType","customerType","businessModel","pricingSummary","pricingRationale","primaryUseCase","coreProblem","costOfInaction","emotionalTension","howWeSolveDifferently","whyBetter","antiPersona","businessGoal","conversionAction","logoIconUrl","logoFullUrl","brandColors","brandKeywords","targetCompanies","targetIndustries","targetDecisionMakers","targetMarkets","jobsToBeDone","useCaseScenarios","alternativesFallingShort","keyDifferentiators","objections","switchingDynamics","customerLanguageProblem","customerLanguageSolution","wordsToUse","wordsToAvoid","glossary","proofMetrics","notableCustomers","testimonials","valueThemes","naceCodes","naceCodeSource","googleAdsCategories","analyzedAt","createdAt","updatedAt"],"title":"TenantProductData"},"TenantProductType":{"type":"string","enum":["saas","marketplace","ecommerce","service","physical_product","mobile_app","agency","other"],"title":"TenantProductType"},"TenantSeoAuditAdCreativeData":{"type":"object","properties":{"creativeId":{"type":"string"},"format":{"type":["string","null"]},"url":{"type":["string","null"]},"previewImageUrl":{"type":["string","null"]},"previewImageWidth":{"type":["integer","null"]},"previewImageHeight":{"type":["integer","null"]},"previewUrl":{"type":["string","null"]},"firstShown":{"type":["string","null"]},"lastShown":{"type":["string","null"]}},"required":["creativeId","format","url","previewImageUrl","previewImageWidth","previewImageHeight","previewUrl","firstShown","lastShown"],"title":"TenantSeoAuditAdCreativeData"},"TenantSeoAuditAdvertiserData":{"type":"object","properties":{"advertiserId":{"type":"string"},"name":{"type":["string","null"]},"isVerified":{"type":["boolean","null"]},"approxAdsCount":{"type":["integer","null"]},"creatives":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditAdCreativeData"}}},"required":["advertiserId","name","isVerified","approxAdsCount","creatives"],"title":"TenantSeoAuditAdvertiserData"},"TenantSeoAuditCompetitorData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"websiteUrl":{"type":["string","null"]},"competitorType":{"type":["string","null"]},"positioningAngle":{"type":["string","null"]},"summary":{"type":["string","null"]},"theirAdvantage":{"type":["string","null"]},"ourAdvantage":{"type":["string","null"]},"strengths":{"type":"array","items":{"type":"string"}},"weaknesses":{"type":"array","items":{"type":"string"}},"estimatedDomainAuthority":{"type":["integer","null"]},"seoMove":{"type":["string","null"]},"keywordOpportunityIds":{"type":"array","items":{"type":"integer"}}},"required":["id","name","websiteUrl","competitorType","positioningAngle","summary","theirAdvantage","ourAdvantage","strengths","weaknesses","estimatedDomainAuthority","seoMove","keywordOpportunityIds"],"title":"TenantSeoAuditCompetitorData"},"TenantSeoAuditData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"tenantProductId":{"type":["integer","null"]},"tenantProductName":{"type":["string","null"],"description":"The name of the product the audit is about."},"derivedFromAnalysisId":{"type":["integer","null"]},"websiteUrl":{"type":["string","null"]},"createdBy":{"type":["integer","null"]},"overallHealth":{"type":["string","null"],"description":"How healthy your SEO is, in a word."},"summary":{"type":["string","null"],"description":"What the audit found, in a few sentences."},"findings":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditFindingData"},"description":"Problems the audit found, each with a fix."},"currentKeywordCoverage":{"type":"array","items":{"type":"string"}},"intentCoverage":{"type":["object","null"],"additionalProperties":{"type":"integer"}},"rawSources":{"type":"array","items":{"type":"string"}},"analyzedAt":{"type":["string","null"],"description":"When the audit was done."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"searchResearch":{"anyOf":[{"$ref":"#/components/schemas/TenantSeoSearchResearchData"},{"type":"null"}]},"recommendations":{"anyOf":[{"$ref":"#/components/schemas/TenantSeoAuditRecommendationsData"},{"type":"null"}],"description":"What to do: search words to aim for and avoid, keyword sets for Google Ads and moves against competitors."},"visibility":{"anyOf":[{"$ref":"#/components/schemas/TenantSeoAuditVisibilityData"},{"type":"null"}],"description":"How visible you and your competitors are in Google."},"competitorPattern":{"type":["string","null"]},"markets":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditMarketData"},"description":"The countries and languages the audit checks."},"researchCountryCode":{"type":["string","null"],"description":"The country the audit researched first."},"researchCountrySource":{"anyOf":[{"$ref":"#/components/schemas/ResearchCountrySource"},{"type":"null"}],"description":"Where that country came from: target_markets, registered_address, business_register or domain."}},"required":["id","tenantId","tenantProductId","tenantProductName","derivedFromAnalysisId","websiteUrl","createdBy","overallHealth","summary","findings","currentKeywordCoverage","intentCoverage","rawSources","analyzedAt","createdAt","updatedAt","searchResearch","recommendations","visibility","competitorPattern","markets","researchCountryCode","researchCountrySource"],"title":"TenantSeoAuditData"},"TenantSeoAuditDetailData":{"type":"object","properties":{"audit":{"$ref":"#/components/schemas/TenantSeoAuditData","description":"The audit."},"keywordOpportunities":{"type":"array","items":{"$ref":"#/components/schemas/TenantKeywordOpportunityData"},"description":"Search words where you could get more visitors, best first."},"competitors":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditCompetitorData"},"description":"Your competitors as seen in search."},"googleAdsSearchCampaign":{"anyOf":[{"$ref":"#/components/schemas/TenantSeoAuditGoogleAdsSearchCampaignData"},{"type":"null"}],"description":"The Google Ads campaign made from this audit, or null."},"markets":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditMarketData"},"description":"The countries and languages the audit checks."}},"required":["audit","keywordOpportunities","competitors","googleAdsSearchCampaign","markets"],"title":"TenantSeoAuditDetailData"},"TenantSeoAuditFindingData":{"type":"object","properties":{"area":{"type":"string"},"issue":{"type":"string"},"impact":{"type":"string"},"evidence":{"type":["string","null"]},"fix":{"type":["string","null"]},"priority":{"type":["integer","null"],"description":"The number of the finding. The lower, the more important. Use it in seo-audits.findings.update."},"citations":{"type":"array","items":{}},"pageUrl":{"type":["string","null"]},"proposedUrls":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"type":"string"}},"beforeAfter":{"type":"array","items":{}},"horizon":{"type":["string","null"]},"clusters":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"string"}},"articles":{"type":"array","items":{}},"locationNote":{"type":["string","null"]},"googleAdsSearchNote":{"type":["string","null"]},"resolvedAt":{"type":["string","null"],"description":"When you marked it as fixed. null while it is open."}},"required":["area","issue","impact","evidence","fix","priority","citations","pageUrl","proposedUrls","steps","beforeAfter","horizon","clusters","keywords","articles","locationNote","googleAdsSearchNote","resolvedAt"],"title":"TenantSeoAuditFindingData"},"TenantSeoAuditGoogleAdsSearchCampaignData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"title":"TenantSeoAuditGoogleAdsSearchCampaignData"},"TenantSeoAuditKeywordGapData":{"type":"object","properties":{"keyword":{"type":"string"},"searchVolume":{"type":["integer","null"]},"cpcUsd":{"type":["number","null"]},"domains":{"type":"array","items":{"type":"string"}}},"required":["keyword","searchVolume","cpcUsd","domains"],"title":"TenantSeoAuditKeywordGapData"},"TenantSeoAuditMarketData":{"type":"object","properties":{"id":{"type":"integer"},"seoAuditId":{"type":["integer","null"]},"countryCode":{"type":["string","null"],"description":"The country as two letters, or null when the market has no country yet."},"countryName":{"type":["string","null"]},"languageId":{"type":"integer"},"languageSlug":{"type":"string","description":"The language as a short code, like cs."},"languageName":{"type":"string"},"isPrimary":{"type":"boolean","description":"true for the market whose numbers you see first."},"isBase":{"type":"boolean","description":"true for the first market, made with the audit itself."},"status":{"$ref":"#/components/schemas/SeoAuditMarketStatus","description":"running (AI checks the market), completed or failed."},"failureReason":{"type":["string","null"],"description":"Why the check failed."},"summary":{"anyOf":[{"$ref":"#/components/schemas/TenantSeoAuditMarketSummaryData"},{"type":"null"}],"description":"Short numbers of the market: searches, click prices, difficulty and how many of your pages are in the top 10."}},"required":["id","seoAuditId","countryCode","countryName","languageId","languageSlug","languageName","isPrimary","isBase","status","failureReason","summary"],"title":"TenantSeoAuditMarketData"},"TenantSeoAuditMarketSummaryData":{"type":"object","properties":{"searchVolume":{"type":["integer","null"]},"cpcLow":{"type":["number","null"]},"cpcHigh":{"type":["number","null"]},"currencyCode":{"type":["string","null"]},"difficulty":{"type":["integer","null"]},"top10Count":{"type":["integer","null"]}},"required":["searchVolume","cpcLow","cpcHigh","currencyCode","difficulty","top10Count"],"title":"TenantSeoAuditMarketSummaryData"},"TenantSeoAuditOverviewQuickFixData":{"type":"object","properties":{"seoAuditId":{"type":"integer"},"priority":{"type":"integer"},"issue":{"type":"string"},"impact":{"type":"string"},"pageUrl":{"type":["string","null"]}},"required":["seoAuditId","priority","issue","impact","pageUrl"],"title":"TenantSeoAuditOverviewQuickFixData"},"TenantSeoAuditOverviewRivalData":{"type":"object","properties":{"domain":{"type":["string","null"]},"isOwn":{"type":"boolean"},"visibilityShare":{"type":"number"}},"required":["domain","isOwn","visibilityShare"],"title":"TenantSeoAuditOverviewRivalData"},"TenantSeoAuditPaidDomainData":{"type":"object","properties":{"competitorId":{"type":["integer","null"]},"domain":{"type":"string"},"runsAds":{"type":["boolean","null"]},"summaryStatus":{"$ref":"#/components/schemas/SeoAuditPaidStatus"},"keywordsStatus":{"$ref":"#/components/schemas/SeoAuditPaidStatus"},"adsStatus":{"$ref":"#/components/schemas/SeoAuditPaidStatus"},"paidKeywordCount":{"type":["integer","null"]},"estimatedTraffic":{"type":["number","null"]},"estimatedTrafficCostUsd":{"type":["number","null"]},"keywords":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditPaidKeywordData"}},"advertisers":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditAdvertiserData"}}},"required":["competitorId","domain","runsAds","summaryStatus","keywordsStatus","adsStatus","paidKeywordCount","estimatedTraffic","estimatedTrafficCostUsd","keywords","advertisers"],"title":"TenantSeoAuditPaidDomainData"},"TenantSeoAuditPaidKeywordData":{"type":"object","properties":{"keyword":{"type":"string"},"position":{"type":"integer"},"url":{"type":["string","null"]},"searchVolume":{"type":["integer","null"]},"cpcUsd":{"type":["number","null"]}},"required":["keyword","position","url","searchVolume","cpcUsd"],"title":"TenantSeoAuditPaidKeywordData"},"TenantSeoAuditPaidVisibilityData":{"type":"object","properties":{"own":{"anyOf":[{"$ref":"#/components/schemas/TenantSeoAuditPaidDomainData"},{"type":"null"}]},"competitors":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditPaidDomainData"}},"keywordGapStatus":{"$ref":"#/components/schemas/SeoAuditPaidStatus"},"keywordGap":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoAuditKeywordGapData"}}},"required":["own","competitors","keywordGapStatus","keywordGap"],"title":"TenantSeoAuditPaidVisibilityData"},"TenantSeoAuditRecommendationsData":{"type":"object","properties":{"targets":{"type":"array","items":{}},"avoid":{"type":"array","items":{}},"googleAdsSearchKeywordSets":{"type":"array","items":{}},"accountNegativeKeywords":{"type":"array","items":{"type":"string"}},"competitorMoves":{"type":"array","items":{}}},"required":["targets","avoid","googleAdsSearchKeywordSets","accountNegativeKeywords","competitorMoves"],"title":"TenantSeoAuditRecommendationsData"},"TenantSeoAuditVisibilityData":{"type":"object","properties":{"own":{},"competitors":{"type":"array","items":{}},"rankedKeywords":{"type":"array","items":{}},"keywordMetrics":{"type":"array","items":{}},"serps":{"type":"array","items":{}},"peopleAlsoAsk":{"type":"array","items":{}},"relatedSearches":{"type":"array","items":{"type":"string"}},"onPage":{"type":"array","items":{}},"serpRivals":{"type":"array","items":{}},"paid":{"anyOf":[{"$ref":"#/components/schemas/TenantSeoAuditPaidVisibilityData"},{"type":"null"}]}},"required":["own","competitors","rankedKeywords","keywordMetrics","serps","peopleAlsoAsk","relatedSearches","onPage","serpRivals","paid"],"title":"TenantSeoAuditVisibilityData"},"TenantSeoSearchCitationData":{"type":"object","properties":{"url":{"type":["string","null"]},"label":{"type":"string"},"quote":{"type":["string","null"]},"dataPath":{"type":["string","null"]},"sourceId":{"type":"string"},"observedAt":{"type":["string","null"]},"sourceType":{"type":"string"},"sourceRecordJson":{"type":["string","null"]}},"required":["url","label","quote","dataPath","sourceId","observedAt","sourceType","sourceRecordJson"],"title":"TenantSeoSearchCitationData"},"TenantSeoSearchCoverageData":{"type":"object","properties":{"device":{"type":["string","null"]},"status":{"type":"string"},"provider":{"type":"string"},"pageCount":{"type":"integer"},"serpCount":{"type":"integer"},"observedAt":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"limitations":{"type":"array","items":{"type":"string"}},"onPageCount":{"type":"integer"},"keywordCount":{"type":"integer"},"languageCode":{"type":["string","null"]},"locationCode":{"type":["integer","null"]},"rankingCount":{"type":"integer"},"chargedCostUsd":{"type":["number","null"]},"availableSerpCount":{"type":"integer"},"omittedKeywordCount":{"type":"integer"},"availableOnPageCount":{"type":"integer"},"unavailableSerpCount":{"type":"integer"},"requestedKeywordCount":{"type":"integer"},"unavailableOnPageCount":{"type":"integer"}},"required":["device","status","provider","pageCount","serpCount","observedAt","countryCode","limitations","onPageCount","keywordCount","languageCode","locationCode","rankingCount","chargedCostUsd","availableSerpCount","omittedKeywordCount","availableOnPageCount","unavailableSerpCount","requestedKeywordCount","unavailableOnPageCount"],"title":"TenantSeoSearchCoverageData"},"TenantSeoSearchMetricsData":{"type":"object","properties":{"cpcUsd":{"type":["number","null"]},"searchVolume":{"type":["integer","null"]},"keywordUpdatedAt":{"type":["string","null"]},"organicDifficulty":{"type":["integer","null"]}},"required":["cpcUsd","searchVolume","keywordUpdatedAt","organicDifficulty"],"title":"TenantSeoSearchMetricsData"},"TenantSeoSearchObservationData":{"type":"object","properties":{"url":{"type":["string","null"]},"kind":{"type":"string"},"rank":{"type":["integer","null"]},"query":{"type":"string"},"stale":{"type":["boolean","null"]},"observedAt":{"type":["string","null"]}},"required":["url","kind","rank","query","stale","observedAt"],"title":"TenantSeoSearchObservationData"},"TenantSeoSearchOpportunityData":{"type":"object","properties":{"action":{"type":"string"},"intent":{"type":"string"},"cluster":{"type":"string"},"keyword":{"type":"string"},"metrics":{"anyOf":[{"$ref":"#/components/schemas/TenantSeoSearchMetricsData"},{"type":"null"}]},"citations":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoSearchCitationData"}},"rationale":{"type":"string"},"relevance":{"type":"number"},"observations":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoSearchObservationData"}},"priorityRank":{"type":"integer"},"targetPageUrl":{"type":["string","null"]}},"required":["action","intent","cluster","keyword","metrics","citations","rationale","relevance","observations","priorityRank","targetPageUrl"],"title":"TenantSeoSearchOpportunityData"},"TenantSeoSearchResearchData":{"type":"object","properties":{"opportunities":{"type":"array","items":{"$ref":"#/components/schemas/TenantSeoSearchOpportunityData"}},"coverage":{"$ref":"#/components/schemas/TenantSeoSearchCoverageData"}},"required":["opportunities","coverage"],"title":"TenantSeoSearchResearchData"},"TenantStrategy.SuggestedCtaData":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"}},"required":["label","description"],"title":"TenantStrategy.SuggestedCtaData"},"TenantStrategyBudgetLevel":{"type":"string","enum":["free","low","medium","high"],"title":"TenantStrategyBudgetLevel"},"TenantStrategyCategory":{"type":"string","enum":["content","social","email","paid_ads","web_seo","conversion","growth"],"title":"TenantStrategyCategory"},"TenantStrategyData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"tenantProductId":{"type":["integer","null"]},"derivedFromAnalysisId":{"type":["integer","null"]},"createdBy":{"type":["integer","null"]},"name":{"type":"string"},"ideaSummary":{"type":"string"},"category":{"type":"string"},"whyItFits":{"type":"string"},"expectedOutcome":{"type":"string"},"stage":{"type":"string"},"budgetLevel":{"type":"string"},"timeline":{"type":"string"},"status":{"type":"string"},"priorityScore":{"type":"integer"},"sourceIdeaNumber":{"type":["integer","null"]},"sourceIdeaSlug":{"type":["string","null"]},"targetedPersonaIds":{"type":"array","items":{"type":"integer"}},"targetedCompetitorIds":{"type":"array","items":{"type":"integer"}},"implementationSteps":{"type":["array","null"],"items":{"$ref":"#/components/schemas/StrategyStepsData"}},"resourcesNeeded":{"anyOf":[{"$ref":"#/components/schemas/StrategyResourcesData"},{"type":"null"}]},"implementationType":{"type":"string"},"phase":{"type":"string"},"integrations":{"type":["array","null"],"items":{"$ref":"#/components/schemas/StrategyIntegrationData"}},"leadTemperature":{"type":"array","items":{"type":"string"}},"askRatio":{"type":["string","null"]},"sources":{"anyOf":[{"$ref":"#/components/schemas/StrategySourcesData"},{"type":"null"}]},"suggestedCtas":{"type":["array","null"],"items":{"$ref":"#/components/schemas/TenantStrategy.SuggestedCtaData"}},"kpiTargets":{"type":["object","null"],"additionalProperties":{"type":"number"}},"prerequisites":{"type":"array","items":{"type":"string"}},"riskLevel":{"type":["string","null"]},"iceImpact":{"type":["integer","null"]},"iceConfidence":{"type":["integer","null"]},"iceEase":{"type":["integer","null"]},"effectiveStatus":{"type":"string"},"linkedCampaignsCount":{"type":"integer"},"linkedCampaigns":{"type":"array","items":{"$ref":"#/components/schemas/LinkedCampaignSummaryData"}},"analyzedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","tenantId","tenantProductId","derivedFromAnalysisId","createdBy","name","ideaSummary","category","whyItFits","expectedOutcome","stage","budgetLevel","timeline","status","priorityScore","sourceIdeaNumber","sourceIdeaSlug","targetedPersonaIds","targetedCompetitorIds","implementationSteps","resourcesNeeded","implementationType","phase","integrations","leadTemperature","askRatio","sources","suggestedCtas","kpiTargets","prerequisites","riskLevel","iceImpact","iceConfidence","iceEase","effectiveStatus","linkedCampaignsCount","linkedCampaigns","analyzedAt","createdAt","updatedAt"],"title":"TenantStrategyData"},"TenantStrategyImplementationType":{"type":"string","enum":["campaign_implementable","advisory_only","setup_task"],"title":"TenantStrategyImplementationType"},"TenantStrategyPhase":{"type":"string","enum":["awareness","acquisition","nurture","conversion","retention"],"title":"TenantStrategyPhase"},"TenantStrategyStage":{"type":"string","enum":["pre_launch","early","growth","scale"],"title":"TenantStrategyStage"},"TenantStrategyStatus":{"type":"string","enum":["proposed","planned","in_progress","done","archived"],"title":"TenantStrategyStatus"},"TenantStrategyTimeline":{"type":"string","enum":["quick_wins","medium_term","long_term"],"title":"TenantStrategyTimeline"},"TenantTeamSize":{"type":"string","enum":["1","2-10","11-50","51-100","101-250","250+"],"title":"TenantTeamSize"},"TenantTrackingEventFieldType":{"type":"string","enum":["string","number","boolean","enum","date"],"title":"TenantTrackingEventFieldType"},"TenantType":{"type":"string","enum":["company","individual"],"title":"TenantType"},"TestimonialsData":{"type":"object","properties":{"quote":{"type":"string"},"attribution":{"type":"string"}},"required":["quote","attribution"],"title":"TestimonialsData"},"TimingData":{"type":"object","properties":{"start":{"type":["string","null"],"format":"date-time"},"end":{"type":["string","null"],"format":"date-time"},"inferredDurationDays":{"type":["integer","null"]}},"required":["start","end","inferredDurationDays"],"title":"TimingData"},"TopicFrequency":{"type":"string","enum":["24h","7d","14d","30d","none"],"title":"TopicFrequency"},"TopicState":{"type":"string","enum":["drafted","approved","rejected","active","paused"],"title":"TopicState"},"TopicTimeRange":{"type":"string","enum":["1d","3d","7d","14d","30d"],"title":"TopicTimeRange"},"TopicType":{"type":"string","enum":["news","evergreen"],"title":"TopicType"},"TrackableType":{"type":"string","enum":["email_campaign","email_delivery","article_campaign","social_post_campaign","ad_campaign","campaign_cta"],"title":"TrackableType"},"TrackingEventFieldBindingKind":{"type":"string","enum":["none","native","custom","create_custom"],"title":"TrackingEventFieldBindingKind"},"UnresolvedEmailPlaceholderData":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"title":"UnresolvedEmailPlaceholderData"},"UnsubscriptionReason":{"type":"string","enum":["spam_complaint","too_frequent","no_longer_relevant","never_signed_up","inappropriate_content","other"],"title":"UnsubscriptionReason"},"UpdateAdAccountData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the ad account in Fusio."},"tenantOAuthPlatformId":{"type":"integer","description":"The number of the connection it belongs to."},"externalId":{"type":"string","description":"The number of the account in the ad network."},"name":{"type":"string","description":"The name of the account."},"isComplete":{"type":"boolean","description":"true when everything needed for ads is set."},"invitationStatus":{"$ref":"#/components/schemas/AdAccountInvitationStatus","description":"How the invitation to the account goes: required, pending, declined, expired or accepted."},"billingStatus":{"$ref":"#/components/schemas/AdAccountBillingStatus","description":"How billing is set: required, pending, approved_held, approved or cancelled."},"currency":{"type":["string","null"],"description":"The currency of the account, or null."},"timezone":{"type":["string","null"],"description":"The time zone of the account, or null."},"metadata":{"description":"More data from the ad network, or null."},"pageExternalId":{"type":["string","null"],"description":"The page the ads run for, or null."},"pageName":{"type":["string","null"],"description":"The name of that page, or null."},"paymentMethodLabel":{"type":["string","null"],"description":"The payment method, like a card ending, or null."},"paymentStatus":{"anyOf":[{"$ref":"#/components/schemas/AdAccountPaymentStatus"},{"type":"null"}],"description":"valid, missing or declined, or null."},"pixelExternalId":{"type":["string","null"],"description":"The pixel that counts results on your website, or null."},"instagramUserId":{"type":["string","null"],"description":"The Instagram account the ads run from, or null."},"instagramUsername":{"type":["string","null"],"description":"The username of that Instagram account, or null."},"dsaBeneficiary":{"type":["string","null"],"description":"Who benefits from the ads, as the EU Digital Services Act requires, or null."},"dsaPayor":{"type":["string","null"],"description":"Who pays for the ads, as the EU Digital Services Act requires, or null."},"accountStatus":{"anyOf":[{"$ref":"#/components/schemas/AdAccountStatus"},{"type":"null"}],"description":"active, disabled, unsettled, pending_review or closed, or null."},"lastSyncedAt":{"type":["string","null"],"description":"When Fusio last read the account, or null."},"lastSyncError":{"type":["string","null"],"description":"Why the last read failed, or null."},"createdAt":{"type":["string","null"],"description":"When it was added."},"updatedAt":{"type":["string","null"],"description":"When it last changed."},"deletedAt":{"type":["string","null"],"description":"When it was removed, or null."}},"title":"UpdateAdAccountData"},"UpdateAdData":{"type":"object","properties":{"id":{"type":"integer","description":"The number of the ad."},"userId":{"type":"integer"},"tenantId":{"type":"integer"},"tenantOAuthPlatformId":{"type":"integer"},"languageId":{"type":"integer"},"type":{"$ref":"#/components/schemas/AdType","description":"The goal of the ad, like website_traffic or post_engagement."},"body":{"type":"string","description":"The main text of the ad."},"headline":{"type":"string","description":"The headline of the ad."},"cta":{"$ref":"#/components/schemas/AdCta","description":"The button of the ad."},"targeting":{},"budget":{"type":"number","description":"How much the ad may spend."},"state":{"$ref":"#/components/schemas/AdState","description":"Where the ad is: drafted, rejected, approved, published, scheduled or failed."},"rejectReason":{"type":["string","null"],"description":"Why the ad was rejected, or null."},"name":{"type":"string","description":"The name of the ad."},"format":{"anyOf":[{"$ref":"#/components/schemas/AdFormat"},{"type":"null"}],"description":"The look of the ad: single_image, or null."},"network":{"anyOf":[{"$ref":"#/components/schemas/AdCampaignPlatform"},{"type":"null"}],"description":"The ad network, like google or linkedin, or null."},"tenantOAuthPlatform":{"anyOf":[{"$ref":"#/components/schemas/UpdateTenantOAuthPlatformData"},{"type":"null"}],"description":"Your connection to the ad network, or null."},"publication":{"anyOf":[{"$ref":"#/components/schemas/AdPublicationData"},{"type":"null"}],"description":"When and how the ad goes out, or null."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"issue":{"anyOf":[{"$ref":"#/components/schemas/AdIssueData"},{"type":"null"}],"description":"A problem of the ad, or null when there is none."},"adAccountId":{"type":["integer","null"],"description":"The number of the ad account in Fusio, or null."},"finalUrl":{"type":["string","null"],"description":"The page the ad leads to, or null."},"imageFileId":{"type":["integer","null"],"description":"The number of the image in Files, or null."},"imageUrl":{"type":["string","null"],"description":"The address of the image, or null."},"targetingCountries":{"type":"array","items":{"type":"string"},"description":"The countries where the ad shows."},"targetingInterests":{"type":"array","items":{"type":"string"},"description":"The interests of the people who should see it."},"targetingAgeMin":{"type":["integer","null"],"description":"The lowest age, or null."},"targetingAgeMax":{"type":["integer","null"],"description":"The highest age, or null."},"budgetType":{"$ref":"#/components/schemas/AdBudgetType","description":"daily or lifetime."},"startsAt":{"type":["string","null"],"description":"When the ad starts, or null."},"endsAt":{"type":["string","null"],"description":"When the ad ends, or null."},"externalId":{"type":["string","null"],"description":"The number of the ad in the ad network, or null before it is there."},"isObjectiveLocked":{"type":"boolean","description":"true when the ad already exists in the network, so its goal and budget type cannot change."},"publishError":{"type":["string","null"],"description":"Why publishing failed, or null."},"publishedAt":{"type":["string","null"],"description":"When the ad went out, or null."},"lastSyncedAt":{"type":["string","null"],"description":"When Fusio last sent or read the ad in the network, or null."},"pendingNetworkChange":{"$ref":"#/components/schemas/AdPendingNetworkChange","description":"What waits to go to the ad network: none, settings or creative (texts and image)."},"last30Days":{"anyOf":[{"$ref":"#/components/schemas/AdMetricTotalsData"},{"type":"null"}],"description":"The numbers of the last 30 days, or null."}},"title":"UpdateAdData"},"UpdateAdPlatformData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"}},"title":"UpdateAdPlatformData"},"UpdateArticleCategoryData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"parentId":{"type":["integer","null"]},"name":{"type":"string"},"slug":{"type":"string"},"translation":{"anyOf":[{"$ref":"#/components/schemas/UpdateArticleCategoryTranslationData"},{"type":"null"}]},"availableLocales":{"type":"array","items":{"type":"string"},"description":"The languages this category has texts in."},"color":{"anyOf":[{"$ref":"#/components/schemas/ArticleCategoryColor"},{"type":"null"}]},"icon":{"anyOf":[{"$ref":"#/components/schemas/ArticleCategoryIcon"},{"type":"null"}]},"count":{"type":["integer","null"]},"averageReadTime":{"type":["integer","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"children":{"type":"array","items":{"$ref":"#/components/schemas/UpdateArticleCategoryData"},"description":"The categories right under this one."},"translationInput":{"anyOf":[{"$ref":"#/components/schemas/ArticleCategoryTranslationInputData"},{"type":"null"}]}},"title":"UpdateArticleCategoryData"},"UpdateArticleCategoryTranslationData":{"type":"object","properties":{"id":{"type":"integer"},"articleCategoryId":{"type":"integer"},"locale":{"type":"string"},"isPrimary":{"type":["boolean","null"]},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"breadcrumbTitle":{"type":["string","null"]},"metaTitle":{"type":["string","null"]},"metaDescription":{"type":["string","null"]},"canonicalUrl":{"type":["string","null"]},"ogTitle":{"type":["string","null"]},"ogDescription":{"type":["string","null"]},"ogImageId":{"type":["integer","null"]},"ogImage":{"anyOf":[{"$ref":"#/components/schemas/UpdateFileData"},{"type":"null"}]}},"title":"UpdateArticleCategoryTranslationData"},"UpdateArticleData":{"type":"object","properties":{"id":{"type":"integer"},"publication":{"anyOf":[{"$ref":"#/components/schemas/UpdatePublicationData"},{"type":"null"}]},"campaign":{"anyOf":[{"$ref":"#/components/schemas/UpdateCampaignData"},{"type":"null"}]},"translation":{"$ref":"#/components/schemas/UpdateArticleTranslationData","description":"The text of the article in its main language."},"availableLocales":{"type":"array","items":{"type":"string"}},"alternates":{"type":"array","items":{"$ref":"#/components/schemas/ArticleAlternateData"}},"tenantId":{"type":"integer"},"tenantSequence":{"type":"integer"},"userId":{"type":"integer"},"articleCategoryId":{"type":["integer","null"]},"categorySlug":{"type":["string","null"]},"tenantArticleAuthorId":{"type":["integer","null"]},"author":{"anyOf":[{"$ref":"#/components/schemas/PublicTenantArticleAuthorData"},{"type":"null"}]},"bannerImageId":{"type":["integer","null"]},"unsplashBannerImageUrl":{"type":["string","null"]},"unsplashBannerCredit":{"anyOf":[{"$ref":"#/components/schemas/ArticleBannerCreditData"},{"type":"null"}]},"bannerImage":{"anyOf":[{"$ref":"#/components/schemas/UpdateFileData"},{"type":"null"}]},"articleIntegrationId":{"type":"integer"},"externalReference":{"type":["string","null"]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/UpdateTagData"}},"articleIntegration":{"anyOf":[{"$ref":"#/components/schemas/UpdateArticleIntegrationData"},{"type":"null"}]},"state":{"$ref":"#/components/schemas/ArticleState","description":"Where the article is now: drafted, approved, rejected, scheduled, published or failed."},"schemaType":{"anyOf":[{"$ref":"#/components/schemas/ArticleSchemaType"},{"type":"null"}]},"seoIndex":{"type":["boolean","null"]},"seoFollow":{"type":["boolean","null"]},"robotsNoarchive":{"type":["boolean","null"]},"robotsNosnippet":{"type":["boolean","null"]},"robotsMaxSnippet":{"type":["integer","null"]},"robotsMaxImagePreview":{"type":["string","null"]},"robotsMaxVideoPreview":{"type":["integer","null"]},"isVisible":{"type":["boolean","null"],"description":"false when the article is hidden on the website."},"isCornerstone":{"type":["boolean","null"]},"publishedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"blueprint":{"anyOf":[{"$ref":"#/components/schemas/CampaignSourceBlueprintSummaryData"},{"type":"null"}]},"campaignAsset":{"anyOf":[{"$ref":"#/components/schemas/CampaignAssetSummaryData"},{"type":"null"}]}},"title":"UpdateArticleData"},"UpdateArticleIntegrationData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ArticleIntegrationType"},"domain":{"type":"string"},"articleUrlTemplate":{"type":["string","null"]},"articleUrlCategoryFallback":{"type":["string","null"]},"articleUrlLocalePatterns":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ArticleUrlLocalePatternData"}},"isPrimary":{"type":"boolean"},"destinationPath":{"type":["string","null"]},"secret":{"type":["string","null"]},"site":{"anyOf":[{"$ref":"#/components/schemas/ArticleSiteSummaryData"},{"type":"null"}]},"siteLeadFormId":{"type":["integer","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"title":"UpdateArticleIntegrationData"},"UpdateArticleTranslationData":{"type":"object","properties":{"id":{"type":"integer"},"articleId":{"type":"integer"},"locale":{"type":"string"},"isPrimary":{"type":["boolean","null"]},"name":{"type":"string"},"content":{"type":"string"},"contentHtml":{"type":"string"},"slug":{"type":"string"},"breadcrumbTitle":{"type":["string","null"]},"metaTitle":{"type":["string","null"]},"metaDescription":{"type":["string","null"]},"primaryFocusKeyword":{"type":["string","null"]},"secondaryKeywords":{"type":["array","null"],"items":{"type":"string"}},"canonicalUrl":{"type":["string","null"]},"ogTitle":{"type":["string","null"]},"ogDescription":{"type":["string","null"]},"ogImageId":{"type":["integer","null"]},"ogImage":{"anyOf":[{"$ref":"#/components/schemas/UpdateFileData"},{"type":"null"}]},"twitterTitle":{"type":["string","null"]},"twitterDescription":{"type":["string","null"]},"twitterImageId":{"type":["integer","null"]},"twitterImage":{"anyOf":[{"$ref":"#/components/schemas/UpdateFileData"},{"type":"null"}]},"wordCount":{"type":["integer","null"]},"readingTime":{"type":["integer","null"]},"summary":{"type":["string","null"]},"summaryHtml":{"type":["string","null"]},"signature":{"type":["string","null"]},"sources":{},"tableOfContents":{}},"title":"UpdateArticleTranslationData"},"UpdateCampaignData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"tenantSequence":{"type":"integer"},"tenantName":{"type":"string"},"userId":{"type":"integer"},"timezone":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"origin":{"$ref":"#/components/schemas/CampaignOrigin"},"mode":{"$ref":"#/components/schemas/CampaignMode"},"audienceWarmth":{"$ref":"#/components/schemas/CampaignAudienceWarmth"},"autonomyLevel":{"$ref":"#/components/schemas/CampaignAutonomyLevel"},"goal":{"$ref":"#/components/schemas/CampaignGoal"},"goalMetricType":{"anyOf":[{"$ref":"#/components/schemas/CampaignGoalMetricType"},{"type":"null"}]},"goalMetricTarget":{"type":["string","number","null"]},"goalMetricLabel":{"type":["string","null"]},"askRatio":{"type":["string","number","null"]},"effectiveAskRatio":{"type":"number","description":"The part of the content that asks people to act, after the default is used."},"contentMix":{"$ref":"#/components/schemas/CampaignContentMixData"},"brief":{"type":["string","null"]},"aiPlan":{"anyOf":[{"$ref":"#/components/schemas/CampaignAiPlanData"},{"type":"null"}]},"aiPlanGenerationStage":{"anyOf":[{"$ref":"#/components/schemas/CampaignAiPlanStage"},{"type":"null"}]},"aiPlanFailureMessage":{"type":["string","null"]},"aiPlanStepOutputs":{},"brandVoiceId":{"type":["integer","null"]},"approvalWindowHours":{"type":["integer","null"]},"approvalTimeoutAction":{"$ref":"#/components/schemas/CampaignApprovalTimeoutAction"},"generationBudgetCredits":{"type":["integer","null"]},"generationSpentCredits":{"type":"integer","description":"How many credits Fusio has spent on writing content so far."},"similarityCheckEnabled":{"type":"boolean"},"similarityThreshold":{"type":["string","number","null"]},"similarityAction":{"$ref":"#/components/schemas/CampaignSimilarityAction"},"similarityWindowDays":{"type":"integer"},"status":{"$ref":"#/components/schemas/CampaignStatus","description":"Where the campaign is now: draft, approved, scheduled, active, paused, completed, cancelled or archived."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"startAt":{"type":["string","null"]},"endsOn":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"endedAt":{"type":["string","null"]},"brandVoice":{"anyOf":[{"$ref":"#/components/schemas/BrandVoiceOutputData"},{"type":"null"}]},"sources":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CampaignSourceOutputData"}},"generationSlots":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CampaignGenerationSlotOutputData"}},"alerts":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CampaignAlertData"},"description":"Problems you should fix, like a missing account."},"destinationsCount":{"type":"integer"},"destinations":{},"ctas":{},"leadForms":{},"linkedTrackingEvents":{},"publication":{"anyOf":[{"$ref":"#/components/schemas/UpdatePublicationData"},{"type":"null"}]},"languageId":{"type":["integer","null"]},"language":{"anyOf":[{"$ref":"#/components/schemas/UpdateLanguageData"},{"type":"null"}]},"conversionActions":{"type":"array","items":{"$ref":"#/components/schemas/CampaignConversionActionData"}},"goalTargets":{"$ref":"#/components/schemas/CampaignGoalTargetsData"},"approvers":{"type":"array","items":{"$ref":"#/components/schemas/CampaignApproverOutputData"}},"standaloneEntity":{"anyOf":[{"$ref":"#/components/schemas/StandaloneCampaignEntityOutputData"},{"type":"null"}]},"slug":{"type":"string"},"derivedFromCampaignId":{"type":["integer","null"]},"canRetryPlan":{"type":"boolean"}},"title":"UpdateCampaignData"},"UpdateCommunicationPreferenceData":{"type":"object","properties":{"id":{"type":"integer"},"hashToken":{"type":"string"},"prefersId":{"type":"integer"},"prefersType":{"anyOf":[{"$ref":"#/components/schemas/CommunicationPreferenceOwnerType"},{"type":"null"}]},"isGloballyUnsubscribed":{"type":"boolean"},"unsubscriptionReason":{"anyOf":[{"$ref":"#/components/schemas/UnsubscriptionReason"},{"type":"null"}]},"unsubscriptionReasonDescription":{"type":["string","null"]},"languageId":{"type":["integer","null"]},"emailFormat":{"$ref":"#/components/schemas/CommunicationPreferenceEmailFormat"},"channelEmailEnabled":{"type":"boolean"},"channelSmsEnabled":{"type":"boolean"},"emailConsentStatus":{"$ref":"#/components/schemas/ConsentStatus"},"smsConsentStatus":{"$ref":"#/components/schemas/ConsentStatus"},"callConsentStatus":{"$ref":"#/components/schemas/ConsentStatus"},"consentUpdatedAt":{"type":["string","null"]},"consentIp":{"type":["string","null"]},"consentUserAgent":{"type":["string","null"]},"consentSource":{"anyOf":[{"$ref":"#/components/schemas/ConsentSource"},{"type":"null"}]},"recipientName":{"type":["string","null"]},"recipientEmail":{"type":["string","null"]},"senderName":{"type":["string","null"]}},"title":"UpdateCommunicationPreferenceData"},"UpdateContactCustomFieldData":{"type":"object","properties":{"id":{"type":"integer"},"contactId":{"type":"integer"},"customField":{"$ref":"#/components/schemas/UpdateCustomFieldData"},"value":{"type":["string","null"]}},"title":"UpdateContactCustomFieldData"},"UpdateContactData":{"type":"object","properties":{"id":{"type":"string","description":"The number of the contact."},"userId":{"type":"integer","description":"The member who added or last changed the contact."},"tenantId":{"type":"integer"},"segments":{"type":"array","items":{"$ref":"#/components/schemas/UpdateSegmentData"},"description":"The segments the contact is in."},"tags":{"type":"array","items":{"$ref":"#/components/schemas/UpdateTagData"},"description":"The tags of the contact."},"contactCustomFields":{"type":"array","items":{"$ref":"#/components/schemas/UpdateContactCustomFieldData"},"description":"The values of your custom fields."},"communicationPreference":{"anyOf":[{"$ref":"#/components/schemas/UpdateCommunicationPreferenceData"},{"type":"null"}],"description":"Consent and the channels the person allows. null when nothing is saved yet."},"lead":{"anyOf":[{"$ref":"#/components/schemas/UpdateLeadData"},{"type":"null"}],"description":"The lead the person works for. null when there is none."},"type":{"$ref":"#/components/schemas/ContactType"},"email":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"name":{"type":["string","null"]},"phone":{"type":["string","null"],"description":"The phone number in the form Fusio saves, like +420601234567."},"position":{"type":["string","null"]},"preferredContactChannel":{"anyOf":[{"$ref":"#/components/schemas/PreferredContactChannel"},{"type":"null"}]},"lastActivityAt":{"type":["string","null"]},"emailVerifiedAt":{"type":["string","null"]}},"title":"UpdateContactData"},"UpdateCrmPlatformData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"}},"title":"UpdateCrmPlatformData"},"UpdateCustomFieldData":{"type":"object","properties":{"id":{"type":"integer"},"userId":{"type":"integer"},"tenantId":{"type":"integer"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/CustomFieldType"},"isRequired":{"type":"boolean"},"isActive":{"type":"boolean"},"isUniqueIdentifier":{"type":"boolean"},"options":{"type":["array","null"],"items":{"$ref":"#/components/schemas/UpdateCustomFieldOptionData"}},"deletedAt":{"type":["string","null"]}},"title":"UpdateCustomFieldData"},"UpdateCustomFieldOptionData":{"type":"object","properties":{"id":{"type":"integer"},"optionLabel":{"type":"string"},"optionValue":{"type":"string"},"isActive":{"type":"boolean"}},"title":"UpdateCustomFieldOptionData"},"UpdateEmailData":{"type":"object","properties":{"id":{"type":"integer"},"publication":{"anyOf":[{"$ref":"#/components/schemas/UpdatePublicationData"},{"type":"null"}]},"campaign":{"anyOf":[{"$ref":"#/components/schemas/UpdateCampaignData"},{"type":"null"}]},"userId":{"type":"integer"},"tenantId":{"type":"integer"},"tenantSequence":{"type":"integer"},"emailTemplateId":{"type":["integer","null"]},"topicId":{"type":["integer","null"]},"languageId":{"type":"integer"},"name":{"type":"string"},"subject":{"type":"string"},"signatureSource":{"$ref":"#/components/schemas/EmailSignatureSource"},"creatorHasSenderIdentity":{"type":"boolean"},"sendFromTenantDomainEmailId":{"type":["integer","null"]},"replyToTenantDomainEmailId":{"type":["integer","null"]},"fromEmail":{"type":["string","null"]},"replyTo":{"type":["string","null"]},"preheaderText":{"type":["string","null"]},"html":{"type":["string","null"],"description":"The finished email as HTML, built from configuration."},"configuration":{},"placeholders":{},"unresolvedPlaceholders":{"type":"array","items":{"$ref":"#/components/schemas/UnresolvedEmailPlaceholderData"}},"state":{"$ref":"#/components/schemas/EmailState"},"conditions":{"anyOf":[{"$ref":"#/components/schemas/ConditionGroupOutputData"},{"type":"null"}]},"contactScope":{"$ref":"#/components/schemas/EmailRecipientContactScope"},"contactOverrides":{"type":"array","items":{"$ref":"#/components/schemas/EmailContactOverrideData"}},"rejectReason":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"blueprint":{"anyOf":[{"$ref":"#/components/schemas/CampaignSourceBlueprintSummaryData"},{"type":"null"}]},"emailTemplate":{"anyOf":[{"$ref":"#/components/schemas/UpdateEmailTemplateData"},{"type":"null"}]},"topic":{"anyOf":[{"$ref":"#/components/schemas/UpdateTopicData"},{"type":"null"}]},"language":{"anyOf":[{"$ref":"#/components/schemas/UpdateLanguageData"},{"type":"null"}]}},"title":"UpdateEmailData"},"UpdateEmailTemplateData":{"type":"object","properties":{"id":{"type":"integer"},"translation":{"$ref":"#/components/schemas/UpdateEmailTemplateTranslationData"},"availableLocales":{"type":"array","items":{"type":"string"}},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"isSubscriptionTemplate":{"type":"boolean"},"category":{"anyOf":[{"$ref":"#/components/schemas/EmailTemplateCategory"},{"type":"null"}]},"layout":{"anyOf":[{"$ref":"#/components/schemas/EmailTemplateLayout"},{"type":"null"}]},"isForWarmAudience":{"type":"boolean"},"isForOwnedAudience":{"type":"boolean"},"usage":{"$ref":"#/components/schemas/EmailTemplateUsage"},"privateOutreachAction":{"anyOf":[{"$ref":"#/components/schemas/PrivateOutreachAction"},{"type":"null"}]},"invoiceMailType":{"anyOf":[{"$ref":"#/components/schemas/InvoiceMailType"},{"type":"null"}]},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"isSharedWithTeam":{"type":"boolean"},"isMine":{"type":"boolean"},"ownerName":{"type":["string","null"]},"bodyMarkdown":{"type":["string","null"]}},"title":"UpdateEmailTemplateData"},"UpdateEmailTemplateTranslationData":{"type":"object","properties":{"id":{"type":"integer"},"emailTemplateId":{"type":"integer"},"languageId":{"type":"integer"},"locale":{"type":"string"},"isPrimary":{"type":["boolean","null"]},"name":{"type":"string"},"subject":{"type":"string"},"preheaderText":{"type":["string","null"]},"description":{"type":["string","null"]},"templateConfiguration":{},"templatePlaceholders":{}},"title":"UpdateEmailTemplateTranslationData"},"UpdateFacebookSocialPostData":{"type":"object","properties":{"id":{"type":"integer"},"tenantOAuthPlatformId":{"type":["integer","null"]},"socialPostId":{"type":"integer"},"externalId":{"type":"string"}},"title":"UpdateFacebookSocialPostData"},"UpdateFileData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"alt":{"type":["string","null"]},"slug":{"type":"string"},"extension":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"integer"},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"ratio":{"type":["number","null"]},"path":{"type":"string"},"url":{"type":"string"},"hash":{"type":"string"},"isAiGenerated":{"type":"boolean"},"isImageEdited":{"type":"boolean"},"isCroppable":{"type":"boolean"},"createdAt":{"type":["string","null"]},"usageCount":{"type":"integer"},"isInUse":{"type":"boolean"},"canDelete":{"type":"boolean"}},"title":"UpdateFileData"},"UpdateInstagramSocialPostData":{"type":"object","properties":{"id":{"type":"integer"},"tenantOAuthPlatformId":{"type":["integer","null"]},"socialPostId":{"type":"integer"},"externalId":{"type":"string"}},"title":"UpdateInstagramSocialPostData"},"UpdateLanguageData":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"}},"title":"UpdateLanguageData"},"UpdateLeadContactData":{"type":"object","properties":{"id":{"type":"integer"},"leadId":{"type":"integer"},"contactId":{"type":"integer"},"isPrimary":{"type":"boolean"},"buyingRole":{"anyOf":[{"$ref":"#/components/schemas/LeadContactBuyingRole"},{"type":"null"}]},"contact":{"anyOf":[{"$ref":"#/components/schemas/UpdateContactData"},{"type":"null"}]}},"title":"UpdateLeadContactData"},"UpdateLeadCustomFieldData":{"type":"object","properties":{"id":{"type":"integer"},"leadId":{"type":"integer"},"customField":{"$ref":"#/components/schemas/UpdateCustomFieldData"},"value":{"type":["string","null"]}},"title":"UpdateLeadCustomFieldData"},"UpdateLeadData":{"type":"object","properties":{"id":{"type":"string","description":"The number of the lead."},"countryId":{"type":["integer","null"]},"countryIso":{"type":["string","null"]},"name":{"type":["string","null"]},"registrationNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"unattestedIdentity":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Company details that Fusio guessed, for example from a form, and nobody checked yet. null when there are none."},"street":{"type":["string","null"]},"city":{"type":["string","null"]},"zip":{"type":["string","null"]},"stage":{"$ref":"#/components/schemas/LeadStage"},"lostReason":{"anyOf":[{"$ref":"#/components/schemas/LeadLostReason"},{"type":"null"}]},"lostReasonNote":{"type":["string","null"]},"personType":{"$ref":"#/components/schemas/LeadPersonType"},"source":{"anyOf":[{"$ref":"#/components/schemas/LeadSource"},{"type":"null"}]},"website":{"type":["string","null"]},"hasResearchProfile":{"type":"boolean"},"originatingLeadFormId":{"type":["integer","null"]},"originatingLeadFormName":{"type":["string","null"]},"outreachStatus":{"$ref":"#/components/schemas/LeadOutreachStatus","description":"How far your team got in reaching out to the lead."},"contactsCount":{"type":"integer","description":"How many contacts the lead has."},"countryName":{"type":["string","null"]},"leadContacts":{"type":"array","items":{"$ref":"#/components/schemas/UpdateLeadContactData"},"description":"The contacts of the lead, with the main one marked."},"segmentIds":{"type":"array","items":{"type":"integer"},"description":"The numbers of the segments the lead is in."},"tagIds":{"type":"array","items":{"type":"integer"},"description":"The numbers of the tags of the lead."},"leadCustomFields":{"type":"array","items":{},"description":"The values of your custom fields."},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/LeadTaskOutputData"},"description":"The tasks of your team about the lead."},"notes":{"type":"array","items":{"$ref":"#/components/schemas/LeadNoteOutputData"}},"billingAddressSameAsLegal":{"type":"boolean"},"billingAddress":{"anyOf":[{"$ref":"#/components/schemas/LeadBillingAddressData"},{"type":"null"}]},"firmographic":{"anyOf":[{"$ref":"#/components/schemas/LeadFirmographicData"},{"type":"null"}]},"registerLookupStatus":{"anyOf":[{"$ref":"#/components/schemas/LeadRegisterLookupStatus"},{"type":"null"}]},"registerLookupLocked":{"type":"boolean"}},"title":"UpdateLeadData"},"UpdateLinkedInSocialPostData":{"type":"object","properties":{"id":{"type":"integer"},"tenantOAuthPlatformId":{"type":["integer","null"]},"socialPostId":{"type":"integer"},"externalId":{"type":"string"}},"title":"UpdateLinkedInSocialPostData"},"UpdatePublicationData":{"type":"object","properties":{"id":{"type":"integer"},"entityId":{"type":"integer"},"entityType":{"type":"string"},"status":{"$ref":"#/components/schemas/PublicationStatus"},"failureReason":{"type":["string","null"]},"useOptimalPublishingTime":{"type":"boolean"},"scheduledAt":{"type":["string","null"]},"timezone":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"failedAt":{"type":["string","null"]}},"title":"UpdatePublicationData"},"UpdateSegmentData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]}},"title":"UpdateSegmentData"},"UpdateSocialPlatformData":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"name":{"type":"string"}},"title":"UpdateSocialPlatformData"},"UpdateSocialPostData":{"type":"object","properties":{"id":{"type":"integer"},"batchId":{"type":"integer"},"tenantOAuthPlatform":{"anyOf":[{"$ref":"#/components/schemas/UpdateTenantOAuthPlatformData"},{"type":"null"}]},"socialPlatform":{"anyOf":[{"$ref":"#/components/schemas/UpdateSocialPlatformData"},{"type":"null"}]},"publication":{"anyOf":[{"$ref":"#/components/schemas/UpdatePublicationData"},{"type":"null"}]},"campaign":{"anyOf":[{"$ref":"#/components/schemas/UpdateCampaignData"},{"type":"null"}]},"xSocialPost":{"anyOf":[{"$ref":"#/components/schemas/UpdateXSocialPostData"},{"type":"null"}]},"instagramSocialPost":{"anyOf":[{"$ref":"#/components/schemas/UpdateInstagramSocialPostData"},{"type":"null"}]},"facebookSocialPost":{"anyOf":[{"$ref":"#/components/schemas/UpdateFacebookSocialPostData"},{"type":"null"}]},"linkedInSocialPost":{"anyOf":[{"$ref":"#/components/schemas/UpdateLinkedInSocialPostData"},{"type":"null"}]},"languageId":{"type":"integer"},"topicId":{"type":["integer","null"]},"tenantId":{"type":"integer"},"tenantSequence":{"type":"integer"},"userId":{"type":"integer"},"name":{"type":"string"},"content":{"type":"string"},"state":{"$ref":"#/components/schemas/SocialPostState","description":"Where the post is now: drafted, approved, rejected, scheduled, published or failed."},"files":{"type":"array","items":{"$ref":"#/components/schemas/UpdateFileData"}},"comments":{"type":"array","items":{"$ref":"#/components/schemas/SocialPostCommentData"},"description":"The parts that follow the post: thread posts and comments."},"updatedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"blueprint":{"anyOf":[{"$ref":"#/components/schemas/CampaignSourceBlueprintSummaryData"},{"type":"null"}]},"sourceArticle":{"anyOf":[{"$ref":"#/components/schemas/SocialPostSourceArticleOutputData"},{"type":"null"}]},"isAwaitingArticle":{"type":"boolean"},"commentsCount":{"type":"integer"},"threadItemsCount":{"type":"integer"}},"title":"UpdateSocialPostData"},"UpdateTagData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"color":{"type":["string","null"]},"notes":{"type":["string","null"]},"assignmentSource":{"$ref":"#/components/schemas/TagAssignmentSource"}},"title":"UpdateTagData"},"UpdateTenantAnalysisData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"url":{"type":"string","description":"The website that was analysed."},"batchId":{"type":["string","null"],"description":"The number of the background work. It is set while the analysis runs."},"analyzedAt":{"type":["string","null"],"description":"When the analysis finished. null while it still runs."},"websiteLanguageId":{"type":["integer","null"],"description":"The number of the language your website is in."},"industryCategoryId":{"type":["integer","null"],"description":"The number of the field your business is in."},"aiProviderModelId":{"type":["integer","null"]},"pagesCrawled":{"type":"integer","description":"How many pages of the website Fusio read."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"title":"UpdateTenantAnalysisData"},"UpdateTenantData":{"type":"object","properties":{"id":{"type":"integer"},"ownerId":{"type":"integer"},"slug":{"type":"string"},"name":{"type":"string"},"legalName":{"type":["string","null"]},"email":{"type":["string","null"]},"ownerEmail":{"type":"string"},"privacyPolicyUrl":{"type":["string","null"]},"termsUrl":{"type":["string","null"]},"verifiedDomainName":{"type":["string","null"]},"hasAgencyWorkspace":{"type":"boolean"},"twoFactorRequired":{"type":"boolean"},"isPriceListLocked":{"type":"boolean"},"preferredAiLanguageId":{"type":"integer"},"bio":{"type":["string","null"]},"website":{"type":["string","null"]},"timezone":{"type":["string","null"]},"resolvedTimezone":{"type":"string"},"logoId":{"type":["integer","null"]},"logoBannerId":{"type":["integer","null"]},"logoUrl":{"type":["string","null"]},"logoBannerUrl":{"type":["string","null"]},"documents":{"type":"array","items":{"$ref":"#/components/schemas/UpdateFileData"}},"type":{"$ref":"#/components/schemas/TenantType"},"teamSize":{"$ref":"#/components/schemas/TenantTeamSize"},"registrationNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"industryCategoryIds":{"type":"array","items":{"type":"string"}},"completedAt":{"type":["string","null"]},"packageName":{"type":"string"},"subscriptionId":{"type":["integer","null"]},"creditBalance":{"type":"number"},"emailSendingBalance":{"type":"integer"},"socialPlatformLinkingBalance":{"type":["integer","null"]},"adPlatformLinkingBalance":{"type":["integer","null"]},"organizationMemberBalance":{"type":["integer","null"]},"crmRecordsUsed":{"type":"integer"},"companyLookupsUsed":{"type":"integer"},"resetLimitsAt":{"type":["string","null"]},"entitlements":{"$ref":"#/components/schemas/TenantEntitlementsData"},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]}},"title":"UpdateTenantData"},"UpdateTenantOAuthPlatformData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"socialPlatform":{"anyOf":[{"$ref":"#/components/schemas/UpdateSocialPlatformData"},{"type":"null"}]},"adPlatform":{"anyOf":[{"$ref":"#/components/schemas/UpdateAdPlatformData"},{"type":"null"}]},"crmPlatform":{"anyOf":[{"$ref":"#/components/schemas/UpdateCrmPlatformData"},{"type":"null"}]},"linkedinAdsOAuthPlatformId":{"type":["integer","null"]},"adAccounts":{"type":["array","null"],"items":{"$ref":"#/components/schemas/UpdateAdAccountData"}},"facebookPages":{"type":["array","null"],"items":{"$ref":"#/components/schemas/UpdateTenantOAuthPlatformFacebookPageData"}},"externalId":{"type":"string"},"linkedinOrganizationUrn":{"type":["string","null"]},"approvedScopes":{"type":"array","items":{"type":"string"}},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"nickname":{"type":["string","null"]},"avatar":{"type":["string","null"]},"authenticationStatus":{"$ref":"#/components/schemas/TenantOAuthPlatformStatus"},"tokenExpiresAt":{"type":["string","null"]},"refreshTokenExpiresAt":{"type":["string","null"]},"socialLockedAt":{"type":["string","null"]},"adLockedAt":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"title":"UpdateTenantOAuthPlatformData"},"UpdateTenantOAuthPlatformFacebookPageData":{"type":"object","properties":{"id":{"type":"integer"},"tenantOAuthPlatformId":{"type":"integer"},"externalId":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"deletedAt":{"type":["string","null"]}},"title":"UpdateTenantOAuthPlatformFacebookPageData"},"UpdateTopicData":{"type":"object","properties":{"id":{"type":"integer"},"tenantId":{"type":"integer"},"userId":{"type":"integer"},"batchId":{"type":"integer"},"name":{"type":"string"},"query":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/TopicType"},"frequency":{"$ref":"#/components/schemas/TopicFrequency"},"timeRange":{"$ref":"#/components/schemas/TopicTimeRange"},"targetLanguageId":{"type":["integer","null"]},"targetCountryId":{"type":["integer","null"]},"excludeWebsites":{"type":["array","null"],"items":{"type":"string"}},"includeWebsites":{"type":["array","null"],"items":{"type":"string"}},"state":{"$ref":"#/components/schemas/TopicState"},"usedBySocialPostId":{"type":["integer","null"]},"usedByArticleId":{"type":["integer","null"]},"usedByEmailId":{"type":["integer","null"]},"lastCrawledAt":{"type":["string","null"],"description":"When Fusio last searched the web for this topic."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"title":"UpdateTopicData"},"UpdateUserData":{"type":"object","properties":{"id":{"type":"integer"},"activeTenantId":{"type":["integer","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"emailVerifiedAt":{"type":["string","null"]},"preferredLanguageId":{"type":["integer","null"]},"preferredTheme":{"type":["string","null"]},"roles":{"type":"array","items":{"type":"string"}},"permissions":{"type":"array","items":{"type":"string"}},"isAdmin":{"type":"boolean"}},"title":"UpdateUserData"},"UpdateXSocialPostData":{"type":"object","properties":{"id":{"type":"integer"},"tenantOAuthPlatformId":{"type":["integer","null"]},"socialPostId":{"type":"integer"},"externalId":{"type":"string"},"editHistoryTweetIds":{"type":"array","items":{"type":"integer"}}},"title":"UpdateXSocialPostData"},"UserSummaryData":{"type":"object","properties":{"id":{"type":"integer"},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]}},"required":["id","firstName","lastName"],"title":"UserSummaryData"},"ValidationErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"],"title":"ValidationErrorResponse"},"ValueThemesData":{"type":"object","properties":{"theme":{"type":"string"},"proof":{"type":"string"}},"required":["theme","proof"],"title":"ValueThemesData"}}},"tags":[{"name":"auth","x-displayName":"Sign-in","description":"Find out who the key acts as and which company it belongs to. Call it first to check that your key works."},{"name":"sync","x-displayName":"Bulk import","description":"Send many leads or deals at once from your CRM. Fusio puts the batch in a queue and works through it in the background. You then ask how far it got and read the result of each item."},{"name":"articles","x-displayName":"Articles","description":"Write, change and publish the articles of your blog. An article has a state: it starts as drafted, gets approved or rejected, and then is scheduled and published through a publication.\n\nReading needs `articles.read`, changing needs `articles.write`. Any step past drafted or rejected also needs `articles.publish`."},{"name":"article-categories","x-displayName":"Article categories","description":"Sort your articles into categories. A category can sit under another one, so they form a tree. Each category has texts per language."},{"name":"article-authors","x-displayName":"Article authors","description":"The people or companies shown as authors of your articles. One author is the default; new articles get this author."},{"name":"public-content","x-displayName":"Website content","description":"Read what your website shows: published articles and active authors in one language. Use these addresses to build your own blog pages."},{"name":"topics","x-displayName":"Topics","description":"Topics tell Fusio what to watch on the web. For an active topic, Fusio searches for pages about it and uses them as ideas for your articles."},{"name":"emails","x-displayName":"Emails","description":"Write emails and pick who gets them. An email starts as drafted, gets approved or rejected, and then is sent through a publication or a sequence.\n\nReading needs `emails.read`, changing needs `emails.write`. Any step past drafted or rejected also needs `emails.send`."},{"name":"social-posts","x-displayName":"Social posts","description":"Write and publish posts for X, Facebook, LinkedIn and Instagram. A post has a state: it starts as drafted, gets approved or rejected, and then is scheduled and published through a publication.\n\nReading needs `social-posts.read`, changing needs `social-posts.write`. Any step past drafted or rejected also needs the publish permission of the network, like `social-posts.publish.linkedin`."},{"name":"campaigns","x-displayName":"Campaigns","description":"A campaign joins your content around one goal: articles, emails, social posts and ads, with the sources Fusio writes from and the forms that collect leads. A campaign has a status: draft, approved, scheduled, active, paused, completed, cancelled or archived.\n\nReading needs `campaigns.read`, changing needs `campaigns.write`. Changing a campaign also needs the write permission of each kind of content in it: `articles.write` for blog articles, `social-posts.write` for social posts and `emails.write` for emails. The other way round, changing an article, social post or email that belongs to a campaign also needs `campaigns.write`. Anything that lets the campaign act on its own, like activate, approve or resume, also needs `campaigns.execute`."},{"name":"publications","x-displayName":"Publications","description":"A publication puts approved content out at a set time: an article on your website, an email to people, a post on a network, an ad, or a whole campaign. Approve the content first, then create a publication for it.\n\nReading needs the read permission of the content. Creating, changing and deleting publications needs the permission that lets the content go out, like `articles.publish` or `emails.send`."},{"name":"files","x-displayName":"Files","description":"The pictures and files of your company. Use them in articles, emails and social posts by their number.\n\nReading needs `files.read`, uploading needs `files.write`. A key sees only the public files of your library, not private documents."},{"name":"contacts","x-displayName":"Contacts","description":"A contact is one person: a name, an email or a phone, and their consent to emails, text messages and calls. Each contact belongs to one lead, the company they work for.\n\nAdd segments, tags and custom fields to sort your contacts. Before you add a person, ask `leads.check-duplicate`, so you do not have them twice."},{"name":"leads","x-displayName":"Leads","description":"A lead is a company or a person you want to win as a client. It has contacts (the people), a stage (cold, warm, qualified, client or lost) and members of your team who look after it.\n\nSort leads with segments, tags and custom fields, and read how they react in the analytics. Before you add a lead, ask `leads.check-duplicate`, so you do not have the same company twice."},{"name":"deals","x-displayName":"Deals","description":"A deal is a sale you work on with a lead. It goes through stages: discovery, qualification, proposal and negotiation, and ends as won or lost.\n\nA deal has items (what you sell and for how much), contacts with their roles and documents. When you win a deal, its lead becomes a client."},{"name":"deal-products","x-displayName":"Products","description":"Products are what you sell, with a price, unit and VAT. Pick them when you add items to a deal, so you do not type the same things again."},{"name":"ads","x-displayName":"Ads","description":"Ads on LinkedIn, and the campaigns Fusio sent to Google Ads. Ads for Facebook and Instagram are in Meta ads. You write an ad as a draft, approve it and then start it in the ad network.\n\nStarting, changing and removing ads that are not drafts needs the execute permission of the network for a key: `ads.execute.google` or `ads.execute.linkedin`. AI work spends AI credits of your company."},{"name":"google-ads-search","x-displayName":"Google Ads search","description":"Search campaigns for Google Ads. A campaign has one ad group with keywords and one search ad. You build it as a draft, by hand or with AI, then approve it and send it to Google Ads. It arrives paused, so nothing is spent until you start it.\n\nAI work spends AI credits of your company. Sending, starting and changing live campaigns needs the permission `ads.execute.google` for a key."},{"name":"meta-ads","x-displayName":"Meta ads","description":"Campaigns for Facebook and Instagram. A campaign has ad sets with targeting, and each ad set has ads. You build it as a draft and approve it. Nothing goes to Meta until you upload it.\n\nSearching targeting, audiences, posts and audience estimates ask Meta, so they need a picked Meta ad account. Approving a campaign needs the permission `ads.execute.facebook` for a key.\n\nUploading to Meta goes like this:\n1. `meta-ads-campaigns.meta-ads.preflight` checks the approved campaign and gives you `planRevision`.\n2. `meta-ads-campaigns.meta-ads.deploy` uploads it. The upload runs in the background; follow it with `meta-ads-deployments.show`. The campaign, ad sets and ads get to Meta paused, so nothing is spent yet.\n3. `meta-ads-deployments.status` starts or pauses the campaign, one ad set or one ad.\n4. After you change the campaign in Fusio, `meta-ads-deployments.apply` uploads the changes. `meta-ads-deployments.live-settings.update` changes the budget or end date of a running campaign right away.\n5. `meta-ads-deployments.sync` reads the state from Meta again, and `meta-ads-deployments.reconcile` repairs a broken upload.\n\nEvery route that changes something in Meta needs the permission `ads.execute.facebook` for a key. Deleting a campaign that is already in Meta archives it there first, so it needs that permission too.\n\nCampaign answers list tips in `checks`. Tips never stop the approval. Each tip has one of these codes:\n- `audience_too_small`: The ad set audience is too small.\n- `ad_sets_overlap`: Two ad sets target the same people.\n- `manual_placements`: The placements are set by hand.\n- `campaign_budget_off`: Several ad sets have no shared campaign budget.\n- `learning_budget_low`: The budget may be too low for learning.\n- `too_few_ads`: The ad set has too few ads.\n- `duplicate_creatives`: Ads repeat the same picture or text.\n- `too_few_texts`: The ad has too few texts to try.\n- `missing_vertical_asset`: The ad has no tall picture for Stories and Reels.\n- `no_video_ad`: The ad set has no video ad.\n- `instagram_without_account`: Instagram ads run without an Instagram account.\n- `creative_enhancements_on`: Meta may change the ads by itself.\n- `lead_form_required_field_missing`: The Meta form lacks fields Fusio needs.\n- `conversion_goal_missing`: Fusio does not send this event to Meta.\n- `conversion_event_low_volume`: The event has too few conversions a week.\n- `value_without_value_data`: Purchases do not send a value yet.\n- `low_match_quality`: Meta matches few conversions to people.\n\nAI can build a whole campaign from your brief with `meta-ads-campaigns.generate`. It runs in the background; follow the job with `meta-ads-operations.show`. `meta-ads-campaigns.brief-picks` lets AI pick the goal and the page first, without saving anything.\n\nAI can also help with one part of a draft: targeting for an ad set (`meta-ads-ad-sets.targets.suggest`), new ads for an ad set (`meta-ads-ad-sets.ads.generate`), texts for an ad (`meta-ads-ads.texts.suggest`) and pictures for an ad (`meta-ads-ads.images.generate`). Suggestions are not saved; you add what you like yourself.\n\nAI work spends AI credits of your company and needs the permission `ai.generate` for a key. A key must also send `maxCredits`."},{"name":"ai","x-displayName":"AI","description":"AI writes articles, emails and social posts for you, and tells you what its work costs. Writing goes in two steps: clarify checks that AI knows enough, generate starts the job. Then you follow the job with `ai.generation-runs.show`.\n\nAI work spends AI credits of your company. A key must send `maxCredits` with every request that spends them."},{"name":"notes","x-displayName":"Notes","description":"A note is a short text a person writes on a lead. It keeps what was said or learned.\n\nA note can be added to a lead. A note on a deal needs the `deals.write` scope too, and a note on a lead contact needs `contacts.write`."},{"name":"tenant-intelligence","x-displayName":"Company knowledge","description":"Company knowledge is everything Fusio knows about your business in one place: your brand voice, product, competitors, customers, strategies, SEO and ads.\n\nAsk for it when an AI tool needs to know your company before it writes something."},{"name":"tenant-analysis","x-displayName":"Website analysis","description":"The website analysis reads your website with AI. From it, Fusio fills your product, brand voice, competitors, customers and strategy ideas.\n\nYou run it once at the start, and again when your website changes a lot."},{"name":"seo-audits","x-displayName":"SEO audits","description":"An SEO audit checks how well people find your website in Google. It lists problems with fixes, search words worth aiming for, and how you stand against competitors.\n\nAn audit can check more markets: other countries and languages. From its keyword sets you can make a Google Ads campaign."},{"name":"product","x-displayName":"Product","description":"Your product is what you sell, told for marketing: who it is for, what problem it solves, why it is better and how your customers talk about it.\n\nAI reads it every time it writes for you, so good answers here mean better texts and better lead scores."},{"name":"customers","x-displayName":"Customer profiles","description":"A customer profile describes one kind of customer: who they are, what troubles them, what they want and where you can reach them.\n\nAI writes texts and targets ads for these people."},{"name":"competitors","x-displayName":"Competitors","description":"Competitors are other companies your customers could pick instead of you. Write down where they are better and where you are.\n\nAI uses them to write texts that show why you are the better choice."},{"name":"strategies","x-displayName":"Strategies","description":"A strategy is a marketing idea for your business: what to do, why it fits, what it costs and what you can expect.\n\nSome strategies Fusio can run for you as a campaign; others are advice or a task to set up."},{"name":"brand-voices","x-displayName":"Brand voices","description":"A brand voice tells AI how your texts should sound: the tone, how hard they are to read, who speaks, and which phrases to use or avoid.\n\nYou can have more voices. The default one is used when you pick none."},{"name":"image-profiles","x-displayName":"Image style presets","description":"An image style preset tells AI how your pictures should look: the style, your sample pictures, your mascot and what to keep in mind.\n\nYou can pick a preset for each place where pictures go, like blog articles or Instagram posts."},{"name":"mascots","x-displayName":"Mascots","description":"A mascot is a character AI can draw into your pictures: its look, its personality, the places where it appears and its friends.\n\nLink a mascot to image style presets, at most 3 mascots per preset."}]}