{"openapi":"3.1.0","info":{"title":"Kino API","version":"1.0.0-preview","description":"Import media into Kino from HTTPS URLs."},"servers":[{"url":"https://kino.ai"}],"externalDocs":{"url":"https://kino.ai/docs/api"},"security":[{"OrganizationApiKey":[]}],"paths":{"/api/v1/bins/{bin_id}/assets/import":{"post":{"operationId":"createMediaImport","summary":"Start an import","description":"Requires imports:write for the destination media bin and access to the import preview.","externalDocs":{"url":"https://kino.ai/docs/api/create-import"},"parameters":[{"name":"bin_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-zA-Z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateImport"}}}},"responses":{"202":{"description":"Import accepted.","headers":{"Location":{"schema":{"type":"string"},"description":"Relative status URL."},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportAccepted"}}}},"400":{"description":"Invalid body, idempotency key or source URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid organization API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope, preview access or plan entitlement.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Destination media bin unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency key conflicts with an earlier submission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body is larger than 64 KiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Preview import limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":0}}}},"503":{"description":"Temporarily unavailable. Retry with the same idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/imports/{import_id}":{"get":{"operationId":"getMediaImport","summary":"Check an import","description":"Requires imports:read for the destination media bin.","externalDocs":{"url":"https://kino.ai/docs/api/get-import"},"parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current transfer and processing state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportStatus"}}}},"401":{"description":"Missing or invalid organization API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or preview access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Import unavailable within the key’s bin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"OrganizationApiKey":{"type":"http","scheme":"bearer","description":"Kino organization API key."}},"schemas":{"CreateImport":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[^/\\\\\\x00-\\x1f\\x7f]+$","description":"File name including its extension."},"source_url":{"type":"string","maxLength":8192,"format":"uri","description":"Direct HTTPS download URL accessible over the public internet."}},"required":["name","source_url"],"additionalProperties":false},"ImportAccepted":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"import_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status_url":{"type":"string","description":"Relative URL for polling this import."}},"required":["import_id","status_url"],"additionalProperties":false},"ImportStatus":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"import_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"transfer":{"type":"string","enum":["queued","copying","copied","failed"]},"asset_id":{"description":"Present once the original has been copied.","type":"string"},"bin_id":{"description":"The current bin of the copied asset.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"library_url":{"description":"Relative URL for the Kino media library.","type":"string"},"processing":{"type":"string","enum":["pending","complete","failed","not_applicable"]},"error":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"],"additionalProperties":false}},"required":["import_id","transfer"],"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"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}