跳转到主要内容
PUT
/
v3beta1
/
organizations
/
{org_id}
/
repositories
/
{repository_path}
/
indexing
索引代码仓库
curl --request PUT \
  --url https://api.devin.ai/v3beta1/organizations/{org_id}/repositories/{repository_path}/indexing \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "branch_names": [
    "<string>"
  ]
}
'
{
  "branches": [
    "<string>"
  ],
  "indexing_enabled": true,
  "repository_path": "<string>",
  "indexing_status": {
    "indexing_enabled": true,
    "latest_completed_search_index_job": {
      "branch_name": "<string>",
      "commit": "<string>",
      "created_at": 123,
      "job_id": "<string>",
      "status": "failed"
    },
    "latest_completed_wiki_index_job": {
      "branch_name": "<string>",
      "commit": "<string>",
      "created_at": 123,
      "job_id": "<string>",
      "status": "failed"
    },
    "latest_indexes": [
      {
        "branch_name": "<string>",
        "commit": "<string>",
        "created_at": 123,
        "job_id": "<string>",
        "status": "failed"
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.devin.ai/llms.txt

Use this file to discover all available pages before exploring further.

权限

需要具备组织级 IndexOrgRepositories 权限的服务用户。

行为

此端点是幂等的——对同一代码仓库多次调用,不会创建重复的索引作业。它会为指定的代码仓库启用索引,并触发索引作业。 你还可以在请求体中选择性指定 branch_names,以索引特定分支。如果省略,则使用默认分支。

授权

Authorization
string
header
必填

服务用户凭据(前缀:cog_)

路径参数

repository_path
string
必填

请求体

application/json
branch_names
string[]

响应

成功响应

branches
string[]
必填
indexing_enabled
boolean
必填
repository_path
string
必填
indexing_status
RepoIndexingStatusResponse · object