From b6ecdede3798f2184052d060a0ecd4c74db57cd3 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Sat, 30 May 2026 13:26:38 -0500 Subject: [PATCH] docs: add three alternatives to OpenAPI documentation --- docs/openapi_modular/components/schemas.yaml | 163 ++++++ docs/openapi_modular/openapi.yaml | 50 ++ docs/openapi_modular/paths/auth.yaml | 39 ++ docs/openapi_modular/paths/checkin.yaml | 70 +++ docs/openapi_modular/paths/reports.yaml | 130 +++++ docs/openapi_modular/paths/sculptures.yaml | 36 ++ docs/openapi_modular/paths/users.yaml | 35 ++ .../openapi_role_based/openapi_collector.yaml | 313 +++++++++++ docs/openapi_role_based/openapi_explorer.yaml | 103 ++++ .../openapi_role_based/openapi_moderator.yaml | 152 ++++++ docs/openapi_unified.yaml | 508 ++++++++++++++++++ 11 files changed, 1599 insertions(+) create mode 100644 docs/openapi_modular/components/schemas.yaml create mode 100644 docs/openapi_modular/openapi.yaml create mode 100644 docs/openapi_modular/paths/auth.yaml create mode 100644 docs/openapi_modular/paths/checkin.yaml create mode 100644 docs/openapi_modular/paths/reports.yaml create mode 100644 docs/openapi_modular/paths/sculptures.yaml create mode 100644 docs/openapi_modular/paths/users.yaml create mode 100644 docs/openapi_role_based/openapi_collector.yaml create mode 100644 docs/openapi_role_based/openapi_explorer.yaml create mode 100644 docs/openapi_role_based/openapi_moderator.yaml create mode 100644 docs/openapi_unified.yaml diff --git a/docs/openapi_modular/components/schemas.yaml b/docs/openapi_modular/components/schemas.yaml new file mode 100644 index 0000000..4a7be52 --- /dev/null +++ b/docs/openapi_modular/components/schemas.yaml @@ -0,0 +1,163 @@ +User: + type: object + required: + - id + - name + - email + - trust_score + - captured_count + properties: + id: + type: string + format: uuid + name: + type: string + example: Juan Perez + email: + type: string + format: email + example: juan.perez@gmail.com + trust_score: + type: number + format: float + description: Reputational metric scaling from 0.0 (untrusted) to 1.0 (highly reliable). + example: 0.85 + captured_count: + type: integer + description: Total number of unique sculptures verified. + example: 12 + +Sculpture: + type: object + required: + - id + - name + - artist + - year + - latitude + - longitude + - status + properties: + id: + type: string + format: uuid + name: + type: string + example: La Novia Dulce + artist: + type: string + example: Lorena Espitia + year: + type: integer + example: 2006 + latitude: + type: number + format: float + example: 3.450143 + longitude: + type: number + format: float + example: -76.533282 + status: + type: string + enum: [on-site, moved, missing] + description: Operational status of the sculpture. + example: on-site + +SculptureDetails: + allOf: + - $ref: '#/Sculpture' + - type: object + properties: + description: + type: string + example: Decorated with sweets and candies representing Cali's culinary traditions. + audio_url: + type: string + format: uri + example: https://cdn.gatos.cali.gov.co/audio/novia_dulce.mp3 + unlocked_content: + type: string + description: Extended history/curation (hidden until captured). + example: This sculpture was crafted in tribute to the traditional festival of Macetas. + +CheckInRecord: + type: object + required: + - sculpture_id + - unlocked_at + - similarity_score + properties: + sculpture_id: + type: string + format: uuid + unlocked_at: + type: string + format: date-time + example: 2026-05-30T10:15:30Z + checkin_photo_url: + type: string + format: uri + example: https://cdn.gatos.cali.gov.co/uploads/checkin_9823.jpg + similarity_score: + type: number + format: float + example: 0.92 + +Ticket: + type: object + required: + - id + - reporter_id + - sculpture_id + - latitude + - longitude + - reported_status + - status + - created_at + properties: + id: + type: string + format: uuid + reporter_id: + type: string + format: uuid + sculpture_id: + type: string + format: uuid + latitude: + type: number + format: float + example: 3.4515 + longitude: + type: number + format: float + example: -76.5320 + reported_status: + type: string + enum: [moved, missing, on-site] + photo_url: + type: string + format: uri + nullable: true + example: https://cdn.gatos.cali.gov.co/uploads/report_8321.jpg + description: + type: string + example: Under construction for street repairs. Pedestal is empty. + status: + type: string + enum: [pending, approved, rejected] + example: pending + created_at: + type: string + format: date-time + example: 2026-05-30T11:00:00Z + resolved_at: + type: string + format: date-time + nullable: true + example: null + notes: + type: string + nullable: true + example: Verified via municipal service coordinates. diff --git a/docs/openapi_modular/openapi.yaml b/docs/openapi_modular/openapi.yaml new file mode 100644 index 0000000..b153824 --- /dev/null +++ b/docs/openapi_modular/openapi.yaml @@ -0,0 +1,50 @@ +openapi: 3.0.3 +info: + title: Novias del Gato API - Modular + description: | + Modular, service-oriented API contract for the "Novias del Gato" digital ecosystem in Cali, Colombia. + This specification splits paths and components into separate domain files for enhanced maintainability. + version: 1.0.0 +servers: + - url: https://api.gatos.cali.gov.co/v1 + description: Production Server + - url: http://localhost:8000/v1 + description: Local Development Server + +paths: + /auth/login: + $ref: 'paths/auth.yaml' + + /users/me: + $ref: 'paths/users.yaml#/me' + + /users/me/collection: + $ref: 'paths/users.yaml#/collection' + + /sculptures: + $ref: 'paths/sculptures.yaml#/list' + + /sculptures/{id}: + $ref: 'paths/sculptures.yaml#/detail' + + /sculptures/{id}/check-in: + $ref: 'paths/checkin.yaml' + + /reports: + $ref: 'paths/reports.yaml#/collection' + + /reports/{id}/verify: + $ref: 'paths/reports.yaml#/verify' + +components: + securitySchemes: + BearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + + responses: + Unauthorized: + description: Authentication token missing or expired. + Forbidden: + description: Insufficient permissions for this action. diff --git a/docs/openapi_modular/paths/auth.yaml b/docs/openapi_modular/paths/auth.yaml new file mode 100644 index 0000000..0c9a723 --- /dev/null +++ b/docs/openapi_modular/paths/auth.yaml @@ -0,0 +1,39 @@ +post: + summary: Google SSO Authentication + description: Exchange a Google OAuth ID token for a system-issued JWT access token. + operationId: loginUser + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - id_token + properties: + id_token: + type: string + description: The ID token returned by Google OAuth. + responses: + '200': + description: Successful authentication + content: + application/json: + schema: + type: object + required: + - access_token + - token_type + - expires_in + properties: + access_token: + type: string + description: JWT access token for subsequent requests. + token_type: + type: string + example: Bearer + expires_in: + type: integer + description: Token lifetime in seconds. + '401': + description: Invalid token provided. diff --git a/docs/openapi_modular/paths/checkin.yaml b/docs/openapi_modular/paths/checkin.yaml new file mode 100644 index 0000000..678049b --- /dev/null +++ b/docs/openapi_modular/paths/checkin.yaml @@ -0,0 +1,70 @@ +post: + summary: Capture / Check-in to a Sculpture + description: | + Perform physical verification by sending the explorer's current GPS location and a freshly captured photo. + The Recognition Service verifies the photo matches the sculpture model embeddings within proximity. + operationId: checkInSculpture + security: + - BearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - photo + - latitude + - longitude + properties: + photo: + type: string + format: binary + description: Sighting image file (JPEG/PNG) to analyze. + latitude: + type: number + format: float + minimum: -90 + maximum: 90 + example: 3.4501 + longitude: + type: number + format: float + minimum: -180 + maximum: 180 + example: -76.5332 + responses: + '200': + description: Verification outcome + content: + application/json: + schema: + type: object + required: + - success + - similarity_score + properties: + success: + type: boolean + description: True if the image embedding matched and location was within threshold. + similarity_score: + type: number + format: float + description: Visual confidence score (0.0 to 1.0). + unlocked_content: + type: string + description: Cultural facts or reward text if successfully captured for the first time. + reward_badge: + type: string + description: Name of the badge unlocked, if any. + '400': + description: Invalid coordinates or image file format. + '401': + description: Authentication token missing or expired. diff --git a/docs/openapi_modular/paths/reports.yaml b/docs/openapi_modular/paths/reports.yaml new file mode 100644 index 0000000..07e5c11 --- /dev/null +++ b/docs/openapi_modular/paths/reports.yaml @@ -0,0 +1,130 @@ +collection: + post: + summary: Submit a Sculpture Location Report + description: | + Allows citizens to report if a sculpture is missing, undergoing maintenance, or has been relocated. + Supplying GPS coordinates and an optional photo helps update the status map via the weighted consensus engine. + operationId: submitReport + security: + - BearerAuth: [] + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - sculpture_id + - latitude + - longitude + - reported_status + properties: + sculpture_id: + type: string + format: uuid + latitude: + type: number + format: float + example: 3.4515 + longitude: + type: number + format: float + example: -76.5320 + reported_status: + type: string + enum: [moved, missing, on-site] + description: The observed state of the sculpture. + photo: + type: string + format: binary + description: Optional verification photo of empty pedestal or relocated site. + description: + type: string + maxLength: 500 + description: Context about the change. + responses: + '201': + description: Report ticket successfully created + content: + application/json: + schema: + $ref: '../components/schemas.yaml#/Ticket' + '401': + description: Authentication token missing or expired. + + get: + summary: List Crowdsourced Reports (Moderator Only) + description: Retrieve reports/tickets submitted by users, filterable by status for verification. + operationId: listReports + security: + - BearerAuth: [] + parameters: + - name: status + in: query + required: false + schema: + type: string + enum: [pending, approved, rejected] + - name: sculpture_id + in: query + required: false + schema: + type: string + format: uuid + responses: + '200': + description: Array of reports + content: + application/json: + schema: + type: array + items: + $ref: '../components/schemas.yaml#/Ticket' + '401': + description: Authentication token missing or expired. + '403': + description: Insufficient permissions for this action. + +verify: + put: + summary: Resolve Location Ticket (Moderator Only) + description: Manually accept or reject a user report. Approving a report updates the location oracle and recalculates user trust scores. + operationId: verifyReport + security: + - BearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - status + properties: + status: + type: string + enum: [approved, rejected] + notes: + type: string + maxLength: 300 + description: Review notes explaining the resolution. + responses: + '200': + description: Ticket resolved successfully + content: + application/json: + schema: + $ref: '../components/schemas.yaml#/Ticket' + '401': + description: Authentication token missing or expired. + '403': + description: Insufficient permissions for this action. + '404': + description: Ticket not found. diff --git a/docs/openapi_modular/paths/sculptures.yaml b/docs/openapi_modular/paths/sculptures.yaml new file mode 100644 index 0000000..5cbbe16 --- /dev/null +++ b/docs/openapi_modular/paths/sculptures.yaml @@ -0,0 +1,36 @@ +list: + get: + summary: List All Cat Sculptures + description: Returns list of all sculptures with names, locations, and current status (Single Source of Truth). + operationId: listSculptures + responses: + '200': + description: List of sculptures + content: + application/json: + schema: + type: array + items: + $ref: '../components/schemas.yaml#/Sculpture' + +detail: + get: + summary: Get Sculpture Details + description: Detailed information about a sculpture, historical context, artist, and unlockable audio guides. + operationId: getSculptureById + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Detailed sculpture object + content: + application/json: + schema: + $ref: '../components/schemas.yaml#/SculptureDetails' + '404': + description: Sculpture not found. diff --git a/docs/openapi_modular/paths/users.yaml b/docs/openapi_modular/paths/users.yaml new file mode 100644 index 0000000..30c3372 --- /dev/null +++ b/docs/openapi_modular/paths/users.yaml @@ -0,0 +1,35 @@ +me: + get: + summary: Retrieve Current User Profile + description: Get details about the authenticated user, including their community trust score. + operationId: getMyProfile + security: + - BearerAuth: [] + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '../components/schemas.yaml#/User' + '401': + description: Authentication token missing or expired. + +collection: + get: + summary: Get User's Unlocked Sculptures + description: Returns the user's progress tracking which cat sculptures they have successfully captured. + operationId: getMyCollection + security: + - BearerAuth: [] + responses: + '200': + description: List of check-ins / captures + content: + application/json: + schema: + type: array + items: + $ref: '../components/schemas.yaml#/CheckInRecord' + '401': + description: Authentication token missing or expired. diff --git a/docs/openapi_role_based/openapi_collector.yaml b/docs/openapi_role_based/openapi_collector.yaml new file mode 100644 index 0000000..d0f15ff --- /dev/null +++ b/docs/openapi_role_based/openapi_collector.yaml @@ -0,0 +1,313 @@ +openapi: 3.0.3 +info: + title: Novias del Gato API - Collector + description: | + Authenticated API contract for collectors and contributors. Contains operations for + social check-ins, location status reporting, and user profiles. + version: 1.0.0 +servers: + - url: https://api.gatos.cali.gov.co/v1 + description: Production Server +paths: + /auth/login: + post: + summary: Google SSO Authentication + description: Exchange a Google OAuth ID token for a system-issued JWT access token. + operationId: loginUser + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - id_token + properties: + id_token: + type: string + description: The ID token returned by Google OAuth. + responses: + '200': + description: Successful authentication + content: + application/json: + schema: + type: object + required: + - access_token + - token_type + - expires_in + properties: + access_token: + type: string + token_type: + type: string + example: Bearer + expires_in: + type: integer + '401': + description: Invalid token. + + /users/me: + get: + summary: Retrieve Current User Profile + description: Get details about the authenticated user, including their community trust score. + operationId: getMyProfile + security: + - BearerAuth: [] + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '401': + $ref: '#/components/responses/Unauthorized' + + /users/me/collection: + get: + summary: Get User's Unlocked Sculptures + description: Returns the user's progress tracking which cat sculptures they have successfully captured. + operationId: getMyCollection + security: + - BearerAuth: [] + responses: + '200': + description: List of check-ins / captures + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CheckInRecord' + '401': + $ref: '#/components/responses/Unauthorized' + + /sculptures/{id}/check-in: + post: + summary: Capture / Check-in to a Sculpture + description: | + Perform physical verification by sending the explorer's current GPS location and a freshly captured photo. + The Recognition Service verifies the photo matches the sculpture model embeddings within proximity. + operationId: checkInSculpture + security: + - BearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - photo + - latitude + - longitude + properties: + photo: + type: string + format: binary + latitude: + type: number + format: float + minimum: -90 + maximum: 90 + example: 3.4501 + longitude: + type: number + format: float + minimum: -180 + maximum: 180 + example: -76.5332 + responses: + '200': + description: Verification outcome + content: + application/json: + schema: + type: object + required: + - success + - similarity_score + properties: + success: + type: boolean + similarity_score: + type: number + format: float + unlocked_content: + type: string + reward_badge: + type: string + '400': + description: Invalid coordinates or photo format. + '401': + $ref: '#/components/responses/Unauthorized' + + /reports: + post: + summary: Submit a Sculpture Location Report + description: | + Allows citizens to report if a sculpture is missing, undergoing maintenance, or has been relocated. + Supplying GPS coordinates and an optional photo helps update the status map via the weighted consensus engine. + operationId: submitReport + security: + - BearerAuth: [] + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - sculpture_id + - latitude + - longitude + - reported_status + properties: + sculpture_id: + type: string + format: uuid + latitude: + type: number + format: float + longitude: + type: number + format: float + reported_status: + type: string + enum: [moved, missing, on-site] + photo: + type: string + format: binary + description: + type: string + maxLength: 500 + responses: + '201': + description: Report ticket successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/Ticket' + '401': + $ref: '#/components/responses/Unauthorized' + +components: + securitySchemes: + BearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + + responses: + Unauthorized: + description: Authentication token missing or expired. + + schemas: + User: + type: object + required: + - id + - name + - email + - trust_score + - captured_count + properties: + id: + type: string + format: uuid + name: + type: string + example: Juan Perez + email: + type: string + format: email + example: juan.perez@gmail.com + trust_score: + type: number + format: float + example: 0.85 + captured_count: + type: integer + example: 12 + + CheckInRecord: + type: object + required: + - sculpture_id + - unlocked_at + - similarity_score + properties: + sculpture_id: + type: string + format: uuid + unlocked_at: + type: string + format: date-time + example: 2026-05-30T10:15:30Z + checkin_photo_url: + type: string + format: uri + example: https://cdn.gatos.cali.gov.co/uploads/checkin_9823.jpg + similarity_score: + type: number + format: float + example: 0.92 + + Ticket: + type: object + required: + - id + - reporter_id + - sculpture_id + - latitude + - longitude + - reported_status + - status + - created_at + properties: + id: + type: string + format: uuid + reporter_id: + type: string + format: uuid + sculpture_id: + type: string + format: uuid + latitude: + type: number + format: float + longitude: + type: number + format: float + reported_status: + type: string + enum: [moved, missing, on-site] + photo_url: + type: string + format: uri + nullable: true + description: + type: string + status: + type: string + enum: [pending, approved, rejected] + created_at: + type: string + format: date-time + resolved_at: + type: string + format: date-time + nullable: true + notes: + type: string + nullable: true diff --git a/docs/openapi_role_based/openapi_explorer.yaml b/docs/openapi_role_based/openapi_explorer.yaml new file mode 100644 index 0000000..b9e0723 --- /dev/null +++ b/docs/openapi_role_based/openapi_explorer.yaml @@ -0,0 +1,103 @@ +openapi: 3.0.3 +info: + title: Novias del Gato API - Explorer (Public) + description: | + Public, read-only API contract for tourists and citizens exploring Cali's public cat sculptures. + Does not require authentication. + version: 1.0.0 +servers: + - url: https://api.gatos.cali.gov.co/v1 + description: Production Server +paths: + /sculptures: + get: + summary: List All Cat Sculptures + description: Returns list of all sculptures with names, locations, and current status (Single Source of Truth). + operationId: listSculptures + responses: + '200': + description: List of sculptures + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Sculpture' + + /sculptures/{id}: + get: + summary: Get Sculpture Details + description: Detailed information about a sculpture, historical context, artist, and unlockable audio guides. + operationId: getSculptureById + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Detailed sculpture object + content: + application/json: + schema: + $ref: '#/components/schemas/SculptureDetails' + '404': + description: Sculpture not found. + +components: + schemas: + Sculpture: + type: object + required: + - id + - name + - artist + - year + - latitude + - longitude + - status + properties: + id: + type: string + format: uuid + name: + type: string + example: La Novia Dulce + artist: + type: string + example: Lorena Espitia + year: + type: integer + example: 2006 + latitude: + type: number + format: float + example: 3.450143 + longitude: + type: number + format: float + example: -76.533282 + status: + type: string + enum: [on-site, moved, missing] + description: Operational status of the sculpture. + example: on-site + + SculptureDetails: + allOf: + - $ref: '#/components/schemas/Sculpture' + - type: object + properties: + description: + type: string + example: Decorated with sweets and candies representing Cali's culinary traditions. + audio_url: + type: string + format: uri + example: https://cdn.gatos.cali.gov.co/audio/novia_dulce.mp3 + unlocked_content: + type: string + description: Extended history/curation (hidden until captured). + example: This sculpture was crafted in tribute to the traditional festival of Macetas. diff --git a/docs/openapi_role_based/openapi_moderator.yaml b/docs/openapi_role_based/openapi_moderator.yaml new file mode 100644 index 0000000..93612a3 --- /dev/null +++ b/docs/openapi_role_based/openapi_moderator.yaml @@ -0,0 +1,152 @@ +openapi: 3.0.3 +info: + title: Novias del Gato API - Moderator (Backoffice) + description: | + Backoffice API contract for administrators and cultural moderators. + Enables tracking and resolving disputed location reports. + version: 1.0.0 +servers: + - url: https://api.gatos.cali.gov.co/v1 + description: Production Server +paths: + /reports: + get: + summary: List Crowdsourced Reports + description: Retrieve reports/tickets submitted by users, filterable by status for verification. + operationId: listReports + security: + - BearerAuth: [] + parameters: + - name: status + in: query + required: false + schema: + type: string + enum: [pending, approved, rejected] + - name: sculpture_id + in: query + required: false + schema: + type: string + format: uuid + responses: + '200': + description: Array of reports + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Ticket' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + + /reports/{id}/verify: + put: + summary: Resolve Location Ticket + description: Manually accept or reject a user report. Approving a report updates the location oracle and recalculates user trust scores. + operationId: verifyReport + security: + - BearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - status + properties: + status: + type: string + enum: [approved, rejected] + notes: + type: string + maxLength: 300 + description: Review notes explaining the resolution. + responses: + '200': + description: Ticket resolved successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Ticket' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + description: Ticket not found. + +components: + securitySchemes: + BearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + + responses: + Unauthorized: + description: Authentication token missing or expired. + Forbidden: + description: Insufficient permissions for this action. + + schemas: + Ticket: + type: object + required: + - id + - reporter_id + - sculpture_id + - latitude + - longitude + - reported_status + - status + - created_at + properties: + id: + type: string + format: uuid + reporter_id: + type: string + format: uuid + sculpture_id: + type: string + format: uuid + latitude: + type: number + format: float + longitude: + type: number + format: float + reported_status: + type: string + enum: [moved, missing, on-site] + photo_url: + type: string + format: uri + nullable: true + description: + type: string + status: + type: string + enum: [pending, approved, rejected] + created_at: + type: string + format: date-time + resolved_at: + type: string + format: date-time + nullable: true + notes: + type: string + nullable: true diff --git a/docs/openapi_unified.yaml b/docs/openapi_unified.yaml new file mode 100644 index 0000000..0b74a6b --- /dev/null +++ b/docs/openapi_unified.yaml @@ -0,0 +1,508 @@ +openapi: 3.0.3 +info: + title: Novias del Gato API - Unified + description: | + Single, comprehensive API contract for the "Novias del Gato" digital ecosystem in Cali, Colombia. + This unified spec manages user profiles, sculpture data (The Oracle), GPS/vision-based check-ins, + and crowdsourced status reports with moderator verification. + version: 1.0.0 +servers: + - url: https://api.gatos.cali.gov.co/v1 + description: Production Server + - url: http://localhost:8000/v1 + description: Local Development Server +paths: + /auth/login: + post: + summary: Google SSO Authentication + description: Exchange a Google OAuth ID token for a system-issued JWT access token. + operationId: loginUser + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - id_token + properties: + id_token: + type: string + description: The ID token returned by Google OAuth. + responses: + '200': + description: Successful authentication + content: + application/json: + schema: + type: object + required: + - access_token + - token_type + - expires_in + properties: + access_token: + type: string + description: JWT access token for subsequent requests. + token_type: + type: string + example: Bearer + expires_in: + type: integer + description: Token lifetime in seconds. + '401': + description: Invalid token provided. + + /users/me: + get: + summary: Retrieve Current User Profile + description: Get details about the authenticated user, including their community trust score. + operationId: getMyProfile + security: + - BearerAuth: [] + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '401': + $ref: '#/components/responses/Unauthorized' + + /users/me/collection: + get: + summary: Get User's Unlocked Sculptures + description: Returns the user's progress tracking which cat sculptures they have successfully captured. + operationId: getMyCollection + security: + - BearerAuth: [] + responses: + '200': + description: List of check-ins / captures + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CheckInRecord' + '401': + $ref: '#/components/responses/Unauthorized' + + /sculptures: + get: + summary: List All Cat Sculptures + description: Returns list of all sculptures with names, locations, and current status (Single Source of Truth). + operationId: listSculptures + responses: + '200': + description: List of sculptures + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Sculpture' + + /sculptures/{id}: + get: + summary: Get Sculpture Details + description: Detailed information about a sculpture, historical context, artist, and unlockable audio guides. + operationId: getSculptureById + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Detailed sculpture object + content: + application/json: + schema: + $ref: '#/components/schemas/SculptureDetails' + '404': + description: Sculpture not found. + + /sculptures/{id}/check-in: + post: + summary: Capture / Check-in to a Sculpture + description: | + Perform physical verification by sending the explorer's current GPS location and a freshly captured photo. + The Recognition Service verifies the photo matches the sculpture model embeddings within proximity. + operationId: checkInSculpture + security: + - BearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - photo + - latitude + - longitude + properties: + photo: + type: string + format: binary + description: Sighting image file (JPEG/PNG) to analyze. + latitude: + type: number + format: float + minimum: -90 + maximum: 90 + example: 3.4501 + longitude: + type: number + format: float + minimum: -180 + maximum: 180 + example: -76.5332 + responses: + '200': + description: Verification outcome + content: + application/json: + schema: + type: object + required: + - success + - similarity_score + properties: + success: + type: boolean + description: True if the image embedding matched and location was within threshold. + similarity_score: + type: number + format: float + description: Visual confidence score (0.0 to 1.0). + unlocked_content: + type: string + description: Cultural facts or reward text if successfully captured for the first time. + reward_badge: + type: string + description: Name of the badge unlocked, if any. + '400': + description: Invalid coordinates or image file format. + '401': + $ref: '#/components/responses/Unauthorized' + + /reports: + post: + summary: Submit a Sculpture Location Report + description: | + Allows citizens to report if a sculpture is missing, undergoing maintenance, or has been relocated. + Supplying GPS coordinates and an optional photo helps update the status map via the weighted consensus engine. + operationId: submitReport + security: + - BearerAuth: [] + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - sculpture_id + - latitude + - longitude + - reported_status + properties: + sculpture_id: + type: string + format: uuid + latitude: + type: number + format: float + example: 3.4515 + longitude: + type: number + format: float + example: -76.5320 + reported_status: + type: string + enum: [moved, missing, on-site] + description: The observed state of the sculpture. + photo: + type: string + format: binary + description: Optional verification photo of empty pedestal or relocated site. + description: + type: string + maxLength: 500 + description: Context about the change. + responses: + '201': + description: Report ticket successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/Ticket' + '401': + $ref: '#/components/responses/Unauthorized' + + get: + summary: List Crowdsourced Reports (Moderator Only) + description: Retrieve reports/tickets submitted by users, filterable by status for verification. + operationId: listReports + security: + - BearerAuth: [] + parameters: + - name: status + in: query + required: false + schema: + type: string + enum: [pending, approved, rejected] + - name: sculpture_id + in: query + required: false + schema: + type: string + format: uuid + responses: + '200': + description: Array of reports + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Ticket' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + + /reports/{id}/verify: + put: + summary: Resolve Location Ticket (Moderator Only) + description: Manually accept or reject a user report. Approving a report updates the location oracle and recalculates user trust scores. + operationId: verifyReport + security: + - BearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - status + properties: + status: + type: string + enum: [approved, rejected] + notes: + type: string + maxLength: 300 + description: Review notes explaining the resolution. + responses: + '200': + description: Ticket resolved successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Ticket' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + description: Ticket not found. + +components: + securitySchemes: + BearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + + responses: + Unauthorized: + description: Authentication token missing or expired. + Forbidden: + description: Insufficient permissions for this action. + + schemas: + User: + type: object + required: + - id + - name + - email + - trust_score + - captured_count + properties: + id: + type: string + format: uuid + name: + type: string + example: Juan Perez + email: + type: string + format: email + example: juan.perez@gmail.com + trust_score: + type: number + format: float + description: Reputational metric scaling from 0.0 (untrusted) to 1.0 (highly reliable). + example: 0.85 + captured_count: + type: integer + description: Total number of unique sculptures verified. + example: 12 + + Sculpture: + type: object + required: + - id + - name + - artist + - year + - latitude + - longitude + - status + properties: + id: + type: string + format: uuid + name: + type: string + example: La Novia Dulce + artist: + type: string + example: Lorena Espitia + year: + type: integer + example: 2006 + latitude: + type: number + format: float + example: 3.450143 + longitude: + type: number + format: float + example: -76.533282 + status: + type: string + enum: [on-site, moved, missing] + description: Operational status of the sculpture. + example: on-site + + SculptureDetails: + allOf: + - $ref: '#/components/schemas/Sculpture' + - type: object + properties: + description: + type: string + example: Decorated with sweets and candies representing Cali's culinary traditions. + audio_url: + type: string + format: uri + example: https://cdn.gatos.cali.gov.co/audio/novia_dulce.mp3 + unlocked_content: + type: string + description: Extended history/curation (hidden until captured). + example: This sculpture was crafted in tribute to the traditional festival of Macetas. + + CheckInRecord: + type: object + required: + - sculpture_id + - unlocked_at + - similarity_score + properties: + sculpture_id: + type: string + format: uuid + unlocked_at: + type: string + format: date-time + example: 2026-05-30T10:15:30Z + checkin_photo_url: + type: string + format: uri + example: https://cdn.gatos.cali.gov.co/uploads/checkin_9823.jpg + similarity_score: + type: number + format: float + example: 0.92 + + Ticket: + type: object + required: + - id + - reporter_id + - sculpture_id + - latitude + - longitude + - reported_status + - status + - created_at + properties: + id: + type: string + format: uuid + reporter_id: + type: string + format: uuid + sculpture_id: + type: string + format: uuid + latitude: + type: number + format: float + example: 3.4515 + longitude: + type: number + format: float + example: -76.5320 + reported_status: + type: string + enum: [moved, missing, on-site] + photo_url: + type: string + format: uri + nullable: true + example: https://cdn.gatos.cali.gov.co/uploads/report_8321.jpg + description: + type: string + example: Under construction for street repairs. Pedestal is empty. + status: + type: string + enum: [pending, approved, rejected] + example: pending + created_at: + type: string + format: date-time + example: 2026-05-30T11:00:00Z + resolved_at: + type: string + format: date-time + nullable: true + example: null + notes: + type: string + nullable: true + example: Verified via municipal service coordinates.