Purplebricks Lettings API

Lettings integration service run by the Team Integrations squad. Creates valuation, viewing and offer enquiries in street.co.uk, handles inbound street.co.uk listing webhooks, exposes the pre-instruct third-party property surface, and resolves Teclet postcodes. The clearest evidence in the estate of the UK lettings stack Purplebricks integrates with.

OpenAPI Specification

purplebricks-lettings-v1-openapi.yml Raw ↑
openapi: 3.0.4
info:
  title: Purplebricks.Lettings.Api 1 - Team Integrations
  description: '### An Lettings Api project to validate the regional postcodes for Teclet

    ### [Purplebricks.Lettings.Api Git Repository](https://dev.azure.com/purplebricks/BackEnd/_git/lettings-api)'
  version: '1'
servers:
- url: https://api.purplebricks.co.uk/lettings-api
paths:
  /v1/enquiries/valuation:
    post:
      tags:
      - Enquiries
      summary: Creates a valuation enquiry in street.co.uk
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Services.Models.StreetService.EnquiryModel'
          text/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Services.Models.StreetService.EnquiryModel'
          application/*+json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Services.Models.StreetService.EnquiryModel'
      responses:
        '201':
          description: The valuation enquiry was successfully created in street.co.uk
          content:
            text/plain:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '400':
          description: One or more problems with the request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /v1/enquiries/viewing:
    post:
      tags:
      - Enquiries
      summary: Creates a viewing enquiry in street.co.uk
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Services.Models.StreetService.EnquiryModelEnquiryModelWithPropertyId'
          text/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Services.Models.StreetService.EnquiryModelEnquiryModelWithPropertyId'
          application/*+json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Services.Models.StreetService.EnquiryModelEnquiryModelWithPropertyId'
      responses:
        '201':
          description: The viewing enquiry was successfully created in street.co.uk
          content:
            text/plain:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '400':
          description: One or more problems with the request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /v1/enquiries/offer:
    post:
      tags:
      - Enquiries
      summary: Creates an offer enquiry in street.co.uk
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Services.Models.StreetService.EnquiryModelEnquiryModelWithPropertyId'
          text/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Services.Models.StreetService.EnquiryModelEnquiryModelWithPropertyId'
          application/*+json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Services.Models.StreetService.EnquiryModelEnquiryModelWithPropertyId'
      responses:
        '201':
          description: The offer enquiry was successfully created in street.co.uk
          content:
            text/plain:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '400':
          description: One or more problems with the request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /v1/preinstruct/thirdpartyproperty/{thirdPartyPropertyId}:
    get:
      tags:
      - PreInstruct
      parameters:
      - name: thirdPartyPropertyId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructPropertyAndUserInformation'
            application/json:
              schema:
                $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructPropertyAndUserInformation'
            text/json:
              schema:
                $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructPropertyAndUserInformation'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '500':
          description: Internal Server Error
  /v1/preinstruct/thirdpartyproperty:
    post:
      tags:
      - PreInstruct
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructPostModel'
          text/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructPostModel'
          application/*+json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructPostModel'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructPropertyAndUserInformation'
            application/json:
              schema:
                $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructPropertyAndUserInformation'
            text/json:
              schema:
                $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructPropertyAndUserInformation'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '500':
          description: Internal Server Error
  /v1/streetwebhooks/listing:
    post:
      tags:
      - StreetWebhooks
      summary: Handles street.co.uk listing webhook
      responses:
        '204':
          description: The street.co.uk listing was successfully created
        '400':
          description: One or more problems with the request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /v1/streetwebhooks:
    post:
      tags:
      - StreetWebhooks
      summary: Handles street.co.uk listing webhook
      responses:
        '204':
          description: The street.co.uk listing was successfully created
        '400':
          description: One or more problems with the request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /v1/tecletpostcode/getbypostcode/{postcode}:
    get:
      tags:
      - TecletPostcode
      operationId: GetByPostcode
      parameters:
      - name: postcode
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
            application/json:
              schema:
                type: string
            text/json:
              schema:
                type: string
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '500':
          description: Internal Server Error
        default:
          description: Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /v1/tecletpostcode/getbypropertyid/{propertyId}:
    get:
      tags:
      - TecletPostcode
      operationId: GetByPropertyId
      parameters:
      - name: propertyId
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
            application/json:
              schema:
                type: string
            text/json:
              schema:
                type: string
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '500':
          description: Internal Server Error
        default:
          description: Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
components:
  schemas:
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    Purplebricks.Lettings.Model.Models.PreInstructAddress:
      type: object
      properties:
        line1:
          type: string
          nullable: true
        line2:
          type: string
          nullable: true
        district:
          type: string
          nullable: true
        town:
          type: string
          nullable: true
        county:
          type: string
          nullable: true
        postcode:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
      additionalProperties: false
    Purplebricks.Lettings.Model.Models.PreInstructPostModel:
      type: object
      properties:
        thirdPartyPropertyId:
          type: string
          nullable: true
      additionalProperties: false
    Purplebricks.Lettings.Model.Models.PreInstructPropertyAndUserInformation:
      type: object
      properties:
        propertyId:
          type: integer
          format: int32
          nullable: true
        thirdPartyPropertyId:
          type: string
          nullable: true
        instructed:
          type: boolean
        user:
          $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructUser'
        address:
          $ref: '#/components/schemas/Purplebricks.Lettings.Model.Models.PreInstructAddress'
      additionalProperties: false
    Purplebricks.Lettings.Model.Models.PreInstructUser:
      type: object
      properties:
        userId:
          type: integer
          format: int32
        email:
          type: string
          nullable: true
      additionalProperties: false
    Purplebricks.Lettings.Services.Models.StreetService.EnquiryModel:
      required:
      - emailAddress
      - firstName
      - lastName
      - message
      - telephoneNumber
      type: object
      properties:
        firstName:
          maxLength: 255
          minLength: 1
          type: string
        lastName:
          maxLength: 255
          minLength: 1
          type: string
        emailAddress:
          maxLength: 255
          minLength: 1
          type: string
          format: email
        telephoneNumber:
          maxLength: 255
          minLength: 1
          type: string
        message:
          maxLength: 10000
          minLength: 1
          type: string
      additionalProperties: false
    Purplebricks.Lettings.Services.Models.StreetService.EnquiryModelEnquiryModelWithPropertyId:
      required:
      - emailAddress
      - firstName
      - lastName
      - message
      - propertyUrl
      - telephoneNumber
      type: object
      properties:
        firstName:
          maxLength: 255
          minLength: 1
          type: string
        lastName:
          maxLength: 255
          minLength: 1
          type: string
        emailAddress:
          maxLength: 255
          minLength: 1
          type: string
          format: email
        telephoneNumber:
          maxLength: 255
          minLength: 1
          type: string
        message:
          maxLength: 10000
          minLength: 1
          type: string
        propertyUrl:
          minLength: 1
          type: string
          format: uri
        propertyId:
          type: integer
          format: int32
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: Authorization header using Bearer scheme
      name: Authorization
      in: header
security:
- Bearer: []