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

# How the listings are doing

> The figures from the account's front page: views, saves and contacts for each day, over 7, 30 or 90 days, plus the totals of the period before so you can compare them. A key of an account with no team gets the account's listings. A key of the owner, an administrator or a manager gets the listings of the team it sees in the portal and can narrow them to one colleague with `agent`. The chart's moments and the contact sources come only if the key also has `leads:read`.



## OpenAPI

````yaml en/openapi.json GET /account/stats
openapi: 3.1.2
info:
  title: Housera API
  version: 1.0.0
  description: >-
    Publish and manage real estate listings on Housera from your CRM or your own
    application, under the same rules as the form on the Housera portal.
servers:
  - url: https://staging.housera.ro/api/v1
    description: 'Sandbox (staging): test data, same rules as production.'
  - url: https://housera.ro/api/v1
    description: 'Production: the real listings on housera.ro.'
security:
  - bearer: []
tags:
  - name: Your listings
  - name: Photos
  - name: Events
  - name: Vocabulary
  - name: Connect with Housera
  - name: Client requests
  - name: The company and its team
  - name: Marketing mandates
  - name: Viewings
  - name: Projects
  - name: Partnerships
  - name: API key
  - name: Statistics
paths:
  /account/stats:
    get:
      tags:
        - Statistics
      summary: How the listings are doing
      description: >-
        The figures from the account's front page: views, saves and contacts for
        each day, over 7, 30 or 90 days, plus the totals of the period before so
        you can compare them. A key of an account with no team gets the
        account's listings. A key of the owner, an administrator or a manager
        gets the listings of the team it sees in the portal and can narrow them
        to one colleague with `agent`. The chart's moments and the contact
        sources come only if the key also has `leads:read`.
      operationId: v1.stats.account
      parameters:
        - name: range
          in: query
          schema:
            type:
              - integer
              - 'null'
            enum:
              - '7'
              - '30'
              - '90'
              - null
          description: 'The period in days: `7`, `30` (the default) or `90`.'
        - name: agent
          in: query
          schema:
            type:
              - string
              - 'null'
            format: email
            maxLength: 254
          description: >-
            The email of a colleague on your team: you get only the figures of
            their listings. Works only with the key of the owner, an
            administrator or a manager.
        - name: locale
          in: query
          required: false
          schema:
            type: string
            enum:
              - ro
              - en
            default: en
          example: en
          description: >-
            The response language, `ro` or `en`. It changes error messages
            (`title`, `detail`), labels and, when the listing has an approved
            translation in that language, its title and description. Codes are
            the same in every language. It takes precedence over
            `Accept-Language` and over the account's language.
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      range:
                        type: integer
                        description: The period, in days.
                      scope:
                        type: string
                        enum:
                          - team
                          - account
                        description: >-
                          `account` for the account's listings, `team` for the
                          listings of the team the account sees.
                      agent:
                        type:
                          - string
                          - 'null'
                        description: >-
                          The email of the colleague you filtered on, otherwise
                          `null`.
                      timezone:
                        type: string
                        description: The time zone the days are counted in.
                      days:
                        type: array
                        items: {}
                        description: The days of the period, oldest first.
                      totals:
                        type: object
                        properties:
                          views:
                            type: number
                            description: Views.
                          saves:
                            type: number
                            description: Saves to favourites.
                          contacts:
                            type: number
                            description: Contacts that came through listings.
                        required:
                          - views
                          - saves
                          - contacts
                        description: The period's totals.
                      previous:
                        type: object
                        properties:
                          views:
                            type: number
                            description: Views.
                          saves:
                            type: number
                            description: Saves to favourites.
                          contacts:
                            type: number
                            description: Contacts that came through listings.
                        required:
                          - views
                          - saves
                          - contacts
                        description: The totals of the period before, of the same length.
                      top:
                        type: array
                        items: {}
                        description: >-
                          The five most viewed listings of the period or, for a
                          team, the colleagues with the most views.
                      moments:
                        type:
                          - array
                          - 'null'
                        items: {}
                        description: >-
                          What explains the chart: a listing published
                          (`published`), deactivated (`deactivated`),
                          reactivated (`reactivated`) or sold (`sold`) in the
                          period. Comes only with `leads:read`, otherwise
                          `null`.
                      contacts:
                        type:
                          - object
                          - 'null'
                        properties:
                          sources:
                            type: array
                            items: {}
                            description: How the contacts came in.
                          new:
                            type: integer
                            description: How many contacts have not been answered yet.
                          in_progress:
                            type: integer
                            description: How many contacts are being worked on.
                        required:
                          - sources
                          - new
                          - in_progress
                        description: >-
                          The period's contacts that came through listings.
                          Comes only with `leads:read`, otherwise `null`.
                    required:
                      - range
                      - scope
                      - agent
                      - timezone
                      - days
                      - totals
                      - previous
                      - top
                      - moments
                      - contacts
                    description: The result of the request.
                required:
                  - data
          description: The request succeeded.
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The key is missing, revoked or expired (`unauthenticated`).
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The key lacks the required permission (`missing_ability`) or access
            is denied (`forbidden`).
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblem'
          description: >-
            `range` is not 7, 30 or 90, or `agent` is not the email of a
            colleague on your team (`agent_not_member`). A key with no team that
            sends `agent` gets `agent_not_allowed`.
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            Too many requests. Try again after the number of seconds in
            `Retry-After`.
components:
  schemas:
    Problem:
      type: object
      title: Problem
      properties:
        type:
          type: string
          format: uri
          description: The URL of the problem type (RFC 9457).
        title:
          type: string
          description: A short summary of the problem, in the request's language.
        status:
          type: integer
          description: The HTTP status code.
        code:
          type: string
          description: >-
            The stable code of the refusal, the one to handle the error by (the
            list is on the Errors page).
        detail:
          type: string
          description: The explanation, in the request's language.
        existing:
          type: object
          properties:
            code:
              type: string
              description: The existing listing's public code.
            external_ref:
              type:
                - string
                - 'null'
              description: >-
                Your ID for the existing listing, if you set it with `PUT
                /listings/ref/{ref}`. Otherwise `null`.
          required:
            - code
            - external_ref
          description: >-
            Only on `409 duplicate_listing`: the listing you already have for
            the same property.
      required:
        - type
        - title
        - status
        - code
        - detail
    ValidationProblem:
      type: object
      title: ValidationProblem
      properties:
        type:
          type: string
          format: uri
          description: The URL of the problem type (RFC 9457).
        title:
          type: string
          description: A short summary of the problem, in the request's language.
        status:
          type: integer
          description: 'The HTTP status code: `422`.'
        errors:
          type: array
          items:
            type: object
            properties:
              pointer:
                type: string
                description: The field it refers to, as a JSON Pointer (`/features/2`).
              code:
                type: string
                description: >-
                  The rule that failed, as a stable code (the list is on the
                  Errors page).
              detail:
                type: string
                description: >-
                  The explanation, in the request's language. The wording can
                  change, so handle the error by `code`.
            required:
              - pointer
              - code
              - detail
          description: One entry for each field that fails the rules.
      required:
        - type
        - title
        - status
        - errors
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: 'Authorization: Bearer <key>'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.