# Create Configuration Source: https://docs.taidalos.com/api-reference/endpoint/media-searches-configuration/create-configuration POST /v1/media-searches/configuration/create-configuration # Get Configuration Source: https://docs.taidalos.com/api-reference/endpoint/media-searches-configuration/get-configuration GET /v1/media-searches/configuration/{media_search_configuration_id} # Get Configuration By Media Search ID Source: https://docs.taidalos.com/api-reference/endpoint/media-searches-configuration/get-configuration-by-media-search-id GET /v1/media-searches/configuration/by-media-search-id/{media_search_id} # Create Media Search Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/create-media-search POST /v1/media-searches/create-search # Delete Media Search Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/delete-media-search DELETE /v1/media-searches/{media_search_id} # Execute Media Search Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/execute-media-search POST /v1/media-searches/execute-media-search # Find Media Search Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/find-media-search GET /v1/media-searches/find # Get Media Search Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/get-media-search GET /v1/media-searches/{media_search_id} # Get Media Search Aggregate Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/get-media-search-aggregate GET /v1/media-searches/aggregate/{media_search_id} # Get Media Search Execution Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/get-media-search-execution GET /v1/media-searches/execution/{media_search_execution_id} # Get Media Search PDF Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/get-media-search-pdf GET /v1/media-searches/{media_search_id}/pdf # Override Article Risk Assessment Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/override-article-disposition POST /v1/media-search-articles/override-disposition # Override Summary Source: https://docs.taidalos.com/api-reference/endpoint/media-searches/override-summary POST /v1/media-search-summaries/override-summary # Create Configuration Source: https://docs.taidalos.com/api-reference/endpoint/sanctions-peps-watchlists-checks/create-configuration POST /v1/sanctions-peps-watchlists-checks/configuration/create-configuration # Delete Check Source: https://docs.taidalos.com/api-reference/endpoint/sanctions-peps-watchlists-checks/delete-check DELETE /v1/sanctions-peps-watchlists-checks/{sanctions_peps_watchlists_check_id} # Get Aggregate Source: https://docs.taidalos.com/api-reference/endpoint/sanctions-peps-watchlists-checks/get-aggregate GET /v1/sanctions-peps-watchlists-checks/aggregate/{sanctions_peps_watchlists_check_id} # Get Latest Sources Source: https://docs.taidalos.com/api-reference/endpoint/sanctions-peps-watchlists-checks/get-latest-sources GET /v1/sanctions-peps-watchlists-checks/sources/latest # Get PDF Source: https://docs.taidalos.com/api-reference/endpoint/sanctions-peps-watchlists-checks/get-pdf GET /v1/sanctions-peps-watchlists-checks/{sanctions_peps_watchlists_check_id}/pdf # Get Sources for Execution Source: https://docs.taidalos.com/api-reference/endpoint/sanctions-peps-watchlists-checks/get-sources-for-execution GET /v1/sanctions-peps-watchlists-checks/sources/{sanction_pep_watchlist_execution_id} # PEP Sources Source: https://docs.taidalos.com/api-reference/endpoint/sanctions-peps-watchlists-checks/introduction Where is the PEP data from? We automatically track and import global data on world leaders and national parliaments. Our coverage is constantly growing as we add more national-level datasets, including lists of state governors and parliamentarians. | Name | Publisher | Country | Updates | | ------------------------------------------------------------------------ | ---------------------------------------------- | --------------- | ------- | | Argentina Members of Parliament | HCDN | Argentina | daily | | Armenia Public Officials and Associates | Hetq Online (non-official) | Armenia | - | | Austria Public Officials | Meine Abgeordneten (non-official) | Austria | daily | | Austrian Members of Parliament | Austrian Parliament | Austria | monthly | | Brazil Politically Exposed Persons | CGU | Brazil | weekly | | Bulgaria Judiciary Asset Declarations | ИВСС | Bulgaria | weekly | | Canada Members of the House of Commons | House of Commons of Canada | Canada | monthly | | Canada Members of the Senate | Senate of Canada | Canada | monthly | | Cayman Islands Members of Parliament | Parliament of the Cayman Islands | Cayman Islands | daily | | Cayman Islands Senior Judicial Officers | Cayman Islands Judicial Administration | Cayman Islands | weekly | | China National People's Congress on Wikipedia | Wikipedia (non-official) | Global | - | | Colombian Joining the Dots PEPs | Directorio Legislativo/EITI (non-official) | Colombia | daily | | Colombian PEP Declarations | DAFP | Colombia | daily | | Croatia State Registry of Public Officials | Sukobu Interesa | Croatia | weekly | | Cuba Members of the Parliament | Proyecto Inventario (non-official) | Cuba | monthly | | Cyprus House of Representatives | Cyprus House of Representatives | Cyprus | monthly | | Denmark, Faroe Islands and Greenland PEPs | Finanstilsynet | Denmark | weekly | | Estonia Members of the Riigikogu | Riigikogu | Estonia | daily | | EU Prominent Public Functions | OJEU | European Union | - | | European Commitee of the Regions Members | CoR | European Union | weekly | | European Parliament Members | EP | European Union | weekly | | Finland Members of Parliament | Suomen eduskunta | Finland | monthly | | Foreign Representatives in Canada: Heads of Missions | Global Affairs Canada | Canada | weekly | | French Mayors | MIOM | France | weekly | | French National Assembly | National Assembly of France | France | weekly | | French Senators | Sénat | France | weekly | | Georgia Public Official Asset Declarations | ACB | Georgia | weekly | | German Legislators from AbgeordnetenWatch | Parlamentwatch e.V. (non-official) | Germany | daily | | Germany Members of the Bundesrat | German Bundesrat | Germany | monthly | | Germany Members of the Bundestag | German Bundestag | Germany | monthly | | Hellenic Parliament | Βουλή των Ελλήνων | Greece | monthly | | Hong Kong Legislative Council Members | Hong Kong Legislative Council | Hong Kong SAR | weekly | | Hong Kong Principal Officials | GovHK | Hong Kong SAR | weekly | | Hungary National Assembly | Országgyűlés | Hungary | monthly | | Iceland parliament | Alþingi | Iceland | daily | | India Lok and Rajya Sabha Members | Parliament of India | India | monthly | | Indonesia 2018 Regional Head Election Results | KPI | Indonesia | - | | Israel Knesset Members | Knesset | Israel | daily | | Italy Members of the Chamber of Deputies | Camera dei deputati | Italy | monthly | | Italy Members of the Senate | Senato della Repubblica | Italy | monthly | | Japanese House of Representatives Members | Shūgiin | Japan | monthly | | Latvian Saeima | Saeima | Latvia | weekly | | Lithuania Members of the Seimas | Seimas | Lithuania | weekly | | Lithuania PEPs from the register of private interests | VTEK | Lithuania | monthly | | Malta Members of Parliament | Parliament of Malta | Malta | monthly | | Mexico Chamber of Deputies | Cámara de Diputados | Mexico | weekly | | Mexico Governors | CONAGO (non-official) | Mexico | - | | Mexico Senate | Senado de La República | Mexico | weekly | | Montenegro declarations of interests by public officials | ACK | Montenegro | weekly | | MySociety's EveryPolitician Legislators | MySociety (non-official) | Global | - | | Netherlands House of Representatives | Tweede Kamer | Netherlands | weekly | | Netherlands Senate | Eerste Kamer | Netherlands | monthly | | Nigeria Joining the Dots PEPs and PEP Relatives | Directorio Legislativo/EITI (non-official) | Nigeria | daily | | Nigerian Politically Exposed Persons data by Chipper | Chipper (non-official) | Nigeria | daily | | North Macedonia Elected and Appointed Officials | SCPC | North Macedonia | weekly | | Norway Members of the Storting | Stortinget | Norway | monthly | | Norway State-Owned Enterprises Leadership | BRREG | Norway | monthly | | PEPs from Chile Interest and Asset Declarations | CPLT | Chile | daily | | Poland Members of the Sejm | Sejm of the Republic of Poland | Poland | monthly | | Poland Members of the Senate | Senate of Poland | Poland | monthly | | Romania FIU Public Officials | ONPCSB | Romania | weekly | | Singapore Government Directory | SGD | Singapore | weekly | | Slovakia Public Officials | NR SR | Slovakia | weekly | | Slovenian Political Officials from Zvezoskop | Oštro (non-official) | Slovenia | - | | South Africa Municipal Leadership | NT | South Africa | weekly | | South Africa National and Provincial Legislators | PMG (non-official) | South Africa | daily | | Spain Mayors and Councillors | MPT | Spain | weekly | | Spain Members of Parliament | Cortes Generales | Spain | weekly | | Sweden State-Owned Enterprises Leadership | Regeringskansliet | Sweden | - | | Swiss Federal Assembly | Parliamentary Services of the Federal Assembly | Switzerland | monthly | | Thailand Cabinet of Ministers | SOC | Thailand | daily | | Türkiye Grand National Assembly | TBMM | Türkiye | weekly | | UN Heads of State, Heads of Government and Ministers for Foreign Affairs | DGACM | - | monthly | | Uruguayan Politically Exposed Persons (PEP) | SENACLAFT | Uruguay | weekly | | US CIA World Leaders | CIA | United States | daily | | US Legislators by Plural (formerly OpenStates) | Plural (non-official) | United States | weekly | | US Members of the Congress | Congress | United States | daily | | US Navy Leadership | Navy | United States | daily | | US Periodically Listing Updates to Management (PLUM) Reporting | OPM | United States | daily | | US State Department Senior Officials | State | United States | weekly | | Venezuela Members of the National Assembly | Asamblea Nacional de Venezuela | Venezuela | weekly | | Wikidata Persons in Relevant Categories | Wikidata (non-official) | Global | daily | | Wikidata Politically Exposed Persons | Wikidata (non-official) | Global | daily | # New Check Source: https://docs.taidalos.com/api-reference/endpoint/sanctions-peps-watchlists-checks/new-check POST /v1/sanctions-peps-watchlists-checks/new-check # Create Subject Source: https://docs.taidalos.com/api-reference/endpoint/subjects/create-subject POST /v1/subjects/create-subject # Delete Subject Source: https://docs.taidalos.com/api-reference/endpoint/subjects/delete-subject DELETE /v1/subjects/{subject_id} # Get Subject Source: https://docs.taidalos.com/api-reference/endpoint/subjects/get-subject GET /v1/subjects/{subject_id} # Introduction Source: https://docs.taidalos.com/api-reference/introduction ## Welcome It's super easy to get started with the API. Create an account on [app.taidalos.com](https://app.taidalos.com) and get your API key. There is no credit card required, and you get 1,000 credits for free to get started. Go to [https://app.taidalos.com/integrations](https://app.taidalos.com/integrations) to create the API key after sign-up. ## Authentication Add the API key to the `Authorization` header. ```curl theme={null} --header 'Authorization: ' ``` ### Example ```curl theme={null} curl --request GET \ --url https://api.taidalos.com/v1/media-searches/{media_search_id} \ --header 'Authorization: ' ``` # Media Search API Source: https://docs.taidalos.com/tech/media-search-api-getting-started This guide provides a step-by-step tutorial on solving the adverse media screening challenge using a few simple APIs. APIs are tools that help software systems communicate with each other, allowing you to solve problems and automate tasks. This guide will walk you through using an API to streamline adverse media screening — checking for negative media coverage about individuals or organizations. ## Goal By the end of this guide, you’ll know how to set up and run media screenings via API and connect the results to your CRM system. ## 1. Explore the API documentation (optional) After you sign up, you can explore the API documentation (in the lower left-hand corner of the sidebar). You can also download the Open API Specifications and use them however you like. You can import them into Postman or a similar solution to make API calls from the convenience of a User Interface. Download Postman or insomnia here: [https://www.postman.com/downloads/](https://www.postman.com/downloads/) [https://insomnia.rest/download](https://insomnia.rest/download) ## 2. Let’s understand the objects ### `subject` A `subject` is the subject you want to investigate (e.g., do media research). This can be an individual or a legal entity. One subject can have multiple `media-searches`. ### `media-search-configuration` A `media-search-configuration` holds configuration data for `media-searches`. You can create one `media-search-configuration` object and reference this object for multiple `media-search`objects. ### `media-search` A `media-search` is the parent container for all `media-search-execution` objects for a given `subject`. To create a `media-search`, you need a `subject` and a `media-search-configuration` reference. ### `media-search-execution` You can create `media-searche` objects without executing them. One `media-search` object can have 0, 1, or multiple `media-search-execution` objects. This is handy for creating `media-search`es in bulk without immediate execution or having multiple `media-search-execution`s over time (monitoring). ## Steps By Step Guide to your first media search results ### 1. Sign Up Sign up at [https://taidalos.com](https://taidalos.com) (it’s free, no credit card required, enough free credits to play around with the application and API) ### 2. Create an API Key After you have signed up, go to “Integrations” and create a new API key by adding a meaningful description and click “Generate API Credentials”. Copy the key to a safe place. You will not be able to see the secret again. However, you can create a new secret anytime and delete the old one. Add the API key to the `header` for each request like so: `Authorization: Basic...` In Postman, you can go to the top level of the collection (Taidalos API Documentation), and go to “Authorization”. Select “API Key” as the Auth Type. Add “Authorization” as the key and the API Key you have created as the value. Set “Add to” to “Header” and click “Save”. ### 3. Create a subject You can create a `subject` with as much or as little information as you want or that is available to you. The only property that is required is the `name`. All information: * **Name (required)** * Internal ID * Aliases * Type (“INDIVIDUAL”, “LEGAL\_ENTITY”) * Date of Birth (for individuals) * Date of Incorporation (for Legal Entities) * Places * Industries * Nationalities A very simple request could look something like: ```bash theme={null} curl --location 'https://api.taidalos.com/v1/subjects/create-subject' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: ••••••' \ --data '{ "data": { "name": "Jan Marsalek" } }' ``` Or more complex ones like: ```bash theme={null} curl --location 'https://api.taidalos.com/v1/subjects/create-subject' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: ••••••' \ --data '{ "data": { "name": "Meta", "type": "LEGAL_ENTITY", "aliases": [ "Facebook", "Instagram" ], "places": [ { "description": "Head Quarter", "place": "1 Hacker Way, Menlo Park, CA 94025, US" }, { "description": "Office in Hamburg", "place": "Curienstraße 2, 20095 Hamburg" } ], "date_of_incorporation": "2004-01-04", "industries": [ "Software", "Communication" ], "internal_id": "crm_id#123456789" } }' ``` To start quickly, use the simple one and add more information, such as the internal\_id (which can be your system's CRM ID), to the payload. ### 4. Create a Search Configuration > **Update May 2025** Use `keyword_lists` instead of `keywords` to configure your keywords. That way you can cover > multiple languages. The property `keywords` is still supported for backward compatability. You only need to create one `media-search-configuration` that can be reused across multiple `media-search` objects. To start quickly, use the template below and save the `media_search_configuration_id` from the response. The below example uses two keyword lists to cover English and German media. Create a template in the UI to explore more languages and tailor the keywords to meet your risk appetite. ```bash theme={null} curl --location 'https://api.taidalos.com/v1/media-searches/configuration/create-configuration' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: ••••••' \ --data '{ "data": { "keyword_lists": [ { "name": "English Keywords", "keywords": [ "Arms Dealing", "Arrested", "Blackmail", "Bribe", "Child Labour", "Convicted", "Corrupt", "Counterfeiting", "Data Breach", "Drug Trafficking", "Embezzlement", "Espionage", "Exploitation", "Extortion", "Felony", "Fined", "Forced Labor", "Fraud", "Human Rights", "Human Trafficking", "Indicted", "Market Manipulation", "Misappropriation", "Money Laundering", "Organised Crime", "Piracy", "Pollution", "Ponzi", "Price Fixing", "Privacy Violation", "Racism", "Racketeering", "Sanction", "Scam", "Sentenced", "Shell Company", "Slavery", "Smuggling", "Steal", "Tax Evasion", "Terrorist", "Theft", "Wildlife Trafficking" ] }, { "name": "German Keywords", "keywords": [ "Angeklagt", "Ausbeutung", "Bestechung", "Betrug", "Briefkastenfirma", "Datenschutzverletzung", "Diebstahl", "Drogenhandel", "Erpressung", "Fälschung", "Geldstrafe", "Geldwäsche", "Kinderarbeit", "Korrupt", "Marktmanipulation", "Menschenhandel", "Menschenrechte", "Organisierte Kriminalität", "Piraterie", "Ponzi", "Preisabsprache", "Rassismus", "Sanktion", "Schmuggel", "Schwerverbrechen", "Sklaverei", "Spionage", "Stehlen", "Steuerhinterziehung", "Terrorist", "Umweltverschmutzung", "Unterschlagung", "Verhaftet", "Verletzung der Privatsphäre", "Veruntreuung", "Verurteilt", "Waffenhandel", "Wildtierhandel", "Zwangsarbeit" ] } ], "language": "en", "risk_categories": [ "Arms & Drugs & Human Trafficking", "Civil/Administrative Actions", "Corruption", "Criminal Proceedings", "Data & Privacy Violations", "Discrimination", "Environmental Crimes", "Extortion & Blackmail", "Fraud & Theft", "Human Rights Violations", "Money Laundering", "Organized Crime", "Other Financial Crimes", "Racketeering", "Sanctions", "Tax Crimes", "Terrorism" ] } }' ``` ### 4.1. Monitoring (Optional) > **Update** New feature since March 2025 Since March 2025, you can adjust the `media-search-configuration` to run searches periodically, ensuring you never miss new media. You can choose from daily, weekly, monthly, quarterly, or yearly monitoring. Simply add the monitoring object ```txt theme={null} "monitoring": { "interval": "WEEKLY", "is_active": true } ``` to the `media-search-configuration` request like this: ```bash theme={null} curl --location 'https://api.taidalos.com/v1/media-searches/configuration/create-configuration' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: ••••••' \ --data '{ "data": { "keyword_lists": [ { "name": "English Keywords", "keywords": [ "Arms Dealing", "Arrested", "Blackmail", "Bribe", "Child Labour", "Convicted", "Corrupt", "Counterfeiting", "Data Breach", "Drug Trafficking", "Embezzlement", "Espionage", "Exploitation", "Extortion", "Felony", "Fined", "Forced Labor", "Fraud", "Human Rights", "Human Trafficking", "Indicted", "Market Manipulation", "Misappropriation", "Money Laundering", "Organised Crime", "Piracy", "Pollution", "Ponzi", "Price Fixing", "Privacy Violation", "Racism", "Racketeering", "Sanction", "Scam", "Sentenced", "Shell Company", "Slavery", "Smuggling", "Steal", "Tax Evasion", "Terrorist", "Theft", "Wildlife Trafficking" ] }, { "name": "German Keywords", "keywords": [ "Angeklagt", "Ausbeutung", "Bestechung", "Betrug", "Briefkastenfirma", "Datenschutzverletzung", "Diebstahl", "Drogenhandel", "Erpressung", "Fälschung", "Geldstrafe", "Geldwäsche", "Kinderarbeit", "Korrupt", "Marktmanipulation", "Menschenhandel", "Menschenrechte", "Organisierte Kriminalität", "Piraterie", "Ponzi", "Preisabsprache", "Rassismus", "Sanktion", "Schmuggel", "Schwerverbrechen", "Sklaverei", "Spionage", "Stehlen", "Steuerhinterziehung", "Terrorist", "Umweltverschmutzung", "Unterschlagung", "Verhaftet", "Verletzung der Privatsphäre", "Veruntreuung", "Verurteilt", "Waffenhandel", "Wildtierhandel", "Zwangsarbeit" ] } ], "language": "en", "risk_categories": [ "Arms & Drugs & Human Trafficking", "Civil/Administrative Actions", "Corruption", "Criminal Proceedings", "Data & Privacy Violations", "Discrimination", "Environmental Crimes", "Extortion & Blackmail", "Fraud & Theft", "Human Rights Violations", "Money Laundering", "Organized Crime", "Other Financial Crimes", "Racketeering", "Sanctions", "Tax Crimes", "Terrorism" ], "monitoring": { "interval": "WEEKLY", "is_active": true } } }' ``` The property `is_active` needs to be set to `true`. The property `interval` can have the following values: * `DAILY` * `WEEKLY` * `MONTHLY` * `QUARTERLY` * `YEARLY` ### 5. Create a media search with immediate execution ```bash theme={null} curl --location 'https://api.taidalos.com/v1/media-searches/create-search' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: ••••••' \ --data '{ "data": { "execute_immediately": true, "media_search_configuration_id": "", "subject_id": "id from step 3" } }' ``` Make sure that `execute_immediately` is set to `true`. **DONE!** You can now go to the User Interface to see the media search (it might be in progress and not done yet). You can also send requests to ```bash theme={null} curl --location 'https://api.taidalos.com/v1/media-searches/aggregate/' \ --header 'Accept: application/json' \ --header 'Authorization: ••••••' ``` The summary and justification will be returned as Markdown. However, if you want, you can remove the Markdown tags and use plain text by setting the `remove_markdown` query parameter to `true`. This will remove all Markdown syntax except ordered and unordered list syntax, e.g., `-`, `1.`, `2.`, etc. To get the results via the API. You can also set up webhooks to listen to the completion of `media-search-exection`s. Let us know if you have any questions or if anything is unclear. We are happy to help! Contact us: [cs@taidalos.com](mailto:cs@taidalos.com) ## Next Steps Use webhooks to listen to the completion of`media-search-execution` s: [How to get started with the webhook?](https://taidalos.com/blog/webhook-get-started/) to handel load on scale. # Webhook Source: https://docs.taidalos.com/tech/webhook-getting-started This guide provides a step-by-step tutorial on how to use the webhook We need to process a lot of data before we can provide you with the full adverse media assessment. This can take a few moments. We also don't like to keep you or your client waiting. That's why we have designed our system to work asynchronously. One way to receive the search results is by polling the API every x seconds * [https://api.taidalos.com/v1/media-searches/execution/\{media\_search\_id}](https://api.taidalos.com/v1/media-searches/execution/\{media_search_id}) * [https://api.taidalos.com/v1/media-searches/aggregate/\{media\_search\_execution\_id}](https://api.taidalos.com/v1/media-searches/aggregate/\{media_search_execution_id}) > Warning: This works for prototyping and trying out the API. However, calling those endpoints in production can lead to > rate limiting issues. That's why we recommend using webhooks. We use Svix to handle the webhooks for you and us. Their focus is solely on webhook security and how to make them easy to use and effective 24/7 (like we do with adverse media). # What are webhooks? Webhooks are API calls to your server to inform you that a certain event has happened. The payload of an event contains information to take next steps (e.g., fetch data and save to a database, send an email, etc.). # Step-by-step ## 1. Set up a POST endpoint to receive webhooks On your server, set up a POST endpoint to receive webhook events. An example endpoint for your application could look like: `https://api.yourdomain.com/webhooks/taidalos`. Make sure that there is no authentication middleware before hitting the handler. Step 3 discusses how to secure your webhook. ## 2. Set up your webhook endpoint in Taidalos [Sign in](https://accounts.taidalos.com/sign-in) to or [create an account](https://accounts.taidalos.com/sign-up) if you have not already (no credit card required). Next, go to `Integrations` and create a new webhook referencing the endpoint you have created in step 1 and subscribe to the events you are interested in. taidalos-webhook-how-to-1.png taidalos-webhook-how-to-2.jpg ## 3. Process and verify incoming events First, get the secret from the webhook settings. taidalos-webhook-how-to-3.png Then you can verify the payload using the secret. You can find more details for this and other events in the Event Catalog# taidalos-webhook-how-to-4.png How you parse and process the data depends on your server language. This is an example of how to verify the request using Python and FastAPI. Other examples including JavaScript, Rust, Go, Java, Kotlin, Ruby, C#, PHP, cURL can be found here: [https://docs.svix.com/receiving/verifying-payloads/how](https://docs.svix.com/receiving/verifying-payloads/how) ```python theme={null} from fastapi import Request, Response, status from svix.webhooks import Webhook, WebhookVerificationError secret = "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw" @router.post("/webhook/", status_code=status.HTTP_204_NO_CONTENT) async def webhook_handler(request: Request, response: Response): headers = request.headers payload = await request.body() try: wh = Webhook(secret) msg = wh.verify(payload, headers) except WebhookVerificationError as e: response.status_code = status.HTTP_400_BAD_REQUEST return # Do something with the message... ``` ## 4. Process the event This is the event payload for the `media_search_execution.completed` event ```json theme={null} { "created_at": 1257894000000, "data": { "created_at": 1257893000000, "media_search_execution_id": "49f04997-d90b-4e32-8763-ac93ea1eb956", "media_search_id": "s8021a271-1110-4b03-b316-76ae48b09226", "subject_id": "ca6b1a40-3dc6-44f0-963f-8d19771b3f47" }, "id": "3faa193c-a203-4ed0-95b9-85e771d4eb39", "object": "event", "organisation_id": "8c7e6269-faa1-4388-8245-0930f19d4b5c", "type": "media_search_execution.completed" } ``` You can now be sure that the media\_search\_execution has been completed. This means that calling * GET [https://api.taidalos.com/v1/media-searches/aggregate/\{media\_search\_execution\_id}](https://api.taidalos.com/v1/media-searches/aggregate/\{media_search_execution_id}) * will return the results for the media search execution * GET [https://api.taidalos.com/v1/media-searches/execution/\{media\_search\_id}](https://api.taidalos.com/v1/media-searches/execution/\{media_search_id}) * will return the results for the entire media search (including the execution). You can then process the results and save them to your database. Any questions or feedback? Please reach out to me at [julius.moeller@taidalos.com](mailto:julius.moeller@taidalos.com).