Search branch files

http
POST /projects/{project_reference}/branches/{branchName}/search

Search branch files. Requires project.files.read.

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
branchNamepathYes

Parameter contracts

JSON
[  {    "schema": {      "type": "string",      "description": "Project ID, slug, or domain from the authenticated context."    },    "required": true,    "name": "project_reference",    "in": "path"  },  {    "schema": {      "type": "string",      "description": "Branch name or ID. Use `main` to search the default project state."    },    "required": true,    "name": "branchName",    "in": "path"  }]

Request body

JSON
{  "content": {    "application/json": {      "schema": {        "$ref": "#/components/schemas/ContentSearchBody"      }    }  }}

Responses

200

Search results. Searches branch content using a precomputed embedding vector.

JSON
{  "description": "Search results. Searches branch content using a precomputed embedding vector.",  "content": {    "application/json": {      "schema": {        "$ref": "#/components/schemas/ContentSearchResponse"      }    }  }}

400

Bad request

JSON
{  "description": "Bad request",  "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

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

404

Not found

JSON
{  "description": "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/ContentSearchBody

JSON
{  "type": "object",  "properties": {    "model": {      "type": "object",      "properties": {        "name": {          "type": "string",          "minLength": 1        },        "provider": {          "type": "string",          "minLength": 1        }      },      "required": [        "name",        "provider"      ]    },    "document_scope": {      "type": "object",      "properties": {        "version": {          "type": "number",          "enum": [            1          ]        },        "path_flavor": {          "type": "string",          "enum": [            "posix"          ]        },        "include_all": {          "type": "boolean"        },        "includes": {          "type": "array",          "items": {            "type": "string",            "minLength": 1,            "maxLength": 4096          },          "maxItems": 1024        },        "excludes": {          "type": "array",          "items": {            "type": "string",            "minLength": 1,            "maxLength": 4096          },          "maxItems": 1024        },        "content_dir": {          "type": "string",          "minLength": 1,          "maxLength": 4096        },        "project_dir": {          "type": "string",          "minLength": 1,          "maxLength": 4096        },        "resolved_content_dir": {          "type": "string",          "minLength": 1,          "maxLength": 4096        },        "resolved_project_dir": {          "type": "string",          "minLength": 1,          "maxLength": 4096        }      },      "required": [        "version",        "path_flavor",        "include_all",        "includes",        "excludes",        "content_dir",        "resolved_content_dir"      ],      "additionalProperties": false    },    "vector": {      "type": "array",      "items": {        "type": "number"      },      "minItems": 768,      "maxItems": 4096,      "description": "Pre-computed query embedding vector. Generate it with an embedding provider before sending the request."    },    "dimension": {      "anyOf": [        {          "type": "number",          "enum": [            768          ]        },        {          "type": "number",          "enum": [            1024          ]        },        {          "type": "number",          "enum": [            1536          ]        },        {          "type": "number",          "enum": [            3072          ]        },        {          "type": "number",          "enum": [            4096          ]        }      ],      "description": "Embedding vector dimension: 768, 1024, 1536, 3072, or 4096."    },    "limit": {      "type": "number",      "minimum": 1,      "maximum": 100,      "default": 10,      "description": "Maximum search results to return, as an integer from 1 to 100."    },    "cursor": {      "type": "string",      "description": "Opaque cursor returned from `page_info.next`."    },    "threshold": {      "type": "number",      "minimum": 0,      "maximum": 1,      "default": 0.7,      "description": "Minimum similarity score for returned semantic matches."    }  },  "required": [    "vector",    "dimension"  ],  "example": {    "vector": [      0,      0.4207,      0.4546,      0.0706,      -0.3784,      -0.4795,      -0.1397,      0.3285,      0.4947,      0.2061,      -0.272,      -0.5,      -0.2683,      0.2101,      0.4953,      0.3251,      -0.144,      -0.4807,      -0.3755,      0.0749,      0.4565,      0.4183,      -0.0044,      -0.4231,      -0.4528,      -0.0662,      0.3813,      0.4782,      0.1355,      -0.3318,      -0.494,      -0.202,      0.2757,      0.5,      0.2645,      -0.2141,      -0.4959,      -0.3218,      0.1482,      0.4819,      0.3726,      -0.0793,      -0.4583,      -0.4159,      0.0089,      0.4255,      0.4509,      0.0618,      -0.3841,      -0.4769,      -0.1312,      0.3351,      0.4933,      0.198,      -0.2794,      -0.4999,      -0.2608,      0.2181,      0.4964,      0.3184,      -0.1524,      -0.4831,      -0.3696,      0.0837,      0.46,      0.4134,      -0.0133,      -0.4278,      -0.449,      -0.0574,      0.3869,      0.4755,      0.1269,      -0.3384,      -0.4926,      -0.1939,      0.2831,      0.4998,      0.257,      -0.2221,      -0.4969,      -0.3149,      0.1566,      0.4842,      0.3666,      -0.088,      -0.4617,      -0.4109,      0.0177,      0.43,      0.447,      0.053,      -0.3897,      -0.4741,      -0.1226,      0.3416,      0.4918,      0.1898,      -0.2867,      -0.4996,      -0.2532,      0.226,      0.4974,      0.3115,      -0.1608,      -0.4853,      -0.3636,      0.0924,      0.4634,      0.4084,      -0.0221,      -0.4323,      -0.445,      -0.0486,      0.3925,      0.4727,      0.1183,      -0.3448,      -0.491,      -0.1857,      0.2903,      0.4994,      0.2494,      -0.23,      -0.4978,      -0.308,      0.165,      0.4863,      0.3605,      -0.0967,      -0.4651,      -0.4058,      0.0265,      0.4345,      0.443,      0.0442,      -0.3952,      -0.4713,      -0.114,      0.348,      0.4901,      0.1816,      -0.2939,      -0.4992,      -0.2455,      0.2339,      0.4982,      0.3045,      -0.1692,      -0.4873,      -0.3574,      0.1011,      0.4667,      0.4032,      -0.031,      -0.4367,      -0.4409,      -0.0398,      0.3979,      0.4698,      0.1097,      -0.3512,      -0.4892,      -0.1775,      0.2975,      0.4989,      0.2416,      -0.2378,      -0.4986,      -0.301,      0.1733,      0.4883,      0.3543,      -0.1054,      -0.4682,      -0.4006,      0.0354,      0.4388,      0.4388,      0.0354,      -0.4006,      -0.4682,      -0.1054,      0.3543,      0.4883,      0.1733,      -0.301,      -0.4986,      -0.2378,      0.2417,      0.4989,      0.2975,      -0.1775,      -0.4892,      -0.3512,      0.1097,      0.4698,      0.3979,      -0.0398,      -0.4409,      -0.4366,      -0.0309,      0.4032,      0.4667,      0.1011,      -0.3574,      -0.4873,      -0.1692,      0.3045,      0.4982,      0.2339,      -0.2455,      -0.4992,      -0.2939,      0.1816,      0.4901,      0.348,      -0.114,      -0.4713,      -0.3952,      0.0442,      0.443,      0.4345,      0.0265,      -0.4058,      -0.465,      -0.0967,      0.3605,      0.4863,      0.165,      -0.308,      -0.4978,      -0.2299,      0.2494,      0.4994,      0.2903,      -0.1857,      -0.491,      -0.3448,      0.1183,      0.4727,      0.3925,      -0.0486,      -0.445,      -0.4323,      -0.0221,      0.4084,      0.4634,      0.0924,      -0.3636,      -0.4853,      -0.1608,      0.3115,      0.4974,      0.226,      -0.2532,      -0.4996,      -0.2867,      0.1898,      0.4918,      0.3416,      -0.1226,      -0.4741,      -0.3897,      0.053,      0.447,      0.43,      0.0177,      -0.4109,      -0.4617,      -0.088,      0.3666,      0.4842,      0.1566,      -0.315,      -0.4969,      -0.222,      0.257,      0.4998,      0.283,      -0.1939,      -0.4926,      -0.3384,      0.1269,      0.4755,      0.3869,      -0.0574,      -0.449,      -0.4278,      -0.0133,      0.4134,      0.46,      0.0837,      -0.3696,      -0.4831,      -0.1524,      0.3184,      0.4964,      0.2181,      -0.2608,      -0.4999,      -0.2794,      0.198,      0.4933,      0.3351,      -0.1312,      -0.4769,      -0.3841,      0.0618,      0.4509,      0.4254,      0.0088,      -0.4159,      -0.4583,      -0.0793,      0.3726,      0.4819,      0.1482,      -0.3218,      -0.4959,      -0.2141,      0.2646,      0.5,      0.2757,      -0.202,      -0.494,      -0.3318,      0.1355,      0.4782,      0.3813,      -0.0662,      -0.4528,      -0.4231,      -0.0044,      0.4183,      0.4565,      0.0749,      -0.3755,      -0.4807,      -0.1439,      0.3252,      0.4953,      0.2101,      -0.2683,      -0.5,      -0.272,      0.2061,      0.4947,      0.3285,      -0.1397,      -0.4795,      -0.3784,      0.0706,      0.4547,      0.4207,      0,      -0.4207,      -0.4546,      -0.0705,      0.3784,      0.4795,      0.1397,      -0.3285,      -0.4947,      -0.206,      0.272,      0.5,      0.2683,      -0.2101,      -0.4953,      -0.3251,      0.144,      0.4807,      0.3755,      -0.075,      -0.4565,      -0.4183,      0.0044,      0.4231,      0.4528,      0.0662,      -0.3813,      -0.4782,      -0.1354,      0.3318,      0.494,      0.202,      -0.2757,      -0.5,      -0.2645,      0.2141,      0.4959,      0.3218,      -0.1482,      -0.4819,      -0.3725,      0.0793,      0.4583,      0.4159,      -0.0089,      -0.4255,      -0.4509,      -0.0618,      0.3841,      0.4769,      0.1312,      -0.3351,      -0.4933,      -0.1979,      0.2794,      0.4999,      0.2608,      -0.2181,      -0.4964,      -0.3184,      0.1524,      0.4831,      0.3696,      -0.0837,      -0.46,      -0.4134,      0.0133,      0.4278,      0.449,      0.0574,      -0.387,      -0.4755,      -0.1269,      0.3384,      0.4926,      0.1939,      -0.2831,      -0.4998,      -0.257,      0.2221,      0.4969,      0.3149,      -0.1566,      -0.4842,      -0.3666,      0.0881,      0.4617,      0.4109,      -0.0177,      -0.43,      -0.447,      -0.053,      0.3897,      0.4741,      0.1226,      -0.3416,      -0.4918,      -0.1898,      0.2867,      0.4996,      0.2532,      -0.226,      -0.4974,      -0.3115,      0.1608,      0.4853,      0.3636,      -0.0924,      -0.4634,      -0.4084,      0.0221,      0.4323,      0.445,      0.0486,      -0.3925,      -0.4727,      -0.1183,      0.3449,      0.491,      0.1857,      -0.2903,      -0.4994,      -0.2493,      0.23,      0.4978,      0.308,      -0.165,      -0.4863,      -0.3605,      0.0968,      0.4651,      0.4058,      -0.0266,      -0.4345,      -0.443,      -0.0442,      0.3952,      0.4713,      0.114,      -0.3481,      -0.4901,      -0.1816,      0.2939,      0.4992,      0.2455,      -0.2339,      -0.4982,      -0.3045,      0.1692,      0.4873,      0.3574,      -0.1011,      -0.4667,      -0.4032,      0.031,      0.4367,      0.4409,      0.0398,      -0.3979,      -0.4698,      -0.1097,      0.3512,      0.4892,      0.1774,      -0.2975,      -0.4989,      -0.2416,      0.2378,      0.4986,      0.301,      -0.1733,      -0.4883,      -0.3543,      0.1054,      0.4682,      0.4006,      -0.0354,      -0.4388,      -0.4388,      -0.0353,      0.4006,      0.4682,      0.1054,      -0.3544,      -0.4883,      -0.1733,      0.301,      0.4986,      0.2377,      -0.2417,      -0.4989,      -0.2974,      0.1775,      0.4892,      0.3512,      -0.1097,      -0.4698,      -0.3979,      0.0398,      0.4409,      0.4366,      0.0309,      -0.4032,      -0.4666,      -0.101,      0.3575,      0.4873,      0.1691,      -0.3045,      -0.4982,      -0.2338,      0.2455,      0.4992,      0.2939,      -0.1816,      -0.4901,      -0.348,      0.1141,      0.4713,      0.3952,      -0.0442,      -0.443,      -0.4345,      -0.0265,      0.4058,      0.465,      0.0967,      -0.3605,      -0.4863,      -0.165,      0.308,      0.4978,      0.2299,      -0.2494,      -0.4994,      -0.2903,      0.1857,      0.491,      0.3448,      -0.1184,      -0.4727,      -0.3925,      0.0486,      0.445,      0.4323,      0.0221,      -0.4084,      -0.4634,      -0.0924,      0.3636,      0.4853,      0.1608,      -0.3115,      -0.4974,      -0.226,      0.2532,      0.4996,      0.2867,      -0.1898,      -0.4918,      -0.3416,      0.1227,      0.4742,      0.3897,      -0.053,      -0.447,      -0.43,      -0.0177,      0.4109,      0.4617,      0.088,      -0.3666,      -0.4842,      -0.1566,      0.315,      0.4969,      0.222,      -0.257,      -0.4998,      -0.283,      0.1939,      0.4926,      0.3384,      -0.1269,      -0.4755,      -0.3869,      0.0574,      0.449,      0.4277,      0.0132,      -0.4134,      -0.46,      -0.0836,      0.3696,      0.4831,      0.1524,      -0.3184,      -0.4964,      -0.2181,      0.2608,      0.4999,      0.2794,      -0.198,      -0.4933,      -0.3351,      0.1312,      0.4769,      0.3841,      -0.0618,      -0.4509,      -0.4254,      -0.0088,      0.4159,      0.4582,      0.0793,      -0.3726,      -0.4819,      -0.1482,      0.3218,      0.4959,      0.2141,      -0.2646,      -0.5,      -0.2757,      0.202,      0.494,      0.3318,      -0.1355,      -0.4782,      -0.3813,      0.0662,      0.4528,      0.4231,      0.0044,      -0.4183,      -0.4565,      -0.0749,      0.3755,      0.4807,      0.1439,      -0.3252,      -0.4953,      -0.2101,      0.2683,      0.5,      0.272,      -0.2061,      -0.4947,      -0.3285,      0.1397,      0.4795,      0.3784,      -0.0706,      -0.4547,      -0.4207,      0,      0.4208,      0.4546,      0.0705,      -0.3784,      -0.4795,      -0.1397,      0.3285,      0.4947,      0.206,      -0.272,      -0.5,      -0.2683,      0.2101,      0.4953,      0.3251,      -0.144,      -0.4807,      -0.3755,      0.075,      0.4565,      0.4183,      -0.0045,      -0.4231,      -0.4528,      -0.0661,      0.3813,      0.4782,      0.1354,      -0.3318,      -0.494,      -0.202,      0.2757,      0.5,      0.2645,      -0.2141,      -0.4959,      -0.3217,      0.1482,      0.4819,      0.3725,      -0.0793,      -0.4583,      -0.4159,      0.0089,      0.4255,      0.4509,      0.0618,      -0.3841,      -0.4769,      -0.1312,      0.3351,      0.4933,      0.1979,      -0.2794,      -0.4999,      -0.2607,      0.2181    ],    "dimension": 768,    "limit": 10,    "threshold": 0.7  }}

components/schemas/ContentSearchResponse

JSON
{  "type": "object",  "properties": {    "document_scope_version": {      "type": "number",      "enum": [        1      ]    },    "data": {      "type": "array",      "items": {        "type": "object",        "properties": {          "chunk": {            "type": "object",            "properties": {              "id": {                "type": "string"              },              "file_path": {                "type": "string"              },              "file_id": {                "type": "string"              },              "file_version_id": {                "type": "string"              },              "index": {                "type": "number"              },              "content": {                "type": "string"              },              "start_offset": {                "type": "number"              },              "end_offset": {                "type": "number"              },              "token_count": {                "type": "number"              },              "metadata": {                "type": "object",                "additionalProperties": {}              }            },            "required": [              "id",              "file_path",              "file_version_id",              "index",              "content",              "start_offset",              "end_offset",              "token_count"            ]          },          "score": {            "type": "number"          },          "match_type": {            "type": "string",            "enum": [              "semantic",              "keyword",              "hybrid"            ]          }        },        "required": [          "chunk",          "score",          "match_type"        ]      },      "description": "Vector search matches ordered by relevance."    },    "page_info": {      "$ref": "#/components/schemas/PageInfo"    },    "search_time_ms": {      "type": "number",      "description": "Server-side search duration in milliseconds."    },    "total_matches": {      "type": "number",      "description": "Total number of matches reported by the search backend."    }  },  "required": [    "data",    "page_info",    "search_time_ms",    "total_matches"  ],  "example": {    "data": [      {        "chunk": {          "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",          "file_path": "src/pages/index.tsx",          "file_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",          "file_version_id": "9b2f4c11-3c6a-4b0e-9d1f-2a7f3f6c8e10",          "index": 0,          "content": "export default function Home() {\n  return <main>Hello</main>\n}\n",          "start_offset": 0,          "end_offset": 63,          "token_count": 18,          "metadata": {            "language": "tsx"          }        },        "score": 0.87,        "match_type": "semantic"      }    ],    "page_info": {      "self": null,      "first": null,      "next": null,      "prev": null    },    "search_time_ms": 42,    "total_matches": 1  }}

components/schemas/PageInfo

JSON
{  "type": "object",  "properties": {    "self": {      "type": [        "string",        "null"      ],      "description": "Cursor pointing to the current page"    },    "first": {      "type": "null",      "description": "First page cursor (always null for cursor-based pagination)"    },    "next": {      "type": [        "string",        "null"      ],      "description": "Cursor for the next page (null if no more pages)"    },    "prev": {      "type": [        "string",        "null"      ],      "description": "Cursor for the previous page (null if on first page)"    }  },  "required": [    "self",    "first",    "next",    "prev"  ]}

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": "searchBranchContent",  "tags": [    "knowledge/Search/Search"  ],  "summary": "Search branch files",  "description": "Search branch files. Requires project.files.read.",  "parameters": [    {      "schema": {        "type": "string",        "description": "Project ID, slug, or domain from the authenticated context."      },      "required": true,      "name": "project_reference",      "in": "path"    },    {      "schema": {        "type": "string",        "description": "Branch name or ID. Use `main` to search the default project state."      },      "required": true,      "name": "branchName",      "in": "path"    }  ],  "requestBody": {    "content": {      "application/json": {        "schema": {          "$ref": "#/components/schemas/ContentSearchBody"        }      }    }  },  "responses": {    "200": {      "description": "Search results. Searches branch content using a precomputed embedding vector.",      "content": {        "application/json": {          "schema": {            "$ref": "#/components/schemas/ContentSearchResponse"          }        }      }    },    "400": {      "description": "Bad request",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "401": {      "description": "Unauthorized",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "403": {      "description": "Forbidden",      "content": {        "application/problem+json": {          "schema": {            "$ref": "#/components/schemas/Problem"          }        }      }    },    "404": {      "description": "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": "Vector search",  "x-canonical-documentation": {    "domain": "knowledge",    "resource": "Search",    "subgroup": "Search",    "name": "Search branch files",    "description": "Search branch files. Requires project.files.read.",    "operationId": "searchBranchContent"  },  "x-mint": {    "href": "/cloud/rest/api-reference/knowledge-search-search/search-branch-files"  }}