{"openapi":"3.0.3","info":{"title":"SCode API","version":"0.1.0","description":"Public HTTP API for encoding and decoding messages using classic ciphers.\n\nBuilt on top of `@zyther/scode-core`. All ciphers run statelessly — no data is stored between requests.","contact":{"name":"Zyther Dev","url":"https://zyther.dev","email":"hello@zyther.dev"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"https://api.scode.zyther.dev","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"paths":{"/api/encode":{"post":{"tags":["Encode"],"summary":"Encode a message","description":"Encodes a plain message using the given cipher pattern. Returns the encrypted text and the configuration needed to decode it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"description":"The plain text to encode.","example":"hello world"},"pattern":{"type":"string","minLength":1,"description":"The cipher pattern (e.g. ¬, ?, |).","example":"¬"}},"required":["message","pattern"],"description":"The request body for encoding a message."}}}},"responses":{"200":{"description":"Encoded successfully","content":{"application/json":{"schema":{"type":"object","properties":{"encrypted":{"type":"string","example":"-.-. .... . .-.. .-.. ---"},"config":{"type":"string","example":""},"pattern":{"type":"string","example":"¬"},"message":{"type":"string","example":"HELLOWORLD"}},"required":["encrypted","config","pattern","message"],"description":"The response body for encoding a message."}}}},"400":{"description":"Encoding failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}},"required":["error"],"description":"The response body for an error."}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}},"required":["error"],"description":"The response body for an error."}}}}}}},"/api/decode":{"post":{"tags":["Decode"],"summary":"Decode a message","description":"Decodes an encrypted message back to plain text. Requires the same pattern used during encoding, plus the emitted config (if any).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"encrypted":{"type":"string","minLength":1},"pattern":{"type":"string","minLength":1},"config":{"type":"string"}},"required":["encrypted","pattern"],"description":"The request body for decoding a message."}}}},"responses":{"200":{"description":"Decoded successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"HELLOWORLD"}},"required":["message"],"description":"The response body for decoding a message."}}}},"400":{"description":"Decoding failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}},"required":["error"],"description":"The response body for an error."}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"fieldErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"formErrors":{"type":"array","items":{"type":"string"}}},"required":["error"],"description":"The response body for an error."}}}}}}},"/api/ciphers":{"get":{"tags":["Meta"],"summary":"List available ciphers","description":"Returns metadata for every cipher available in the API.","responses":{"200":{"description":"List of ciphers","content":{"application/json":{"schema":{"type":"object","properties":{"ciphers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"symbol":{"type":"string"},"description":{"type":"string"}},"required":["name","symbol","description"]}}},"required":["ciphers"]}}}}}}},"/api/health":{"get":{"tags":["Meta"],"summary":"Health check","responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"timestamp":{"type":"string"}},"required":["status","timestamp"]}}}}}}}}}