> ## 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.

# Prepare an upload

> Returns a pre-signed URL to which you upload a photo directly (`PUT`, with exactly `Content-Type` and `Content-Length` declared) and the key that you then send to `PUT /listings/{code}/photos`.



## OpenAPI

````yaml en/openapi.json POST /uploads
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
    application, with the same rules as the Housera form.
servers:
  - url: https://staging.housera.ro/api/v1
    description: 'Sandbox (staging): test data, the same rules as production.'
  - url: https://housera.ro/api/v1
    description: 'Production: real listings from housera.ro.'
security:
  - bearer: []
tags:
  - name: Your Listings
  - name: Photos
  - name: Events
  - name: Vocabulary
paths:
  /uploads:
    post:
      tags:
        - Photos
      summary: Prepare an upload
      description: >-
        Returns a pre-signed URL to which you upload a photo directly (`PUT`,
        with exactly `Content-Type` and `Content-Length` declared) and the key
        that you then send to `PUT /listings/{code}/photos`.
      operationId: v1.uploads.sign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                content_type:
                  type: string
                  enum:
                    - image/jpeg
                    - image/png
                    - image/webp
                  description: Content type.
                content_length:
                  type: integer
                  minimum: 1
                  maximum: 0
                  description: Content length.
              required:
                - content_type
                - content_length
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  method:
                    type: string
                    const: PUT
                    description: The HTTP method for upload (`PUT`).
                  url:
                    type: string
                    description: Address.
                  headers:
                    type: object
                    properties:
                      Content-Type:
                        type: string
                        description: The file type to be sent on upload.
                    required:
                      - Content-Type
                    description: The headers to be sent exactly like this on upload.
                  key:
                    type: string
                    description: >-
                      The key of the uploaded file, to be sent later in
                      `photos[].key`.
                required:
                  - method
                  - url
                  - headers
                  - key
          description: Successful.
        '401':
          content:
            application/problem+json:
              schema:
                $ref: df9e5864-a2f9-487d-b0db-169bf3dc8506
          description: The key is missing, revoked, or expired (`unauthenticated`).
        '422':
          content:
            application/problem+json:
              schema:
                $ref: e53cadd6-998b-41ac-a57d-ce6040097918
          description: >-
            The data do not pass the rules: one entry per field in `errors[]`,
            with a stable `code`.
components:
  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.