Fork
POST /api/forks copies a research repository into your own namespace to continue work on top of existing research.
POST /api/forks copies a full snapshot of the source repository into the target namespace: the paper, Claims, experiment plans, evidence, and provenance are all preserved, but run records (runs) are cleared, forkCount is reset to 0, and forkedFrom is recorded (the source repository's repositoryId, owner, slug, and commitId at the time of forking) to trace the fork's origin. The source repository's forkCount is incremented accordingly.
Authentication
Requires write permission: a browser session or an API Key (x-api-key). You must also have read permission on the source repository.
Request
Body is JSON:
| Field | Type | Required | Description |
|---|---|---|---|
| sourceRepositoryId | string | Yes | Source repository ID |
| owner | string | No | Target namespace (the current account or an organization you have permission for); defaults to the current account. Lowercase letters, digits, and hyphens only, max 64 characters |
| slug | string | No | New repository slug; defaults to the source repository's slug. Lowercase letters, digits, and hyphens only, max 96 characters |
Example
curl -X POST https://citeark.com/api/forks \
-H "x-api-key: $CITEARK_API_KEY" \
-H "content-type: application/json" \
-d '{"sourceRepositoryId": "…", "owner": "your-name"}'Response
On success returns 201:
{
"repository": {
"id": "…",
"owner": "<owner>",
"slug": "<slug>",
"forkedFrom": { "repositoryId": "…", "owner": "…", "slug": "…", "commitId": "…" }
},
"url": "/r/<owner>/<slug>"
}Errors
Errors always take the form {"error": "message"}:
| Code | Description |
|---|---|
| 400 | Invalid fork request (parameter validation failed); a nonexistent source repository also returns 400 |
| 401 | Not signed in or invalid credentials |
| 403 | No read permission on the source repository |
| 429 | Rate limit exceeded |
Rate limit
20 requests per hour per account. Exceeding the limit returns 429 with a Retry-After header.