In general, APIs are used for cross-site site requests. Therefore, your CSRF protection is pointless.
If you are not going to use a cross site, most likely the API is not the optimal solution for what you are trying to do. In any case, you can create an API endpoint that returns a token.
public function getToken(){ return Response::json(['token'=>csrf_token()]); }
If you want to disable CSRF protection for some methods , you can use except or only .
$this->beforeFilter('csrf', array('on' => 'post', 'except'=>array('methodName', 'anotherMethod') ));
Refer to the official Laravel documentation .
source share