> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ariacompute.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Code Repo - POST /v1/workspaces/:workspace_id/code-repos

> Import and parse a code repository via POST /v1/workspaces/:workspace_id/code-repos. Minimum role contributor.

Import a Git repository (by URL and branch); it is cloned and parsed in the background into symbols and call/reference edges, building the code graph.

## Endpoint

```http theme={null}
POST /v1/workspaces/:workspace_id/code-repos
```

## Authentication

`Authorization: Bearer <jwt>` or `X-API-Key <sk_...>`. Minimum role: **contributor**.

## Path parameters

**workspace\_id** `string` *required*

Workspace id.

## Request body

**url** `string` *required*

Repository Git URL.

**branch** `string`

Branch to parse; defaults to the default branch when omitted.

## Response

**id** `string`

Repo id (`repo_...`).

**workspace\_id** `string`

Owning workspace id.

**owner\_id** `string`

Importer user id.

**url** `string`

Repository URL.

**branch** `string`

Branch.

**status** `string`

Status (`cloning` / `indexing` / `ready` / `failed`).

**visibility** `string`

Visibility.

**error** `string`

Error message when failed.

**created\_at** `string`

Creation time (RFC3339).

**updated\_at** `string`

Update time (RFC3339).

## Example

```bash cURL theme={null}
curl -X POST https://memo.ariacompute.com/v1/workspaces/ws_01a2b3c4d5e6/code-repos \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://github.com/ariacompute/ariamem","branch":"main"}'
```

```json 200 theme={null}
{
  "id": "repo_01a2b3c4d5e6",
  "workspace_id": "ws_01a2b3c4d5e6",
  "owner_id": "usr_01a2b3c4d5e6",
  "url": "https://github.com/ariacompute/ariamem",
  "branch": "main",
  "status": "cloning",
  "visibility": "private",
  "error": "",
  "created_at": "2026-10-12T11:00:00Z",
  "updated_at": "2026-10-12T11:00:00Z"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.