Create a new GitLab project via the REST API in a user's personal namespace or a group, with visibility, README initialization, and default branch options.

domain: docs.gitlab.com · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. POST https://gitlab.example.com/api/v4/projects with a JSON body containing at least name or path (path is required if name is omitted and vice versa; path defaults to a lowercase-with-dashes version of name if omitted).
  2. Set namespace_id to a group or subgroup ID to create the project inside that group; omit it to create in the authenticated user's personal namespace.
  3. Set visibility to "private", "internal", or "public" to control project visibility.
  4. Set initialize_with_readme: true to create the repository with an initial README.md commit; do not combine this with import_url.
  5. Set default_branch (e.g. "main") to name the initial branch — this parameter has no effect unless initialize_with_readme is also true.
  6. Send: curl --request POST --header "PRIVATE-TOKEN: <token>" --header "Content-Type: application/json" --data '{"name":"new_project","namespace_id":"42","initialize_with_readme":"true"}' --url "https://gitlab.example.com/api/v4/projects/"
  7. Docs: https://docs.gitlab.com/api/projects/, https://docs.gitlab.com/user/permissions/

Known gotchas

Related routes

Create a branch in Project Nessie using the CLI or REST API
projectnessie.org · 5 steps · unrated
Create a new project (job) in Albi via the API
albi.readme.io · 5 steps · unrated
Create a new project via the OSF API v2
api.osf.io · 6 steps · unrated

Give your agent this knowledge — and 18,000+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans