{"openapi":"3.0.3","info":{"version":"1.0.0","contact":{"name":"API Support","email":"support@contexthub.dev"},"title":"Context Hub - Context API","description":"API for storing and retrieving temporary JSON context data by code."},"servers":[{"url":"http://localhost:3000","description":"Development Server"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key for authentication"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token obtained from an auth provider"}},"schemas":{"Context":{"type":"object","required":["code","data"],"properties":{"code":{"type":"string","description":"Unique code for the context","example":"abc123"},"data":{"type":"object","description":"Context data to store","example":{"user":"john.doe","role":"admin"}}}},"ContextResponse":{"type":"object","properties":{"message":{"type":"string","example":"Context stored"},"code":{"type":"string","example":"abc123"}}}}},"paths":{"/api/v1/context":{"post":{"summary":"Store context data with a temporary code","tags":["Context"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"description":"Store temporary JSON context data that can be retrieved later using the provided code.\nThis endpoint can be authenticated using either:\n- API key with CREATE permission, or\n- Valid JWT token from a configured auth provider (users will be auto-provisioned if needed)\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Context"},"examples":{"userSession":{"summary":"User session context","value":{"code":"session-abc123","data":{"user":{"id":"user-456","email":"user@example.com","role":"admin"},"permissions":["read","write"],"expiresAt":"2024-01-16T00:00:00Z"}}},"simpleData":{"summary":"Simple data context","value":{"code":"temp-data-123","data":{"message":"Hello World","timestamp":"2024-01-15T10:30:00Z"}}}}}}},"responses":{"201":{"description":"Context stored successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextResponse"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Invalid code: Code is required and must be a non-empty string"}}}}}},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"}}}},"/api/v1/context/{code}":{"get":{"summary":"Retrieve context data by code","tags":["Context"],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"description":"Retrieve temporary context data using the provided code.\nThis endpoint can be authenticated using either:\n- API key with READ permission, or\n- Valid JWT token from a configured auth provider (users will be auto-provisioned if needed)\n\nNote: Depending on configuration, the context may be deleted after retrieval.\n","parameters":[{"in":"path","name":"code","required":true,"schema":{"type":"string"},"description":"The temporary code for the context","example":"abc123"}],"responses":{"200":{"description":"Context data retrieved successfully","content":{"application/json":{"schema":{"type":"object","description":"The stored context data"},"examples":{"userSession":{"summary":"User session data","value":{"user":{"id":"user-456","email":"user@example.com","role":"admin"},"permissions":["read","write"],"expiresAt":"2024-01-16T00:00:00Z"}},"simpleData":{"summary":"Simple data","value":{"message":"Hello World","timestamp":"2024-01-15T10:30:00Z"}}}}}},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Context not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Context not found"}}}}}}}}}},"tags":[]}