{"openapi":"3.1.0","info":{"title":"MacedFileConvert API","version":"1.0.0","description":"API REST de conversion et de traitement de fichiers (PDF, images, audio, vidéo, OCR, IA). Authentification par clé d’API."},"servers":[{"url":"https://api.macedfileconvert.com/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Tool":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string"},"title":{"type":"string"},"accepts":{"type":"array","items":{"type":"string"}},"produces":{"type":"array","items":{"type":"string"}},"maxInputSizeBytes":{"type":"integer"}}},"FileRef":{"type":"object","properties":{"id":{"type":"string"},"originalName":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"}}},"Job":{"type":"object","properties":{"id":{"type":"string"},"tool":{"type":"string"},"status":{"type":"string","enum":["QUEUED","PROCESSING","DONE","FAILED","CANCELED"]},"progress":{"type":"integer"},"outputFormat":{"type":["string","null"]},"errorMessage":{"type":["string","null"]}}},"CreateJob":{"type":"object","required":["tool","inputFileIds"],"properties":{"tool":{"type":"string","example":"compress-pdf"},"inputFileIds":{"type":"array","items":{"type":"string"}},"params":{"type":"object","additionalProperties":true}}},"Result":{"type":"object","properties":{"downloadUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}}}}},"paths":{"/tools":{"get":{"summary":"Liste les outils disponibles","parameters":[{"name":"category","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Liste des outils","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Tool"}}}}}}}},"/files":{"post":{"summary":"Téléverse un fichier d’entrée","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}}}},"responses":{"201":{"description":"Fichier enregistré","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileRef"}}}},"401":{"description":"Clé d’API manquante ou invalide"}}}},"/jobs":{"post":{"summary":"Crée un traitement","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJob"}}}},"responses":{"201":{"description":"Traitement mis en file (statut QUEUED)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"description":"Clé d’API manquante ou invalide"},"402":{"description":"Quota quotidien atteint"},"503":{"description":"Maintenance ou outil désactivé"}}}},"/jobs/{id}":{"get":{"summary":"Statut et progression d’un traitement","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[],"responses":{"200":{"description":"Statut du job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"404":{"description":"Job introuvable"}}}},"/jobs/{id}/result":{"get":{"summary":"URL signée de téléchargement du résultat","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[],"responses":{"200":{"description":"Lien de téléchargement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"409":{"description":"Le traitement n’est pas terminé"}}}}}}