> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/connect/n8n-api/source-control.md).

# Source Control

Operations about source control

## Pull changes from the remote repository

> Requires the Source Control feature to be licensed and connected to a repository.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"SourceControl","description":"Operations about source control"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"pull":{"type":"object","properties":{"force":{"type":"boolean"},"autoPublish":{"type":"string","enum":["none","all","published"],"default":"none","description":"Controls automatic workflow publishing after import:\n- `none`: Keep workflows in their local published state (default)\n- `all`: Publish all imported workflows\n- `published`: Publish only workflows that were published locally before import\n"}}},"pullResult":{"type":"array","items":{"$ref":"#/components/schemas/sourceControlledFile"}},"sourceControlledFile":{"type":"object","required":["file","id","name","type","status","location","conflict","updatedAt"],"properties":{"file":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["credential","workflow","tags","variables","file","folders","project","datatable"]},"status":{"type":"string","enum":["new","modified","deleted","created","renamed","conflicted","ignored","staged","unknown"]},"location":{"type":"string","enum":["local","remote"]},"conflict":{"type":"boolean"},"updatedAt":{"type":"string"},"pushed":{"type":"boolean"},"isLocalPublished":{"type":"boolean"},"isRemoteArchived":{"type":"boolean"},"parentFolderId":{"type":"string","nullable":true},"folderPath":{"type":"array","items":{"type":"string"}},"owner":{"type":"object","required":["type","projectId","projectName"],"properties":{"type":{"type":"string","enum":["personal","team"]},"projectId":{"type":"string"},"projectName":{"type":"string"}}},"publishingError":{"type":"string"}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."}}},"paths":{"/source-control/pull":{"post":{"tags":["SourceControl"],"summary":"Pull changes from the remote repository","description":"Requires the Source Control feature to be licensed and connected to a repository.","requestBody":{"description":"Pull options","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/pull"}}}},"responses":{"200":{"description":"Pull result containing the list of files that were pulled from the remote repository.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/pullResult"}}}},"400":{"$ref":"#/components/responses/badRequest"},"409":{"description":"Conflict due to uncommitted local changes or merge conflicts. The response body lists every file in the pull diff; files causing the conflict have `conflict: true` or `status: modified`. Retry with `force=true` to discard local changes.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/pullResult"}}}}}}}}}
```
