{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Migrate from API V1 to V2"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"migrate-from-api-v1-to-v2","__idx":0},"children":["Migrate from API V1 to V2"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide explains how to move an existing AdFlex API integration from V1 to V2."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["V2 keeps the standard response envelope used by V1, but it changes endpoint paths, authentication, filter metadata, sorting, search-result fields, and ad-detail responses. Do not migrate by changing only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v1"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v2"]}," in the URL."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"migration-overview","__idx":1},"children":["Migration overview"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Area"},"children":["Area"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V1"},"children":["V1"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V2"},"children":["V2"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required action"},"children":["Required action"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Base URL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.adflex.io/api/v1"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.adflex.io/api"]}," with routes beginning with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v2"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Update every route using the endpoint map below"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Authentication"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API key sent in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-api-key"]}," header or as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_key"]}," in the query string or request body"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Formal contract uses the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-api-key"]}," header"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Keep or move the key to the request header"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Filter routes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Separate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/filters"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/filter"]}," route patterns"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["All filter routes are under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v2/ads/{platform}/filters"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Update filter discovery and filter-item requests"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Filter metadata"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Component settings nested under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["component_data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Component settings are flattened onto each filter"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Update dynamic-filter parsing"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sorting"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A single ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orderby"]}," string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["advanced_order"]}," object containing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orderby"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Map the old sorting value to the new structure"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Search results"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Platform-specific fields"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Normalized cards using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["platform"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["stats"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metadata"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Update search-result models and UI mapping"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ad details"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ad data nested under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Structured sections directly under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Replace the V1 detail-response parser"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Pagination"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_hit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Snapshot pagination with stricter ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_hit"]}," handling"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Preserve the original page-one ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_hit"]}," value"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Errors"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Application codes in the response body"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP status is always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},"; application result remains in the response body"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["meta.code"]}," for every response"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Aggregated search"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not available"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mega"]}," searches across platforms"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use the source platform for detail requests"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"1-update-authentication","__idx":2},"children":["1. Update authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For V2, send your API key in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-api-key"]}," header on every request:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"x-api-key: YOUR_API_KEY\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do not place API keys in URLs, logs, analytics events, or client-side code. If your current key is not enabled for V2, contact AdFlex support before continuing the migration."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"v1","__idx":3},"children":["V1"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"GET /api/v1/filters/facebook/search?api_key=YOUR_API_KEY\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"v2","__idx":4},"children":["V2"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"GET /api/v2/ads/facebook/filters\nx-api-key: YOUR_API_KEY\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Although compatibility authentication methods may be accepted, the V2 OpenAPI contract uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-api-key"]},". New and migrated integrations should use the header."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"2-update-endpoint-paths","__idx":5},"children":["2. Update endpoint paths"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following patterns apply to all individual platform values:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["facebook"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["meta"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["native"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["display"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pinterest"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reddit"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tiktok"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youtube"]}]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Operation"},"children":["Operation"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V1"},"children":["V1"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V2"},"children":["V2"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Get filters"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /api/v1/filters/{platform}/search"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /api/v2/ads/{platform}/filters"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Get dynamic filter items"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /api/v1/{platform}/filter/{filter}/items"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /api/v2/ads/{platform}/filters/{filter}"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Search ads"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /api/v1/{platform}/ads/search"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /api/v2/ads/{platform}/search"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Get ad details"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /api/v1/{platform}/ads/{ad}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /api/v2/ads/{platform}/{ad}"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The complete V2 request URL is the base URL plus the V2 route. For example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"https://api.adflex.io/api/v2/ads/facebook/search\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"dynamic-filter-items","__idx":6},"children":["Dynamic filter items"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Only call a dynamic filter-item route when the filter response provides an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_url"]},". Send the search term as a query parameter:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --get 'https://api.adflex.io/api/v2/ads/facebook/filters/interests' \\\n  --header 'x-api-key: YOUR_API_KEY' \\\n  --data-urlencode 'search=shopping'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The V1 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ids"]}," query parameter is not part of the V2 public contract. Remove it from migrated requests unless AdFlex has confirmed a separate compatibility requirement for your account."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"3-update-filter-response-parsing","__idx":7},"children":["3. Update filter-response parsing"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["V1 places most component settings inside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["component_data"]},". V2 places the applicable settings directly on each filter and omits fields that do not apply."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"v1-filter-object","__idx":8},"children":["V1 filter object"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"key\": \"interests\",\n  \"component\": \"StringMultiApi\",\n  \"component_data\": {\n    \"api_url\": \"v1/facebook/filter/interests/items\",\n    \"items\": [],\n    \"min\": null,\n    \"max\": null\n  },\n  \"resettable\": true\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"v2-filter-object","__idx":9},"children":["V2 filter object"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"key\": \"interests\",\n  \"component\": \"StringMultiApi\",\n  \"api_url\": \"v2/ads/facebook/filters/interests\",\n  \"items\": [],\n  \"default\": []\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Update your parser as follows:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V1 location"},"children":["V1 location"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V2 location or behavior"},"children":["V2 location or behavior"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["component_data.api_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_url"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["component_data.items"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["items"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["component_data.min"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["min"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["component_data.max"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["max"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["component_data.infinite_sign"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["infinite_sign"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["component_data.action"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["action_data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not part of the V2 public filter schema"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["relations"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not part of the V2 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FilterGroup"]}," schema"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resettable"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not part of the V2 public filter schema"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["disabled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not part of the V2 public filter schema"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No equivalent"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["disable_other"]},", when applicable"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do not assume that optional fields exist or contain ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},". V2 generally omits fields that are not applicable."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fetch the V2 filter definition for each platform during migration. Do not build a V2 request by copying cached V1 filter metadata."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"4-update-search-requests","__idx":10},"children":["4. Update search requests"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"authentication-field","__idx":11},"children":["Authentication field"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Remove ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_key"]}," from the JSON request body and send it in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-api-key"]}," header."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"sorting","__idx":12},"children":["Sorting"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Replace the V1 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orderby"]}," string with the V2 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["advanced_order"]}," object:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"advanced_order\": {\n    \"orderby\": \"newest\",\n    \"order\": \"desc\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the following mapping when converting existing saved searches:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V1 orderby"},"children":["V1 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orderby"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V2 advanced_order"},"children":["V2 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["advanced_order"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["updated_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"orderby\": \"newest\", \"order\": \"desc\" }"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["oldest"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"orderby\": \"newest\", \"order\": \"asc\" }"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["popularity"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"orderby\": \"engagement\", \"order\": \"desc\" }"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["most_relevant"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"orderby\": \"relevancy\", \"order\": \"desc\" }"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["seen_counts"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"orderby\": \"ad_impressions\", \"order\": \"desc\" }"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["impressions"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"orderby\": \"ad_impressions\", \"order\": \"desc\" }"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["days_active"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"orderby\": \"days_running\", \"order\": \"desc\" }"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["running_longest"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"orderby\": \"days_running\", \"order\": \"desc\" }"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain.traffic"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"orderby\": \"web_traffic\", \"order\": \"desc\" }"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Not every sort option is available for every platform. Before sending a saved sort, confirm that its V2 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orderby"]}," value appears in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["advanced_order.items"]}," array returned by that platform's filter endpoint. If it is unavailable, use the platform's default sort."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"search-example","__idx":13},"children":["Search example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --request POST 'https://api.adflex.io/api/v2/ads/facebook/search' \\\n  --header 'Content-Type: application/json' \\\n  --header 'x-api-key: YOUR_API_KEY' \\\n  --data '{\n    \"page\": 1,\n    \"advanced_order\": {\n      \"orderby\": \"newest\",\n      \"order\": \"desc\"\n    },\n    \"target_age\": [18, 65],\n    \"gender\": [9886],\n    \"interests\": [10, 4],\n    \"search_field\": [\n      { \"type\": \"text\", \"text\": \"PlayStation\" },\n      { \"type\": \"without_owner\", \"text\": \"MSI\" }\n    ]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Most platform-specific filter keys remain recognizable, but use the V2 filter endpoint as the source of truth for accepted keys, values, defaults, and component types."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"5-update-pagination","__idx":14},"children":["5. Update pagination"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["V2 search responses return up to 18 ads per page. The page size is fixed."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the first page:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Omit ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_hit"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Store the returned ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.last_hit"]}," value."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the second and later pages:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Increment ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Send the exact ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.last_hit"]}," value returned by the first-page response."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Keep all filters and sorting options unchanged."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Continue while ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.has_next_page"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"page\": 2,\n  \"last_hit\": 1786180640,\n  \"advanced_order\": {\n    \"orderby\": \"newest\",\n    \"order\": \"desc\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do not generate, increment, or otherwise modify ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_hit"]},". If any filter or sorting option changes, restart at page 1 and omit the previous value. V2 does not impose an expiry time or maximum page depth for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_hit"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"6-update-search-response-models","__idx":15},"children":["6. Update search-response models"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The outer response envelope remains the same:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": \"ok\",\n  \"meta\": {\n    \"code\": 1000,\n    \"message\": null\n  },\n  \"data\": {}\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Search pagination also remains under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.ads"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.current_page"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.has_next_page"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.last_hit"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The objects inside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.ads"]}," have been normalized in V2. Update any serializer, database mapper, UI component, or export job that reads V1 search fields."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V1 search field"},"children":["V1 search field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V2 replacement or behavior"},"children":["V2 replacement or behavior"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No common field"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["platform"]}," identifies the result's source platform"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["display_site_url"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["display_url"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["display_url"]},", when available for the platform"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["updated_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_seen"]},", a display-oriented relative value such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["10 minutes ago"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["active_days"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Usually represented in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metadata"]},"; exact values are available in the detail response under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["impression.days_running"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["engagements"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["stats"]},", when available"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["views"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["seen_counts"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["impressions"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["stats"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metadata"]},", depending on the platform and metric"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["locations"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["placements"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metadata"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["is_active"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["active"]}," in Meta search results"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["attachments[].files.main"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["attachments[].url"]}," for image and video platforms"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["attachments[].files.thumbnail"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["attachments[].thumbnail"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["attachments[].files.youtube_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["attachments[].youtube_id"]}," for YouTube"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The V2 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["stats"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metadata"]}," fields are arrays of display-ready label-and-value entries. Do not depend on array order, and allow entries to be absent when a metric does not apply to a platform."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If your application needs an exact last-seen timestamp, do not parse the relative ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_seen"]}," search value. Request the ad details and use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.impression.last_seen_at"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Owner and attachment objects are also normalized. For example, Native and Display owner objects now use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["avatar_url"]}," instead of the V1 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["title"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["icon"]}," combination. Update platform-specific owner adapters rather than assuming that every V1 owner field is preserved."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"7-replace-the-ad-detail-parser","__idx":16},"children":["7. Replace the ad-detail parser"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The V2 detail response is a structural redesign."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"v1-structure","__idx":17},"children":["V1 structure"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"data\": {\n      \"ad\": {},\n      \"durations\": [],\n      \"url_chains\": [],\n      \"domain\": {},\n      \"technologies\": []\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"v2-structure","__idx":18},"children":["V2 structure"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"id\": 100,\n    \"post_url\": \"https://example.com/ad\",\n    \"card\": {},\n    \"impression\": {},\n    \"targeting_detail\": {},\n    \"engagement_data\": {},\n    \"url_chain\": [],\n    \"domain\": {}\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The exact sections vary by platform. Use optional fields and platform-specific models."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V1 detail location"},"children":["V1 detail location"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V2 location"},"children":["V2 location"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.id"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.ad_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.post_url"]},", when available"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.title"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.card.title"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.cta"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.card.cta"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.is_bookmarked"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.card.is_bookmarked"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.owner"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.card.owner"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.attachments"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.card.attachments"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.impressions"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.impression.total"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.active_days"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.impression.days_running"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.first_seen_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.impression.first_seen_at"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.last_seen_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.impression.last_seen_at"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Targeting fields on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.targeting_detail.cards"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.targeting_detail.tabs"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad.engagements"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.engagement_data"]},", when available"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.url_chains"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.url_chain"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.domain"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.domain"]},", using the new domain schema"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.technologies"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No equivalent top-level field in the V2 public contract"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The V2 domain object also changes:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V1 domain field"},"children":["V1 domain field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"V2 domain field"},"children":["V2 domain field"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["monthly_traffic"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["monthly_visit"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["daily_traffic"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No direct equivalent"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain_created_at"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain_updated_at"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain_expires_at"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No direct equivalent in the V2 public contract"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No direct V1 equivalent"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["age"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timeline"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do not make ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["engagement_data"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["publishers"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["impression_data"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["impression_breakdown"]}," mandatory in a shared model. These sections are platform-specific."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"8-handle-errors-using-the-response-body","__idx":19},"children":["8. Handle errors using the response body"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["V2 returns HTTP ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]}," for successful and failed application responses. A transport-level success does not mean that the API operation succeeded."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A successful response normally contains:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": \"ok\",\n  \"meta\": {\n    \"code\": 1000,\n    \"message\": null\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A failed response can contain:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": \"failed\",\n  \"meta\": {\n    \"code\": 1009,\n    \"message\": \"Server Error\"\n  },\n  \"data\": []\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treat a response as successful only when both conditions are true:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ok"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["meta.code"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1000"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Handle unknown non-",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1000"]}," codes safely instead of assuming that the documented list is exhaustive. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://doc.adflex.io/response_codes"},"children":["API Response Codes"]}," for the current code list."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"9-review-credits-and-retries","__idx":20},"children":["9. Review credits and retries"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["V2 credit usage is request-based:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Endpoint"},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"right","data-label":"Cost"},"children":["Cost"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Get filters"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["Free"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Get dynamic filter items"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["Free"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Search ads"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["100 credits"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Get ad details"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"right"},"children":["100 credits"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The number of results in a response does not change the cost."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["V2 has no predefined per-second or per-minute rate limit. Retry only connection errors, timeouts, or temporary server failures. Use exponential backoff with jitter and stop after three attempts. Do not retry validation, authentication, permission, or not-found failures."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every retry is another API request and can consume credits when the endpoint is not free. Include retry traffic and parallel V1/V2 testing in your migration credit estimate."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"10-use-mega-search-when-appropriate","__idx":21},"children":["10. Use Mega search when appropriate"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["V2 adds ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mega"]}," as an aggregated search source:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"GET /api/v2/ads/mega/filters\nPOST /api/v2/ads/mega/search\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mega results include a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["platform"]}," value. Mega does not provide a detail endpoint. To retrieve details, use the result's source platform and ad ID:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Search result: platform = facebook, id = 123\nDetail route: GET /api/v2/ads/facebook/123\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following route does not exist:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"GET /api/v2/ads/mega/{ad}\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"recommended-cutover-process","__idx":22},"children":["Recommended cutover process"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Inventory every V1 endpoint, platform, filter, sort, response field, export, and background job used by your integration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add a separate V2 client or version-specific adapter. Keep the working V1 client unchanged during validation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Move authentication to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-api-key"]}," header and verify the key against a free V2 filter request."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replace all endpoint paths using the mapping in this guide."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Fetch fresh V2 filter metadata and update the filter parser for flattened fields and omitted optional values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Convert saved V1 sorts to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["advanced_order"]}," and fall back when a platform does not support the requested sort."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Update search-result and detail-response models. Keep platform-specific sections optional."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Implement V2 snapshot pagination and response-body error handling."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Test filters, page-one search, later pages, ad details, failures, and credit behavior for every platform you use."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Run a limited parallel comparison between V1 and V2. Exact result order and counts may change as live data is collected, so validate structure and business behavior rather than requiring byte-for-byte equality."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Roll out V2 behind a feature flag or gradual traffic split, monitor failures and credit consumption, and keep a tested V1 rollback path during the cutover window."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["After V2 is stable, remove V1-specific routes, request fields, parsers, and any API keys stored in query strings or request bodies."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"migration-verification-checklist","__idx":23},"children":["Migration verification checklist"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Every request uses an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/v2/ads/..."]}," route."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," The API key is sent in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-api-key"]}," header."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," API keys are absent from URLs, request bodies, logs, and analytics."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Dynamic filter parsing no longer depends on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["component_data"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Optional filter fields may be omitted instead of set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Saved ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orderby"]}," values are converted to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["advanced_order"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Each sort is checked against the selected platform's V2 filter response."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Page 1 omits ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_hit"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Later pages reuse the original page-one ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_hit"]}," without modifying it."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Search-card parsing supports ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["platform"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["stats"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metadata"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Exact timestamps come from the detail response, not the relative search value."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Detail parsing starts at ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},", not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.data.ad"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Platform-specific detail sections are optional."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Application success requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status = ok"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["meta.code = 1000"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Failed application responses are handled even when HTTP status is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Search, detail, and retry traffic is included in credit monitoring."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," Mega detail requests use the source platform rather than ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mega"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," V2 has been tested for every platform used in production."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"input","attributes":{"checked":false,"type":"checkbox","readOnly":true},"children":[]}," A rollback path remains available until the V2 rollout is complete."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-documentation","__idx":24},"children":["Related documentation"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://doc.adflex.io/guide"},"children":["Quick Start Guide"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://doc.adflex.io/response_codes"},"children":["API Response Codes"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://doc.adflex.io/openapi"},"children":["OpenAPI Documentation"]}]}]}]},"headings":[{"value":"Migrate from API V1 to V2","id":"migrate-from-api-v1-to-v2","depth":1},{"value":"Migration overview","id":"migration-overview","depth":2},{"value":"1. Update authentication","id":"1-update-authentication","depth":2},{"value":"V1","id":"v1","depth":3},{"value":"V2","id":"v2","depth":3},{"value":"2. Update endpoint paths","id":"2-update-endpoint-paths","depth":2},{"value":"Dynamic filter items","id":"dynamic-filter-items","depth":3},{"value":"3. Update filter-response parsing","id":"3-update-filter-response-parsing","depth":2},{"value":"V1 filter object","id":"v1-filter-object","depth":3},{"value":"V2 filter object","id":"v2-filter-object","depth":3},{"value":"4. Update search requests","id":"4-update-search-requests","depth":2},{"value":"Authentication field","id":"authentication-field","depth":3},{"value":"Sorting","id":"sorting","depth":3},{"value":"Search example","id":"search-example","depth":3},{"value":"5. Update pagination","id":"5-update-pagination","depth":2},{"value":"6. Update search-response models","id":"6-update-search-response-models","depth":2},{"value":"7. Replace the ad-detail parser","id":"7-replace-the-ad-detail-parser","depth":2},{"value":"V1 structure","id":"v1-structure","depth":3},{"value":"V2 structure","id":"v2-structure","depth":3},{"value":"8. Handle errors using the response body","id":"8-handle-errors-using-the-response-body","depth":2},{"value":"9. Review credits and retries","id":"9-review-credits-and-retries","depth":2},{"value":"10. Use Mega search when appropriate","id":"10-use-mega-search-when-appropriate","depth":2},{"value":"Recommended cutover process","id":"recommended-cutover-process","depth":2},{"value":"Migration verification checklist","id":"migration-verification-checklist","depth":2},{"value":"Related documentation","id":"related-documentation","depth":2}],"frontmatter":{"seo":{"title":"Migrate from API V1 to V2"}},"lastModified":"2026-08-19T15:12:20.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/migration_guide","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}