openapi: 3.2.0 info: title: Spectre Property Reports API description: Public API for the Spectre products version: '1.0' contact: name: Spectre API Development Team url: https://spectre.uk.com email: apis@spectre.uk.com servers: - url: https://api.spectre.uk.com/v1 description: production security: - your-api-token: [] tags: - name: Property Reports description: All endpoints for Spectre Property Reports paths: /property-reports/user: parameters: [] get: summary: Get current user tags: - Property Reports responses: '200': description: OK content: application/vnd.api+json: schema: type: object additionalProperties: false properties: data: $ref: '#/components/schemas/User' included: type: array items: anyOf: - $ref: '#/components/schemas/IncludedAccount' - $ref: '#/components/schemas/IncludedCompany' - $ref: '#/components/schemas/IncludedReportTemplate' examples: Get current user response: value: data: id: uuid type: user attributes: email: string relationships: accounts: data: - type: account id: uuid company: data: type: company id: uuid included: - id: uuid type: account attributes: name: string - id: uuid type: company attributes: name: string relationships: data: - type: reportTemplate id: uuid - id: uuid type: reportTemplate attributes: name: string '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '500': $ref: '#/components/responses/500' operationId: get-property-reports-user description: This endpoint retrieves the current user. parameters: - schema: type: array uniqueItems: true minItems: 1 items: type: string enum: - accounts - company - company.reportTemplates in: query name: include description: Optional related entities to include in the results explode: false style: form /property-reports/reports: get: summary: Get all reports tags: - Property Reports responses: '200': description: OK content: application/vnd.api+json: schema: type: object additionalProperties: false properties: data: type: array items: $ref: '#/components/schemas/Report' included: type: array items: anyOf: - $ref: '#/components/schemas/IncludedMedia' examples: Get all reports response: value: data: - id: uuid type: report attributes: title: string description: string state: string reportUrl: url imageUrl: url imageSource: string relationships: pdf: data: - type: medium id: uuid included: - id: uuid type: medium attributes: id: uuid url: url '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '500': $ref: '#/components/responses/500' operationId: get-property-reports-reports parameters: - schema: type: array uniqueItems: true minItems: 1 items: type: string enum: - pdf in: query name: include description: Optional related entities to include in the results explode: false style: form description: This endpoint retrieves all the reports the current user. post: summary: Create a new report tags: - Property Reports responses: '201': description: Created content: application/vnd.api+json: schema: type: object additionalProperties: false properties: data: type: array items: $ref: '#/components/schemas/Report' included: type: array items: anyOf: - $ref: '#/components/schemas/IncludedMedia' examples: Create a report response: value: data: id: uuid type: report attributes: title: string description: string state: string reportUrl: url imageUrl: url imageSource: string relationships: pdf: data: - type: medium id: uuid included: - id: uuid type: medium attributes: id: uuid url: url '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '500': $ref: '#/components/responses/500' operationId: post-property-reports-reports parameters: - schema: type: array uniqueItems: true minItems: 1 items: type: string enum: - pdf in: query name: include description: Optional related entities to include in the results explode: false style: form requestBody: content: application/vnd.api+json: schema: allOf: - type: object properties: account_id: type: string format: uuid report_template_id: type: string format: uuid anyOf: - $ref: '#/components/schemas/PropertyAddress' - $ref: '#/components/schemas/PropertyBarcode' /property-reports/reports/{reportId}: get: summary: Get a single report tags: - Property Reports responses: '200': description: OK content: application/vnd.api+json: schema: type: object additionalProperties: false properties: data: $ref: '#/components/schemas/Report' included: type: array items: anyOf: - $ref: '#/components/schemas/IncludedMedia' examples: Get single report response: value: data: id: uuid type: report attributes: title: string description: string state: string reportUrl: url imageUrl: url imageSource: string relationships: pdf: data: - type: medium id: uuid included: - id: uuid type: medium attributes: id: uuid url: url '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '500': $ref: '#/components/responses/500' operationId: get-property-reports-report parameters: - schema: type: array uniqueItems: true minItems: 1 items: type: string enum: - pdf in: query name: include description: Optional related entities to include in the results explode: false style: form description: This endpoint retrieves a single report by UUID for the current user. /property-reports/leads: get: summary: Get all leads tags: - Property Reports responses: '200': description: OK content: application/vnd.api+json: schema: type: object additionalProperties: false properties: data: type: array items: $ref: '#/components/schemas/Lead' examples: Get all leads response: value: data: - id: uuid type: lead attributes: contactName: string contactEmail: email contactNumber: phone contactAddress: string preferredValuationDate: date emailConsent: boolean closedAt: date '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '500': $ref: '#/components/responses/500' operationId: get-property-reports-leads description: This endpoint retrieves all the leads the current user. post: summary: Create a new lead tags: - Property Reports responses: '201': description: Created content: application/vnd.api+json: schema: type: object additionalProperties: false properties: data: type: array items: $ref: '#/components/schemas/Lead' examples: Create a lead response: value: data: id: uuid type: report attributes: contactName: string contactEmail: string contactNumber: string contactAddress: string preferredValuationDate: string emailConsent: string closedAt: string '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '404': $ref: '#/components/responses/404' '406': $ref: '#/components/responses/406' '415': $ref: '#/components/responses/415' '500': $ref: '#/components/responses/500' operationId: post-property-reports-leads requestBody: content: application/vnd.api+json: schema: allOf: - required: - email properties: account_id: type: string format: uuid report_id: type: string format: uuid first_name: type: string last_name: type: string email: type: string format: email contact_number: type: string has_marketing_consent: type: boolean type: object components: schemas: LeadAttributes: title: Lead (attributes) type: object x-tags: - Leads properties: contactName: type: string contactEmail: type: string contactNumber: type: string contactAddress: type: string preferredValuationDate: type: string format: date-time emailConsent: type: boolean closedAt: type: string format: date-time CompanyAttributes: title: Company (attributes) type: object properties: name: type: string x-tags: - Companies Report: title: Report allOf: - $ref: '#/components/schemas/BaseModel' - type: object properties: type: type: string default: report attributes: $ref: '#/components/schemas/ReportAttributes' x-tags: - Reports IncludedResource: title: Included Resource type: object additionalProperties: false properties: type: type: string id: type: string format: uuid attributes: type: object relationships: type: object links: $ref: '#/components/schemas/IncludedLinks' meta: $ref: '#/components/schemas/Meta' required: - type - id examples: [] x-tags: - JSON:API Structures User: title: User allOf: - $ref: '#/components/schemas/BaseModel' - type: object properties: type: type: string default: user attributes: $ref: '#/components/schemas/UserAttributes' relationships: type: object properties: accounts: allOf: - $ref: '#/components/schemas/RelationshipPlural' - type: object properties: data: type: array items: type: object properties: type: type: string enum: - account company: allOf: - $ref: '#/components/schemas/RelationshipSingular' - type: object properties: data: type: object properties: type: type: string default: company Lead: title: Lead allOf: - $ref: '#/components/schemas/BaseModel' - type: object properties: type: type: string default: lead attributes: $ref: '#/components/schemas/LeadAttributes' x-tags: - Leads UserAttributes: title: User (attributes) type: object properties: email: type: string format: email x-tags: - Users description: '' ReportAttributes: title: Report (attributes) type: object properties: title: type: string description: type: string state: type: string reportUrl: type: string imageUrl: type: string imageSource: type: string x-tags: - Reports RelationshipSingular: title: Relationship Singular x-tags: - JSON:API Structures type: object properties: data: type: object properties: type: type: string id: type: string example: a827a3ae-4c74-4c32-8b42-42248d4010d3 description: This is a inheritable schema to allow you to easily add relationships to your main schemas. This should be used for `1:1` relationships. IncludedMedia: allOf: - $ref: '#/components/schemas/IncludedResource' - type: object properties: type: type: string enum: - media attributes: $ref: '#/components/schemas/MediaAttributes' title: Media (Included) x-tags: - Media Link: title: Link oneOf: - description: a string containing the link's URL type: string format: uri-reference - type: object required: - href properties: href: description: a string containing the link's URL type: string format: uri-reference meta: $ref: '#/components/schemas/Meta' x-tags: - JSON:API Structures PropertyAddress: title: PropertyAddress type: object properties: property_address: type: string property_postcode: type: string x-tags: - Reports description: '' PropertyBarcode: title: PropertyBarcode type: object x-tags: - Reports properties: property_barcode: type: string AccountAttributes: title: Account (attributes) type: object properties: name: type: string x-tags: - Accounts RelationshipPlural: title: Relationship Plural x-tags: - JSON:API Structures type: object properties: data: type: array items: type: object properties: type: type: string id: type: string example: a827a3ae-4c74-4c32-8b42-42248d4010d3 description: This is a inheritable schema to allow you to easily add relationships to your main schemas. This should be used for `1:n` relationships. Meta: title: Meta Information description: The server's implementation type: object additionalProperties: true x-tags: - JSON:API Structures IncludedAccount: allOf: - $ref: '#/components/schemas/IncludedResource' - type: object properties: type: type: string enum: - account attributes: $ref: '#/components/schemas/AccountAttributes' title: Account (included) x-tags: - Accounts IncludedReportTemplate: allOf: - $ref: '#/components/schemas/IncludedResource' - type: object properties: type: type: string enum: - reportTemplate attributes: $ref: '#/components/schemas/ReportTemplateAttributes' title: Report Templates (included) x-tags: - Report Templates IncludedCompany: allOf: - $ref: '#/components/schemas/IncludedResource' - type: object properties: type: type: string enum: - company attributes: $ref: '#/components/schemas/CompanyAttributes' relationships: type: object properties: reportTemplates: allOf: - $ref: '#/components/schemas/RelationshipPlural' - type: object properties: data: type: array items: type: object properties: type: type: string enum: - reportTemplate title: Company (included) x-tags: - Companies BaseModel: title: Base Model type: object properties: type: type: string id: type: string format: uuid attributes: type: object required: - type - id - attributes description: This is a base schema that can be inherited by your main schemas to prevent duplicating boilerplate. You should use this for 'models' such as `User` or `Profile` x-tags: - JSON:API Structures ReportTemplateAttributes: title: Report Template (attributes) type: object properties: name: type: string x-tags: - Report Templates BaseError: discriminator: propertyName: errorType mapping: '401': '#/components/responses/401' '403': '#/components/responses/403' '404': '#/components/responses/404' '406': '#/components/responses/406' '415': '#/components/responses/415' '500': '#/components/responses/500' title: Basic Error type: object x-tags: - Errors - JSON:API Structures properties: title: type: string code: type: string required: - title - code description: This is a inheritable schema to allow you to easily extend when you need add new error responses. MediaAttributes: title: Media (attributes) type: object properties: id: type: string url: type: string x-tags: - Media IncludedLinks: title: Included Links type: object properties: self: $ref: '#/components/schemas/Link' related: $ref: '#/components/schemas/Link' examples: [] x-tags: - JSON:API Structures responses: '406': description: 'The HTTP 406 Not Acceptable client error response code indicates that the server cannot produce a response matching the list of acceptable values defined in the request''s proactive content negotiation headers, and that the server is unwilling to supply a default representation. ' content: application/vnd.api+json: schema: type: object properties: errors: type: array items: allOf: - $ref: '#/components/schemas/BaseError' - type: object properties: code: type: string default: '406' title: type: string default: Not Acceptable examples: Example 406 Response: value: errors: - title: Not Acceptable code: '406' '404': description: The HTTP 404 Not Found response status code indicates that the server cannot find the requested resource. content: application/vnd.api+json: schema: type: object properties: errors: type: array items: allOf: - $ref: '#/components/schemas/BaseError' - type: object properties: code: default: '404' type: string title: type: string default: Not Found examples: Example 404 Response: value: errors: - title: Not Found code: '404' '403': description: The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it. content: application/vnd.api+json: schema: type: object properties: errors: type: array items: allOf: - $ref: '#/components/schemas/BaseError' - type: object properties: code: type: string default: '403' title: type: string default: Forbidden examples: Example 403 Response: value: errors: - title: Forbidden code: '403' '500': description: The HTTP 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. content: application/vnd.api+json: schema: type: object properties: errors: type: array items: allOf: - $ref: '#/components/schemas/BaseError' - type: object properties: code: type: string default: '500' title: type: string default: Internal Server Error examples: Example 500 Response: value: errors: - title: Internal Server Error code: '500' '415': description: The HTTP 415 Unsupported Media Type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format. content: application/vnd.api+json: schema: type: object properties: errors: type: array items: allOf: - $ref: '#/components/schemas/BaseError' - type: object properties: code: type: string default: '415' title: type: string default: Unsupported Media Type examples: Example 415 Response: value: errors: - title: Unsupported Media Type code: '415' '401': description: The HTTP 401 Unauthorized response status code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource. content: application/vnd.api+json: schema: type: object properties: errors: type: array items: allOf: - $ref: '#/components/schemas/BaseError' - type: object properties: code: type: string default: '401' title: type: string default: Unauthorized examples: Example 401 Response: value: errors: - title: Unauthorized code: '401' '400': description: The HTTP 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error. content: application/vnd.api+json: schema: type: object properties: errors: type: array items: allOf: - $ref: '#/components/schemas/BaseError' - type: object properties: code: type: string const: '400' title: type: string default: Bad Request examples: Example 400 Response: value: errors: - title: Bad Request code: '400' securitySchemes: your-api-token: type: http scheme: bearer x-ext-urls: {}