Skip to main content
POST
/
update
Update Repository
curl --request POST \
  --url https://api.example.com/update \
  --header 'Content-Type: application/json' \
  --data '
{
  "repository": "<string>",
  "repository_owner": "<string>",
  "repository_name": "<string>"
}
'
{
  "status": "<string>",
  "message": "<string>",
  "repository": "<string>",
  "files_analyzed": 123,
  "files_updated": 123,
  "branch": "<string>",
  "pull_request_url": "<string>",
  "is_own_repo": true,
  "quality_metrics": {
    "average_confidence_score": 123,
    "all_files_validated": true,
    "high_confidence_files": 123,
    "validation_results": [
      {}
    ]
  },
  "output": [
    {
      "path": "<string>",
      "new_content": "<string>",
      "comments": "<string>",
      "confidence_score": 123,
      "validation": {},
      "changelog": {}
    }
  ],
  "fork_info": {
    "message": "<string>",
    "fork_owner": "<string>",
    "fork_name": "<string>",
    "can_delete": true,
    "delete_note": "<string>"
  }
}

Overview

This is the core endpoint of Dependify. It analyzes a GitHub repository, refactors outdated code using AI, and automatically creates a pull request with the modernized changes.

Workflow

  1. Analysis: Scans repository files for outdated syntax and patterns
  2. Refactoring: Uses LLM to modernize code with AI-powered suggestions
  3. Validation: Validates refactored code for syntax and quality
  4. Git Operations: Creates a branch, commits changes, and pushes to GitHub
  5. Pull Request: Creates a PR with detailed changelog and quality metrics

Authentication

Authentication is optional for public repositories but required for private repositories.
Authorization: Bearer <access_token>

Rate Limiting

This endpoint is rate-limited to 100 requests per hour per IP address (configurable via environment).

Request Body

repository
string
required
Full GitHub repository URL (e.g., https://github.com/owner/repo)Must be a valid GitHub URL starting with https://github.com/ or [email protected]:
repository_owner
string
required
GitHub username or organization that owns the repository
repository_name
string
required
Repository name (without owner)

Response

status
string
Operation status: "success" or "error"
message
string
Human-readable status message
repository
string
Repository URL that was processed
files_analyzed
integer
Total number of files analyzed for outdated patterns
files_updated
integer
Number of files successfully updated
branch
string
Name of the created branch containing the changes
pull_request_url
string
URL to the created GitHub pull request
is_own_repo
boolean
Whether the authenticated user owns the repository (if true, no fork was created)
quality_metrics
object
Quality and validation metrics for the refactored code
output
array
Sample of refactored files (first 5 files for preview)
fork_info
object
Fork information (only present if repository was forked)

Example Request

curl -X POST https://api.dependify.dev/update \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -d '{
    "repository": "https://github.com/octocat/Hello-World",
    "repository_owner": "octocat",
    "repository_name": "Hello-World"
  }'

Example Response

{
  "status": "success",
  "message": "Repository updated and pull request created successfully",
  "repository": "https://github.com/octocat/Hello-World",
  "files_analyzed": 15,
  "files_updated": 8,
  "branch": "dependify/modernize-2026-03-03-142536",
  "pull_request_url": "https://github.com/octocat/Hello-World/pull/123",
  "is_own_repo": false,
  "quality_metrics": {
    "average_confidence_score": 87.3,
    "all_files_validated": true,
    "high_confidence_files": 7,
    "validation_results": [
      {
        "file": "src/utils/helpers.js",
        "is_valid": true,
        "confidence": 92
      }
    ]
  },
  "output": [
    {
      "path": "/staging/src/utils/helpers.js",
      "new_content": "const formatDate = (date) => {...}",
      "comments": "Modernized to ES6 arrow functions and const/let",
      "confidence_score": 92,
      "validation": {
        "is_valid": true,
        "language": "javascript"
      },
      "changelog": {
        "lines_added": 12,
        "lines_removed": 15,
        "key_changes": ["Converted var to const/let", "Updated to arrow functions"]
      }
    }
  ],
  "fork_info": {
    "message": "A temporary staging fork was created to propose these changes",
    "fork_owner": "your-username",
    "fork_name": "Hello-World",
    "can_delete": true,
    "delete_note": "You can safely delete this fork after the PR is merged or closed"
  }
}

Error Responses

Success Without Changes

If no outdated files are found, the endpoint returns a success response without creating a pull request:
{
  "status": "success",
  "message": "No outdated files found in repository",
  "repository": "https://github.com/octocat/Hello-World",
  "files_analyzed": 0,
  "files_updated": 0
}

Processing Time

This endpoint performs complex operations and may take several minutes to complete:
  • Small repos (< 10 files): 30-60 seconds
  • Medium repos (10-50 files): 2-5 minutes
  • Large repos (> 50 files): 5-15 minutes
Consider using the WebSocket endpoint (/ws) for real-time progress updates.

Build docs developers (and LLMs) love