> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pingintel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Source Access Policy

> Returns the effective source access policy for a user or organization. The policy has two facets:

1. **`allowlist`** — which sources may be called at all. `mode` is `restricted` (only the listed `sources` are callable) or `unrestricted` (no gate). For user-scope queries the allowlist cascades: `User.allowed_sources` wins if set, otherwise `Organization.allowed_sources` applies; `source` tells you which level the allowlist came from.

2. **`sources`** — per-source quota state. Only sources with at least one cap appear here. For user-scope queries, caps stack: when both user and org cap a source, the **lower** cap wins per window. Windows are calendar-aligned in UTC: `daily` since 00:00 UTC today; `monthly` since 00:00 UTC on the 1st of the current month.

To decide if `N` locations of source `X` may be called: (1) if `allowlist.mode == 'restricted'` and `X` not in `allowlist.sources`, denied; (2) if `sources[X].remaining[window] < N` for any window, denied; otherwise allowed.



## OpenAPI

````yaml https://data-api-staging.sovfixer.com/api/schema/?format=json get /api/v1/limits
openapi: 3.0.3
info:
  title: Ping.Data API
  version: v1.0
  description: >
    ### Ping.Data API


    This API provides convenient, efficient access to bulk location data from
    many sources.


    The typical usage flow is:


    * POST to `/api/v1/bulk_enhance`.  The POST body should look like this:

    ``` {
        "locations": [
            {
                "id": "user-id1",
                "address": "1212 Ping Data Lane, Pingville, FL",
                "sources": ["PG", "PH"],
                ...
            },
            ...
        ],
        "timeout": 60.0,
    }

    ```


    * Poll GET `/api/v1/bulk_enhance/{id}`, passing the `id` given by the
    previous response until `response.request.status` is `COMPLETE` or `FAILED`.

    * Download the  data as JSON from `/api/v1/sov/{id}/output/{filename}`. The
    exact url comes from the response to the above query, in
    `response.result.outputs[].url`.


    Output JSON Example:

    ```

    {
      "user-id1": {
        "GG": {
          "is_success": true,
          "error_message": null,
          "confidence": 80,
          "status_code": 200,
          "fetch_time": 4.754,
          "street_number": "1212",
          "route": "Ping Data Ln",
          "location_type": "ROOFTOP",
          "latitude": 28.xxx,
          "longitude": -81.xxx,
          "formatted_address": "1212 Ping Data Lane, Pingville, FL, USA",
          "place_id": "xxx-yyy",
          "address_line_1": "1212 Ping Data Lane",
          "address_line_2": "",
          "city": "Pingville",
          "postal_code": "00010",
          "county": "Pingville",
          "state": "FL",
          "country": "US"
        },
        "HH": {
          "is_success": true,
          "error_message": null,
          "confidence": null,
          "status_code": null,
          "latitude": 28.xxx,
          "longitude": -81.xxx,
          "geocode_type": "ADDRESS",
          "google_maps_link": "https://www.google.com/maps/search/?api=1&query=28.xxx,-81.xxx",
          "fema_flood_zone": "X",
          "elevation": null,
          "bldg_year_built": 2009,
          ... more attributes ...

        }
      },
      ... more buildings ...
    }

    ```
  contact:
    email: support@pingintel.com
    name: Ping Intel
    url: https://www.pingintel.com
servers:
  - url: https://data-api.sovfixer.com
    description: Ping.Data API
  - url: https://data-api-staging.sovfixer.com
    description: Ping.Data API (staging)
security: []
paths:
  /api/v1/limits:
    get:
      tags:
        - Usage
      summary: Get Source Access Policy
      description: >-
        Returns the effective source access policy for a user or organization.
        The policy has two facets:


        1. **`allowlist`** — which sources may be called at all. `mode` is
        `restricted` (only the listed `sources` are callable) or `unrestricted`
        (no gate). For user-scope queries the allowlist cascades:
        `User.allowed_sources` wins if set, otherwise
        `Organization.allowed_sources` applies; `source` tells you which level
        the allowlist came from.


        2. **`sources`** — per-source quota state. Only sources with at least
        one cap appear here. For user-scope queries, caps stack: when both user
        and org cap a source, the **lower** cap wins per window. Windows are
        calendar-aligned in UTC: `daily` since 00:00 UTC today; `monthly` since
        00:00 UTC on the 1st of the current month.


        To decide if `N` locations of source `X` may be called: (1) if
        `allowlist.mode == 'restricted'` and `X` not in `allowlist.sources`,
        denied; (2) if `sources[X].remaining[window] < N` for any window,
        denied; otherwise allowed.
      operationId: api_v1_limits
      parameters:
        - in: query
          name: org_short_name
          schema:
            type: string
          description: >-
            Filter by organization short name (e.g. 'AMWNS'). Staff only.
            Mutually exclusive with username.
        - in: query
          name: username
          schema:
            type: string
          description: >-
            Filter by this username. Defaults to the requesting user. Staff only
            when querying another user.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LimitsResponse'
              examples:
                UserPolicy—Typical:
                  value:
                    scope: user
                    subject: alice@example.com
                    allowlist:
                      mode: restricted
                      source: user
                      sources:
                        - GG
                        - TD
                        - HH
                        - PH
                    sources:
                      GG:
                        limits:
                          daily: 500
                          monthly: 10000
                        usage:
                          daily: 42
                          monthly: 6700
                        remaining:
                          daily: 458
                          monthly: 3300
                      PH:
                        limits:
                          monthly: 1000
                        usage:
                          monthly: 312
                        remaining:
                          monthly: 688
                  summary: User policy — typical
                UnrestrictedUser,OneCappedSource:
                  value:
                    scope: user
                    subject: bob@example.com
                    allowlist:
                      mode: unrestricted
                      source: null
                    sources:
                      PH:
                        limits:
                          monthly: 1000
                        usage:
                          monthly: 312
                        remaining:
                          monthly: 688
                  summary: Unrestricted user, one capped source
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LimitsErrorResponse'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LimitsErrorResponse401'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LimitsErrorResponse403'
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    LimitsResponse:
      type: object
      properties:
        allowlist:
          $ref: '#/components/schemas/LimitsAllowlist'
        scope:
          enum:
            - user
            - org
          type: string
          x-spec-enum-id: 807db6603926e4bc
        sources:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/LimitsSourceEntry'
          description: Per-source quota state. Sources with no cap are omitted.
        subject:
          type: string
      required:
        - allowlist
        - scope
        - sources
        - subject
    LimitsErrorResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    LimitsErrorResponse401:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    LimitsErrorResponse403:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    LimitsAllowlist:
      type: object
      properties:
        mode:
          enum:
            - restricted
            - unrestricted
          type: string
          x-spec-enum-id: 9b23bb003b3468a2
        source:
          enum:
            - user
            - organization
            - null
          type: string
          x-spec-enum-id: 3720f397649c6eb7
          nullable: true
          description: Where the allowlist came from; null when unrestricted.
        sources:
          type: array
          items:
            type: string
          description: Allowed source codes; present iff mode='restricted'.
      required:
        - mode
        - source
    LimitsSourceEntry:
      type: object
      properties:
        limits:
          type: object
          additionalProperties:
            type: integer
        remaining:
          type: object
          additionalProperties:
            type: integer
        usage:
          type: object
          additionalProperties:
            type: integer
      required:
        - limits
        - remaining
        - usage
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````