openapi: 3.2.0 info: title: Piknik.Spot Users 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: Users paths: /users/{userId}/follows: get: summary: Get all entities a user follows tags: - Users 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: userId in: path required: true schema: type: string description: userId identifier operationId: getUsersByUserIdFollows x-operation-id-source: derived /users/me/social-links/phone/code: post: summary: POST /api/users/me/social-links/phone/code tags: - Users 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: [] operationId: postUsersMeSocialLinksPhoneCode x-operation-id-source: derived /users/me/social-links/phone: delete: summary: DELETE /api/users/me/social-links/phone tags: - Users 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: deleteUsersMeSocialLinksPhone x-operation-id-source: derived /users/me/social-links: get: summary: GET /api/users/me/social-links tags: - Users 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: getUsersMeSocialLinks x-operation-id-source: derived /users/me/social-links/telegram/code: post: summary: POST /api/users/me/social-links/telegram/code tags: - Users 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: [] operationId: postUsersMeSocialLinksTelegramCode x-operation-id-source: derived /users/me/social-links/telegram: delete: summary: DELETE /api/users/me/social-links/telegram tags: - Users 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: deleteUsersMeSocialLinksTelegram x-operation-id-source: derived /users/search: get: summary: GET /users/search description: Endpoint for /users/search tags: - Users 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: q in: query schema: type: string description: Search query string operationId: getUsersSearch x-operation-id-source: derived /v2/users/{userId}/suggestions: get: summary: GET /v2/users/{userId}/suggestions description: Endpoint for /v2/users/{userId}/suggestions tags: - Users 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: userId in: path required: true schema: type: string description: userId identifier operationId: getV2UsersByUserIdSuggestions 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}'