openapi: 3.2.0 info: title: Piknik.Spot Surveys 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: Surveys paths: /business/surveys/{id}: get: summary: GET /business/surveys/{id} description: Endpoint for /business/surveys/{id} tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] parameters: - name: id in: path required: true schema: type: string description: id identifier operationId: getBusinessSurveysById x-operation-id-source: derived put: summary: PUT /business/surveys/{id} description: Endpoint for /business/surveys/{id} tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] parameters: - name: id in: path required: true schema: type: string description: id identifier requestBody: required: true content: application/json: schema: type: object operationId: putBusinessSurveysById x-operation-id-source: derived delete: summary: DELETE /business/surveys/{id} description: Endpoint for /business/surveys/{id} tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] parameters: - name: id in: path required: true schema: type: string description: id identifier operationId: deleteBusinessSurveysById x-operation-id-source: derived /business/surveys: get: summary: GET /business/surveys description: Endpoint for /business/surveys tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] operationId: getBusinessSurveys x-operation-id-source: derived post: summary: POST /business/surveys description: Endpoint for /business/surveys tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] requestBody: required: true content: application/json: schema: type: object operationId: postBusinessSurveys x-operation-id-source: derived /surveys: post: summary: POST /surveys description: Endpoint for /surveys tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] parameters: - name: status in: query schema: type: string description: status parameter - name: surveyType in: query schema: type: string description: surveyType parameter - name: participantId in: query schema: type: string description: Participant identifier requestBody: required: true content: application/json: schema: type: object operationId: postSurveys x-operation-id-source: derived get: summary: GET /surveys description: Endpoint for /surveys tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] parameters: - name: status in: query schema: type: string description: status parameter - name: surveyType in: query schema: type: string description: surveyType parameter - name: participantId in: query schema: type: string description: Participant identifier operationId: getSurveys x-operation-id-source: derived /v2/surveys/{id}/respond: post: summary: POST /v2/surveys/{id}/respond description: Endpoint for /v2/surveys/{id}/respond tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] parameters: - name: id in: path required: true schema: type: string description: id identifier requestBody: required: true content: application/json: schema: type: object operationId: postV2SurveysByIdRespond x-operation-id-source: derived /v2/surveys/{id}/results: get: summary: GET /v2/surveys/{id}/results description: Endpoint for /v2/surveys/{id}/results tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] parameters: - name: id in: path required: true schema: type: string description: id identifier - name: include_responses in: query schema: type: string description: include_responses parameter operationId: getV2SurveysByIdResults x-operation-id-source: derived /v2/surveys/active: get: summary: GET /v2/surveys/active description: Endpoint for /v2/surveys/active tags: - Surveys 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: - bearerAuth: [] - cookieAuth: [] parameters: - name: userLat in: query schema: type: number format: double description: userLat parameter - name: userLng in: query schema: type: number format: double description: userLng parameter - name: radius in: query schema: type: integer description: Search radius in kilometers - name: anonymousId in: query schema: type: string description: anonymousId parameter operationId: getV2SurveysActive x-operation-id-source: derived /v2/surveys/aggregate: get: summary: GET /v2/surveys/aggregate description: Endpoint for /v2/surveys/aggregate tags: - Surveys 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: userLat in: query schema: type: number format: double description: userLat parameter - name: userLng in: query schema: type: number format: double description: userLng parameter operationId: getV2SurveysAggregate 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}'