openapi: 3.0.0
info:
  title: Api CV Extractor
  description: |-
    Complete API collection for CV (Resume) data extraction.

    ## Features
    - Extract CV data from PDF files
    - Extract CV data from raw text
    - Automatic field extraction and validation
    - High accuracy data extraction

    ## Authentication
    All requests require an API key in the `x-api-co-id` header.

    ## Base URL
    ```
    https://use.api.co.id/ocr
    ```

    ## File Requirements
    - **Supported formats**: PDF
    - **Maximum file size**: 5 MB
    - **Content**: Valid CV/Resume document

    ## Extracted Fields
    - Full Name
    - Title/Position
    - Email
    - Phone Numbers
    - Location
    - Summary
    - Skills (Hard Skills, Soft Skills, Tools & Technologies)
    - Work Experience
    - Education
    - Certifications
    - Languages
    - Projects
    - Links (LinkedIn, GitHub, Portfolio)
    - Analysis (Core Competencies, Seniority Level, Strengths, Job Matches)
  version: 1.0.0
servers:
  - url: https://use.api.co.id
tags:
  - name: CV Extraction
    description: CV extraction endpoints for processing resume documents and text.
paths:
  /ocr/upload-cv:
    post:
      tags:
        - CV Extraction
      summary: Extract CV from PDF
      description: 'Extract structured CV data from an uploaded PDF file. Maximum file size: 5 MB. Supported format: PDF.'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: 'CV PDF file. Maximum size: 5 MB'
      parameters:
        - name: x-api-co-id
          in: header
          schema:
            type: string
          description: Your API key for authentication
          example: '{{api_key}}'
      responses:
        '200':
          description: Successful response - CV data extracted
          content:
            application/json:
              examples:
                success:
                  summary: Success - CV Extracted
                  value:
                    is_success: true
                    message: Success
                    data:
                      full_name: John Doe
                      title: Senior Software Engineer
                      email: john.doe@example.com
                      phone_numbers:
                        - '+62 812-3456-7890'
                      location: Jakarta, Indonesia
                      summary: 'Experienced software engineer with 5+ years of experience...'
                      skills:
                        hard_skills:
                          - Java
                          - Python
                          - JavaScript
                        soft_skills:
                          - Leadership
                          - Communication
                          - 'Problem Solving'
                        tools_and_technologies:
                          - Docker
                          - Kubernetes
                          - AWS
                      experience:
                        - company: Tech Company Inc
                          title: Senior Software Engineer
                          location: Jakarta, Indonesia
                          start_date: '2020-01'
                          end_date: ''
                          currently_working: true
                          duration_months: 48
                          description: 'Lead development of microservices architecture...'
                          achievements:
                            - Reduced API response time by 40%
                            - Led team of 5 developers
                      total_experience_months: 60
                      education:
                        - institution: University of Indonesia
                          degree: Bachelor of Science
                          major: Computer Science
                          start_date: '2014-09'
                          end_date: '2018-06'
                          gpa: 3.8/4.0
                      certifications:
                        - name: AWS Certified Solutions Architect
                          issuer: Amazon Web Services
                          issue_date: '2022-03'
                          expiration_date: '2025-03'
                      languages:
                        - language: English
                          proficiency: Fluent
                        - language: Indonesian
                          proficiency: Native
                      projects:
                        - name: E-commerce Platform
                          description: Built scalable e-commerce platform handling 10K+ daily transactions
                          tech_stack:
                            - React
                            - Node.js
                            - PostgreSQL
                            - Redis
                      links:
                        linkedin: https://linkedin.com/in/johndoe
                        github: https://github.com/johndoe
                        portfolio: https://johndoe.dev
                        other_links: []
                      analysis:
                        core_competencies:
                          - Backend Development
                          - System Architecture
                          - Team Leadership
                        seniority_level: Senior
                        strengths_summary: 'Strong technical background with leadership experience...'
                        possible_job_matches:
                          - Senior Backend Engineer
                          - Tech Lead
                          - Software Architect
                        total_experience_months: 60
        '400':
          description: Bad Request - Invalid file or parameters
          content:
            application/json:
              examples:
                missing_file:
                  summary: Error - Missing File
                  value:
                    is_success: false
                    message: 'File is required. Please upload a PDF file using ''file'' field in multipart/form-data'
                    data: null
                invalid_file_type:
                  summary: Error - Invalid File Type
                  value:
                    is_success: false
                    message: Invalid file type. Only PDF files are allowed
                    data: null
                file_too_large:
                  summary: Error - File Too Large
                  value:
                    is_success: false
                    message: 'File size exceeds maximum limit of 5 MB'
                    data: null
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              examples:
                missing_api_key:
                  summary: Error - Missing API Key
                  value:
                    is_success: false
                    message: User not authenticated
                    data: null
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              examples:
                rate_limit_exceeded:
                  summary: Error - Rate Limit Exceeded
                  value:
                    is_success: false
                    message: 'Monthly CV Extractor limit exceeded. Please upgrade to premium for more requests.'
                    data: null
  /ocr/cv-extract:
    post:
      tags:
        - CV Extraction
      summary: Extract CV from Text
      description: Extract structured CV data from raw text.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                  description: CV text content
                  example: 'John Doe\nSenior Software Engineer\nEmail: john.doe@example.com\nPhone: +62 812-3456-7890\n\nExperience:\n- Senior Software Engineer at Tech Company Inc (2020-Present)\n- Software Engineer at Startup XYZ (2018-2020)\n\nEducation:\n- Bachelor of Science in Computer Science, University of Indonesia (2014-2018)'
              example:
              text: 'John Doe\nSenior Software Engineer\nEmail: john.doe@example.com\nPhone: +62 812-3456-7890\n\nExperience:\n- Senior Software Engineer at Tech Company Inc (2020-Present)\n- Software Engineer at Startup XYZ (2018-2020)\n\nEducation:\n- Bachelor of Science in Computer Science, University of Indonesia (2014-2018)'
      parameters:
        - name: x-api-co-id
          in: header
          schema:
            type: string
          description: Your API key for authentication
          example: '{{api_key}}'
      responses:
        '200':
          description: Successful response - CV data extracted
          content:
            application/json:
              examples:
                success:
                  summary: Success - CV Extracted from Text
                  value:
                    is_success: true
                    message: Success
                    data:
                      full_name: John Doe
                      title: Senior Software Engineer
                      email: john.doe@example.com
                      phone_numbers:
                        - '+62 812-3456-7890'
                      location: ''
                      summary: ''
                      skills:
                        hard_skills: []
                        soft_skills: []
                        tools_and_technologies: []
                      experience:
                        - company: Tech Company Inc
                          title: Senior Software Engineer
                          location: ''
                          start_date: '2020'
                          end_date: ''
                          currently_working: true
                          duration_months: 0
                          description: ''
                          achievements: []
                        - company: Startup XYZ
                          title: Software Engineer
                          location: ''
                          start_date: '2018'
                          end_date: '2020'
                          currently_working: false
                          duration_months: 24
                          description: ''
                          achievements: []
                      total_experience_months: 24
                      education:
                        - institution: University of Indonesia
                          degree: Bachelor of Science
                          major: Computer Science
                          start_date: '2014'
                          end_date: '2018'
                          gpa: ''
                      certifications: []
                      languages: []
                      projects: []
                      links:
                        linkedin: ''
                        github: ''
                        portfolio: ''
                        other_links: []
                      analysis:
                        core_competencies: []
                        seniority_level: ''
                        strengths_summary: ''
                        possible_job_matches: []
                        total_experience_months: 24
        '400':
          description: Bad Request - Missing or invalid text
          content:
            application/json:
              examples:
                missing_text:
                  summary: Error - Missing Text Field
                  value:
                    is_success: false
                    message: text field is required and cannot be empty
                    data: null
                empty_text:
                  summary: Error - Empty Text
                  value:
                    is_success: false
                    message: text field is required and cannot be empty
                    data: null
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              examples:
                missing_api_key:
                  summary: Error - Missing API Key
                  value:
                    is_success: false
                    message: User not authenticated
                    data: null
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              examples:
                rate_limit_exceeded:
                  summary: Error - Rate Limit Exceeded
                  value:
                    is_success: false
                    message: 'Monthly CV Extractor limit exceeded. Please upgrade to premium for more requests.'
                    data: null
