openapi: 3.1.3 info: title: The Special Standard API version: 0.1.0 servers: - url: http://localhost:8080/api/v1 description: Development server - url: https://king-prawn-app-n5vk6.ondigitalocean.app/api/v1 description: Production server tags: - name: Health description: Health check operations - name: Sessions description: Therapy session operations - name: Students description: Student management operations - name: Therapists description: Physical Therapists Registered - name: Themes description: Theme management operations paths: /health: get: summary: Health check description: Check if the API is running and healthy tags: [Health] responses: "200": description: API is healthy (status code only) "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" /sessions: get: summary: Get all sessions description: Retrieve all therapy sessions from the database tags: [Sessions] responses: "200": description: List of therapy sessions content: application/json: schema: type: array items: $ref: "#/components/schemas/Session" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Resource not found" post: summary: Create a new session description: Create a new therapy session tags: [Sessions] requestBody: required: true content: application/json: schema: type: object required: - start_datetime - end_datetime - therapist_id properties: start_datetime: type: string format: date-time description: Start date and time of the session example: "2025-09-13T17:19:00Z" end_datetime: type: string format: date-time description: End date and time of the session example: "2025-09-13T18:00:00Z" therapist_id: type: string format: uuid description: UUID of the Therapist example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" notes: type: string description: Optional notes about the session example: "Daily Affirmation: My luck is so good that even four-leaf clovers ask for my autograph" responses: "201": description: Session created successfully content: application/json: schema: $ref: "#/components/schemas/Session" "400": description: Bad Request (e.g., validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" "500": description: Internal Server Error content: application/json: schema: $ref: "#/components/schemas/Error" /sessions/{id}: get: summary: Get session by ID description: Retrieve a specific therapy session by its UUID tags: [Sessions] parameters: - name: id in: path required: true description: UUID of the Session to retrieve schema: type: string format: uuid example: "123e4567-e89b-12d3-a456-426614174000" responses: "200": description: Session found successfully content: application/json: schema: $ref: "#/components/schemas/Session" "400": description: Bad Request (invalid UUID format) content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 400 message: "Invalid UUID format" "404": description: Session not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Session not found" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" patch: summary: Update session description: Update an existing session (partial update) tags: [Sessions] parameters: - name: id in: path required: true description: UUID of the Session to patch schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateSessionInput" responses: "200": description: Session updated successfully content: application/json: schema: $ref: "#/components/schemas/Session" "400": description: Bad request (e.g., validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Session Not Found content: application/json: schema: $ref: "#/components/schemas/Error" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" delete: summary: Delete session description: Delete a session from the database tags: [Sessions] parameters: - name: id in: path required: true description: UUID of the Session to delete schema: type: string format: uuid responses: "200": description: Session deleted successfully content: application/json: schema: type: object properties: message: type: string example: "Session deleted successfully" "400": description: Bad Request Error (parsing invalid uuid, etc.) content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Session not found content: application/json: schema: $ref: "#/components/schemas/Error" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" /students: get: summary: Get all students description: Retrieve all students from the database tags: [Students] responses: "200": description: List of students content: application/json: schema: type: array items: $ref: "#/components/schemas/Student" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" post: summary: Create a new student description: Create a new student record tags: [Students] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateStudentInput" responses: "201": description: Student created successfully content: application/json: schema: $ref: "#/components/schemas/Student" "400": description: Bad request (validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" examples: invalid_json: summary: Invalid JSON format value: code: 400 message: "Invalid JSON format" invalid_date: summary: Invalid date format value: code: 400 message: "Invalid date format. Use YYYY-MM-DD" invalid_therapist_id: summary: Invalid therapist ID value: code: 400 message: "Invalid therapist ID format" "422": description: Therapist not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 422 message: "Therapist not found" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" /students/{id}: get: summary: Get student by ID description: Retrieve a specific student by their ID tags: [Students] parameters: - name: id in: path required: true schema: type: string format: uuid description: Student ID example: "123e4567-e89b-12d3-a456-426614174000" responses: "200": description: Student found content: application/json: schema: $ref: "#/components/schemas/Student" "400": description: Invalid UUID format content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 400 message: "Invalid UUID format" "404": description: Student not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Student not found" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" patch: summary: Update student description: Update an existing student's information (partial update) tags: [Students] parameters: - name: id in: path required: true schema: type: string format: uuid description: Student ID example: "123e4567-e89b-12d3-a456-426614174000" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateStudentInput" responses: "200": description: Student updated successfully content: application/json: schema: $ref: "#/components/schemas/Student" "400": description: Bad request (validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" examples: invalid_uuid: summary: Invalid UUID format value: code: 400 message: "Invalid UUID format" invalid_json: summary: Invalid JSON format value: code: 400 message: "Invalid JSON format" invalid_date: summary: Invalid date format value: code: 400 message: "Invalid date format. Use YYYY-MM-DD" "404": description: Student not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Student not found" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" delete: summary: Delete student description: Delete a student record tags: [Students] parameters: - name: id in: path required: true schema: type: string format: uuid description: Student ID example: "123e4567-e89b-12d3-a456-426614174000" responses: "204": description: Student deleted successfully (no content) "400": description: Invalid UUID format content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 400 message: "Invalid UUID format" "404": description: Student not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Student not found" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" /therapists: get: summary: Get all therapists description: Retrieve all therapists from the database tags: [Therapists] responses: "200": description: A list of Therapists content: application/json: schema: type: array items: $ref: "#/components/schemas/Therapist" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Resource not found" post: summary: Create a new therapist description: Create a new therapist for school districts tags: [Therapists] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateTherapistInput" responses: "201": description: Therapist created successfully content: application/json: schema: $ref: "#/components/schemas/Therapist" "400": description: Bad request (e.g., validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" /therapists/{id}: get: summary: Get therapist by ID description: Retrieve a specific therapist from the database tags: [Therapists] parameters: - name: id in: path required: true schema: type: string format: uuid description: Therapist ID example: "123e4567-e89b-12d3-a456-426614174000" responses: "200": description: Therapist found content: application/json: schema: $ref: "#/components/schemas/Therapist" "400": description: Invalid UUID format content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 400 message: "There was an error parsing the given id!" "404": description: Therapist not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Therapist not found" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" patch: summary: Update therapist description: Update a specific field within a therapist object in the database tags: [Therapists] parameters: - name: id in: path required: true schema: type: string format: uuid description: Therapist ID example: "123e4567-e89b-12d3-a456-426614174000" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateTherapistInput" responses: "200": description: Therapist updated successfully content: application/json: schema: $ref: "#/components/schemas/Therapist" "400": description: Bad request (validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 400 message: "There was an error parsing the given id!" "404": description: Therapist not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Therapist not found" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" delete: summary: Delete therapist description: Get the specific therapist corresponding to the given ID and delete it tags: [Therapists] parameters: - name: id in: path required: true schema: type: string format: uuid description: Therapist ID example: "123e4567-e89b-12d3-a456-426614174000" responses: "200": description: Therapist deleted successfully content: application/json: schema: type: object properties: message: type: string example: "Therapist deleted successfully" "400": description: Invalid UUID format content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 400 message: "Error querying database for given ID" "404": description: Therapist not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Therapist not found" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" /resources: get: summary: Get all resources description: Retrieve all resources from the database tags: [Resources] parameters: - in: query name: theme_id schema: type: string format: uuid required: false description: Filter resources by theme ID - in: query name: grade_level schema: type: string required: false description: Filter resources by grade level - in: query name: date schema: type: string format: date required: false description: Filter resources by date - in: query name: type schema: type: string required: false description: Filter resources by type - in: query name: title schema: type: string required: false description: Filter resources by title - in: query name: category schema: type: string required: false description: Filter resources by category - in: query name: content schema: type: string required: false description: Filter resources by content/URL responses: "200": description: List of resources content: application/json: schema: type: array items: $ref: "#/components/schemas/Resource" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Resource not found" post: summary: Create a new resource description: Create a new resource in the database tags: [Resources] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateResourceBody" responses: "201": description: Resource created successfully content: application/json: schema: $ref: "#/components/schemas/Resource" "400": description: Bad request (e.g., validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Not found (e.g. theme_id does not exist) content: application/json: schema: $ref: "#/components/schemas/Error" /resources/:id: get: summary: Get resource by ID description: Retrieve a specific resource by its ID tags: [Resources] parameters: - in: path name: id schema: type: string format: uuid required: true description: ID of the resource to retrieve responses: "200": description: Resource found successfully content: application/json: schema: $ref: "#/components/schemas/Resource" "400": description: Bad request (e.g., invalid UUID format) content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Resource not found content: application/json: schema: $ref: "#/components/schemas/Error" patch: summary: Update a resource description: Update an existing resource in the database tags: [Resources] parameters: - in: path name: id schema: type: string format: uuid required: true description: ID of the resource to update requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateResourceBody" responses: "200": description: Resource updated successfully content: application/json: schema: $ref: "#/components/schemas/Resource" "400": description: Bad request (e.g., validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Resource not found content: application/json: schema: $ref: "#/components/schemas/Error" delete: summary: Delete a resource description: Delete an existing resource from the database tags: [Resources] parameters: - in: path name: id schema: type: string format: uuid required: true description: ID of the resource to delete responses: "204": description: Resource deleted successfully (no content) "404": description: Resource not found content: application/json: schema: $ref: "#/components/schemas/Error" /themes: get: summary: Get all themes description: Retrieve all themes from the database tags: [Themes] responses: "200": description: List of themes content: application/json: schema: type: array items: $ref: "#/components/schemas/Theme" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" post: summary: Create a new theme description: Create a new theme for therapy sessions tags: [Themes] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateThemeInput" responses: "201": description: Theme created successfully content: application/json: schema: $ref: "#/components/schemas/Theme" "400": description: Bad request (e.g., validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" /themes/{id}: get: summary: Get theme by ID description: Retrieve a specific theme by its UUID tags: [Themes] parameters: - name: id in: path required: true description: UUID of the theme to retrieve schema: type: string format: uuid example: "123e4567-e89b-12d3-a456-426614174000" responses: "200": description: Theme found successfully content: application/json: schema: $ref: "#/components/schemas/Theme" "400": description: Bad Request (invalid UUID format) content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 400 message: "Invalid UUID format" "404": description: Theme not found content: application/json: schema: $ref: "#/components/schemas/Error" example: code: 404 message: "Theme not found" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" patch: summary: Update theme description: Update an existing theme (partial update) tags: [Themes] parameters: - name: id in: path required: true description: UUID of the theme to patch schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateThemeInput" responses: "200": description: Theme updated successfully content: application/json: schema: $ref: "#/components/schemas/Theme" "400": description: Bad request (e.g., validation errors) content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Theme not found content: application/json: schema: $ref: "#/components/schemas/Error" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" delete: summary: Delete theme description: Delete a theme from the database tags: [Themes] parameters: - name: id in: path required: true description: UUID of the theme to delete schema: type: string format: uuid responses: "200": description: Theme deleted successfully content: application/json: schema: type: object properties: message: type: string example: "Theme deleted successfully" "400": description: Bad Request Error (parsing invalid uuid, etc.) content: application/json: schema: $ref: "#/components/schemas/Error" "404": description: Theme not found content: application/json: schema: $ref: "#/components/schemas/Error" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/Error" components: schemas: Error: type: object required: - code - message properties: code: type: integer description: HTTP status code example: 500 message: anyOf: - type: string - type: object description: Error message or validation errors example: "Internal server error" Therapist: type: object required: - id - first_name - last_name - email - active - created_at - updated_at properties: id: type: string format: uuid description: Unique identifier for the therapist example: "123e4567-e89b-12d3-a456-426614174000" first_name: type: string example: "Kevin" last_name: type: string example: "Matilda" email: type: string format: email example: "email123@example.com" active: type: boolean description: Whether the therapist is currently active example: true created_at: type: string format: date-time example: "2024-01-15T10:30:00Z" updated_at: type: string format: date-time example: "2024-01-15T10:35:00Z" CreateTherapistInput: type: object required: - first_name - last_name - email properties: first_name: type: string description: First name of the therapist example: "Kevin" last_name: type: string description: Last name of the therapist example: "Matilda" email: type: string format: email description: Email of the therapist example: "email123@example.com" UpdateTherapistInput: type: object properties: first_name: type: string description: First name of the therapist example: "Kevin" last_name: type: string description: Last name of the therapist example: "Matilda" email: type: string format: email description: Email of the therapist example: "email123@example.com" active: type: boolean description: Whether the therapist is active example: true Session: type: object required: - id - start_datetime - end_datetime - therapist_id properties: id: type: string format: uuid description: Unique identifier for the session example: "123e4567-e89b-12d3-a456-426614174000" start_datetime: type: string format: date-time description: Start date and time of the session example: "2024-01-15T14:30:00Z" end_datetime: type: string format: date-time description: End date and time of the session example: "2024-01-15T15:30:00Z" therapist_id: type: string format: uuid description: ID of the therapist conducting the session example: "987fcdeb-51a2-43d1-9f4c-123456789abc" notes: type: string nullable: true description: Session notes (optional) example: "Patient showed improvement in anxiety management techniques" created_at: type: string format: date-time nullable: true description: When the session record was created example: "2024-01-15T10:30:00Z" updated_at: type: string format: date-time nullable: true description: When the session record was last updated example: "2024-01-15T10:35:00Z" UpdateSessionInput: type: object properties: start_datetime: type: string format: date-time description: Start date and time of the session example: "2025-09-13T17:19:00Z" end_datetime: type: string format: date-time description: End date and time of the session example: "2025-09-13T18:00:00Z" therapist_id: type: string format: uuid description: UUID of the Therapist example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" notes: type: string description: Optional notes about the session example: "Updated session notes" Student: type: object required: - id - first_name - last_name - therapist_id - created_at - updated_at properties: id: type: string format: uuid description: Unique identifier for the student example: "123e4567-e89b-12d3-a456-426614174000" first_name: type: string description: Student's first name example: "John" last_name: type: string description: Student's last name example: "Doe" dob: type: string format: date nullable: true description: Student's date of birth (optional) example: "2010-05-15" therapist_id: type: string format: uuid description: ID of the assigned therapist example: "987fcdeb-51a2-43d1-9f4c-123456789abc" grade: type: string nullable: true description: Student's current grade level (optional) example: "5th Grade" iep: type: string nullable: true description: Individualized Education Program details (optional) example: "Active IEP with speech therapy goals" created_at: type: string format: date-time description: When the student record was created example: "2024-01-15T10:30:00Z" updated_at: type: string format: date-time description: When the student record was last updated example: "2024-01-15T10:35:00Z" CreateStudentInput: type: object required: - first_name - last_name - therapist_id properties: first_name: type: string description: Student's first name example: "John" last_name: type: string description: Student's last name example: "Doe" dob: type: string format: date nullable: true description: Student's date of birth (YYYY-MM-DD format, optional) example: "2010-05-15" therapist_id: type: string format: uuid description: ID of the assigned therapist example: "987fcdeb-51a2-43d1-9f4c-123456789abc" grade: type: string nullable: true description: Student's current grade level (optional) example: "5th Grade" iep: type: string nullable: true description: Individualized Education Program details (optional) example: "Active IEP with speech therapy goals" UpdateStudentInput: type: object description: Fields that can be updated (all optional for partial updates) properties: first_name: type: string description: Student's first name example: "John" last_name: type: string description: Student's last name example: "Doe" dob: type: string format: date nullable: true description: Student's date of birth (YYYY-MM-DD format, can be set to null) example: "2010-05-15" therapist_id: type: string format: uuid description: ID of the assigned therapist example: "987fcdeb-51a2-43d1-9f4c-123456789abc" grade: type: string nullable: true description: Student's current grade level (can be set to null) example: "6th Grade" iep: type: string nullable: true description: Updated IEP details (can be set to null) example: "Updated IEP with advanced speech therapy goals" Theme: type: object required: - id - name - month - year - created_at - updated_at properties: id: type: string format: uuid description: Unique identifier for the theme example: "123e4567-e89b-12d3-a456-426614174000" name: type: string description: Name of the theme example: "Winter Wonderland" month: type: integer description: Month of the theme (1-12) example: 12 year: type: integer description: Year of the theme (e.g., 2024) example: 2024 created_at: type: string format: date-time description: When the theme was created example: "2024-01-15T10:30:00Z" updated_at: type: string format: date-time description: When the theme was last updated example: "2024-01-15T10:35:00Z" CreateThemeInput: type: object required: - name - month - year properties: name: type: string description: Name of the theme example: "Winter Wonderland" month: type: integer description: Month of the theme example: 12 year: type: integer description: Year of the theme example: 2024 UpdateThemeInput: type: object description: Fields that can be updated (all optional for partial updates) properties: name: type: string description: Name of the theme example: "Spring Blossoms" month: type: integer description: Month of the theme (1-12) example: 3 year: type: integer description: Year of the theme example: 2024 CreateResourceBody: type: object required: - theme_id properties: theme_id: type: string format: uuid description: ID of the theme associated with the resource example: "123e4567-e89b-12d3-a456-426614174000" grade_level: type: string nullable: true description: Grade level for the resource (optional) date: type: string format: date nullable: true description: Date associated with the resource (optional) type: type: string nullable: true description: Type of resource (optional) title: type: string nullable: true description: Title of the resource (optional) category: type: string nullable: true description: Category of the resource (optional) content: type: string nullable: true description: Content/URL of the resource (optional) Resource: type: object required: - id - theme_id properties: id: type: string format: uuid description: Unique identifier for the resource example: "123e4567-e89b-12d3-a456-426614174000" theme_id: type: string format: uuid description: ID of the theme associated with the resource example: "123e4567-e89b-12d3-a456-426614174000" grade_level: type: string nullable: true description: Grade level for the resource (optional) example: "5th Grade" date: type: string format: date nullable: true description: Date associated with the resource (optional) example: "2024-01-15" type: type: string nullable: true description: Type of resource (optional) title: type: string nullable: true description: Title of the resource (optional) example: "Coping with Anxiety" category: type: string nullable: true description: Category of the resource (optional) content: type: string nullable: true description: Content/URL of the resource (optional) example: "https://example.com/resource" UpdateResourceBody: type: object properties: theme_id: type: string format: uuid nullable: true description: ID of the theme associated with the resource (optional) example: "123e4567-e89b-12d3-a456-426614174000" grade_level: type: string nullable: true description: Grade level for the resource (optional) example: "5th Grade" date: type: string format: date nullable: true description: Date associated with the resource (optional) example: "2024-01-15" type: type: string nullable: true description: Type of resource (optional) title: type: string nullable: true description: Title of the resource (optional) example: "Coping with Anxiety" category: type: string nullable: true description: Category of the resource (optional) content: type: string nullable: true description: Content/URL of the resource (optional) example: "https://example.com/resource"