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

# Get bearer token

> Issue a short-lived bearer token for API authentication. The token expires after 1 hour 
and provides access to the Housr API based on your client credentials and associated scopes.




## OpenAPI

````yaml openapi.yaml post /auth/token
openapi: 3.1.0
info:
  title: Housr API
  version: 1.0.0
  summary: Property management API with hourly-expiring bearer token authentication.
  description: >
    This API provides endpoints for managing properties in the Housr platform.
    It issues an hourly-expiring bearer token via HTTP Basic Auth for secure
    access. Unless otherwise noted, all endpoints require `Authorization: Bearer
    <token>` over HTTPS.


    ## Endpoints


    ### Health Check

    - `GET /health-check` - Check API service availability (no authentication
    required)


    ### Authentication

    - `POST /auth/token` - Obtain a bearer token using HTTP Basic Auth
      - Token expires in 1 hour by default
      - Token provides access based on client credentials and associated scopes

    ### Properties

    - `GET /get-property/{propertyId}` - Retrieve a property by ID
      - Requires bearer token authentication
    - `POST /create-property` - Create a new property record
      - Requires `properties:write` scope
      - Accepts JSON or form-encoded data
      - Supports image URLs as array or comma-separated string
    - `PATCH /update-property/{propertyId}` - Update an existing property
      - Requires `properties:write` scope
      - Server enforces ownership/permissions
      - Provide only fields you wish to change
    - `DELETE /delete-property/{propertyId}` - Delete a property
      - Requires `properties:delete` scope
      - Server enforces ownership/permissions

    ## Authentication

    - Obtain a token with Basic Auth to `/auth/token`.

    - Token expires in 1 hour by default.

    - Use the token in subsequent requests: `Authorization: Bearer <token>`


    ## Error Responses

    All error responses follow the `application/problem+json` format with a
    `response` field containing the error message. Validation errors include an
    additional `errors` object with field-specific error arrays.
servers:
  - url: https://v2.api.uk.housr.com
    description: Production
  - url: https://v2.staging.api.uk.housr.com
    description: Sandbox
security:
  - bearerAuth: []
tags:
  - name: Auth
  - name: Properties
  - name: Health Check
paths:
  /auth/token:
    post:
      tags:
        - Auth
      summary: Get bearer token
      description: >
        Issue a short-lived bearer token for API authentication. The token
        expires after 1 hour 

        and provides access to the Housr API based on your client credentials
        and associated scopes.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
      responses:
        '200':
          description: Token issued
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  expires_at:
                    type: string
                    format: date-time
              examples:
                success:
                  value:
                    access_token: >-
                      eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
                    expires_at: '2024-01-15T14:30:00Z'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              examples:
                rate_limit:
                  value:
                    response: Rate limit exceeded. Please try again later.
      security:
        - basicAuth: []
components:
  schemas:
    Problem:
      type: object
      properties:
        response:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    basicAuth:
      type: http
      scheme: basic

````