Skip to content

API reference

API: Imports

Markdown version

MethodPathWhat it doesScope
GET/v1/importsImports, newest firstrecords:read
POST/v1/importsUpload a CSV/TSV (up to 20 MB) or an .xlsx (base64, up to 15 MB), up to 100,000 rows. Returns suggested column mapping and detected formats; nothing is imported until you start it.records:write
GET/v1/imports/:idAn import with progress, stats, errors and a sample of rowsrecords:read
POST/v1/imports/:id/cancelStop an import that hasn't finished; rows already imported stay. 409 once it has finished.records:write
POST/v1/imports/:id/startConfirm the column mapping and dedupe rule, then import in the backgroundrecords:write

Examples

GET /v1/imports

Imports, newest first

curl -s "https://api.closefinch.com/v1/imports" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/imports`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/imports

Upload a CSV/TSV (up to 20 MB) or an .xlsx (base64, up to 15 MB), up to 100,000 rows. Returns suggested column mapping and detected formats; nothing is imported until you start it.

curl -s -X POST "https://api.closefinch.com/v1/imports" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/imports`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/imports/$ID

An import with progress, stats, errors and a sample of rows

curl -s "https://api.closefinch.com/v1/imports/$ID" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/imports/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/imports/$ID/cancel

Stop an import that hasn't finished; rows already imported stay. 409 once it has finished.

curl -s -X POST "https://api.closefinch.com/v1/imports/$ID/cancel" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/imports/${id}/cancel`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/imports/$ID/start

Confirm the column mapping and dedupe rule, then import in the background

curl -s -X POST "https://api.closefinch.com/v1/imports/$ID/start" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/imports/${id}/start`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

Request and response schemas: https://www.closefinch.com/openapi.json. All resources: API reference.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.

Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.