---
title: "Upload References"
method: POST
path: "/v1/code-references"
tags: ["Code References"]
---

# Upload References

`POST /v1/code-references`

## Request body

- CodeReferenceRequest
  - `configId` string, uuid, required — The Config's identifier the scanning was performed against.
  - `repository` string, required — The source control repository that contains the scanned code. (Source of the repository selector on the ConfigCat Dashboard)
  - `branch` string, required — The source control branch on where the scan was performed. (Source of the branch selector on the ConfigCat Dashboard)
  - `commitUrl` string, nullable — The related commit's URL. (Appears on the ConfigCat Dashboard)
  - `commitHash` string, nullable — The related commit's hash. (Appears on the ConfigCat Dashboard)
  - `uploader` string, nullable — The scanning tool's name. (Appears on the ConfigCat Dashboard)
  - `activeBranches` string[] — The currently active branches of the repository. Each previously uploaded report that belongs to a non-reported active branch is being deleted.
  - `flagReferences` FlagReference[] — The actual code reference collection.
    - `settingId` integer, required — The identifier of the Feature Flag or Setting the code reference belongs to.
    - `references` ReferenceLinesRequest[], required — The actual references to the given Feature Flag or Setting.
      - `file` string, required — The file's name in where the code reference has been found. (Appears on the ConfigCat Dashboard)
      - `fileUrl` string, nullable — The file's url. (Used to point to the file on the repository's website)
      - `preLines` ReferenceLineRequest[] — The lines before the actual reference line.
        - `lineText` string, nullable — The content of the reference line.
        - `lineNumber` integer, required — The line number.
      - `postLines` ReferenceLineRequest[] — The lines after the actual reference line.
        - `lineText` string, nullable — The content of the reference line.
        - `lineNumber` integer, required — The line number.
      - `referenceLine` ReferenceLineRequest, required — Determines a code reference line.
        - `lineText` string, nullable — The content of the reference line.
        - `lineNumber` integer, required — The line number.

## Response `200`

OK

## Other responses

- `400` — Bad request.
- `404` — Not found.
- `429` — Too many requests. In case of the request rate exceeds the rate limits.

---

[API](https://skmtc.net/configcat/apis/configcat-public-management-api.md) · [All operations](https://skmtc.net/configcat/apis/configcat-public-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/configcat/configcat-public-management-api/versions/6b4d53bc1455/schema)
