openapi: 3.0.1 info: title: Clerk API description: API that the Django backend will provide. version: 0.1.0 paths: /clerk/api/person/: get: operationId: getPeople responses: "200": description: Successful response. content: application/json: schema: type: array items: $ref: "#/components/schemas/Person" post: operationId: createPerson requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PersonCreate" responses: "201": description: Successful response. content: application/json: schema: $ref: "#/components/schemas/Person" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/PermissionDenied" /clerk/api/person/search/: get: operationId: searchPeople parameters: - name: query in: query schema: type: string required: true responses: "200": description: Successful response. content: application/json: schema: type: array items: $ref: "#/components/schemas/Person" /clerk/api/person/{id}/: get: operationId: getPerson parameters: - description: Entity ID in: path name: id required: true schema: type: integer responses: "200": description: Successful response. content: application/json: schema: $ref: "#/components/schemas/Person" put: operationId: updatePerson parameters: - description: Entity ID in: path name: id required: true schema: type: integer requestBody: required: true description: Successful response. content: application/json: schema: $ref: "#/components/schemas/PersonCreate" responses: "201": description: Successful response. content: application/json: schema: $ref: "#/components/schemas/Person" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/PermissionDenied" delete: operationId: deletePerson parameters: - description: Entity ID in: path name: id required: true schema: type: integer responses: "204": $ref: "#/components/responses/NoContent" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/PermissionDenied" /clerk/api/tenancy/{id}/: get: operationId: getTenancy parameters: - description: Entity ID in: path name: id required: true schema: type: integer responses: "200": description: Successful response. content: application/json: schema: $ref: "#/components/schemas/Tenancy" put: operationId: updateTenancy parameters: - description: Entity ID in: path name: id required: true schema: type: integer requestBody: required: true description: Successful response. content: application/json: schema: $ref: "#/components/schemas/TenancyCreate" responses: "201": description: Successful response. content: application/json: schema: $ref: "#/components/schemas/Tenancy" "400": $ref: "#/components/responses/BadRequest" "403": $ref: "#/components/responses/PermissionDenied" components: schemas: PersonBase: type: object properties: full_name: type: string email: type: string address: type: string phone_number: type: string required: - full_name - email - address - phone_number TextChoiceField: type: object properties: display: type: string value: type: string choices: type: array items: type: array items: type: string required: - display - value - choices Person: allOf: - $ref: "#/components/schemas/PersonBase" - type: object properties: id: type: integer url: type: string support_contact_preferences: $ref: "#/components/schemas/TextChoiceField" required: - id - url - support_contact_preferences PersonCreate: allOf: - $ref: "#/components/schemas/PersonBase" - type: object properties: support_contact_preferences: type: string required: - support_contact_preferences Error: description: The schema for an error response type: object properties: detail: oneOf: - type: string - type: object - type: array items: oneOf: - type: string - type: object - type: array nonFieldErrors: type: array items: type: string TenancyBase: type: object properties: address: type: string suburb: type: string nullable: true postcode: type: string nullable: true started: type: string nullable: true required: - address - suburb - postcode - started ClientBase: type: object properties: first_name: type: string last_name: type: string email: type: string phone_number: type: string weekly_income: type: number nullable: true gender: type: string nullable: true centrelink_support: type: boolean eligibility_notes: type: string requires_interpreter: type: boolean primary_language_non_english: type: boolean primary_language: type: string is_aboriginal_or_torres_strait_islander: type: boolean number_of_dependents: type: number nullable: true referrer: type: string notes: type: string employment_status: type: array items: type: string rental_circumstances: type: string eligibility_circumstances: type: array items: type: string referrer_type: type: string date_of_birth: type: string nullable: true required: - first_name - last_name - email - phone_number - employment_status - weekly_income - gender - centrelink_support - eligibility_notes - requires_interpreter - primary_language_non_english - primary_language - is_aboriginal_or_torres_strait_islander - rental_circumstances - number_of_dependents - eligibility_circumstances - referrer_type - referrer - notes - date_of_birth Client: allOf: - $ref: "#/components/schemas/ClientBase" - type: object properties: id: type: string format: uuid url: type: string age: type: integer full_name: type: string required: - id - url - age - full_name - date_of_birth Tenancy: allOf: - $ref: "#/components/schemas/TenancyBase" - type: object properties: id: type: integer url: type: string is_on_lease: $ref: "#/components/schemas/TextChoiceField" landlord: $ref: "#/components/schemas/Person" agent: $ref: "#/components/schemas/Person" client: $ref: "#/components/schemas/Client" required: - id - url - is_on_lease - landlord - agent - client TenancyCreate: allOf: - $ref: "#/components/schemas/TenancyBase" - type: object properties: is_on_lease: type: string required: - is_on_lease responses: BadRequest: description: Bad request content: application/json: schema: $ref: "#/components/schemas/Error" PermissionDenied: description: Permission Denied content: application/json: schema: $ref: "#/components/schemas/Error" NoContent: description: The specific resource was deleted successfully