{"openapi":"3.1.0","info":{"title":"API de Documentos do Hub Grupo CSV","version":"0.12.0","description":"Contrato versionado das rotas documentais implementadas, com storage privado, exclusão lógica governada, links públicos revogáveis, catálogo e releases Compass™ tenant-first, paginação por cursor, streaming HTTP Range, agentes idempotentes e recuperação administrativa auditada."},"servers":[{"url":"/","description":"Origem do Worker no ambiente configurado"}],"tags":[{"name":"Documentos"},{"name":"Capacidades"},{"name":"Versões"},{"name":"Upload"},{"name":"Bytes"},{"name":"Coleções"},{"name":"Etiquetas"},{"name":"Busca"},{"name":"Jobs"},{"name":"Links públicos"},{"name":"Exclusões"},{"name":"Compass™","description":"Catálogo editorial autenticado sobre documentos, versões e links públicos existentes."},{"name":"Contrato"}],"security":[{"HumanSession":[]},{"ServiceBearer":[]},{"ServiceBearer":[],"ServiceTenant":[]}],"paths":{"/docs/openapi.json":{"get":{"operationId":"getOpenApiDocument","summary":"Obter a especificação OpenAPI versionada","tags":["Contrato"],"security":[],"responses":{"200":{"description":"Especificação retornada sem cache.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"type":"object"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"head":{"operationId":"headOpenApiDocument","summary":"Consultar metadados da especificação OpenAPI","tags":["Contrato"],"security":[],"responses":{"200":{"description":"Metadados retornados sem corpo e sem cache.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/s/{slug}":{"parameters":[{"$ref":"#/components/parameters/PublicSlug"}],"get":{"operationId":"getPublicShare","summary":"Ler uma versão compartilhada por slug","description":"Serve bytes do R2 privado sem revelar tenant nem object key. O limite de acesso é aplicado antes de D1/R2. allow_download controla apenas Content-Disposition inline ou attachment e não impede que o destinatário salve os bytes.","tags":["Links públicos"],"security":[],"parameters":[{"$ref":"#/components/parameters/Range"},{"$ref":"#/components/parameters/IfRange"}],"responses":{"200":{"description":"Representação completa com Cache-Control private, no-store e X-Robots-Tag noindex.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"206":{"description":"Intervalo satisfatório da representação.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"404":{"$ref":"#/components/responses/NotFound"},"416":{"$ref":"#/components/responses/RangeNotSatisfiable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"head":{"operationId":"headPublicShare","summary":"Consultar metadados de uma versão compartilhada","tags":["Links públicos"],"security":[],"parameters":[{"$ref":"#/components/parameters/Range"},{"$ref":"#/components/parameters/IfRange"}],"responses":{"200":{"description":"Metadados completos, sem corpo e sem cache.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"206":{"description":"Metadados do intervalo, sem corpo.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"404":{"$ref":"#/components/responses/NotFound"},"416":{"$ref":"#/components/responses/RangeNotSatisfiable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/public-links":{"get":{"operationId":"listTenantPublicLinks","summary":"Listar links públicos do tenant","tags":["Links públicos"],"parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/PublicLinkStatus"}},{"name":"slug","in":"query","schema":{"$ref":"#/components/schemas/PublicSlug"}},{"name":"document_id","in":"query","schema":{"type":"string","minLength":1,"maxLength":256}}],"responses":{"200":{"description":"Página tenant-first com título documental e cursor opaco.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicLinkListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/documents/{documentId}/public-links":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"get":{"operationId":"listDocumentPublicLinks","summary":"Listar links públicos de um documento","tags":["Links públicos"],"parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/PublicLinkStatus"}},{"name":"slug","in":"query","schema":{"$ref":"#/components/schemas/PublicSlug"}}],"responses":{"200":{"description":"Página de links retornada.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicLinkListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"post":{"operationId":"createPublicLink","summary":"Criar link público revogável","tags":["Links públicos"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicLinkRequest"}}}},"responses":{"201":{"description":"Link criado ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicLinkResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/documents/{documentId}/public-links/{linkId}":{"parameters":[{"$ref":"#/components/parameters/DocumentId"},{"$ref":"#/components/parameters/PublicLinkId"}],"patch":{"operationId":"updatePublicLink","summary":"Ativar, inativar ou ajustar um link público","tags":["Links públicos"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicLinkRequest"}}}},"responses":{"200":{"description":"Link atualizado ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicLinkResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/deletion-requests":{"get":{"operationId":"listDeletionRequests","summary":"Listar pedidos de exclusão do tenant","tags":["Exclusões"],"parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/DeletionRequestStatus"}}],"responses":{"200":{"description":"Página tenant-first de pedidos retornada.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionRequestListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/deletion-requests/{requestId}/approve":{"parameters":[{"$ref":"#/components/parameters/DeletionRequestId"}],"post":{"operationId":"approveDeletionRequest","summary":"Aprovar pedido e concluir tombstone sem hard delete","tags":["Exclusões"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionDecisionRequest"}}}},"responses":{"200":{"description":"Pedido executado ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionDecisionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/deletion-requests/{requestId}/reject":{"parameters":[{"$ref":"#/components/parameters/DeletionRequestId"}],"post":{"operationId":"rejectDeletionRequest","summary":"Rejeitar pedido e restaurar o lifecycle anterior","tags":["Exclusões"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionDecisionRequest"}}}},"responses":{"200":{"description":"Pedido rejeitado ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionDecisionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/deletion-requests/{requestId}/cancel":{"parameters":[{"$ref":"#/components/parameters/DeletionRequestId"}],"post":{"operationId":"cancelDeletionRequest","summary":"Cancelar pedido solicitado pelo próprio principal","tags":["Exclusões"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionDecisionRequest"}}}},"responses":{"200":{"description":"Pedido cancelado ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionDecisionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/capabilities":{"get":{"operationId":"getCapabilities","summary":"Obter capacidades globais do principal","description":"Retorna somente permissões globais necessárias à composição da interface, sem expor tenant, papel ou escopos.","tags":["Capacidades"],"responses":{"200":{"description":"Capacidades globais retornadas.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilitiesResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/documents":{"get":{"operationId":"listDocuments","summary":"Listar documentos visíveis","tags":["Documentos"],"responses":{"200":{"description":"Documentos retornados.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"name":"collection_id","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":256}},{"name":"lifecycle_status","in":"query","required":false,"schema":{"type":"string","enum":["draft","active","archived","deletion_requested","deleting","deleted"]}},{"name":"classification","in":"query","required":false,"schema":{"type":"string","enum":["public","internal","confidential","restricted"]}},{"name":"tag_id","in":"query","required":false,"description":"Filtra documentos pela etiqueta do tenant autenticado.","schema":{"type":"string","minLength":1,"maxLength":256}},{"name":"favorite","in":"query","required":false,"description":"Quando presente, retorna somente os favoritos do usuário humano autenticado. Não disponível para principais de serviço.","schema":{"type":"string","enum":["true"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":4096}}]},"post":{"operationId":"createDocument","summary":"Criar documento","tags":["Documentos"],"responses":{"201":{"description":"Documento criado ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocumentRequest"}}}}}},"/v1/documents/{documentId}":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"get":{"operationId":"getDocument","summary":"Obter detalhe documental","tags":["Documentos"],"responses":{"200":{"description":"Documento e permissões efetivas.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentDetailResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"patch":{"operationId":"updateDocument","summary":"Atualizar metadados documentais","tags":["Documentos"],"responses":{"200":{"description":"Metadados atualizados.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"$ref":"#/components/parameters/IfMatch"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDocumentRequest"}}}}}},"/v1/documents/{documentId}/archive":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"operationId":"archiveDocument","summary":"Arquivar documento","tags":["Documentos"],"responses":{"200":{"description":"Documento arquivado.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyObjectRequest"}}}}}},"/v1/documents/{documentId}/restore":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"operationId":"restoreDocument","summary":"Restaurar documento","tags":["Documentos"],"responses":{"200":{"description":"Documento restaurado.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyObjectRequest"}}}}}},"/v1/documents/{documentId}/deletion-requests":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"operationId":"requestDocumentDeletion","summary":"Solicitar exclusão documental","tags":["Documentos"],"responses":{"202":{"description":"Pedido de exclusão aceito.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionRequestInput"}}}}}},"/v1/documents/{documentId}/versions":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"get":{"operationId":"listDocumentVersions","summary":"Listar versões do documento","tags":["Versões"],"responses":{"200":{"description":"Versões públicas retornadas.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/documents/{documentId}/versions/{versionId}/promote":{"parameters":[{"$ref":"#/components/parameters/DocumentId"},{"$ref":"#/components/parameters/VersionId"}],"post":{"operationId":"promoteDocumentVersion","summary":"Promover versão elegível","tags":["Versões"],"responses":{"200":{"description":"Versão promovida.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyObjectRequest"}}}}}},"/v1/documents/{documentId}/favorite":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"operationId":"favoriteDocument","summary":"Marcar documento como favorito","tags":["Documentos"],"responses":{"204":{"description":"Favorito registrado.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyObjectRequest"}}}}},"delete":{"operationId":"unfavoriteDocument","summary":"Remover documento dos favoritos","tags":["Documentos"],"responses":{"204":{"description":"Favorito removido.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/documents/{documentId}/upload-sessions":{"parameters":[{"$ref":"#/components/parameters/DocumentId"}],"post":{"operationId":"createUploadSession","summary":"Criar sessão privada de upload","tags":["Upload"],"responses":{"201":{"description":"Sessão criada ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadSessionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadSessionRequest"}}}}}},"/v1/upload-sessions/{uploadId}/bytes":{"parameters":[{"$ref":"#/components/parameters/UploadId"}],"put":{"operationId":"uploadSessionBytes","summary":"Transmitir os bytes da sessão","tags":["Upload"],"responses":{"204":{"description":"Bytes armazenados ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"410":{"$ref":"#/components/responses/Gone"},"411":{"$ref":"#/components/responses/LengthRequired"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"$ref":"#/components/parameters/ContentLength"},{"$ref":"#/components/parameters/ContentSha256"}],"requestBody":{"required":true,"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"text/plain":{"schema":{"type":"string","format":"binary"}},"text/markdown":{"schema":{"type":"string","format":"binary"}}}}}},"/v1/upload-sessions/{uploadId}/complete":{"parameters":[{"$ref":"#/components/parameters/UploadId"}],"post":{"operationId":"completeUploadSession","summary":"Concluir upload e enfileirar processamento","tags":["Upload"],"responses":{"202":{"description":"Upload concluído ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteUploadSessionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"410":{"$ref":"#/components/responses/Gone"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/v1/upload-sessions/{uploadId}":{"parameters":[{"$ref":"#/components/parameters/UploadId"}],"delete":{"operationId":"abortUploadSession","summary":"Abortar sessão de upload","tags":["Upload"],"responses":{"204":{"description":"Sessão abortada ou replay idempotente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/documents/{documentId}/versions/{versionId}/viewer-tickets":{"parameters":[{"$ref":"#/components/parameters/DocumentId"},{"$ref":"#/components/parameters/VersionId"}],"post":{"operationId":"issueViewerTicket","summary":"Emitir ticket opaco para leitura de bytes","tags":["Bytes"],"responses":{"201":{"description":"Ticket emitido.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewerTicketResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/documents/{documentId}/versions/{versionId}/bytes":{"parameters":[{"$ref":"#/components/parameters/DocumentId"},{"$ref":"#/components/parameters/VersionId"}],"get":{"operationId":"getVersionBytes","summary":"Ler bytes autorizados da versão","tags":["Bytes"],"responses":{"200":{"description":"Representação completa em stream.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Accept-Ranges":{"$ref":"#/components/headers/AcceptRanges"},"Content-Length":{"$ref":"#/components/headers/ContentLength"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"206":{"description":"Intervalo único em stream.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Accept-Ranges":{"$ref":"#/components/headers/AcceptRanges"},"Content-Length":{"$ref":"#/components/headers/ContentLength"},"ETag":{"$ref":"#/components/headers/ETag"},"Content-Range":{"$ref":"#/components/headers/ContentRange"}},"content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"416":{"$ref":"#/components/responses/RangeNotSatisfiable"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"$ref":"#/components/parameters/Range"},{"$ref":"#/components/parameters/IfRange"}],"security":[{"HumanSession":[],"ViewerTicket":[]},{"ServiceBearer":[],"ViewerTicket":[]},{"ServiceBearer":[],"ServiceTenant":[],"ViewerTicket":[]}]},"head":{"operationId":"headVersionBytes","summary":"Inspecionar headers dos bytes autorizados","tags":["Bytes"],"responses":{"200":{"description":"Headers da representação completa.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Accept-Ranges":{"$ref":"#/components/headers/AcceptRanges"},"Content-Length":{"$ref":"#/components/headers/ContentLength"},"ETag":{"$ref":"#/components/headers/ETag"}}},"206":{"description":"Headers do intervalo único.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Accept-Ranges":{"$ref":"#/components/headers/AcceptRanges"},"Content-Length":{"$ref":"#/components/headers/ContentLength"},"ETag":{"$ref":"#/components/headers/ETag"},"Content-Range":{"$ref":"#/components/headers/ContentRange"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"416":{"$ref":"#/components/responses/RangeNotSatisfiable"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"parameters":[{"$ref":"#/components/parameters/Range"},{"$ref":"#/components/parameters/IfRange"}],"security":[{"HumanSession":[],"ViewerTicket":[]},{"ServiceBearer":[],"ViewerTicket":[]},{"ServiceBearer":[],"ServiceTenant":[],"ViewerTicket":[]}]}},"/v1/collections":{"get":{"operationId":"listCollections","summary":"Listar coleções","tags":["Coleções"],"responses":{"200":{"description":"Coleções retornadas.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"post":{"operationId":"createCollection","summary":"Criar coleção","tags":["Coleções"],"responses":{"201":{"description":"Coleção criada.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCollectionRequest"}}}}}},"/v1/collections/{collectionId}":{"parameters":[{"$ref":"#/components/parameters/CollectionId"}],"patch":{"operationId":"updateCollection","summary":"Renomear ou mover coleção","tags":["Coleções"],"responses":{"200":{"description":"Coleção atualizada.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchCollectionRequest"}}}}}},"/v1/tags":{"get":{"operationId":"listTags","summary":"Listar vocabulário de etiquetas","tags":["Etiquetas"],"responses":{"200":{"description":"Etiquetas retornadas.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagListResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/search":{"post":{"operationId":"searchDocuments","summary":"Buscar documentos visíveis","description":"Busca textual limitada ao escopo derivado do D1 e revalidada pelo control plane antes da resposta.","tags":["Busca"],"responses":{"200":{"description":"Resultados autorizados e revalidados.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}}}},"/v1/jobs/{jobId}":{"parameters":[{"$ref":"#/components/parameters/JobId"}],"get":{"operationId":"getJob","summary":"Obter estado público de job","description":"Revalida a permissão de leitura do documento vinculado antes de devolver o estado público do job.","tags":["Jobs"],"responses":{"200":{"description":"Estado público do job.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/jobs/{jobId}/recoveries":{"parameters":[{"$ref":"#/components/parameters/JobId"}],"post":{"operationId":"recoverJob","summary":"Agendar uma tentativa adicional de job em dead letter","description":"Operação humana restrita a super_admin. O tenant é derivado da sessão; somente falha transitória terminal, sem run ativo ou callback pendente, pode ser reaberta. A resposta é idempotente e os efeitos de job, outbox e auditoria são atômicos.","tags":["Jobs"],"security":[{"HumanSession":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRecoveryRequest"}}}},"responses":{"202":{"description":"Tentativa adicional agendada ou replay idempotente da mesma solicitação.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRecoveryResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/compass/editions":{"get":{"operationId":"listCompassEditions","summary":"Listar edições Compass™ do tenant autenticado","description":"Exige documents:read. O tenant é derivado da identidade e não pode ser informado por query.","tags":["Compass™"],"responses":{"200":{"description":"Edições e release ativo retornados sem chaves privadas do R2.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompassEditionListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"post":{"operationId":"createCompassEdition","summary":"Registrar uma edição Compass™","description":"Exige documents:publish, Idempotency-Key e Origin autorizado para sessão humana. Identidade editorial, slug, rota web e documento PDF tornam-se imutáveis.","tags":["Compass™"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCompassEditionRequest"}}}},"responses":{"201":{"description":"Edição Compass™ registrada em draft.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompassEditionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/compass/editions/{editionId}":{"parameters":[{"name":"editionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"get":{"operationId":"getCompassEdition","summary":"Obter uma edição Compass™","description":"Retorna somente a edição do tenant autenticado, o release ativo e a URL pública derivada de document_public_links quando existente.","tags":["Compass™"],"responses":{"200":{"description":"Edição retornada.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompassEditionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/compass/editions/{editionId}/releases":{"parameters":[{"name":"editionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"get":{"operationId":"listCompassReleases","summary":"Listar releases de uma edição Compass™","tags":["Compass™"],"responses":{"200":{"description":"Releases ordenados do mais recente ao mais antigo.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompassReleaseListResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"post":{"operationId":"prepareCompassRelease","summary":"Preparar um release Compass™ sem alterar o ponteiro ativo","description":"Exige documents:publish e Idempotency-Key. O PDF deve estar uploaded, clean e pertencer ao documento da edição. Não altera documents.current_version_id nem active_release_id.","tags":["Compass™"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareCompassReleaseRequest"}}}},"responses":{"201":{"description":"Release preparado.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompassPreparedReleaseResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/v1/compass/editions/{editionId}/releases/{releaseId}/activate":{"parameters":[{"name":"editionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"releaseId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"post":{"operationId":"activateCompassRelease","summary":"Ativar ou restaurar um release Compass™ por ponteiro","description":"Exige documents:publish, Idempotency-Key e expected_active_release_id. Move atomicamente o release ativo e documents.current_version_id; um release superseded pode ser reativado para rollback.","tags":["Compass™"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateCompassReleaseRequest"}}}},"responses":{"200":{"description":"Ponteiro ativado ou restaurado.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompassActivationResponse"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/InvalidRequest"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}},"components":{"securitySchemes":{"HumanSession":{"type":"apiKey","in":"header","name":"X-Auth-Token","description":"Sessão humana validada pelo serviço de identidade. Não combinar com Authorization nem X-Tenant-Id."},"ServiceBearer":{"type":"http","scheme":"bearer","bearerFormat":"credencial opaca de serviço","description":"Credencial de serviço. X-Tenant-Id é exigido somente para credenciais autorizadas em múltiplos tenants."},"ServiceTenant":{"type":"apiKey","in":"header","name":"X-Tenant-Id","description":"Tenant explícito para credencial de serviço multi-tenant. Não é aceito com X-Auth-Token."},"ViewerTicket":{"type":"apiKey","in":"header","name":"X-Viewer-Ticket","description":"Ticket opaco, curto e vinculado ao ator, documento, versão e ação de leitura de bytes."}},"parameters":{"DocumentId":{"name":"documentId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[^/]+$"}},"VersionId":{"name":"versionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}},"UploadId":{"name":"uploadId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}},"CollectionId":{"name":"collectionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}},"JobId":{"name":"jobId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}},"PublicLinkId":{"name":"linkId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}},"DeletionRequestId":{"name":"requestId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}},"PublicSlug":{"name":"slug","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PublicSlug"}},"Cursor":{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":512}},"Limit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":256}},"IfMatch":{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","minLength":1}},"ContentLength":{"name":"Content-Length","in":"header","required":true,"schema":{"type":"integer","minimum":1,"maximum":52428800}},"ContentSha256":{"name":"X-Content-SHA256","in":"header","required":false,"description":"Checksum SHA-256 canônico. É obrigatório nesta operação quando não foi informado na criação da sessão.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}},"Range":{"name":"Range","in":"header","required":false,"schema":{"type":"string","pattern":"^bytes="}},"IfRange":{"name":"If-Range","in":"header","required":false,"schema":{"type":"string","minLength":1}}},"headers":{"XRequestId":{"description":"Identificador canônico da solicitação.","schema":{"type":"string","format":"uuid"}},"ETag":{"description":"Validador da representação.","schema":{"type":"string"}},"AcceptRanges":{"description":"Unidade de range aceita.","schema":{"type":"string","const":"bytes"}},"ContentLength":{"description":"Comprimento da representação em bytes.","schema":{"type":"integer","minimum":0}},"ContentRange":{"description":"Intervalo retornado ou tamanho total em resposta 416.","schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"Credenciais ambíguas, tenant explícito ausente ou sobrescrita de tenant humano.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Unauthenticated":{"description":"Autenticação necessária ou credencial inválida.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Forbidden":{"description":"Ação não permitida ou origem humana não autorizada.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"NotFound":{"description":"Recurso não encontrado ou deliberadamente indistinguível para isolamento.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Conflict":{"description":"Conflito de idempotência, metadados, estado ou concorrência.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Gone":{"description":"Sessão de upload expirada.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"LengthRequired":{"description":"Content-Length obrigatório.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"PayloadTooLarge":{"description":"Conteúdo acima do limite permitido.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"UnsupportedMediaType":{"description":"Tipo de arquivo não permitido.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"RangeNotSatisfiable":{"description":"Range não satisfatório.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Accept-Ranges":{"$ref":"#/components/headers/AcceptRanges"},"Content-Length":{"$ref":"#/components/headers/ContentLength"},"ETag":{"$ref":"#/components/headers/ETag"},"Content-Range":{"$ref":"#/components/headers/ContentRange"}}},"InvalidRequest":{"description":"Payload, parâmetro, header ou segmento semântico inválido.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"TooManyRequests":{"description":"Limite anônimo por slug e endereço de origem excedido.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"},"Retry-After":{"description":"Segundos até nova tentativa.","schema":{"type":"integer","const":60}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"InternalError":{"description":"Falha interna não detalhada publicamente.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"ServiceUnavailable":{"description":"Controle ou armazenamento temporariamente indisponível.","headers":{"X-Request-Id":{"$ref":"#/components/headers/XRequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"schemas":{"Actor":{"type":"object","properties":{"type":{"type":"string","enum":["human","service","system"]},"id":{"type":"string","minLength":1,"maxLength":256}},"required":["type","id"],"additionalProperties":false},"Owner":{"type":"object","properties":{"type":{"type":"string","enum":["human","service"]},"id":{"type":"string","minLength":1,"maxLength":256}},"required":["type","id"],"additionalProperties":false},"Document":{"type":"object","properties":{"tenantId":{"type":"string","minLength":1,"maxLength":256},"documentId":{"type":"string","minLength":1,"maxLength":256},"collectionId":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","maxLength":4000},"classification":{"type":"string","enum":["public","internal","confidential","restricted"]},"indexingPolicy":{"type":"string","enum":["disabled","metadata_only","full_text"]},"lifecycleStatus":{"type":"string","enum":["draft","active","archived","deletion_requested","deleting","deleted"]},"currentVersionId":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"owner":{"$ref":"#/components/schemas/Owner"},"metadataVersion":{"type":"integer","minimum":1},"etag":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["tenantId","documentId","collectionId","title","description","classification","indexingPolicy","lifecycleStatus","currentVersionId","owner","metadataVersion","etag","createdAt","updatedAt"],"additionalProperties":false},"DocumentCatalogItem":{"type":"object","properties":{"tenantId":{"type":"string","minLength":1,"maxLength":256},"documentId":{"type":"string","minLength":1,"maxLength":256},"collectionId":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","maxLength":4000},"classification":{"type":"string","enum":["public","internal","confidential","restricted"]},"indexingPolicy":{"type":"string","enum":["disabled","metadata_only","full_text"]},"lifecycleStatus":{"type":"string","enum":["draft","active","archived","deletion_requested","deleting","deleted"]},"currentVersionId":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"owner":{"$ref":"#/components/schemas/Owner"},"metadataVersion":{"type":"integer","minimum":1},"etag":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"favorite":{"type":"boolean"}},"required":["tenantId","documentId","collectionId","title","description","classification","indexingPolicy","lifecycleStatus","currentVersionId","owner","metadataVersion","etag","createdAt","updatedAt","favorite"],"additionalProperties":false},"Version":{"type":"object","properties":{"versionId":{"type":"string","minLength":1,"maxLength":256},"documentId":{"type":"string","minLength":1,"maxLength":256},"versionNumber":{"type":"integer","minimum":1},"originalName":{"oneOf":[{"type":"string"},{"type":"null"}]},"mimeClaimed":{"oneOf":[{"type":"string"},{"type":"null"}]},"mimeDetected":{"oneOf":[{"type":"string"},{"type":"null"}]},"sizeBytes":{"oneOf":[{"type":"integer","minimum":0},{"type":"null"}]},"uploadStatus":{"type":"string","enum":["pending","uploading","uploaded","failed","expired"]},"securityStatus":{"type":"string","enum":["pending","validating","scanning","clean","rejected","error"]},"previewStatus":{"type":"string","enum":["not_required","pending","processing","ready","failed"]},"extractionStatus":{"type":"string","enum":["disabled","pending","processing","ready","failed"]},"indexingStatus":{"type":"string","enum":["disabled","pending","indexing","indexed","stale","failed","deleting"]},"publicationStatus":{"type":"string","enum":["draft","eligible","current","superseded","withdrawn"]},"sourceType":{"type":"string","enum":["upload","agent","remote_fetch","migration"]},"createdBy":{"$ref":"#/components/schemas/Actor"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"finalizedAt":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["versionId","documentId","versionNumber","originalName","mimeClaimed","mimeDetected","sizeBytes","uploadStatus","securityStatus","previewStatus","extractionStatus","indexingStatus","publicationStatus","sourceType","createdBy","createdAt","updatedAt","finalizedAt"],"additionalProperties":false},"Collection":{"type":"object","properties":{"collectionId":{"type":"string","minLength":1,"maxLength":256},"parentId":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","enum":["active","archived"]}},"required":["collectionId","parentId","name","slug","status"],"additionalProperties":false},"Tag":{"type":"object","properties":{"tagId":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1}},"required":["tagId","name","slug"],"additionalProperties":false},"Job":{"type":"object","properties":{"job_id":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","minLength":1},"status":{"type":"string","enum":["pending","running","succeeded","failed","dead_lettered","cancelled"]},"attempt_count":{"type":"integer","minimum":0},"maximum_attempts":{"type":"integer","minimum":1},"last_error_code":{"oneOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["job_id","type","status","attempt_count","maximum_attempts","last_error_code","created_at","updated_at","completed_at"],"additionalProperties":false},"JobRecoveryRequest":{"type":"object","properties":{"expected_attempt_count":{"type":"integer","minimum":1,"maximum":99},"reason_code":{"type":"string","enum":["scanner_restored","processor_restored","transient_infrastructure_recovered","transient_failure_reviewed"]},"operational_reference":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:/-]*$"}},"required":["expected_attempt_count","reason_code","operational_reference"],"additionalProperties":false},"JobRecovery":{"type":"object","properties":{"recovery_id":{"type":"string","format":"uuid"},"job_id":{"type":"string","minLength":1,"maxLength":256},"status":{"type":"string","const":"scheduled"},"job_status":{"type":"string","const":"failed"},"attempt_count":{"type":"integer","minimum":1},"maximum_attempts":{"type":"integer","minimum":2,"maximum":100},"scheduled_at":{"type":"string","format":"date-time"}},"required":["recovery_id","job_id","status","job_status","attempt_count","maximum_attempts","scheduled_at"],"additionalProperties":false},"JobRecoveryResponse":{"type":"object","properties":{"recovery":{"$ref":"#/components/schemas/JobRecovery"}},"required":["recovery"],"additionalProperties":false},"PublicSlug":{"type":"string","minLength":3,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"PublicLinkStatus":{"type":"string","enum":["active","inactive"]},"PublicLink":{"type":"object","description":"URL bearer revogável. allow_download escolhe inline ou attachment; não impede o destinatário de salvar os bytes.","properties":{"link_id":{"type":"string","minLength":1,"maxLength":256},"document_id":{"type":"string","minLength":1,"maxLength":256},"document_title":{"type":["string","null"],"maxLength":500},"version_id":{"type":"string","minLength":1,"maxLength":256},"slug":{"$ref":"#/components/schemas/PublicSlug"},"status":{"$ref":"#/components/schemas/PublicLinkStatus"},"expires_at":{"type":["string","null"],"format":"date-time"},"allow_download":{"type":"boolean","description":"false serve Content-Disposition inline; true serve attachment. Não é controle anticópia."},"public_url":{"type":"string","format":"uri"},"created_by":{"$ref":"#/components/schemas/Owner"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["link_id","document_id","version_id","slug","status","expires_at","allow_download","public_url","created_by","created_at","updated_at"],"additionalProperties":false},"CreatePublicLinkRequest":{"type":"object","properties":{"slug":{"$ref":"#/components/schemas/PublicSlug"},"version_id":{"type":"string","minLength":1,"maxLength":256},"expires_at":{"type":["string","null"],"format":"date-time"},"allow_download":{"type":"boolean","default":false,"description":"Controla inline ou attachment, sem impedir salvamento."}},"required":["slug"],"additionalProperties":false},"UpdatePublicLinkRequest":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/PublicLinkStatus"},"expires_at":{"type":["string","null"],"format":"date-time"},"allow_download":{"type":"boolean","description":"Controla inline ou attachment, sem impedir salvamento."}},"minProperties":1,"additionalProperties":false},"PublicLinkResponse":{"type":"object","properties":{"public_link":{"$ref":"#/components/schemas/PublicLink"}},"required":["public_link"],"additionalProperties":false},"PublicLinkListResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PublicLink"}},"next_cursor":{"type":["string","null"],"maxLength":512}},"required":["items","next_cursor"],"additionalProperties":false},"DeletionRequestStatus":{"type":"string","enum":["requested","approved","rejected","cancelled","executed"]},"DeletionGovernanceRequest":{"type":"object","properties":{"request_id":{"type":"string","minLength":1,"maxLength":256},"document_id":{"type":"string","minLength":1,"maxLength":256},"document_title":{"type":"string","minLength":1,"maxLength":500},"status":{"$ref":"#/components/schemas/DeletionRequestStatus"},"reason":{"type":"string","minLength":1,"maxLength":2000},"requested_by":{"$ref":"#/components/schemas/Owner"},"reviewed_by_type":{"type":["string","null"],"enum":["human","service",null]},"reviewed_by_id":{"type":["string","null"],"maxLength":256},"reviewed_at":{"type":["string","null"],"format":"date-time"},"execute_after":{"type":["string","null"],"format":"date-time"},"previous_lifecycle_status":{"type":"string","enum":["active","archived"]},"decision_reason":{"type":["string","null"],"maxLength":2000},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["request_id","document_id","document_title","status","reason","requested_by","reviewed_by_type","reviewed_by_id","reviewed_at","execute_after","previous_lifecycle_status","decision_reason","created_at","updated_at"],"additionalProperties":false},"DeletionRequestListResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DeletionGovernanceRequest"}},"next_cursor":{"type":["string","null"],"maxLength":512}},"required":["items","next_cursor"],"additionalProperties":false},"DeletionDecisionRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":2000}},"additionalProperties":false},"DeletionDecisionResponse":{"type":"object","properties":{"request":{"$ref":"#/components/schemas/DeletionGovernanceRequest"},"document":{"$ref":"#/components/schemas/Document"}},"required":["request"],"additionalProperties":false},"DeletionRequest":{"type":"object","properties":{"requestId":{"type":"string","minLength":1,"maxLength":256},"documentId":{"type":"string","minLength":1,"maxLength":256},"status":{"type":"string","const":"requested"},"reason":{"type":"string","minLength":1,"maxLength":2000},"requestedBy":{"$ref":"#/components/schemas/Owner"},"createdAt":{"type":"string","format":"date-time"}},"required":["requestId","documentId","status","reason","requestedBy","createdAt"],"additionalProperties":false},"UploadSessionCreated":{"type":"object","properties":{"upload_id":{"type":"string","minLength":1,"maxLength":256},"document_id":{"type":"string","minLength":1,"maxLength":256},"version_id":{"type":"string","minLength":1,"maxLength":256},"state":{"type":"string","const":"pending"},"maximum_size_bytes":{"type":"integer","const":52428800},"expires_at":{"type":"string","format":"date-time"}},"required":["upload_id","document_id","version_id","state","maximum_size_bytes","expires_at"],"additionalProperties":false},"UploadSessionCompleted":{"type":"object","properties":{"upload_id":{"type":"string","minLength":1,"maxLength":256},"version_id":{"type":"string","minLength":1,"maxLength":256},"state":{"type":"string","const":"completed"}},"required":["upload_id","version_id","state"],"additionalProperties":false},"ProcessingJob":{"type":"object","properties":{"job_id":{"type":"string","minLength":1,"maxLength":256},"state":{"type":"string","const":"pending"}},"required":["job_id","state"],"additionalProperties":false},"ViewerTicket":{"type":"object","properties":{"token":{"type":"string","minLength":1,"readOnly":true},"expires_at":{"type":"string","format":"date-time"}},"required":["token","expires_at"],"additionalProperties":false},"CreateDocumentRequest":{"type":"object","properties":{"document_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9](?:[A-Za-z0-9_-]{0,126}[A-Za-z0-9])?$"},"collection_id":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","maxLength":4000},"classification":{"type":"string","enum":["public","internal","confidential","restricted"]},"indexing_policy":{"type":"string","enum":["disabled","metadata_only","full_text"]}},"required":["document_id","title","classification","indexing_policy"],"additionalProperties":false},"PatchDocumentRequest":{"type":"object","properties":{"collection_id":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","maxLength":4000},"classification":{"type":"string","enum":["public","internal","confidential","restricted"]},"indexing_policy":{"type":"string","enum":["disabled","metadata_only","full_text"]}},"required":[],"additionalProperties":false},"EmptyObjectRequest":{"type":"object","properties":{},"required":[],"additionalProperties":false},"DeletionRequestInput":{"type":"object","properties":{"request_id":{"type":"string","minLength":1,"maxLength":256},"reason":{"type":"string","minLength":1,"maxLength":2000},"requested_at":{"type":"string","minLength":1,"maxLength":64}},"required":["request_id","reason","requested_at"],"additionalProperties":false},"CreateCollectionRequest":{"type":"object","properties":{"collection_id":{"type":"string","minLength":1,"maxLength":256},"parent_id":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":200}},"required":["collection_id","name","slug"],"additionalProperties":false},"PatchCollectionRequest":{"type":"object","properties":{"parent_id":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":200}},"required":[],"additionalProperties":false,"minProperties":1},"CreateUploadSessionRequest":{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":255},"content_type":{"type":"string","enum":["application/pdf","image/png","image/jpeg","image/webp","text/plain","text/markdown"]},"size_bytes":{"type":"integer","minimum":1,"maximum":52428800},"sha256":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"},"source_type":{"type":"string","enum":["upload","migration"],"default":"upload","description":"A origem migration é exclusiva de serviços com documents:publish."},"source_ref":{"type":"string","minLength":1,"maxLength":2048,"description":"Referência imutável da baseline; obrigatória somente quando source_type=migration."}},"required":["file_name","content_type","size_bytes"],"additionalProperties":false,"allOf":[{"if":{"properties":{"source_type":{"const":"migration"}},"required":["source_type"]},"then":{"required":["source_ref"]}},{"if":{"required":["source_ref"]},"then":{"properties":{"source_type":{"const":"migration"}},"required":["source_type"]}}]},"CapabilitiesResponse":{"type":"object","properties":{"permissions":{"type":"array","items":{"type":"string","enum":["create","manage_public_links","review_deletion_requests"]},"uniqueItems":true,"maxItems":3}},"required":["permissions"],"additionalProperties":false},"DocumentResponse":{"type":"object","properties":{"document":{"$ref":"#/components/schemas/Document"}},"required":["document"],"additionalProperties":false},"DocumentDetailResponse":{"type":"object","properties":{"document":{"$ref":"#/components/schemas/Document"},"permissions":{"type":"array","items":{"type":"string","enum":["read","create_version","update_metadata","publish","archive","restore","manage_acl","request_deletion","manage_public_links"]},"uniqueItems":true}},"required":["document","permissions"],"additionalProperties":false},"DocumentListResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DocumentCatalogItem"}},"next_cursor":{"oneOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor"],"additionalProperties":false},"VersionResponse":{"type":"object","properties":{"version":{"$ref":"#/components/schemas/Version"}},"required":["version"],"additionalProperties":false},"VersionListResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Version"}}},"required":["items"],"additionalProperties":false},"DeletionResponse":{"type":"object","properties":{"request":{"$ref":"#/components/schemas/DeletionRequest"}},"required":["request"],"additionalProperties":false},"CollectionResponse":{"type":"object","properties":{"collection":{"$ref":"#/components/schemas/Collection"}},"required":["collection"],"additionalProperties":false},"CollectionListResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}}},"required":["items"],"additionalProperties":false},"TagListResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}}},"required":["items"],"additionalProperties":false},"SearchRequest":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":500},"limit":{"type":"integer","minimum":1,"maximum":50,"default":10}},"required":["query"],"additionalProperties":false},"SearchResult":{"type":"object","properties":{"document_id":{"type":"string","minLength":1,"maxLength":256},"version_id":{"type":"string","minLength":1,"maxLength":256},"chunk_id":{"type":"string","minLength":1,"maxLength":256},"title":{"type":"string","minLength":1,"maxLength":500},"score":{"type":"number"},"excerpt":{"type":"string","maxLength":600}},"required":["document_id","version_id","chunk_id","title","score","excerpt"],"additionalProperties":false},"SearchResponse":{"type":"object","properties":{"query_id":{"type":"string","format":"uuid"},"results":{"type":"array","maxItems":50,"items":{"$ref":"#/components/schemas/SearchResult"}}},"required":["query_id","results"],"additionalProperties":false},"JobResponse":{"type":"object","properties":{"job":{"$ref":"#/components/schemas/Job"}},"required":["job"],"additionalProperties":false},"CreateUploadSessionResponse":{"type":"object","properties":{"upload_session":{"$ref":"#/components/schemas/UploadSessionCreated"}},"required":["upload_session"],"additionalProperties":false},"CompleteUploadSessionResponse":{"type":"object","properties":{"upload_session":{"$ref":"#/components/schemas/UploadSessionCompleted"},"job":{"$ref":"#/components/schemas/ProcessingJob"}},"required":["upload_session","job"],"additionalProperties":false},"ViewerTicketResponse":{"type":"object","properties":{"viewer_ticket":{"$ref":"#/components/schemas/ViewerTicket"}},"required":["viewer_ticket"],"additionalProperties":false},"CompassDownload":{"type":"object","additionalProperties":false,"required":["link_id","slug","status","allow_download","public_url"],"properties":{"link_id":{"type":"string"},"slug":{"$ref":"#/components/schemas/PublicSlug"},"status":{"$ref":"#/components/schemas/PublicLinkStatus"},"allow_download":{"type":"boolean"},"public_url":{"type":"string","format":"uri"}}},"CompassRelease":{"type":"object","additionalProperties":false,"required":["release_id","edition_id","release_number","status","pdf","web","catalog_sha256","engine_version","template_version","source_commit","download","created_by","created_at","activated_at","updated_at"],"properties":{"release_id":{"type":"string","minLength":1,"maxLength":128},"edition_id":{"type":"string","minLength":1,"maxLength":128},"release_number":{"type":"integer","minimum":1},"status":{"type":"string","enum":["prepared","active","superseded","withdrawn"]},"pdf":{"type":"object","additionalProperties":false,"required":["version_id","sha256","size_bytes","original_name","page_count"],"properties":{"version_id":{"type":"string"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"size_bytes":{"type":"integer","minimum":1},"original_name":{"type":"string"},"page_count":{"type":"integer","minimum":1,"maximum":500}}},"web":{"type":"object","additionalProperties":false,"required":["sha256"],"properties":{"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"catalog_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"engine_version":{"type":"string","minLength":1,"maxLength":64},"template_version":{"type":"string","minLength":1,"maxLength":128},"source_commit":{"type":"string","pattern":"^(?:[a-f0-9]{40}|[a-f0-9]{64})$"},"download":{"anyOf":[{"$ref":"#/components/schemas/CompassDownload"},{"type":"null"}]},"created_by":{"$ref":"#/components/schemas/Actor"},"created_at":{"type":"string","format":"date-time"},"activated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updated_at":{"type":"string","format":"date-time"}}},"CompassEdition":{"type":"object","additionalProperties":false,"required":["edition_id","edition_number","publication_year","public_slug","web_route","pdf_document_id","brand_signature","practical_application_label","status","active_release_id","active_release","created_by","created_at","updated_at"],"properties":{"edition_id":{"type":"string","minLength":1,"maxLength":128},"edition_number":{"type":"string","pattern":"^[0-9]{3}$"},"publication_year":{"type":"integer","minimum":2000,"maximum":2100},"public_slug":{"type":"string","minLength":3,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"web_route":{"type":"string","pattern":"^/compass/edicoes/[a-z0-9-]+/[a-z0-9-]+/compass$"},"pdf_document_id":{"type":"string","minLength":1,"maxLength":256},"brand_signature":{"type":"string","const":"Compass™ — um produto do Grupo CSV | Responsabilidade editorial: MedValor®"},"practical_application_label":{"type":"string","const":"AxiaCare®"},"status":{"type":"string","enum":["draft","released","archived"]},"active_release_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}]},"active_release":{"anyOf":[{"$ref":"#/components/schemas/CompassRelease"},{"type":"null"}]},"created_by":{"$ref":"#/components/schemas/Actor"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"CreateCompassEditionRequest":{"type":"object","additionalProperties":false,"required":["edition_id","edition_number","publication_year","public_slug","web_route","pdf_document_id"],"properties":{"edition_id":{"type":"string","minLength":1,"maxLength":128},"edition_number":{"type":"string","pattern":"^[0-9]{3}$"},"publication_year":{"type":"integer","minimum":2000,"maximum":2100},"public_slug":{"type":"string","minLength":3,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"web_route":{"type":"string","pattern":"^/compass/edicoes/[a-z0-9-]+/[a-z0-9-]+/compass$"},"pdf_document_id":{"type":"string","minLength":1,"maxLength":256}}},"PrepareCompassReleaseRequest":{"type":"object","additionalProperties":false,"required":["release_id","version_id","web_sha256","catalog_sha256","engine_version","template_version","source_commit","page_count"],"properties":{"release_id":{"type":"string","minLength":1,"maxLength":128},"version_id":{"type":"string","minLength":1,"maxLength":256},"web_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"catalog_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"engine_version":{"type":"string","minLength":1,"maxLength":64},"template_version":{"type":"string","minLength":1,"maxLength":128},"source_commit":{"type":"string","pattern":"^(?:[a-f0-9]{40}|[a-f0-9]{64})$"},"page_count":{"type":"integer","minimum":1,"maximum":500}}},"ActivateCompassReleaseRequest":{"type":"object","additionalProperties":false,"required":["expected_active_release_id"],"properties":{"expected_active_release_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]}}},"CompassEditionResponse":{"type":"object","additionalProperties":false,"required":["edition"],"properties":{"edition":{"$ref":"#/components/schemas/CompassEdition"}}},"CompassEditionListResponse":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CompassEdition"}}}},"CompassReleaseListResponse":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CompassRelease"}}}},"CompassPreparedReleaseResponse":{"type":"object","additionalProperties":false,"required":["release"],"properties":{"release":{"type":"object","additionalProperties":false,"required":["release_id","edition_id","version_id","status"],"properties":{"release_id":{"type":"string"},"edition_id":{"type":"string"},"version_id":{"type":"string"},"status":{"type":"string","const":"prepared"}}}}},"CompassActivationResponse":{"type":"object","additionalProperties":false,"required":["activation"],"properties":{"activation":{"type":"object","additionalProperties":false,"required":["edition_id","release_id","previous_active_release_id","active_release_id"],"properties":{"edition_id":{"type":"string"},"release_id":{"type":"string"},"previous_active_release_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"active_release_id":{"type":"string"}}}}},"Error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found","method_not_allowed","unauthenticated","identity_unavailable","service_auth_unavailable","tenant_required","tenant_not_allowed","ambiguous_credentials","tenant_override_forbidden","forbidden","invalid_request","invalid_state","length_required","payload_too_large","unsupported_media_type","checksum_mismatch","upload_session_expired","upload_conflict","storage_unavailable","etag_required","metadata_conflict","idempotency_conflict","collection_cycle","version_conflict","job_recovery_conflict","classification_not_shareable","version_not_shareable","slug_conflict","public_link_conflict","deletion_request_conflict","rate_limited","hard_delete_disabled","search_unavailable","search_scope_too_large","control_plane_unavailable","internal_error"]},"message":{"type":"string","minLength":1},"request_id":{"type":"string","format":"uuid"}},"required":["code","message","request_id"],"additionalProperties":false},"ErrorEnvelope":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}},"required":["error"],"additionalProperties":false}}}}