Resolve and pin dependencies

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

Resolve dependency pins. Requires project.files.write.

Parameters

NameInRequiredDescription
project_referencepathYes

Request body

FieldTypeRequiredDescription
specifiersarrayYesnpm 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").
branchstringBranch name or UUID, 1–255 characters without surrounding whitespace. Omit for main; selected package.json receives the resolved pins.
expected_declarationsobjectPackage 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.

Responses

StatusDescription
200Dependency resolution result.
400Invalid specifier syntax or batch size exceeded
401Unauthorized
403Forbidden — project.files.write capability required
404Project or branch not found
500Server error