Skip to main content
POST
Import Quota Values

Overview

This endpoint writes the values of a quota — the target assigned to each person, for each period. Use it to send the objectives you keep in another tool. Use this endpoint for:
  • A routine that pushes the targets of the year, or their changes
  • Filling a quota from a planning spreadsheet or a data warehouse
  • Clearing the targets of a period
Writes run in the background. The call checks your rows and returns an import_id at once; an import then writes them. A 200 means the import was created, not that the values were written: follow it with Fetch import.
Only quotas from your company’s live environment can be written. A quota_id that belongs to a sandbox environment returns 404 Not Found. Discover valid ids with GET /v2/data-structures, where every quota is listed with "type": "quota".

Your first call

Example response


One row per person and per period

The body holds a data array of 1 to 10,000 rows. Each row is one cell of the quota: one user, one period. These are the only keys accepted: Any other key is refused, including the read-only keys of the read: standard.id, standard.period and standard.source. The email is the only way to name a user. A row whose email matches no user, or an archived one, is set aside when the import runs, and the other rows are written.

Periods follow your company’s fiscal year

Send any date of the period you write: you never compute its first or last day. The periods follow the fiscal year set for your company in Qobra. On a quarterly quota: A date rather than a period label keeps your routine valid if the frequency of the quota changes. A period label such as 2026-Q1 is refused.

The value depends on the quota type

standard.value is a plain number, whatever the type of the quota:
A percentage is sent as a ratio. 0.8 means 80%, as in the read.
An amount carries no currency: it takes the currency the quota uses for that user, as when it is entered in the Qobra app. A text, NaN or an infinity is refused.

From a read to a write

Every row read from Fetch quota values carries standard.date: send it back as is to write the same cell. The read returns the user and an amount as objects, the write takes their plain value:

Clear a value

To clear a cell, send "deleted": true. Its standard.value is then ignored, and may be null:
A null value without "deleted": true is refused, so an empty cell of your spreadsheet never clears a target by accident. deleted also reads 1 and 0, and the texts "true", "false", "1" and "0". null reads as false.

Check a call with dry_run

?dry_run=true runs the same checks and returns the same errors, without importing anything. A call that passes them returns a 200 whose import_id is null:
A dry run checks the shape of the call, not its data: an unknown or archived user only shows in the import.

What the values become

  • A value changed by hand in Qobra is kept. A value entered by hand in the app over a value sent by the API becomes an overwrite: the API does not replace it.
  • Only the cells you send are written. The other values of the quota stay as they are.
  • Sending a call again is safe. A call sent twice writes the same values: there is no idempotency key to manage.
  • The last row wins. When several rows target the same user and period, the last one received is written, and the others are set aside.
  • Statements are recomputed. Once the import is finished, Qobra recomputes the statements not yet validated of the users the owner of the API key can see.
The values written show "standard.source": "integration" in the read. In Qobra, each import shows in the Update history of the Quotas page.

Send more than 10,000 rows

A call takes 10,000 rows and a body of 3 MB at most. Beyond either, the call is refused, never cut: split your rows into several calls. debounce, a number of seconds from 0 to 1,800 and 0 by default, makes the import wait for the next calls:
Three things worth knowing:
  • The first call creates the import, which starts after debounce seconds.
  • The calls made before the import starts join it and return the same import_id, even when they write other quotas. They do not push its start further.
  • A call made once the import has started creates a new import.

What this endpoint does not do

  • No user id. Users are named by email only.
  • No currency. An amount takes the currency of the quota for its user.
  • No sandbox. Only quotas of the live environment can be written.
  • No quota fed by another integration. A quota synchronized from your CRM, data warehouse or HRIS returns 409 Conflict, and so does an archived quota.
  • No result per call. The import reports on every call it merged, in Fetch import.

Errors

401, 403 and 404 keep the format of the read endpoints, and 429 returns {"error": "Ratelimit exceeded"}. Every other error lists what went wrong:
A 400 refuses the whole call and lists every error at once, so you can fix them all before sending it again: errors holds the first 1,000, those of the URL parameters first. Some 400 worth knowing:
  • An unknown URL parameter is refused. A misspelt dry_run would otherwise import your rows instead of checking them.
  • Above 10,000 rows, the call gets a single error, whatever its rows hold:
  • A body that is not valid JSON returns a single error whose path is [].

Authorizations

X-API-Key
string
header
required

Your Qobra API key. Generate it from Settings > API Keys in Qobra.

Path Parameters

quota_id
string<ObjectId>
required

ID of a quota, listed with the type 'quota' by /v2/data-structures

Query Parameters

dry_run
boolean
default:false

true checks the call without importing anything: the same errors, or a 200 whose import_id is null. Also read from 1 and 0

debounce
integer
default:0

Seconds the import created by this call waits before it starts (30 minutes at most), so that the next calls join it. A call that joins an import does not push its start further

Required range: 0 <= x <= 1800

Body

application/json
data
object[]
required

The cells to write, 1 to 10,000 per call. To send more, split them across calls with a debounce

Required array length: 1 - 10000 elements

Response

The call passed every check and its rows were added to an import, or, on a dry run, would have been.

The import the call joined or created. Nothing is written yet

import_id
string<ObjectId> | null
required

ID of the import that writes the rows. Calls merged into the same import get the same id. null on a dry run, which creates no import

records_processed
integer
required

Number of rows this call sent