openapi: 3.2.0 info: title: Piknik.Spot Spend Challenge API description: Piknik.Spot API with OAuth2 authentication, Model Context Protocol (MCP) support, and Agent-to-Agent (A2A) capabilities for AI-powered local food system interactions. version: 1.0.0 contact: name: Piknik.Spot API Support url: https://piknik.spot email: info@piknik.spot license: name: Proprietary url: https://piknik.spot/terms servers: - url: https://piknik.spot/api description: Production Server - url: http://localhost:3000/api description: Development Server tags: - name: Spend Challenge paths: /spend-challenge/associations/{id}/campaign: get: summary: GET /spend-challenge/associations/{id}/campaign description: Endpoint for /spend-challenge/associations/{id}/campaign tags: - Spend Challenge responses: '200': description: Success content: application/json: schema: type: object '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' security: [] parameters: - name: id in: path required: true schema: type: string description: id identifier - name: slug in: query schema: type: string description: slug parameter operationId: getSpendChallengeAssociationsByIdCampaign x-operation-id-source: derived /spend-challenge/associations/{id}: get: summary: GET /spend-challenge/associations/{id} description: Endpoint for /spend-challenge/associations/{id} tags: - Spend Challenge responses: '200': description: Success content: application/json: schema: type: object '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' security: [] parameters: - name: id in: path required: true schema: type: string description: id identifier operationId: getSpendChallengeAssociationsById x-operation-id-source: derived /spend-challenge/associations/{id}/share-card: get: summary: Fetch an image (remote URL or local file path) and return a base64 data URI tags: - Spend Challenge responses: '200': description: Success content: application/json: schema: type: object '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' security: [] parameters: - name: id in: path required: true schema: type: string description: id identifier operationId: getSpendChallengeAssociationsByIdShareCard x-operation-id-source: derived /spend-challenge/log: post: summary: POST /spend-challenge/log description: Endpoint for /spend-challenge/log tags: - Spend Challenge responses: '201': description: Created successfully content: application/json: schema: type: object '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' security: [] requestBody: required: true content: application/json: schema: type: object operationId: postSpendChallengeLog x-operation-id-source: derived /spend-challenge/my-logs: get: summary: GET /spend-challenge/my-logs description: Endpoint for /spend-challenge/my-logs tags: - Spend Challenge responses: '200': description: Success content: application/json: schema: type: object '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' security: [] parameters: - name: anonymousId in: query schema: type: string description: anonymousId parameter operationId: getSpendChallengeMyLogs x-operation-id-source: derived /spend-challenge/nearby: get: summary: GET /spend-challenge/nearby description: Endpoint for /spend-challenge/nearby tags: - Spend Challenge responses: '200': description: Success content: application/json: schema: type: object '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' security: [] parameters: - name: lat in: query schema: type: number format: double description: Latitude coordinate - name: lng in: query schema: type: number format: double description: Longitude coordinate - name: radiusKm in: query schema: type: integer description: radiusKm parameter operationId: getSpendChallengeNearby x-operation-id-source: derived /spend-challenge/participant/{id}/impact: get: summary: GET /spend-challenge/participant/{id}/impact description: Endpoint for /spend-challenge/participant/{id}/impact tags: - Spend Challenge responses: '200': description: Success content: application/json: schema: type: object '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' security: [] parameters: - name: id in: path required: true schema: type: string description: id identifier operationId: getSpendChallengeParticipantByIdImpact x-operation-id-source: derived /spend-challenge/rankings: get: summary: GET /spend-challenge/rankings description: Endpoint for /spend-challenge/rankings tags: - Spend Challenge responses: '200': description: Success content: application/json: schema: type: object '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' security: [] operationId: getSpendChallengeRankings x-operation-id-source: derived components: schemas: Error: type: object properties: error: type: string description: Error message error_description: type: string description: Detailed error description securitySchemes: cookieAuth: type: apiKey in: cookie name: next-auth.session-token description: Session-based authentication for web browsers oauth2: type: oauth2 description: OAuth 2.0 authentication for external applications and AI agents flows: authorizationCode: authorizationUrl: https://piknik.spot/api/oauth/authorize tokenUrl: https://piknik.spot/api/oauth/token refreshUrl: https://piknik.spot/api/oauth/token scopes: marketplace:write: Create and manage marketplace listings events:write: Create and manage community events read:profile: Read user profile information write:profile: Update user profile information bearerAuth: type: http scheme: bearer bearerFormat: JWT description: 'OAuth2 access token (JWT). Include in Authorization header as: Bearer {token}'