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

# Ask for a partnership

> The agency asks for a partnership on a developer's development, with an optional message. Only the agency's owner or an admin. The development's company gets a notification and the `partnership.requested` event.



## OpenAPI

````yaml en/openapi.json POST /partnerships
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:
  /partnerships:
    post:
      tags:
        - Partnerships
      summary: Ask for a partnership
      description: >-
        The agency asks for a partnership on a developer's development, with an
        optional message. Only the agency's owner or an admin. The development's
        company gets a notification and the `partnership.requested` event.
      operationId: v1.partnerships.store
      parameters:
        - 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.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                complex:
                  type: string
                  maxLength: 64
                  description: >-
                    The development the unit belongs to, `null` outside a
                    development. The catalog names only an active development.
                note:
                  type:
                    - string
                    - 'null'
                  maxLength: 500
                  description: Note.
              required:
                - complex
      responses:
        '201':
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PartnershipApiResource'
                    description: The result of the request.
                required:
                  - data
          description: The request was sent. The response holds the partnership, `pending`.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request body is not valid JSON (`malformed_json`).
        '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`).
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The key's company isn't an approved agency, or the account isn't its
            owner or an admin (`not_found`).
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The agency can't ask now: `partnership_unavailable`,
            `partnership_already_open`, `partnership_already_partner`,
            `partnership_paused` or `partnership_too_many`.
        '413':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request body is larger than 1 MB (`payload_too_large`).
        '415':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The request body isn't declared as JSON (`unsupported_media_type`).
            Send it with `Content-Type: application/json`.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblem'
          description: >-
            The data fails the rules: one entry per field in `errors[]`, each
            with a stable `code`.
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            Too many requests. Try again after the number of seconds in
            `Retry-After`.
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            Housera has temporarily paused writes through the API
            (`api_writes_paused`). Try again after the number of seconds in
            `Retry-After`.
components:
  schemas:
    PartnershipApiResource:
      type: object
      properties:
        id:
          type: integer
          description: The partnership's id. It's the same in the `partnership.*` events.
        side:
          type: string
          description: >-
            `agency`: your agency asked for it; `developer`: it's on one of your
            company's developments.
        status:
          type: string
          description: >-
            `pending`, `approved`, `rejected`, `withdrawn`, `revoked` or
            `ended`.
        note:
          type:
            - string
            - 'null'
          description: >-
            The agency's message with the request. When the developer rejects or
            revokes with a reason, this holds their reason.
        created_at:
          type: string
          description: When the request was made (ISO 8601).
        decided_at:
          type:
            - string
            - 'null'
          description: >-
            When it was approved or rejected (ISO 8601), `null` while the
            request waits.
        ended_at:
          type:
            - string
            - 'null'
          description: >-
            When it was withdrawn, revoked or ended (ISO 8601), `null` while it
            is open.
        complex:
          type:
            - object
            - 'null'
          properties:
            code:
              type: string
              description: The development's public code.
            title:
              type:
                - string
                - 'null'
              description: The development's title.
            url:
              type: string
              description: The development's address on Housera.
          required:
            - code
            - title
            - url
          description: The partnership's development.
        developer:
          type:
            - object
            - 'null'
          properties:
            name:
              type: string
              description: The name of the development's company.
          required:
            - name
          description: The development's company.
        agency:
          type:
            - object
            - 'null'
          properties:
            name:
              type: string
              description: The agency's name.
            id:
              type: integer
              description: The agency's id.
          required:
            - name
            - id
          description: >-
            The partnership's agency. `id` is the same as `publisher.agency_id`
            on the project's units.
        units:
          type: object
          properties:
            linked:
              type: integer
              description: >-
                How many of the agency's listings are linked to the development,
                drafts aside.
            active:
              type: integer
              description: How many of them are active.
          required:
            - linked
            - active
          description: The agency's listings linked to the development.
        leads:
          type:
            - integer
            - 'null'
          description: >-
            How many client requests the agency's listings brought, on the
            developer's side only; `null` on the agency's. The clients' data
            stays with the agency.
      required:
        - id
        - side
        - status
        - note
        - created_at
        - decided_at
        - ended_at
        - complex
        - developer
        - agency
        - units
        - leads
      title: PartnershipApiResource
    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.