openapi: 3.2.0 info: title: Street Open Users API description: Build on top of the UKs most advanced Estate Agency software. version: '1.0' contact: name: Street API Development Team url: https://street.co.uk email: apis@street.co.uk servers: - url: https://street.co.uk/open-api/v1 description: Production. - url: https://demo.street.co.uk/open-api/v1 description: Testing. security: - your-api-token: [] tags: - name: Users description: Users endpoints for this API. paths: /users: get: summary: Get all Users tags: - Users responses: '200': description: OK. content: application/vnd.api+json: schema: type: object properties: data: type: array items: $ref: '#/components/schemas/User' included: type: array items: $ref: '#/components/schemas/IncludedBranch' links: $ref: '#/components/schemas/Links' meta: allOf: - $ref: '#/components/schemas/Pagination' jsonapi: $ref: '#/components/schemas/JsonApi' '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-users description: This endpoint retrieves multiple paginated users along with `meta` and `pagination` information. parameters: - $ref: '#/components/parameters/filter_trashed' - $ref: '#/components/parameters/filter_created_from' - $ref: '#/components/parameters/filter_created_to' - $ref: '#/components/parameters/filter_updated_from' - $ref: '#/components/parameters/filter_updated_to' - $ref: '#/components/parameters/page_size' - $ref: '#/components/parameters/page_number' - schema: type: array uniqueItems: true minItems: 1 items: type: string enum: - branch in: query name: include description: Optional related entities to include in the results. explode: false style: form /users/{user_id}: parameters: - schema: type: string format: uuid name: user_id in: path required: true description: The UUID of the User. get: summary: Get a single User tags: - Users responses: '200': description: OK. content: application/vnd.api+json: schema: type: object properties: data: $ref: '#/components/schemas/User' included: type: array items: $ref: '#/components/schemas/IncludedBranch' links: $ref: '#/components/schemas/IncludedLinks' meta: type: object jsonapi: $ref: '#/components/schemas/JsonApi' '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-users-userId description: This endpoint retrieves a single user by their `UUID`. parameters: - schema: type: array uniqueItems: true minItems: 1 items: type: string enum: - branch - ownedProperties - applicants in: query name: include description: Optional related entities to include in the results, e.g. `branch,ownedProperties,applicants` explode: false style: form components: parameters: page_size: name: page[size] description: Set the number of results per page. in: query required: false schema: type: number minimum: 1 maximum: 250 example: 25 filter_created_from: name: filter[created_from] in: query required: false schema: type: string format: date-time description: Filter by results created after the provided date. filter_updated_from: name: filter[updated_from] in: query required: false schema: type: string format: date-time description: Filter by results updated after the provided date. filter_updated_to: name: filter[updated_to] in: query required: false schema: type: string format: date-time description: Filter by results updated before the provided date. filter_created_to: name: filter[created_to] in: query required: false schema: type: string format: date-time description: Filter by results created before the provided date. filter_trashed: name: filter[trashed] in: query required: false schema: type: string enum: - with - only description: Optionally return result WITH deleted results or return ONLY deleted results. page_number: name: page[number] description: Set the page number. in: query required: false schema: type: number minimum: 1 example: 3 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: $ref: '#/components/schemas/jsonApiErrorResponseBody' '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: $ref: '#/components/schemas/jsonApiErrorResponseBody' '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: $ref: '#/components/schemas/jsonApiErrorResponseBody' '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: $ref: '#/components/schemas/jsonApiMultiErrorResponseBody' '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: $ref: '#/components/schemas/jsonApiErrorResponseBody' '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: $ref: '#/components/schemas/jsonApiErrorResponseBody' '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: $ref: '#/components/schemas/jsonApiMultiErrorResponseBody' schemas: IncludedBranch: allOf: - $ref: '#/components/schemas/IncludedResource' - type: object properties: type: type: string enum: - branch attributes: $ref: '#/components/schemas/BranchAttributes' title: Branch (included) IncludedResource: title: Included Resource type: object examples: [] required: - type - id properties: type: type: string id: type: string format: uuid attributes: type: object relationships: type: - object - 'null' meta: $ref: '#/components/schemas/Meta' User: title: User allOf: - $ref: '#/components/schemas/BaseModel' - type: object properties: type: type: string enum: - user attributes: $ref: '#/components/schemas/UserAttributes' relationships: type: object properties: properties: allOf: - $ref: '#/components/schemas/RelationshipPlural' - type: object properties: data: type: array items: type: object properties: type: type: string enum: - property jsonApiErrorResponseBody: title: JSON:API Error Response Body description: Response body for JSON:API errors, containing an array of `errors` in place of the `data` property provided in JSON:API success responses. Used for non-400/500 error codes where only a single error is expected. type: object properties: meta: type: object source: type: object description: The primary source of the conflict for 409 responses. properties: pointer: type: string description: JSON Pointer to the conflicting request value. parameter: type: string description: URI parameter related to the conflict. errors: description: An array of error objects providing additional information about problems encountered while processing the request. type: array maxItems: 1 items: $ref: '#/components/schemas/jsonApiError' required: - errors UserAttributes: title: User (attributes) type: object properties: first_name: type: string last_name: type: string job_title: type: - string - 'null' telephone_number: type: - string - 'null' mobile_number: type: - string - 'null' email_address: type: string format: email deactivated_at: type: - string - 'null' format: date-time deleted_at: type: - string - 'null' format: date-time created_at: type: string format: date-time updated_at: type: string format: date-time Pagination: title: Pagination description: Pagination object - JSON:API Standard. type: object properties: pagination: type: object properties: total: type: integer example: 226 count: type: integer example: 10 per_page: type: integer example: 10 current_page: type: integer example: 1 total_pages: type: integer example: 23 x-examples: example-1: pagination: total: 226 count: 10 per_page: 10 current_page: 1 total_pages: 23 examples: - pagination: total: 226 count: 10 per_page: 10 current_page: 1 total_pages: 23 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' BranchAttributes: type: object title: Branch (attributes) properties: address: $ref: '#/components/schemas/AddressSimple' name: type: string public_name: type: - string - 'null' email_address: type: string format: email telephone: type: string website: type: - string - 'null' format: uri about_branch_copy: type: - string - 'null' disclaimer: type: - string - 'null' matching_links_to_website: type: - boolean - 'null' readOnly: true description: If true, custom property matching links are enabled for the branch. matching_url_pattern: type: - string - 'null' readOnly: true description: 'Pattern for property match URLs on the agent website: https://www.yourwebsite.co.uk/property/{UUID}' created_at: type: string format: date-time updated_at: type: string format: date-time AddressSimple: title: Address (simple) type: object properties: single_line: type: string example: 19 Lansdowne Road, Monton, Manchester anon_single_line: type: string example: Lansdowne Road, Monton, Manchester building_number: type: - string - 'null' example: '19' building_name: type: - string - 'null' street: type: - string - 'null' line_1: type: string example: 19 Lansdowne Road line_2: type: - string - 'null' example: Monton line_3: type: - string - 'null' example: Manchester line_4: type: - string - 'null' town: type: - string - 'null' example: Manchester country: type: string example: United Kingdom postcode: type: string example: M30 9PA udprn: type: - string - 'null' example: '28327204' geo: type: object properties: lat: type: - number - 'null' example: 0.2365698 format: float lng: type: - number - 'null' example: 53.023654 format: float royal_mail: type: - object - 'null' properties: postcode: type: string post_town: type: string thoroughfare: type: string building_name: type: - string - 'null' building_number: type: - string - 'null' department_name: type: - string - 'null' organisation_name: type: - string - 'null' sub_building_name: type: - string - 'null' dependent_locality: type: - string - 'null' dependent_thoroughfare: type: - string - 'null' double_dependent_locality: type: - string - 'null' street_group_property_id: type: - string - 'null' Links: title: Links description: Links object - JSON:API Standard. type: object x-examples: example-1: self: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=2 first: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=1 prev: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=1 next: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=3 last: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=9 examples: - self: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=2 first: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=1 next: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=1 prev: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=3 last: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=9 properties: self: type: string example: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=2 first: type: string example: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=1 next: type: string example: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=1 prev: type: string example: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=3 last: type: string example: http://localhost:3000/users?page[number]=2&page[size]=25&page[number]=9 RelationshipPlural: title: Relationship Plural 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. type: object properties: data: type: array items: type: object properties: type: type: string id: type: string example: a827a3ae-4c74-4c32-8b42-42248d4010d3 links: type: object properties: self: $ref: '#/components/schemas/Link' related: $ref: '#/components/schemas/Link' Meta: title: Meta Information description: The server's implementation. type: object jsonApiError: title: JSON:API Error Object description: A JSON:API object representing a single error. type: object properties: title: type: string detail: type: string code: type: string source: type: object description: An object containing references to the primary source of the error. properties: pointer: type: string description: A JSON Pointer to the value in the request document that caused the error. parameter: type: string description: A string indicating which URI query parameter caused the error. required: - title examples: - title: 401 Unauthorized detail: The requester is not authorized to access the resource. code: '401' BaseModel: title: Base Model type: object properties: id: type: string format: uuid type: type: string attributes: type: object relationships: type: object JsonApi: title: API Details description: The server's implementation. type: object properties: version: type: string meta: $ref: '#/components/schemas/Meta' jsonApiMultiErrorResponseBody: title: JSON:API Multi-Error Response Body description: Response body for JSON:API errors that may contain multiple error objects (400 Bad Request and 500 Internal Server Error). type: object properties: meta: type: object errors: description: An array of error objects providing additional information about problems encountered while processing the request. type: array items: $ref: '#/components/schemas/jsonApiError' required: - errors IncludedLinks: title: Included Links type: object properties: self: $ref: '#/components/schemas/Link' related: $ref: '#/components/schemas/Link' examples: [] securitySchemes: your-api-token: type: http scheme: bearer x-ext-urls: {}