API Reference

Repositories

GET /api/repositories lists repositories and returns snapshots; POST /api/repositories uploads a PDF or indexes a paper from arXiv / a URL.

A research repository is CiteArk's fundamental object, corresponding to a paper together with its Claims, experiments, run records, and evidence. GET /api/repositories serves the public list and individual repository snapshots; POST /api/repositories submits a new paper.

For Agents, prefer GET /api/v1/repositories and GET /api/v1/repositories/{id}. They provide cursor pagination, fields, opt-in include sections, stable ID lookup, ETag revalidation, and much smaller default responses. See Agent API. The endpoint below is the legacy full-snapshot interface.

Authentication

  • GET is public; no authentication required.
  • POST requires a browser session or x-api-key, and the account must have write permission.

GET /api/repositories

Request

ParameterTypeRequiredDescription
ownerstringNoRepository owner. When provided together with slug, returns a single repository snapshot
slugstringNoRepository name. When provided together with owner, returns a single repository snapshot

Without parameters, returns the list of public repositories, sorted by updatedAt descending, at most 50 entries, with no pagination parameters.

Examples

# Public repository list
curl https://citeark.com/api/repositories

# Single repository snapshot
curl "https://citeark.com/api/repositories?owner=<owner>&slug=<slug>"

Response

The list returns { "repositories": [...] }, where each entry is a RepositorySummary:

FieldTypeDescription
idstringRepository ID
ownerstringOwner namespace
slugstringRepository name
titlestringPaper title
descriptionstringShort description
topicsstring[]Topic tags
headIdstringCurrent version commit digest (sha256: prefixed)
claimCountnumberTotal Claim count
verifiedClaimCountnumberVerified Claim count
runCountnumberRun record count
forkCountnumberFork count
updatedAtstringLast update time (ISO 8601)

A single repository returns { "repository": { ... } }, a full snapshot (top-level structure described in Core concepts). Private repositories are readable only by the owner / organization members; everyone else gets 404 {"error": "repository not found"}. Non-owners reading a public repository receive a redacted projection.

POST /api/repositories

Two modes, distinguished by Content-Type.

Submit an arXiv link/ID or an HTTPS PDF direct link; the server fetches and indexes the paper — no file upload needed.

ParameterTypeRequiredDescription
inputstringYes1–300 characters. An arXiv link/ID (e.g. 2401.12345, https://arxiv.org/abs/..., https://arxiv.org/pdf/...), or an HTTPS PDF direct link
titlestringNo3–240 characters; only meaningful in PDF direct-link mode (defaults to the filename)
ownerstringNoTarget namespace: a personal slug or an organization slug you have permission for; must match ^[a-z0-9-]+$, ≤64 characters
slugstringNo≤96 characters; derived automatically when omitted
githubUrlstringNoMust be an HTTPS link to a repository on github.com
visibilitystringNopublic / private, defaults to public

Behavior: in arXiv mode the server fetches the title, abstract, and license, and downloads the PDF. When the License Gate is green, the PDF is stored in object storage; otherwise only metadata is kept, linking back to the original source. After creation the repository automatically enters the processing pipeline; poll progress via Processing status.

Mode 2: Multipart upload (multipart/form-data)

Upload the paper PDF file directly.

FieldTypeRequiredDescription
paperfileYesPDF file, ≤25 MB; the server validates the %PDF header
titlestringYes3–240 characters
slugstringYes≤96 characters; must match ^[a-z0-9-]+$
ownerstringNoTarget namespace: a personal slug or an organization slug you have permission for, ≤64 characters
descriptionstringNo≤1000 characters
githubUrlstringNoMust be an HTTPS link to a repository on github.com
sourceUrlstringNoOriginal source HTTPS URL
paperLicensestringNoOne of: CC0-1.0, CC-BY-4.0, CC-BY-SA-4.0, MIT, Apache-2.0, arXiv-default, publisher-restricted, unknown; defaults to unknown
codeLicensestringNoOne of: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, MPL-2.0, GPL-3.0-only, no-code, unknown; defaults to unknown
submitterAttestedstringYesMust be the string "true", attesting that you have the right to submit this paper
visibilitystringNopublic / private, defaults to public

Examples

# Mode 1: index from arXiv
curl -X POST https://citeark.com/api/repositories \
  -H "x-api-key: $CITEARK_API_KEY" \
  -H "content-type: application/json" \
  -d '{"input": "https://arxiv.org/abs/2401.00001"}'

# Mode 2: upload a PDF
curl -X POST https://citeark.com/api/repositories \
  -H "x-api-key: $CITEARK_API_KEY" \
  -F "paper=@paper.pdf" \
  -F "title=Paper title" \
  -F "slug=your-paper-slug" \
  -F "submitterAttested=true"

Response

On success returns 201:

{
  "repository": { "id": "…", "owner": "<owner>", "slug": "<slug>", "title": "…" },
  "url": "/r/<owner>/<slug>"
}

Errors

CodeMeaning
400Input not recognized or field validation failed
404Paper not found on arXiv
409This paper already exists on CiteArk (the response includes a url field pointing to the existing page)
413PDF exceeds 25 MB
429Rate limit or monthly quota exceeded

Rate limits and notes

  • POST is limited to 5 requests per hour per account.
  • Uploads and indexing are additionally subject to a 25-upload monthly quota per account; when exhausted, returns 429 with X-Quota-* headers.