{"id":38596,"date":"2024-02-14T17:21:51","date_gmt":"2024-02-14T16:21:51","guid":{"rendered":"https:\/\/churchtools.academy\/help\/non-knowledgebase\/uncategorized\/cors\/"},"modified":"2026-02-09T12:40:13","modified_gmt":"2026-02-09T11:40:13","password":"","slug":"cors","status":"publish","type":"docs","link":"https:\/\/churchtools.academy\/en\/help\/system-settings\/api\/cors\/","title":{"rendered":"CORS"},"content":{"rendered":"\n<p>CORS stands for Cross-Origin Resource Sharing<a class=\"external\" href=\"https:\/\/developer.mozilla.org\/de\/docs\/Web\/HTTP\/CORS\" target=\"_blank\" rel=\"noopener\">(MDN<\/a>). This is a security policy that is built into browsers to protect the user. In simple terms, this means that a website cannot simply (re)load external resources that do not belong to its own domain or are explicitly permitted.  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Example<\/strong><\/h2>\n\n\n\n<p>Your own congregation website is available at <code>https:\/\/my-church-website.uk\/ <\/code>. All resources, CSS, JS or images are delivered from this domain. In other words, the header image, for example, can be viewed via the URL <code>https:\/\/my-church-website.uk\/header.jpg<\/code>. In this case, the browser allows the header image to be loaded because the domain is the same.<\/p>\n\n\n\n<p>If the website attempts to load data from ChurchTools, e.g. to display the pastor&#8217;s contact details, the API <code>https:\/\/my-congregation.church.tools\/api\/persons\/1<\/code> must be called. There are two scenarios that need to be distinguished here:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Backend call<\/h3>\n\n\n\n<p>If your congregation website retrieves the contact data via the ChurchTools API using your own server (PHP, NodeJS, etc.), there are no problems. The call is declared as secure because it is your own server and nobody else has access to it. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Front-end call<\/h3>\n\n\n\n<p>If the ChurchTools API is called via the frontend (Vanilla JS, jQuery, Angular, Vue or using HTML tags), the browser checks whether loading is permitted. The browser does this so that the user does not load third-party content that an attacker may have planted on them. The browser therefore asks ChurchTools whether your website with the domain <code>meine-gemeinde-website.de<\/code> has permission to load this data.  <\/p>\n\n\n\n<p>This is not allowed by default. This means that the API call will fail and no data will reach the website. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Set CORS header<\/h2>\n\n\n\n<p>In order for the API call to succeed via the frontend, ChurchTools must send certain CORS headers in the response, which explicitly list all websites that are allowed to execute this call.<\/p>\n\n\n\n<p>You can set and manage the permitted URLs, also known as Access Control Allow Origins (4), in the system settings (1) under <em>Integrations <\/em>(2)<em> &gt; Cross-Origin Resource Sharing<\/em> (3).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/churchtools.academy\/wp-content\/uploads\/2024\/02\/Cross-origin-ressource-sharing-CleanShot-2025-08-21-at-11.00.40@2x-scaled.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"414\" src=\"https:\/\/churchtools.academy\/wp-content\/uploads\/2024\/02\/Cross-origin-ressource-sharing-CleanShot-2025-08-21-at-11.00.40@2x-1024x414.png\" alt=\"System settings - Integration - Cross-Origin Ressource Sharing\" class=\"wp-image-38608\" srcset=\"https:\/\/churchtools.academy\/wp-content\/uploads\/2024\/02\/Cross-origin-ressource-sharing-CleanShot-2025-08-21-at-11.00.40@2x-1024x414.png 1024w, https:\/\/churchtools.academy\/wp-content\/uploads\/2024\/02\/Cross-origin-ressource-sharing-CleanShot-2025-08-21-at-11.00.40@2x-300x121.png 300w, https:\/\/churchtools.academy\/wp-content\/uploads\/2024\/02\/Cross-origin-ressource-sharing-CleanShot-2025-08-21-at-11.00.40@2x-768x311.png 768w, https:\/\/churchtools.academy\/wp-content\/uploads\/2024\/02\/Cross-origin-ressource-sharing-CleanShot-2025-08-21-at-11.00.40@2x-1536x621.png 1536w, https:\/\/churchtools.academy\/wp-content\/uploads\/2024\/02\/Cross-origin-ressource-sharing-CleanShot-2025-08-21-at-11.00.40@2x-2048x828.png 2048w, https:\/\/churchtools.academy\/wp-content\/uploads\/2024\/02\/Cross-origin-ressource-sharing-CleanShot-2025-08-21-at-11.00.40@2x-360x146.png 360w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<aside class=\"wp-block-group ct-artikel-zum-weiterlesen has-background is-layout-constrained wp-container-core-group-is-layout-89fd719a wp-block-group-is-layout-constrained\" style=\"border-radius:8px;background-color:#f9fafb;margin-top:24px;margin-bottom:24px;padding-top:32px;padding-right:24px;padding-bottom:32px;padding-left:24px\">\n<h2 class=\"wp-block-heading has-medium-font-size\">Article to read more<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/churchtools.academy\/en\/help\/system-settings\/api-en\/overview-api\/\" data-type=\"docs\" data-id=\"7251\">Overview API<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/churchtools.academy\/de\/help\/system-settings\/api\/0-api-dokumentation\/\" data-type=\"docs\" data-id=\"7253\">API documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/churchtools.academy\/de\/help\/system-settings\/api\/0-api-authentifizierung\/\" data-type=\"docs\" data-id=\"7252\">API authentication<\/a><\/li>\n<\/ul>\n<\/aside>\n","protected":false},"excerpt":{"rendered":"<p>CORS stands for Cross-Origin Resource Sharing(MDN). This is a security policy that is built into browsers to protect the user. In simple terms, this means that a website cannot simply (re)load external resources that do not belong to its own domain or are explicitly permitted. Example Your own congregation website is available at https:\/\/my-church-website.uk\/ . [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"doc_category":[461,461],"doc_tag":[653],"knowledge_base":[425],"class_list":{"0":"post-38596","1":"docs","2":"type-docs","3":"status-publish","4":"hentry","5":"doc_category-api-en","7":"doc_tag-content-outdated-en","8":"knowledge_base-system-settings"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"year_month":"2026-04","word_count":346,"total_views":"1425","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Victoria Weidemann","author_nicename":"vweidemann","author_url":"https:\/\/churchtools.academy\/en\/author\/vweidemann\/"},"doc_category_info":[{"term_name":"API","term_url":"https:\/\/churchtools.academy\/en\/help\/system-settings\/api-en\/"},{"term_name":"API","term_url":"https:\/\/churchtools.academy\/en\/help\/system-settings\/api-en\/"}],"doc_tag_info":[{"term_name":"Content outdated","term_url":"https:\/\/churchtools.academy\/en\/docs-tag\/content-outdated-en\/"}],"knowledge_base_info":[{"term_name":"System Settings","term_url":"https:\/\/churchtools.academy\/en\/help\/system-settings\/","term_slug":"system-settings"}],"knowledge_base_slug":["system-settings"],"_links":{"self":[{"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/docs\/38596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/comments?post=38596"}],"version-history":[{"count":10,"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/docs\/38596\/revisions"}],"predecessor-version":[{"id":48065,"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/docs\/38596\/revisions\/48065"}],"wp:attachment":[{"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/media?parent=38596"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/doc_category?post=38596"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/doc_tag?post=38596"},{"taxonomy":"knowledge_base","embeddable":true,"href":"https:\/\/churchtools.academy\/en\/wp-json\/wp\/v2\/knowledge_base?post=38596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}