curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/update \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": {
"type": "diff",
"operations": [
{
"type": "write",
"filename": "src/search.ts",
"content": "function findItem(array: Item[], targetId: string): Item | undefined {\n for (let i = 0; i < array.length; i++) {\n const item = array[i];\n if (item.id === targetId) {\n return item;\n }\n }\n return undefined;\n}"
},
{
"type": "rename",
"old_filename": "src/utils.ts",
"new_filename": "src/helpers.ts"
},
{
"type": "delete",
"filename": "old-file.js"
}
]
},
"metadata": {
"version": "2.1.0",
"updated_by": "user123"
}
}'
{
"repo_head": "abc123def456",
"repo_id": "123e4567-e89b-12d3-a456-426614174000",
"changed_files": ["src/search.ts", "src/helpers.ts", "old-file.js"]
}
Update repo content with files or sync from Git.
curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/update \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": {
"type": "diff",
"operations": [
{
"type": "write",
"filename": "src/search.ts",
"content": "function findItem(array: Item[], targetId: string): Item | undefined {\n for (let i = 0; i < array.length; i++) {\n const item = array[i];\n if (item.id === targetId) {\n return item;\n }\n }\n return undefined;\n}"
},
{
"type": "rename",
"old_filename": "src/utils.ts",
"new_filename": "src/helpers.ts"
},
{
"type": "delete",
"filename": "old-file.js"
}
]
},
"metadata": {
"version": "2.1.0",
"updated_by": "user123"
}
}'
{
"repo_head": "abc123def456",
"repo_id": "123e4567-e89b-12d3-a456-426614174000",
"changed_files": ["src/search.ts", "src/helpers.ts", "old-file.js"]
}
Documentation Index
Fetch the complete documentation index at: https://docs.relace.ai/llms.txt
Use this file to discover all available pages before exploring further.
Show properties
"git" for Git sync, "files" to replace all repo content, or
"diff" for specific operationsShow properties
"write" to create/update, "rename" to change filename, or "delete" to removeShow operation-specific properties
source nor metadata is provided, you’ll receive a 422 error.curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/update \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": {
"type": "diff",
"operations": [
{
"type": "write",
"filename": "src/search.ts",
"content": "function findItem(array: Item[], targetId: string): Item | undefined {\n for (let i = 0; i < array.length; i++) {\n const item = array[i];\n if (item.id === targetId) {\n return item;\n }\n }\n return undefined;\n}"
},
{
"type": "rename",
"old_filename": "src/utils.ts",
"new_filename": "src/helpers.ts"
},
{
"type": "delete",
"filename": "old-file.js"
}
]
},
"metadata": {
"version": "2.1.0",
"updated_by": "user123"
}
}'
{
"repo_head": "abc123def456",
"repo_id": "123e4567-e89b-12d3-a456-426614174000",
"changed_files": ["src/search.ts", "src/helpers.ts", "old-file.js"]
}