openapi: 3.2.0 info: title: Piknik.Spot Associations 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: Associations paths: /associations/{id}/members/{membershipId}: put: summary: PUT /associations/{id}/members/{membershipId} description: Endpoint for /associations/{id}/members/{membershipId} tags: - Associations 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: membershipId in: path required: true schema: type: string description: membershipId identifier requestBody: required: true content: application/json: schema: type: object operationId: putAssociationsByIdMembersByMembershipId x-operation-id-source: derived /associations/{id}/members: get: summary: GET /associations/{id}/members description: Endpoint for /associations/{id}/members tags: - Associations 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: getAssociationsByIdMembers x-operation-id-source: derived /associations/{id}/place-tours/{tourId}: patch: summary: PATCH /associations/{id}/place-tours/{tourId} description: Endpoint for /associations/{id}/place-tours/{tourId} tags: - Associations 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: tourId in: path required: true schema: type: string description: tourId identifier requestBody: required: true content: application/json: schema: type: object operationId: patchAssociationsByIdPlaceToursByTourId x-operation-id-source: derived put: summary: PUT /associations/{id}/place-tours/{tourId} description: Endpoint for /associations/{id}/place-tours/{tourId} tags: - Associations 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: tourId in: path required: true schema: type: string description: tourId identifier requestBody: required: true content: application/json: schema: type: object operationId: putAssociationsByIdPlaceToursByTourId x-operation-id-source: derived /associations/{id}/place-tours: get: summary: GET /associations/{id}/place-tours description: Endpoint for /associations/{id}/place-tours tags: - Associations 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: getAssociationsByIdPlaceTours x-operation-id-source: derived post: summary: POST /associations/{id}/place-tours description: Endpoint for /associations/{id}/place-tours tags: - Associations 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: [] parameters: - name: id in: path required: true schema: type: string description: id identifier requestBody: required: true content: application/json: schema: type: object operationId: postAssociationsByIdPlaceTours x-operation-id-source: derived /associations/{id}/spend-challenge/activity-map: get: summary: GET /associations/{id}/spend-challenge/activity-map description: Endpoint for /associations/{id}/spend-challenge/activity-map tags: - Associations 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: challengeId in: query schema: type: string description: challengeId parameter - name: campaignId in: query schema: type: string description: campaignId parameter operationId: getAssociationsByIdSpendChallengeActivityMap x-operation-id-source: derived /associations/{id}/spend-challenge/campaigns/{campaignId}/open: post: summary: POST /associations/{id}/spend-challenge/campaigns/{campaignId}/open description: Endpoint for /associations/{id}/spend-challenge/campaigns/{campaignId}/open tags: - Associations 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: [] parameters: - name: id in: path required: true schema: type: string description: id identifier - name: campaignId in: path required: true schema: type: string description: campaignId identifier requestBody: required: true content: application/json: schema: type: object operationId: postAssociationsByIdSpendChallengeCampaignsByCampaignIdOpen x-operation-id-source: derived /associations/{id}/spend-challenge/campaigns/{campaignId}/poster: get: summary: GET /associations/{id}/spend-challenge/campaigns/{campaignId}/poster description: Endpoint for /associations/{id}/spend-challenge/campaigns/{campaignId}/poster tags: - Associations 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: campaignId in: path required: true schema: type: string description: campaignId identifier operationId: getAssociationsByIdSpendChallengeCampaignsByCampaignIdPoster x-operation-id-source: derived /associations/{id}/spend-challenge/campaigns/{campaignId}: patch: summary: PATCH /associations/{id}/spend-challenge/campaigns/{campaignId} description: Endpoint for /associations/{id}/spend-challenge/campaigns/{campaignId} tags: - Associations 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: campaignId in: path required: true schema: type: string description: campaignId identifier requestBody: required: true content: application/json: schema: type: object operationId: patchAssociationsByIdSpendChallengeCampaignsByCampaignId x-operation-id-source: derived /associations/{id}/spend-challenge/campaigns: get: summary: GET /associations/{id}/spend-challenge/campaigns description: Endpoint for /associations/{id}/spend-challenge/campaigns tags: - Associations 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: getAssociationsByIdSpendChallengeCampaigns x-operation-id-source: derived post: summary: POST /associations/{id}/spend-challenge/campaigns description: Endpoint for /associations/{id}/spend-challenge/campaigns tags: - Associations 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: postAssociationsByIdSpendChallengeCampaigns x-operation-id-source: derived /associations/{id}/spend-challenge/insights: get: summary: GET /associations/{id}/spend-challenge/insights description: Endpoint for /associations/{id}/spend-challenge/insights tags: - Associations 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: challengeId in: query schema: type: string description: challengeId parameter - name: from in: query schema: type: string description: from parameter - name: to in: query schema: type: string description: to parameter - name: campaignId in: query schema: type: string description: campaignId parameter operationId: getAssociationsByIdSpendChallengeInsights x-operation-id-source: derived /associations/{id}/spend-challenge: get: summary: GET /associations/{id}/spend-challenge description: Endpoint for /associations/{id}/spend-challenge tags: - Associations 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: challengeId in: query schema: type: string description: challengeId parameter operationId: getAssociationsByIdSpendChallenge x-operation-id-source: derived put: summary: PUT /associations/{id}/spend-challenge description: Endpoint for /associations/{id}/spend-challenge tags: - Associations 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: challengeId in: query schema: type: string description: challengeId parameter requestBody: required: true content: application/json: schema: type: object operationId: putAssociationsByIdSpendChallenge x-operation-id-source: derived /associations/by-slug/{slug}/tours/{tourSlug}: get: summary: GET /associations/by-slug/{slug}/tours/{tourSlug} description: Endpoint for /associations/by-slug/{slug}/tours/{tourSlug} tags: - Associations 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: slug in: path required: true schema: type: string description: slug identifier - name: tourSlug in: path required: true schema: type: string description: tourSlug identifier operationId: getAssociationsBySlugBySlugToursByTourSlug x-operation-id-source: derived /associations/by-slug/{slug}/tours: get: summary: GET /associations/by-slug/{slug}/tours description: Endpoint for /associations/by-slug/{slug}/tours tags: - Associations 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: slug in: path required: true schema: type: string description: slug identifier operationId: getAssociationsBySlugBySlugTours x-operation-id-source: derived /v2/associations/{slug}/campaigns: get: summary: GET /v2/associations/{slug}/campaigns description: Endpoint for /v2/associations/{slug}/campaigns tags: - Associations 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: slug in: path required: true schema: type: string description: slug identifier operationId: getV2AssociationsBySlugCampaigns x-operation-id-source: derived /v2/associations/{slug}/chat: post: summary: POST /v2/associations/{slug}/chat description: Endpoint for /v2/associations/{slug}/chat tags: - Associations 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: slug in: path required: true schema: type: string description: slug identifier requestBody: required: true content: application/json: schema: type: object operationId: postV2AssociationsBySlugChat x-operation-id-source: derived /v2/associations/{slug}/jobs: get: summary: GET /v2/associations/{slug}/jobs description: Endpoint for /v2/associations/{slug}/jobs tags: - Associations 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: slug in: path required: true schema: type: string description: slug identifier - name: limit in: query schema: type: integer description: Maximum number of results - name: offset in: query schema: type: integer description: Pagination offset operationId: getV2AssociationsBySlugJobs x-operation-id-source: derived /v2/associations/{slug}/members: get: summary: GET /v2/associations/{slug}/members description: Endpoint for /v2/associations/{slug}/members tags: - Associations 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: slug in: path required: true schema: type: string description: slug identifier - name: page in: query schema: type: string description: page parameter - name: limit in: query schema: type: integer description: Maximum number of results operationId: getV2AssociationsBySlugMembers x-operation-id-source: derived /v2/associations/{slug}: get: summary: GET /v2/associations/{slug} description: Endpoint for /v2/associations/{slug} tags: - Associations 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: slug in: path required: true schema: type: string description: slug identifier operationId: getV2AssociationsBySlug x-operation-id-source: derived /v2/associations/available: get: summary: GET /v2/associations/available description: Endpoint for /v2/associations/available tags: - Associations 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: excludeParticipant in: query schema: type: string description: excludeParticipant parameter - name: category in: query schema: type: string description: category parameter - name: search in: query schema: type: string description: Search query string - name: featured in: query schema: type: string description: featured parameter operationId: getV2AssociationsAvailable 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}'