Import a repository from a public git URL
POST/api/imports/url
createUrlImport
Creates a new neosource repository in the caller's personal workspace and enqueues a background import that clones a PUBLIC git URL into it — no OAuth, provider-agnostic (GitHub, GitLab, Codeberg, self-hosted, …). The URL is validated (https-only, no credentials, host must resolve to a public address) before enqueue. Watch progress via the repo's `import-progress` SSE / `import-status` endpoints.
Requires authentication using a session cookie or a bearer token — see tokens and scopes.
curl
curl -X POST 'https://neosource.dev/api/imports/url' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"clone_url":"string"}'fetch
fetch("https://neosource.dev/api/imports/url", {
method: "POST",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({"clone_url":"string"}),
});Request bodyrequired
application/json
Responses
202Repo created and import enqueued
application/json
403Forbidden — one of: forbidden, needs_scope
application/json
one of
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 404Not Found — one of: not_found
- 409Conflict — one of: already_exists, conflict
- 429Rate limited — retry after the `Retry-After` header
- 500Internal server error
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget