Resolve and pin dependencies

http
POST /projects/{project_reference}/dependencies/resolve

Resolve dependency pins. Requires project.files.write.

Servers

JSON
[  {    "url": "https://api.veryfront.com"  }]

Authentication

JSON
[  {    "bearerAuth": []  },  {    "apiKeyAuth": []  }]
JSON
{  "bearerAuth": {    "type": "http",    "scheme": "bearer",    "bearerFormat": "JWT or API Key",    "description": "Use a JWT bearer token or a Veryfront API key in the `Authorization` header."  },  "apiKeyAuth": {    "type": "apiKey",    "in": "header",    "name": "X-API-Key",    "description": "Alternative API key header for `vf_<prefix>_<secret>` tokens."  }}

Parameters

NameLocationRequiredDescription
project_referencepathYes

Parameter contracts

JSON
[  {    "schema": {      "type": "string",      "description": "Project UUID or slug, or the project domain."    },    "required": true,    "name": "project_reference",    "in": "path"  }]

Request body

JSON
{  "content": {    "application/json": {      "schema": {        "type": "object",        "properties": {          "specifiers": {            "type": "array",            "items": {              "type": "string",              "minLength": 1,              "maxLength": 200            },            "minItems": 1,            "maxItems": 100,            "description": "npm package specifiers to pin in package.json after adding imports or packages. Inline exact versions are used as-is; ranges and bare names resolve against the npm registry (cached in Redis). Existing exact pins are never overwritten. Each entry may be a bare name, a name with an inline exact version, or a name with a semver range (for example, \"react\", \"[email protected]\", \"zod@^3\", \"@radix-ui/react-dialog\").",            "example": [              "styled-components",              "@radix-ui/react-dialog",              "[email protected]",              "zod@^3"            ]          },          "branch": {            "type": "string",            "minLength": 1,            "maxLength": 255,            "description": "Branch name or UUID, 1-255 characters without surrounding whitespace. Omit for main; selected package.json receives the resolved pins.",            "example": "feature-a"          },          "expected_declarations": {            "type": "object",            "description": "Package declarations observed by the caller, at most 100 entries with string values up to 200 characters. A null value means the package was absent. When supplied, every requested package must be present and stale declarations are not overwritten.",            "additionalProperties": {              "type": [                "string",                "null"              ],              "maxLength": 200            },            "example": {              "styled-components": "^6",              "got": null            }          }        },        "required": [          "specifiers"        ]      }    }  }}

Responses

200

Dependency resolution result.

JSON
{  "description": "Dependency resolution result.",  "content": {    "application/json": {      "schema": {        "type": "object",        "properties": {          "pins": {            "type": "object",            "description": "Successfully resolved exact pins, including existing pins. Existing exact pins remain unchanged. Unknown packages and registry failures are omitted without failing the batch. A requested package absent from both pins and skipped was not resolved or written.",            "additionalProperties": {              "type": "string"            },            "example": {              "styled-components": "6.3.5",              "got": "12.6.1",              "zod": "3.23.8"            }          },          "persisted": {            "type": "boolean",            "description": "True when eligible pins were persisted or no eligible write was needed. False means persistence failed; pins retain intended values for retry."          },          "skipped": {            "type": "object",            "description": "Packages skipped because their current declaration differs from the supplied snapshot. The skip reason is declaration_changed.",            "additionalProperties": {              "type": "string",              "enum": [                "declaration_changed"              ]            },            "example": {              "zod": "declaration_changed"            }          }        },        "required": [          "pins",          "persisted",          "skipped"        ]      }    }  }}

400

Invalid specifier syntax or batch size exceeded

