{"openapi":"3.1.0","info":{"title":"Records API","version":"0.1.0"},"components":{"schemas":{"RecordInstance":{"type":"object","properties":{"id":{"type":"string"},"app_namespace":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"timezone":{"type":"string"},"notify_hour":{"type":"number"},"lang":{"type":"string","enum":["en","es"]},"email_fallback":{"type":"boolean"}},"required":["id","app_namespace","name","created_at","updated_at","timezone","notify_hour","lang","email_fallback"]},"ApiError":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"example":false},"error":{"type":"object","properties":{"code":{"type":"string","example":"UNAUTHORIZED"},"message":{"type":"string","example":"Authentication required"},"docsUrl":{"type":"string","example":"/api/reference#tag/errors/unauthorized"},"details":{"type":"object","additionalProperties":{},"example":{"field":"email"}},"retryAfter":{"type":"number","example":60},"field":{"type":"string","example":"email"}},"required":["code","message"]},"requestId":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}},"required":["success","error","requestId"]}},"parameters":{}},"paths":{"/v1/records/instances":{"post":{"tags":["Records instances"],"requestBody":{"description":"Instance","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"app_namespace":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_-]*$"},"name":{"type":"string","minLength":1,"maxLength":200},"timezone":{"type":"string","maxLength":100},"lang":{"type":"string","enum":["en","es"],"default":"en"}},"required":["app_namespace","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Existing instance","content":{"application/json":{"schema":{"type":"object","properties":{"instance":{"$ref":"#/components/schemas/RecordInstance"}},"required":["instance"]}}}},"201":{"description":"Created instance","content":{"application/json":{"schema":{"type":"object","properties":{"instance":{"$ref":"#/components/schemas/RecordInstance"}},"required":["instance"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"User session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Instance unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["Records instances"],"responses":{"200":{"description":"Live instances","content":{"application/json":{"schema":{"type":"object","properties":{"instances":{"type":"array","items":{"$ref":"#/components/schemas/RecordInstance"}}},"required":["instances"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"User session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Instance unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/records/instances/{id}":{"patch":{"tags":["Records instances"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"Settings","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"timezone":{"type":"string","maxLength":100},"notify_hour":{"type":"integer","minimum":0,"maximum":23},"lang":{"type":"string","enum":["en","es"]},"email_fallback":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Updated instance","content":{"application/json":{"schema":{"type":"object","properties":{"instance":{"$ref":"#/components/schemas/RecordInstance"}},"required":["instance"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"User session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Instance unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Records instances"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted instance"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"User session required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Instance unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"webhooks":{}}