Developers

Send your schedule to Quotas

Your software plans, Quotas tracks time. A simple REST API to send your teams' slots: they appear in the schedule, locked, and each team member clocks in on them from the app.

API addresshttps://quotas.app/api/integration/v1

Quick start

  1. Create a key

    The company administrator opens Quotas → Settings → Connections, names the connection (after your app) and confirms with their password. The key starts with qk_ and is shown only once.

  2. Test it

    A simple call to /me returns the company and the connection name.

    curl https://quotas.app/api/integration/v1/me \
      -H "X-Api-Key: $QUOTAS_API_KEY"
  3. Send a slot

    One PUT per slot, with your own ID. Send it again on every change: Quotas updates it without creating duplicates.

    curl -X PUT https://quotas.app/api/integration/v1/shifts/INT-2027-0042 \
      -H "X-Api-Key: $QUOTAS_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"startsAt":"2027-01-04T07:30:00","endsAt":"2027-01-04T16:00:00","breakMinutes":30,"workers":["lucas@example.be"],"title":"Site Dupont"}'

Authentication and security

Every request carries the key in the X-Api-Key header. It is never accepted in the address (URL parameter), where it would end up in logs.

One key per connection

Each app has its own key, limited to a single company and to the slots it sent. It sees no clock-ins, no leave and no data from other connections.

Never stored in plain text

Quotas only keeps a SHA-256 fingerprint of the key: even we cannot read it back. Lost the key? Renew it, the old one stops working immediately.

Under the administrator's control

Only the account owner creates a key, with their password. All administrators get an email, and every creation, renewal or deletion is recorded in the audit log.

Protected against abuse

Rate limited per connection, IP addresses blocked after several invalid keys, HTTPS required: a plain-HTTP request is refused, not redirected.

The key is a server-side secret. Keep it in an environment variable or a secrets vault, never in a mobile app, a web page, a Git repository or a log. If in doubt, delete the connection in Quotas: access is cut off immediately.

Principles

Your ID
Each slot carries an externalId you choose (your job's reference or id): 1 to 100 characters among letters, digits and . _ : / -. It is what makes requests idempotent.
People
Team members are matched by their email address in Quotas (see /members). An unknown address is reported, never created: only the company invites its team. A slot with several people becomes one shift per person.
Times
ISO 8601 format. With an offset (+01:00 or Z) the time is converted; without one, it is read as Brussels time. Responses are always in Europe/Brussels, with an offset.
Locked shifts
A received shift can only be changed from your app: in Quotas it shows the connection name and any edit is refused. Clock-ins, leave, reminders and reports work as usual. If the connection is deleted, the shifts stay and become editable again.

Reference

JSON in and out (Content-Type: application/json header when sending).

GET/me

Checks the key. Returns the connection, the company and the time zone.

{
  "connection": {
    "id": 3,
    "name": "SiteManager"
  },
  "company": {
    "id": 12,
    "name": "Dupont & Fils"
  },
  "timezone": "Europe/Brussels"
}
GET/members

The company's active team members, to match your people by email address.

{
  "members": [
    {
      "id": 20,
      "email": "lucas@example.be",
      "firstName": "Lucas",
      "lastName": "Dupont",
      "role": "employee",
      "status": "active"
    }
  ]
}
GET/shifts?from=2027-01-04&to=2027-01-10

Shifts sent by this connection over a period (YYYY-MM-DD dates, “to” included, 400 days at most).

{
  "shifts": [
    {
      "id": 349,
      "externalId": "INT-2027-0042",
      "email": "lucas@example.be",
      "memberId": 20,
      "startsAt": "2027-01-04T07:30:00+01:00",
      "endsAt": "2027-01-04T16:00:00+01:00",
      "breakMinutes": 30,
      "note": "Site Dupont",
      "site": null,
      "published": true
    }
  ]
}
PUT/shifts/{externalId}

Creates or updates a slot. Sending the same content changes nothing; a person removed from the list loses their shift. Responds 200 as soon as at least one person is scheduled (any refusals are in errors), 422 if none is.

FieldTypeDescription
startsAt requireddatetimeStart of the slot.
endsAt requireddatetimeEnd of the slot, after the start (16 hours at most).
workers requiredstring[]Email addresses of the people (1 to 50). For a single person, email (string) is also accepted.
breakMinutesintBreak in minutes (0 by default).
title, notestringShown on the shift, separated by a middle dot.
sitestringName of an existing work site in Quotas (ignored if it does not exist).
publishedboolVisible to the team member (true by default).
{
  "externalId": "INT-2027-0042",
  "shifts": [ … ],
  "errors": [
    {
      "email": "julie@example.be",
      "code": "member_not_found",
      "message": "No active team member with this address in Quotas."
    }
  ]
}
DELETE/shifts/{externalId}

Removes the slot (cancelled or deleted on your side).

{
  "externalId": "INT-2027-0042",
  "removed": 2
}
POST/sync

Sends the full schedule for a period. Each item is handled like a PUT, then this connection's shifts starting in the period but missing from items are removed. Ideal for a nightly catch-up. 1,000 slots at most per request.

{
  "from": "2027-01-01",
  "to": "2027-02-28",
  "items": [
    {
      "externalId": "INT-2027-0042",
      "startsAt": "2027-01-04T07:30:00",
      "endsAt": "2027-01-04T16:00:00",
      "workers": [
        "lucas@example.be"
      ]
    }
  ]
}
{
  "items": [
    {
      "externalId": "INT-2027-0042",
      "shifts": [ … ],
      "errors": []
    }
  ],
  "removed": 1,
  "errorCount": 0
}

Errors

General errors always have the same shape; the message is in the company's language.

{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid or deleted API key."
  }
}
HTTPCodeMeaning
401invalid_api_keyKey missing, invalid, renewed or deleted.
402license_expiredThe company's subscription has expired.
403—Plain-HTTP request: use HTTPS.
404—Unknown route or invalid externalId in the address.
422validation_failedInvalid data (period, dates, addresses, limits); details are in fields.
429too_many_requestsToo many requests: wait a minute before retrying.

Refusals per person or per slot, in errors:

member_not_foundNo active team member with this address in the company.
invalid_shiftRefused by the schedule: overlaps another shift of that person or exceeds 16 hours.
invalid_itemUnreadable slot in /sync (index gives its position).

Limits

  • 300 requests per minute per connection.
  • 20 invalid keys per 10 minutes per IP address, then a temporary block.
  • 1,000 slots per /sync request, 50 people per slot, 400 days per period.
  • 10 active connections per company.

Code examples

The same request in four languages. The key is read from an environment variable.

curl -X PUT https://quotas.app/api/integration/v1/shifts/INT-2027-0042 \
  -H "X-Api-Key: $QUOTAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"startsAt":"2027-01-04T07:30:00","endsAt":"2027-01-04T16:00:00","workers":["lucas@example.be"],"title":"Site Dupont"}'

Recommended integration

  1. On every slot creation or change on your side: PUT /shifts/{externalId}
  2. On cancellation or deletion: DELETE /shifts/{externalId}
  3. Every night, over a rolling window (for example 7 days back → 60 days ahead), to catch up on a missed request: POST /sync
  4. Never block your app if Quotas does not respond: log the error, the nightly catch-up will take care of it.
  5. Show refusals (errors) to the user, most often an email address that does not match.
A question about the integration?

Write to us: we reply in French, Dutch, German and English.

info@smartcom.digital