Location Permits ---------------- This API allows listing, retrieving, creating, updating, and deleting of Location Permits, as well as associating them to locations and users. Permits required for a location can be set via the ``/location`` endpoint, as described in :ref:`associate-permit-to-location`. Location Permits held by users can be set via the ``/user`` endpoint, described in :ref:`associate-location-permit-to-user`. .. warning:: The endpoints described in this page are only accessible if the ``location_access_permits`` toggle has been enabled. List Location Permits ..................... .. http:get:: /permit/ List all permits. **Sample request**: .. sourcecode:: http GET /permit/ HTTP/1.1 Host: api.fieldaware.net Authorization: Token 9dcae3660ec84eac94bb506e09a9af40 Accept: application/json **Sample response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json { "count": 100, "items": [ { "name": "Safety Permit", "uuid": "d6d22438096503fe72a7c161201c9373", "archived": false, }, { "name": "Police vetting", "uuid": "28a01f359aabafb4ff28347bddd9a24f", "archived": false, }, { "name": "Security Certification", "uuid": "6a360274f3fa2e224e17ba9ece3f4b0a" "archived": true, } ], "page": 0, "pageSize": 3, "sortedBy": [] } :query sortedBy: Available sorting criteria: ``name`` :query name: A filtering value for permit name :query archived: filtered by ``archived`` Get Location Permit ................... .. http:get:: /permit/(permit_ref) Retrieve a given Location Permit. **Sample request**: .. sourcecode:: http GET /permit/d6d22438096503fe72a7c161201c9373 HTTP/1.1 Host: api.fieldaware.net Authorization: Token 9dcae3660ec84eac94bb506e09a9af40 Accept: application/json **Sample response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json { "name": "Security Certification", "uuid": "d6d22438096503fe72a7c161201c9373"., "archived": false } Create Location Permit ...................... .. http:post:: /permit/ Create a new Location Permit. **Sample request**: .. sourcecode:: http POST /permit/ HTTP/1.1 Host: api.fieldaware.net Authorization: Token 9dcae3660ec84eac94bb506e09a9af40 Accept: application/json { "name": "A new Location Permit" } :