{"openapi":"3.1.0","info":{"title":"Brasil Orquestral","version":"1.0.0"},"externalDocs":{"url":"https://github.com/belloni123/musica-classica-brasileira-maestro/blob/main/docs/claude-code.md"},"paths":{"/api/v1/catalog/{entity}":{"get":{"operationId":"consultarCatalogo","summary":"Consulta de registros publicados com login e conta ativa","security":[{"accountToken":[]}],"parameters":[{"name":"entity","in":"path","required":true,"schema":{"type":"string","enum":["composers","conductors","works"]}},{"name":"q","in":"query","schema":{"type":"string","maxLength":100}},{"name":"slug","in":"query","schema":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":100000,"default":0}}],"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["entity","data","total","limit","offset"],"properties":{"entity":{"type":"string","enum":["composers","conductors","works"]},"data":{"type":"array","items":{"type":"object","required":["slug"],"properties":{"slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}}}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}},"400":{"description":"Parâmetros inválidos","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"401":{"description":"Sessão ausente, inválida ou expirada","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"403":{"description":"Conta inativa ou perfil ausente","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"429":{"description":"Limite temporário de autenticação","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"503":{"description":"Serviço temporariamente indisponível","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}}}}},"/api/v1/imports":{"post":{"operationId":"importarCatalogo","summary":"Valida ou aplica um lote editorial","security":[{"editorialToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"entity":{"type":"string","const":"composers"},"file_name":{"type":"string","minLength":1,"maxLength":255},"rows":{"type":"array","items":{"type":"object","properties":{"publication_status":{"type":"string","enum":["draft","in_review","published","archived"]},"canonical_name":{"type":"string","minLength":2,"maxLength":300},"display_name":{"type":"string","minLength":2,"maxLength":300},"birth_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"death_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"short_biography":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"long_biography":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"surname":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"alternative_names":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"pseudonyms":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"birth_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"death_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"birth_city":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"birth_state":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"birth_country":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"death_city":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"death_state":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"nationality":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"gender":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"ethnicity_identity":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"brazil_region":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"biography_source":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"official_website":{"anyOf":[{"type":"string","format":"uri","pattern":"^https?:\\/\\/","maxLength":2000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"reliability_level":{"type":"string","enum":["primary_source_confirmed","secondary_source_confirmed","composer_reported","publisher_reported","inferred","pending"]},"slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"required":["slug"],"additionalProperties":false},"minItems":1,"maxItems":100},"mode":{"type":"string","const":"preview"}},"required":["entity","file_name","rows","mode"],"additionalProperties":false},{"type":"object","properties":{"entity":{"type":"string","const":"composers"},"file_name":{"type":"string","minLength":1,"maxLength":255},"rows":{"type":"array","items":{"type":"object","properties":{"publication_status":{"type":"string","enum":["draft","in_review","published","archived"]},"canonical_name":{"type":"string","minLength":2,"maxLength":300},"display_name":{"type":"string","minLength":2,"maxLength":300},"birth_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"death_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"short_biography":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"long_biography":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"surname":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"alternative_names":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"pseudonyms":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"birth_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"death_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"birth_city":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"birth_state":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"birth_country":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"death_city":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"death_state":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"nationality":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"gender":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"ethnicity_identity":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"brazil_region":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"biography_source":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"official_website":{"anyOf":[{"type":"string","format":"uri","pattern":"^https?:\\/\\/","maxLength":2000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"reliability_level":{"type":"string","enum":["primary_source_confirmed","secondary_source_confirmed","composer_reported","publisher_reported","inferred","pending"]},"slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"required":["slug"],"additionalProperties":false},"minItems":1,"maxItems":100},"mode":{"type":"string","const":"apply"},"plan":{"type":"string","pattern":"^[a-f0-9]{32}$"}},"required":["entity","file_name","rows","mode","plan"],"additionalProperties":false},{"type":"object","properties":{"entity":{"type":"string","const":"conductors"},"file_name":{"type":"string","minLength":1,"maxLength":255},"rows":{"type":"array","items":{"type":"object","properties":{"publication_status":{"type":"string","enum":["draft","in_review","published","archived"]},"canonical_name":{"type":"string","minLength":2,"maxLength":300},"display_name":{"type":"string","minLength":2,"maxLength":300},"birth_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"death_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"short_biography":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"long_biography":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"required":["slug"],"additionalProperties":false},"minItems":1,"maxItems":100},"mode":{"type":"string","const":"preview"}},"required":["entity","file_name","rows","mode"],"additionalProperties":false},{"type":"object","properties":{"entity":{"type":"string","const":"conductors"},"file_name":{"type":"string","minLength":1,"maxLength":255},"rows":{"type":"array","items":{"type":"object","properties":{"publication_status":{"type":"string","enum":["draft","in_review","published","archived"]},"canonical_name":{"type":"string","minLength":2,"maxLength":300},"display_name":{"type":"string","minLength":2,"maxLength":300},"birth_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"death_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"short_biography":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"long_biography":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"required":["slug"],"additionalProperties":false},"minItems":1,"maxItems":100},"mode":{"type":"string","const":"apply"},"plan":{"type":"string","pattern":"^[a-f0-9]{32}$"}},"required":["entity","file_name","rows","mode","plan"],"additionalProperties":false},{"type":"object","properties":{"entity":{"type":"string","const":"works"},"file_name":{"type":"string","minLength":1,"maxLength":255},"rows":{"type":"array","items":{"type":"object","properties":{"publication_status":{"type":"string","enum":["draft","in_review","published","archived"]},"composer_slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"canonical_title":{"type":"string","minLength":1,"maxLength":500},"display_title":{"type":"string","minLength":1,"maxLength":500},"alternative_titles":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"original_title":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"translated_title":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"composition_year_start":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"composition_year_end":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"composition_date_text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"revision_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"opus":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"catalog":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"catalog_number":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"duration_minutes":{"anyOf":[{"type":"number","minimum":0,"maximum":9999.99},{"type":"null"}]},"duration_minimum":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"duration_maximum":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"formation_type":{"anyOf":[{"type":"string","enum":["Orquestra de cordas","Orquestra de câmara","Orquestra sinfônica"]},{"type":"null"}]},"difficulty_level":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"soloist_type":{"anyOf":[{"type":"string","enum":["none","vocal","instrumental"]},{"type":"null"}]},"has_choir":{"type":"boolean"},"has_electronics":{"type":"boolean"},"has_brazilian_instruments":{"type":"boolean"},"educational_work":{"type":"boolean"},"youth_work":{"type":"boolean"},"public_domain":{"type":"boolean"},"rights_status":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"work_status":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"public_summary":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"subscriber_notes":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"performance_notes":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"editorial_notes":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"main_source":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"instrumentation_text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"instrumentation":{"type":"array","items":{"type":"object","properties":{"instrument":{"type":"string","minLength":1,"maxLength":200},"minimum_quantity":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"null"}]},"maximum_quantity":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"null"}]}},"required":["instrument","minimum_quantity","maximum_quantity"],"additionalProperties":false},"maxItems":40},"reliability_level":{"type":"string","enum":["primary_source_confirmed","secondary_source_confirmed","composer_reported","publisher_reported","inferred","pending"]},"slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"required":["slug"],"additionalProperties":false},"minItems":1,"maxItems":100},"mode":{"type":"string","const":"preview"}},"required":["entity","file_name","rows","mode"],"additionalProperties":false},{"type":"object","properties":{"entity":{"type":"string","const":"works"},"file_name":{"type":"string","minLength":1,"maxLength":255},"rows":{"type":"array","items":{"type":"object","properties":{"publication_status":{"type":"string","enum":["draft","in_review","published","archived"]},"composer_slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"canonical_title":{"type":"string","minLength":1,"maxLength":500},"display_title":{"type":"string","minLength":1,"maxLength":500},"alternative_titles":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"original_title":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"translated_title":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"composition_year_start":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"composition_year_end":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"composition_date_text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"revision_year":{"anyOf":[{"type":"integer","minimum":0,"maximum":3000},{"type":"null"}]},"opus":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"catalog":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"catalog_number":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"duration_minutes":{"anyOf":[{"type":"number","minimum":0,"maximum":9999.99},{"type":"null"}]},"duration_minimum":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"duration_maximum":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"formation_type":{"anyOf":[{"type":"string","enum":["Orquestra de cordas","Orquestra de câmara","Orquestra sinfônica"]},{"type":"null"}]},"difficulty_level":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"soloist_type":{"anyOf":[{"type":"string","enum":["none","vocal","instrumental"]},{"type":"null"}]},"has_choir":{"type":"boolean"},"has_electronics":{"type":"boolean"},"has_brazilian_instruments":{"type":"boolean"},"educational_work":{"type":"boolean"},"youth_work":{"type":"boolean"},"public_domain":{"type":"boolean"},"rights_status":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"work_status":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"public_summary":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"subscriber_notes":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"performance_notes":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"editorial_notes":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"main_source":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"instrumentation_text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"instrumentation":{"type":"array","items":{"type":"object","properties":{"instrument":{"type":"string","minLength":1,"maxLength":200},"minimum_quantity":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"null"}]},"maximum_quantity":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"null"}]}},"required":["instrument","minimum_quantity","maximum_quantity"],"additionalProperties":false},"maxItems":40},"reliability_level":{"type":"string","enum":["primary_source_confirmed","secondary_source_confirmed","composer_reported","publisher_reported","inferred","pending"]},"slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"required":["slug"],"additionalProperties":false},"minItems":1,"maxItems":100},"mode":{"type":"string","const":"apply"},"plan":{"type":"string","pattern":"^[a-f0-9]{32}$"}},"required":["entity","file_name","rows","mode","plan"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Sucesso","content":{"application/json":{"schema":{"type":"object","required":["entity","dry_run","plan","batch_id","total","changed","rows"],"properties":{"entity":{"type":"string","enum":["composers","conductors","works"]},"dry_run":{"type":"boolean"},"plan":{"type":"string"},"batch_id":{"type":["string","null"],"format":"uuid"},"total":{"type":"integer"},"changed":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer"},"slug":{"type":"string","maxLength":160,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"action":{"enum":["create","update","unchanged"]},"previous_status":{"type":["string","null"]},"publication_status":{"type":"string"},"changed_fields":{"type":"array","items":{"type":"string"}}}}}}}}}},"400":{"description":"Lote inválido","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"401":{"description":"Sessão ausente, inválida ou expirada","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"403":{"description":"Conta sem permissão editorial","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"409":{"description":"Conflito. Gere uma nova prévia","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"413":{"description":"Corpo acima de 1 MiB","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"415":{"description":"Formato diferente de application/json","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"429":{"description":"Limite temporário de autenticação","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}},"503":{"description":"Serviço temporariamente indisponível","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{}}}}}}}}}},"components":{"securitySchemes":{"accountToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Token de acesso do Supabase de usuário com perfil ativo. Qualquer papel pode consultar."},"editorialToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Token de acesso do Supabase de Editor ou Administrador com perfil ativo."}}}}