{"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"]},"RecordCollection":{"type":"object","properties":{"name":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["text"]},"max_length":{"type":"integer","minimum":1,"maximum":20000},"multiline":{"type":"boolean"}},"required":["key","label","type"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["number"]},"min":{"type":"number"},"max":{"type":"number"},"integer":{"type":"boolean"}},"required":["key","label","type"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["boolean"]}},"required":["key","label","type"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["date"]}},"required":["key","label","type"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false}},"required":["value","label"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["key","label","type","options"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["money"]},"default_currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["key","label","type"],"additionalProperties":false}]},"minItems":1,"maxItems":64},"reminder":{"type":["object","null"],"properties":{"date_field":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"offsets_days":{"type":"array","items":{"type":"integer","minimum":0,"maximum":365},"minItems":1,"maxItems":5}},"required":["date_field","offsets_days"],"additionalProperties":false},"id":{"type":"string"},"organization_id":{"type":"string"},"key":{"type":"string"},"version":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":["string","null"]}},"required":["name","fields","id","organization_id","key","version","created_at","updated_at","deleted_at"]},"CollectionRecord":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"collection_id":{"type":"string"},"title":{"type":"string"},"title_norm":{"type":"string"},"data":{"type":"object","additionalProperties":{}},"revision":{"type":"number"},"created_by":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":["string","null"]}},"required":["id","organization_id","collection_id","title","title_norm","data","revision","created_by","created_at","updated_at","deleted_at"]}},"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"}}}}}}},"/v1/records/instances/{id}/collections/{key}":{"put":{"tags":["Records collections"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"required":true,"name":"key","in":"path"},{"schema":{"type":"string","enum":["1"]},"required":false,"name":"create_only","in":"query"}],"requestBody":{"description":"Collection definition and reminder rule","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"fields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["text"]},"max_length":{"type":"integer","minimum":1,"maximum":20000},"multiline":{"type":"boolean"}},"required":["key","label","type"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["number"]},"min":{"type":"number"},"max":{"type":"number"},"integer":{"type":"boolean"}},"required":["key","label","type"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["boolean"]}},"required":["key","label","type"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["date"]}},"required":["key","label","type"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["select"]},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false}},"required":["value","label"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["key","label","type","options"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"label":{"type":"object","properties":{"en":{"type":"string","minLength":1,"maxLength":200},"es":{"type":"string","minLength":1,"maxLength":200}},"required":["en","es"],"additionalProperties":false},"required":{"type":"boolean"},"title":{"type":"boolean"},"default":{},"type":{"type":"string","enum":["money"]},"default_currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["key","label","type"],"additionalProperties":false}]},"minItems":1,"maxItems":64},"reminder":{"type":"object","properties":{"date_field":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$"},"offsets_days":{"type":"array","items":{"type":"integer","minimum":0,"maximum":365},"minItems":1,"maxItems":5}},"required":["date_field","offsets_days"],"additionalProperties":false}},"required":["name","fields"],"additionalProperties":false}}}},"responses":{"200":{"description":"Upserted collection","content":{"application/json":{"schema":{"type":"object","properties":{"collection":{"$ref":"#/components/schemas/RecordCollection"}},"required":["collection"]}}}},"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, collection or record unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"409":{"description":"Conflict; stale revisions include the current record","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input or capacity exceeded","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/records/instances/{id}/collections":{"get":{"tags":["Records collections"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Collections","content":{"application/json":{"schema":{"type":"object","properties":{"collections":{"type":"array","items":{"$ref":"#/components/schemas/RecordCollection"}}},"required":["collections"]}}}},"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, collection or record unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"409":{"description":"Conflict; stale revisions include the current record","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input or capacity exceeded","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/records/instances/{id}/collections/{key}/records":{"get":{"tags":["Records collections"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"required":true,"name":"key","in":"path"},{"schema":{"type":"string","pattern":"^\\d+$","default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$","default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Live records","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array","items":{"$ref":"#/components/schemas/CollectionRecord"}}},"required":["records"]}}}},"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, collection or record unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"409":{"description":"Conflict; stale revisions include the current record","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input or capacity exceeded","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Records collections"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"required":true,"name":"key","in":"path"}],"requestBody":{"description":"Record values","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{}}},"required":["data"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created record","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["record"]}}}},"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, collection or record unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"409":{"description":"Conflict; stale revisions include the current record","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input or capacity exceeded","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/records/instances/{id}/collections/{key}/records/{recordId}":{"get":{"tags":["Records collections"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"required":true,"name":"key","in":"path"},{"schema":{"type":"string","maxLength":100,"pattern":"^rrec_[A-Za-z0-9_-]+$"},"required":true,"name":"recordId","in":"path"}],"responses":{"200":{"description":"Record","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["record"]}}}},"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, collection or record unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"409":{"description":"Conflict; stale revisions include the current record","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input or capacity exceeded","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Records collections"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"required":true,"name":"key","in":"path"},{"schema":{"type":"string","maxLength":100,"pattern":"^rrec_[A-Za-z0-9_-]+$"},"required":true,"name":"recordId","in":"path"}],"requestBody":{"description":"Revision and changed values","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{}},"revision":{"type":"integer","minimum":1}},"required":["data","revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated record","content":{"application/json":{"schema":{"type":"object","properties":{"record":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["record"]}}}},"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, collection or record unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"409":{"description":"Conflict; stale revisions include the current record","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input or capacity exceeded","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Records collections"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"required":true,"name":"key","in":"path"},{"schema":{"type":"string","maxLength":100,"pattern":"^rrec_[A-Za-z0-9_-]+$"},"required":true,"name":"recordId","in":"path"}],"responses":{"204":{"description":"Soft-deleted record"},"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, collection or record unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"409":{"description":"Conflict; stale revisions include the current record","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input or capacity exceeded","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"503":{"description":"Storage unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/records/instances/{id}/notifications":{"get":{"tags":["Records notifications"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Notification settings","content":{"application/json":{"schema":{"type":"object","properties":{"public_key":{"type":["string","null"]},"vapid_key_id":{"type":["string","null"]},"push_available":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active","needs_reregistration"]}},"required":["id","status"]}},"last_failures":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string"},"http_status":{"type":["number","null"]}},"required":["id","channel","http_status"]}},"timezone":{"type":"string"},"notify_hour":{"type":"number"},"lang":{"type":"string","enum":["en","es"]},"email_fallback":{"type":"boolean"},"account_email_masked":{"type":["string","null"]}},"required":["public_key","vapid_key_id","push_available","subscriptions","last_failures","timezone","notify_hour","lang","email_fallback","account_email_masked"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"403":{"description":"User session required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"404":{"description":"Instance unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"retry_after":{"type":"number"}},"required":["error","retry_after"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}}}}},"/v1/records/instances/{id}/push-subscriptions":{"put":{"tags":["Records notifications"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"Browser push subscription","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string","maxLength":4096},"keys":{"type":"object","properties":{"p256dh":{"type":"string","pattern":"^[A-Za-z0-9_-]{87}={0,2}$"},"auth":{"type":"string","pattern":"^[A-Za-z0-9_-]{22}={0,2}$"}},"required":["p256dh","auth"],"additionalProperties":false}},"required":["endpoint","keys"],"additionalProperties":false}}}},"responses":{"200":{"description":"Subscription","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active"]}},"required":["id","status"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"403":{"description":"User session required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"404":{"description":"Instance unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"retry_after":{"type":"number"}},"required":["error","retry_after"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}}}},"delete":{"tags":["Records notifications"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"}],"requestBody":{"description":"Endpoint to revoke","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string","maxLength":4096}},"required":["endpoint"],"additionalProperties":false}}}},"responses":{"204":{"description":"Revoked subscription"},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"403":{"description":"User session required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"404":{"description":"Instance unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"retry_after":{"type":"number"}},"required":["error","retry_after"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}}}}},"/v1/records/instances/{id}/push/test":{"post":{"tags":["Records notifications"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Test push result","content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"number"}},"required":["sent"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"403":{"description":"User session required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"404":{"description":"Instance unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"retry_after":{"type":"number"}},"required":["error","retry_after"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}}}}},"/v1/records/instances/{id}/lookups/rdap":{"get":{"tags":["Records notifications"],"parameters":[{"schema":{"type":"string","maxLength":100,"pattern":"^rin_[A-Za-z0-9_-]+$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":253},"required":true,"name":"domain","in":"query"}],"responses":{"200":{"description":"RDAP lookup result","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string","enum":["found","no-rdap","not-found","failed"]},"domain":{"type":"string"},"checked_at":{"type":"string"},"registrar":{"type":"string"},"expires_at":{"type":"string"},"registered_at":{"type":"string"},"source_url":{"type":"string"},"upstream_status":{"type":"number"}},"required":["result","domain","checked_at"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"403":{"description":"User session required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"404":{"description":"Instance unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"name":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["code","path"]}}},"required":["name","issues"]}},"required":["success","error"]}]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"retry_after":{"type":"number"}},"required":["error","retry_after"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"current":{"$ref":"#/components/schemas/CollectionRecord"}},"required":["error"]}}}}}}}},"webhooks":{}}