{"openapi":"3.1.1","info":{"title":"Context Factory API","version":"1.0.0","description":"Read-only discovery for public context artifacts and collections. Source bodies are not returned."},"servers":[{"url":"https://api.contextfactory.dev/v1"}],"paths":{"/artifacts":{"get":{"operationId":"searchArtifacts","summary":"Search public artifacts","parameters":[{"name":"q","in":"query","description":"Metadata search terms.","schema":{"type":"string","minLength":1}},{"name":"type","in":"query","description":"Exact artifact type.","schema":{"type":"string","enum":["markdown","text","agents","skill","readme"]}},{"name":"owner","in":"query","description":"Exact GitHub owner login.","schema":{"type":"string","minLength":1}},{"name":"repository","in":"query","description":"Exact GitHub repository in owner/repository form.","schema":{"type":"string","pattern":"^[^/\\s]+/[^/\\s]+$"}},{"name":"cursor","in":"query","description":"Opaque cursor from the previous response.","schema":{"type":"string","minLength":1}},{"name":"limit","in":"query","description":"Maximum artifacts to return.","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"Artifact page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactPage"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/artifacts/{artifactId}":{"get":{"operationId":"getArtifact","summary":"Resolve one public artifact","parameters":[{"name":"artifactId","in":"path","required":true,"schema":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{12}$"}}],"responses":{"200":{"description":"Artifact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}}},"400":{"description":"Invalid artifact ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Artifact not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/collections/{collectionId}":{"get":{"operationId":"getCollection","summary":"Resolve a public collection and its ordered artifacts","parameters":[{"name":"collectionId","in":"path","required":true,"schema":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{12}$"}},{"name":"q","in":"query","description":"Metadata search terms.","schema":{"type":"string","minLength":1}},{"name":"type","in":"query","description":"Exact artifact type.","schema":{"type":"string","enum":["markdown","text","agents","skill","readme"]}},{"name":"owner","in":"query","description":"Exact GitHub owner login.","schema":{"type":"string","minLength":1}},{"name":"repository","in":"query","description":"Exact GitHub repository in owner/repository form.","schema":{"type":"string","pattern":"^[^/\\s]+/[^/\\s]+$"}},{"name":"cursor","in":"query","description":"Opaque cursor from the previous response.","schema":{"type":"string","minLength":1}},{"name":"limit","in":"query","description":"Maximum artifacts to return.","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"Collection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Collection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Artifact":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{12}$"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["markdown","text","agents","skill","readme"]},"canonicalUrl":{"type":"string","format":"uri"},"source":{"type":"object","properties":{"kind":{"type":"string","enum":["github_repository","github_gist"]},"owner":{"type":"string"},"repository":{"type":"string"},"path":{"type":"string"},"ref":{"type":"string"},"containerUrl":{"type":"string","format":"uri"},"directoryUrl":{"type":"string","format":"uri"},"fileUrl":{"type":"string","format":"uri"},"rawUrl":{"type":"string","format":"uri"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["kind","owner","repository","path","ref","containerUrl","directoryUrl","fileUrl","rawUrl"],"additionalProperties":false},"attributes":{"type":"object","properties":{"license":{"type":"string"},"compatibility":{"type":"string"}},"additionalProperties":false}},"required":["id","name","type","canonicalUrl","source"],"additionalProperties":false},"ArtifactPage":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"artifacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{12}$"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["markdown","text","agents","skill","readme"]},"canonicalUrl":{"type":"string","format":"uri"},"source":{"type":"object","properties":{"kind":{"type":"string","enum":["github_repository","github_gist"]},"owner":{"type":"string"},"repository":{"type":"string"},"path":{"type":"string"},"ref":{"type":"string"},"containerUrl":{"type":"string","format":"uri"},"directoryUrl":{"type":"string","format":"uri"},"fileUrl":{"type":"string","format":"uri"},"rawUrl":{"type":"string","format":"uri"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["kind","owner","repository","path","ref","containerUrl","directoryUrl","fileUrl","rawUrl"],"additionalProperties":false},"attributes":{"type":"object","properties":{"license":{"type":"string"},"compatibility":{"type":"string"}},"additionalProperties":false}},"required":["id","name","type","canonicalUrl","source"],"additionalProperties":false}},"page":{"type":"object","properties":{"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["cursor","hasMore"],"additionalProperties":false}},"required":["artifacts","page"],"additionalProperties":false},"Collection":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{12}$"},"name":{"type":"string"},"description":{"type":"string"},"canonicalUrl":{"type":"string","format":"uri"},"owner":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{12}$"},"name":{"type":"string"},"githubHandle":{"type":"string"},"canonicalUrl":{"type":"string","format":"uri"}},"required":["id","canonicalUrl"],"additionalProperties":false},"artifactCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"artifacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[1-9A-HJ-NP-Za-km-z]{12}$"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["markdown","text","agents","skill","readme"]},"canonicalUrl":{"type":"string","format":"uri"},"source":{"type":"object","properties":{"kind":{"type":"string","enum":["github_repository","github_gist"]},"owner":{"type":"string"},"repository":{"type":"string"},"path":{"type":"string"},"ref":{"type":"string"},"containerUrl":{"type":"string","format":"uri"},"directoryUrl":{"type":"string","format":"uri"},"fileUrl":{"type":"string","format":"uri"},"rawUrl":{"type":"string","format":"uri"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["kind","owner","repository","path","ref","containerUrl","directoryUrl","fileUrl","rawUrl"],"additionalProperties":false},"attributes":{"type":"object","properties":{"license":{"type":"string"},"compatibility":{"type":"string"}},"additionalProperties":false}},"required":["id","name","type","canonicalUrl","source"],"additionalProperties":false}},"page":{"type":"object","properties":{"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasMore":{"type":"boolean"}},"required":["cursor","hasMore"],"additionalProperties":false}},"required":["id","name","canonicalUrl","owner","artifactCount","artifacts","page"],"additionalProperties":false},"Error":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}