Quotas
Import Quota Values
Writes the values of a quota: one row per user and per period. The call checks the body, the URL parameters and the quota before answering, and refuses the whole call when anything is wrong, listing every error. Otherwise it creates an import that writes the rows in the background: a 200 means the import was created, not that the values were written. A value changed by hand in Qobra is kept. Calls made while the import waits join it.
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 adata 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:
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 carriesstandard.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:
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:
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.
"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:
- The first call creates the import, which starts after
debounceseconds. - 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_runwould 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
pathis[].
Authorizations
Path Parameters
Query Parameters
Body
application/json
Response
The call passed every check and its rows were added to an import, or, on a dry run, would have been.