Team and sharing

API keys

Creating and revoking API keys so feed, accounting or cooperative software can read your Milk Trace data read-only.

An API key lets another piece of software, such as a feed program, accounting or cooperative system, read your Milk Trace data automatically. The key is read-only: it cannot change any data.

Who can use it?

Only the farm owner can create and revoke API keys.

Where?

  • Web panel: Settings → API keys
  • Mobile app: Account → Integrations → API keys

What can be read with a key?

  • The animal list and a single animal record
  • Tank deliveries
  • Daily yield export: per animal, per day, in mL; withheld milk is shown separately

Notes, treatments and all kinds of write operations are closed. There is no permission choice (scope); every key gives the same read-only access.

Creating a key

  1. Press the Create key button.
  2. Enter a Key name. Write which system will use it, e.g. "Feed program". In the web panel, the name can be at most 60 characters.
  3. The full key is shown in the Key created window. Copy it with Copy and enter it in the system you are connecting.
  4. After you have saved the key, press the I saved it button. The window closes only with this button.

You can have at most 10 active keys at the same time.

Key list

The list shows each key's name, who created it and when, and its Last used time (or Never used). Only the beginning of the key (the prefix starting with mtk_) is shown.

Usage

The example on the screen shows how to get the daily yield:

  • Request: GET /api/v1/exports/daily?from=YYYY-MM-DD&to=YYYY-MM-DD
  • Header: Authorization: Bearer <key>

If you give no dates, the last 7 days are returned; at most 92 days can be fetched in one request. The example in the web panel shows the full address.

All addresses you can use with a key (animal list, animal details, tank deliveries and daily yield), example responses and error codes are on the API documentation page. The documentation is in Turkish and English; the OpenAPI file can also be downloaded there.

Revoking a key

  1. Press the Revoke button next to the key in the list.
  2. Confirm the Revoke this key? question.

A system connected with that key loses access within 1 minute at most. Revoking cannot be undone. Keys have no expiry date; revoke keys you do not use. Creating and revoking keys are recorded in the Activity log on mobile.

Did not find what you were looking for?

Every topic is in the help center. If you still have a question, write to us from Settings → Feedback in the app or the panel.