JSON
{  "description": "Invalid specifier syntax or batch size exceeded",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

401

Unauthorized

JSON
{  "description": "Unauthorized",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

403

Forbidden, project.files.write capability required

JSON
{  "description": "Forbidden, project.files.write capability required",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

404

Project or branch not found

JSON
{  "description": "Project or branch not found",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

500

Server error

JSON
{  "description": "Server error",  "content": {    "application/problem+json": {      "schema": {        "$ref": "#/components/schemas/Problem"      }    }  }}

Referenced contracts

components/schemas/Problem

JSON
{  "type": "object",  "properties": {    "cause": {      "type": "string",      "enum": [        "schedule_concurrency_forbidden",        "schedule_fire_in_progress",        "schedule_run_limit_reached"      ],      "description": "Schedule admission refusal."    },    "idempotency": {      "type": "object",      "properties": {        "state": {          "type": "string",          "enum": [            "in_progress",            "payload_mismatch",            "outcome_unknown"          ]        },        "operation": {          "type": "string",          "minLength": 1        },        "retryable": {          "type": "boolean"        },        "retry_after_seconds": {          "type": [            "integer",            "null"          ],          "minimum": 0        },        "expires_at": {          "type": [            "string",            "null"          ]        },        "recovery": {          "type": "object",          "properties": {            "available": {              "type": "boolean"            },            "description": {              "type": "string"            },            "resource_url": {              "type": "string"            }          },          "required": [            "available",            "description"          ]        }      },      "required": [        "state",        "operation",        "retryable",        "retry_after_seconds",        "expires_at"      ],      "description": "Replay status, retry timing, and recovery lookup."    },    "type": {      "type": "string",      "description": "URI reference identifying the problem type",      "example": "https://api.veryfront.com/errors/validation-failed"    },    "title": {      "type": "string",      "description": "Short human-readable summary of the problem",      "example": "Validation Failed"    },    "status": {      "type": "integer",      "minimum": 100,      "maximum": 599,      "description": "HTTP status code",      "example": 400    },    "code": {      "type": "string",      "description": "Stable machine-readable error code",      "example": "RUN_INVALID_INPUT"    },    "detail": {      "type": "string",      "description": "Human-readable explanation specific to this occurrence",      "example": "The 'email' field must be a valid email address"    },    "instance": {      "type": "string",      "description": "URI reference identifying the specific occurrence",      "example": "/projects/my-project/members"    },    "slug": {      "type": "string",      "description": "Stable identifier for the problem type",      "example": "validation-failed"    },    "category": {      "type": "string",      "enum": [        "AUTH",        "RESOURCE",        "VALIDATION",        "DATABASE",        "SUBSCRIPTION",        "INTEGRATION",        "INTERNAL"      ],      "description": "API error category",      "example": "VALIDATION"    },    "suggestion": {      "type": "string",      "description": "Suggested action to resolve the problem",      "example": "Check the request body and query parameters against the API documentation."    },    "errors": {      "type": "array",      "items": {        "type": "object",        "properties": {          "field": {            "type": "string",            "description": "Field path that caused the error",            "example": "email"          },          "message": {            "type": "string",            "description": "Error message for this field",            "example": "Invalid email format"          },          "code": {            "type": "string",            "description": "Error code for this field",            "example": "INVALID_FORMAT"          }        },        "required": [          "field",          "message"        ]      },      "description": "Detailed field-level errors for validation failures"    }  },  "required": [    "type",    "title",    "status"  ]}

Operation contract

JSON
{  "operationId": "resolveProjectDependencies",  "tags": [    "deployments/Artifacts/Dependencies"  ],  "summary": "Resolve and pin dependencies",  "description": "Resolve dependency pins. Requires project.files.write.",  "parameters": [    {      "schema": {        "type": "string",        "description": "Project UUID or slug, or the project domain."      },      "required": true,      "name": "project_reference",      "in": "path"    }  ],  "requestBody": {    "content": {      "application/json": {        "schema": {          "type": "object",          "properties": {            "specifiers": {              "type": "array",              "items": {                "type": "string",                "minLength": 1,                "maxLength": 200              },              "minItems": 1,              "maxItems": 100,              "description": "npm package specifiers to pin in package.json after adding imports or packages. Inline exact versions are used as-is; ranges and bare names resolve against the npm registry (cached in Redis). Existing exact pins are never overwritten. Each entry may be a bare name, a name with an inline exact version, or a name with a semver range (for example, \"react\", \"[email protected]\", \"zod@^3\", \"@radix-ui/react-dialog\").",              "example": [                "styled-components",                "@radix-ui/react-dialog",                "[email protected]",                "zod@^3"              ]            },            "branch": {              "type": "string",              "minLength": 1,              "maxLength": 255,              "description": "Branch name or UUID, 1-255 characters without surrounding whitespace. Omit for main; selected package.json receives the resolved pins.",              "example": "feature-a"            },            "expected_declarations": {              "type": "object",              "description": "Package declarations observed by the caller, at most 100 entries with string values up to 200 characters. A null value means the package was absent. When supplied, every requested package must be present and stale declarations are not overwritten.",              "additionalProperties": {                "type": [                  "string",                  "null"                ],                "maxLength": 200              },              "example": {                "styled-components": "^6",                "got": null              }            }          },          "required": [            "specifiers"          ]        }      }    }  },  "responses": {    "200": {      "description": "Dependency resolution result.",      "content": {        "application/json": {          "schema": {            "type": "object",            "properties": {              "pins": {                "type": "object",                "description": "Successfully resolved exact pins, including existing pins. Existing exact pins remain unchanged. Unknown packages and registry failures are omitted without failing the batch. A requested package absent from both pins and skipped was not resolved or written.",                "additionalProperties": {                  "type": "string"                },                "example": {                  "styled-components": "6.3.5",                  "got": "12.6.1",                  "zod": "3.23.8"                }              },              "persisted": {                "type": "boolean",                "description": "True when eligible pins were persisted or no eligible write was needed. False means persistence failed; pins retain intended values for retry."              },              "skipped": {                "type": "object",                "description": "Packages skipped because their current declaration differs from the supplied snapshot. The skip reason is declaration_changed.",                "additionalProperties": {                  "type": "string",                  "enum": [                    "declaration_changed"                  ]                },                "example": {                  "zod": "declaration_changed"                }              }            },            "required": [              "pins",              "persisted",              "skipped"            ]          }        }      }    },    "400": {      "description": "Invalid specifier syntax or batch size exceeded",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "401": {      "description": "Unauthorized",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "403": {      "description": "Forbidden, project.files.write capability required",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "404": {      "description": "Project or branch not found",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "500": {      "description": "Server error",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    }  },  "x-documentation-source-tag": "Dependencies",  "x-canonical-documentation": {    "domain": "deployments",    "resource": "Artifacts",    "subgroup": "Dependencies",    "name": "Resolve and pin dependencies",    "description": "Resolve dependency pins. Requires project.files.write.",    "operationId": "resolveProjectDependencies"  },  "x-mint": {    "href": "/cloud/rest/api-reference/deployments-artifacts-dependencies/resolve-and-pin-dependencies"  }}