title: Using Flask-Security as part of a REST API
body: <p>The <a href="https://pythonhosted.org/Flask-Security/features.html#json-ajax-support" rel="nofollow">Flask-Security docs</a> mention JSON/Ajax support for all of the important view endpoints. So it's possible to get all of the buit-in Flask-Security awesomeness by hitting the views with JSON objects. </p>
  
  <p>But, now I'm trying to use it as part of a RESTful API, and it's not working, because it needs a CSRF token, which is necessary for webpages, but not for APIs: </p>
  
  <pre><code>{
      "meta": {
          "code": 400
      },
      "response": {
          "errors": {
              "csrf_token": [
                  "CSRF token missing"
              ]
          }
      }
  }
  </code></pre>
  
  <p>What is the best way to get around this?</p>