# Determ API Docs > Official API documentation for Determ media monitoring platform - Base URL: `https://api.mediatoolkit.com` - OpenAPI 3.1.0 spec (machine-readable contract for every endpoint below): https://developers.determ.com/openapi.json - Full documentation as one plain-text file: https://developers.determ.com/llms-full.txt --- Source: https://developers.determ.com/getting-started.html # Getting Started This guide walks you through making your first API call to Determ in under five minutes. ## Prerequisites - A Determ account with an active plan that supports API access - Your API token (see below) ## Step 1: Get Your API Token 1. Log in to [app.determ.com](https://app.determ.com) 2. Navigate to **Settings** > **Account Settings** 3. Locate the **API token** field 4. Copy the token and store it securely > **Tip** > > The API token field is available if your plan includes API access. If you don't see it, contact your account manager or [Determ support](https://determ.com). ## Step 2: Make Your First Request The simplest endpoint to test is `GET /v2/me`, which returns your user profile. Use it to verify that your token is working. **Endpoint:** `GET /v2/me` Returns the authenticated user's profile, including name, email, organization IDs, and account metadata. curl: ```bash curl -X GET "https://api.mediatoolkit.com/v2/me" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` Python: ```python import requests url = "https://api.mediatoolkit.com/v2/me" headers = { "Authorization": "Bearer YOUR_API_TOKEN" } response = requests.get(url, headers=headers) print(response.json()) ``` JavaScript: ```javascript const response = await fetch("https://api.mediatoolkit.com/v2/me", { method: "GET", headers: { "Authorization": "Bearer YOUR_API_TOKEN", }, }); const data = await response.json(); console.log(data); ``` PHP: ```php true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer YOUR_API_TOKEN", ], ]); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true); print_r($data); ``` ## Step 3: Understand the Response A successful request returns a `200 OK` with your user profile: ```json { "id": 12345, "email": "you@company.com", "name": "Jane Smith", "verified": true, "languageCode": "en", "organizationIds": [100, 200], "organizationRoles": { "100": { "id": "admin", "name": "Admin", "isAdmin": true, "canUpdate": true, "canInvite": true, "canUpdateMentions": true } }, "createdTime": 1672531200000, "lastLoginTime": 1713200000000 } ``` | Field | Type | Description | |-------|------|-------------| | `id` | integer | Your unique user ID | | `email` | string | Account email address | | `name` | string | Display name | | `verified` | boolean | Whether the email is verified | | `languageCode` | string | Preferred language (ISO 639-1) | | `organizationIds` | integer[] | IDs of organizations you belong to | | `organizationRoles` | object | Your role in each organization, keyed by organization ID — see [Current User](https://developers.determ.com/api/current-user.html#organization-role-object) | | `createdTime` | integer | Account creation timestamp (epoch ms) | | `lastLoginTime` | integer | Last login timestamp (epoch ms) | > **Info** > > Timestamps are in Unix epoch milliseconds. Divide by 1000 to convert to seconds for most programming languages. > > **Exception:** keyword and organization timestamps are ISO 8601 strings (e.g. `"2024-01-15T10:30:00Z"`), not epoch milliseconds — `createdAt` / `editedAt` returned by [Create Keyword](https://developers.determ.com/api/create-keyword.html), and `createdAt` on the organization and `createdAt` / `editedAt` on its keywords in [Get Organization](https://developers.determ.com/api/get-organization.html). ## Step 4: See the Request in Other Languages The tabs below show the same `GET /v2/me` request in curl, Python, JavaScript, and PHP. Each carries the `YOUR_API_TOKEN` placeholder in its `Authorization` header — swap in your own token after you copy the snippet. ## Next Steps Now that you have verified your token works, here are the recommended next steps: - **[Authentication](https://developers.determ.com/authentication.html)** — Security best practices for managing your token - **[Errors & Rate Limits](https://developers.determ.com/errors.html)** — Error responses and retry logic - **[Count by Keyword](https://developers.determ.com/api/count-by-keyword.html)** — Count mentions for a keyword with filters - **[Scroll by Keyword](https://developers.determ.com/api/scroll-by-keyword.html)** — Retrieve paginated mention data - **[API Reference](https://developers.determ.com/api/overview.html)** — See all available endpoints --- Source: https://developers.determ.com/authentication.html # Authentication All Determ API requests require a Bearer token for authentication. This page explains how to obtain, use, and secure your token. ## Overview The Determ API uses **Bearer token authentication**. Every request must include an `Authorization` header with your token: ``` Authorization: Bearer YOUR_API_TOKEN ``` There is no OAuth flow, no client ID/secret, and no token refresh mechanism. If your organization is on an API plan, every user in the organization has their own static access token tied to their user account. ## Getting Your Token 1. Log in to [app.determ.com](https://app.determ.com) 2. Open **Settings** > **Account Settings** 3. Find the **API token** field 4. Click to reveal and copy the token > **Warning** > > The API token field is only visible if your Determ plan includes API access. If you do not see the field, contact your account manager to upgrade. ## Using the Token Include the token in the `Authorization` header of every request: **Endpoint:** `GET /v2/me` Example endpoint used to verify your authentication is working. **Headers:** - `Authorization` (string, required, in header): Bearer token in the format: Bearer YOUR_API_TOKEN ### Code Examples curl: ```bash curl -X GET "https://api.mediatoolkit.com/v2/me" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` Python: ```python import os import requests API_TOKEN = os.environ["DETERM_API_TOKEN"] response = requests.get( "https://api.mediatoolkit.com/v2/me", headers={"Authorization": f"Bearer {API_TOKEN}"} ) print(response.json()) ``` JavaScript: ```javascript const API_TOKEN = process.env.DETERM_API_TOKEN; const response = await fetch("https://api.mediatoolkit.com/v2/me", { headers: { "Authorization": `Bearer ${API_TOKEN}`, }, }); const data = await response.json(); console.log(data); ``` PHP: ```php true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . $apiToken, ], ]); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true); print_r($data); ``` ## Authentication Errors If your token is missing, invalid, or expired, the API returns one of these HTTP status codes: | Status | Meaning | What to Do | |--------|---------|------------| | `401 Unauthorized` | Token is missing or invalid | Check that the `Authorization` header is present and correctly formatted | | `403 Forbidden` | Token is valid but lacks permission for this resource | Verify you have access to the requested organization or resource | Errors use the [RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807) format, sent with `Content-Type: application/problem+json`. The message is in `detail`: ```json { "type": "about:blank", "title": "Unauthorized", "status": 401, "detail": "Missing Authentication Token", "instance": "/v2/organizations/100/keywords" } ``` See the [Errors & Rate Limits](https://developers.determ.com/errors.html) page for the full error response structure. ## Security Best Practices ### Do Not Commit Tokens to Version Control Never hardcode your API token in source files. Use environment variables instead: ```bash # Set the environment variable export DETERM_API_TOKEN="your-token-here" ``` Add token files to `.gitignore`: ```txt .env .env.local *.token ``` ### Use Environment Variables Store your token in a `.env` file for local development and in your CI/CD platform's secrets manager for production: ```bash # .env (local development only — never commit this file) DETERM_API_TOKEN=your-token-here ``` ### Restrict Access - Share your token only with services and team members that need it - Use a dedicated service account if multiple systems need API access - Monitor your API usage for unexpected patterns ## Next Steps - **[Getting Started](https://developers.determ.com/getting-started.html)** — Make your first API call - **[Errors & Rate Limits](https://developers.determ.com/errors.html)** — Handle error responses and rate limits - **[API Reference](https://developers.determ.com/api/overview.html)** — Explore all available endpoints --- Source: https://developers.determ.com/errors.html # Errors & Rate Limits This page documents the error responses returned by the Determ API and how to handle them in your code. ## Error Response Format The API returns errors in the **[RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807)** format with `Content-Type: application/problem+json`. ```json { "type": "about:blank", "title": "Bad Request", "status": 400, "detail": "Invalid parameter: from", "instance": "/v2/organizations/100/keywords", "code": "INVALID_PARAM" } ``` | Field | Type | Description | |-------|------|-------------| | `type` | string (URI) | Always `"about:blank"` — no custom problem type URIs are emitted | | `title` | string | The HTTP reason phrase (`"Bad Request"`, `"Not Found"`, …) | | `status` | integer | The HTTP status code | | `detail` | string | Human-readable error message | | `instance` | string | The request path (e.g. `/v2/organizations/100/keywords`) | | `code` | string | **Optional.** Domain error code on handled domain exceptions, always in upper case (e.g. `INVALID_PARAM`, `NOT_EXISTS`, `ILLEGAL_PERMISSION`, `ILLEGAL_PARAM`). Not present on framework errors like `429`, `500`, validation failures. | > **Info: Known exception** > > The `/v2/organizations/{orgId}/mentions/**` endpoints (count/scroll) return a plain `text/plain` body with just the error message for `400` and `404` — not the JSON structure above. Handle both cases if you parse errors for those endpoints. ## HTTP Status Codes ### Client Errors (4xx) | Status | Name | Description | |--------|------|-------------| | **400** | Bad Request | The request is malformed. Check query parameters, request body, and data types. | | **401** | Unauthorized | Authentication token is missing or invalid. See [Authentication](https://developers.determ.com/authentication.html). | | **403** | Forbidden | The token is valid but you lack permission to access this resource, or a plan limit is reached (the [keyword limit](https://developers.determ.com/api/create-keyword.html#keyword-limit)). | | **404** | Not Found | The requested resource does not exist. Verify IDs and paths. | | **409** | Conflict | The request conflicts with the current state (e.g. the resource already exists in an incompatible way). | | **417** | Expectation Failed | The request body is invalid or unparseable. | | **429** | Too Many Requests | You have exceeded the rate limit. Wait the number of seconds indicated by `X-Rate-Limit-Retry-After-Seconds` before retrying. | ### Server Errors (5xx) | Status | Name | Description | |--------|------|-------------| | **500** | Internal Server Error | An unexpected error occurred on the server. Retry after a short delay. | | **502** | Bad Gateway | An upstream service returned an error. Retry shortly. | | **503** | Service Unavailable | The server is temporarily unavailable (typically returned by the edge proxy as `text/html`, not JSON). | ## Common Error Scenarios ### 400 Bad Request Typically caused by: - Invalid parameter values (bad enum, out-of-range numbers, malformed dates) - Missing required parameters - Malformed JSON in the request body ```json { "type": "about:blank", "title": "Bad Request", "status": 400, "detail": "Invalid parameter: from", "instance": "/v2/organizations/100/keywords", "code": "INVALID_PARAM" } ``` Possible `code` values: `INVALID_PARAM`, `MISSING_PARAM`, `INVALID_ROLE`, `INVALID_KEYWORD`. On the mention count and scroll endpoints, a `query` with neither `feedTime` nor `publishedTime` returns `400` with the plain-text body `Must provide either 'feedTime' or 'publishedTime' in query`. Set at least one time range (see [the query object](https://developers.determ.com/api/scroll-by-keyword.html#query-object-feedssearchqueryrequest)). ### 401 Unauthorized Your token is missing or invalid: ```json { "type": "about:blank", "title": "Unauthorized", "status": 401, "detail": "Missing Authentication Token", "instance": "/v2/organizations/100/keywords" } ``` **Fix:** Verify that your `Authorization` header is formatted as `Bearer YOUR_API_TOKEN` with no extra spaces or characters. See [Authentication](https://developers.determ.com/authentication.html). ### 403 Forbidden Your token is valid but cannot access the requested resource: ```json { "type": "about:blank", "title": "Forbidden", "status": 403, "detail": "User does not have access to organization", "instance": "/v2/organizations/100/keywords", "code": "ILLEGAL_PERMISSION" } ``` **Fix:** Confirm that your user account is a member of the organization referenced in the request path. `403` with `ILLEGAL_PERMISSION` also means a plan limit: [Create Keyword](https://developers.determ.com/api/create-keyword.html#keyword-limit) returns it when the organization already has as many keywords as its plan allows. The `detail` names the limit. **Fix:** [delete a keyword](https://developers.determ.com/api/delete-keyword.html#keyword-limit) you no longer need, then retry. Retrying alone returns the same `403`. ### 404 Not Found The resource ID does not exist or has been deleted: ```json { "type": "about:blank", "title": "Not Found", "status": 404, "detail": "Keyword 12345 does not exist", "instance": "/v2/organizations/100/keywords/12345", "code": "NOT_EXISTS" } ``` **Fix:** Double-check resource IDs. Use the list endpoints to discover valid IDs. On a `DELETE`, a `404` usually means the resource is already gone — treat it as success rather than an ID to correct. ### 409 Conflict The request conflicts with current resource state: ```json { "type": "about:blank", "title": "Conflict", "status": 409, "detail": "Already exists", "instance": "/v2/organizations/100/keywords", "code": "ILLEGAL_PARAM" } ``` Possible `code` values: `ILLEGAL_PARAM`, `INCONSISTENT_STATE`. ### 429 Too Many Requests You are sending requests too quickly. The response includes an `X-Rate-Limit-Retry-After-Seconds` header telling you how long to wait: ```json { "type": "about:blank", "title": "Too Many Requests", "status": 429, "detail": "No message available", "instance": "/v2/organizations/100/keywords" } ``` Response headers: ``` X-Rate-Limit-Retry-After-Seconds: 30 ``` **Fix:** Wait the indicated number of seconds, then retry. See the retry logic section below. ### 502 Bad Gateway An upstream service returned an error to the API: ```json { "type": "about:blank", "title": "Bad Gateway", "status": 502, "detail": "Downstream service error" } ``` **Fix:** Retry after a short delay with exponential backoff. ## Rate Limiting The API uses a **token bucket** algorithm (Bucket4j) to enforce rate limits. Limits are applied **per user, per endpoint method** — meaning each endpoint has its own independent bucket for each authenticated user. For unauthenticated endpoints (languages, locations), rate limiting is applied **per IP address**. ### Rate Limits by Endpoint | Endpoint | Limit | Scope | |----------|-------|-------| | `GET /v2/me` | **200 req/s** | Per user | | `GET /v2/organizations/{orgId}` | **100 req/s** | Per user | | `GET /v2/languages` | **100 req/60s** | Per IP | | `GET /v2/locations` | **100 req/60s** | Per IP | | `GET /v2/organizations/{orgId}/tags` | **100 req/s** | Per user | | `POST /v2/organizations/{orgId}/keywords` | **2 req/10s** | Per user | | `DELETE /v2/organizations/{orgId}/keywords/{keywordId}` | **100 req/60s** | Per user | | `POST .../mentions/count` (keyword & group) | **100 req/60s** | Per user | | `POST .../mentions/scroll` (keyword & group) | **100 req/60s** | Per user | > **Warning: Shared Buckets for Mention Endpoints** > > Both **count** endpoints (keyword-level and group-level) share a single 100 req/60s bucket per user. The same applies to both **scroll** endpoints. This means calling keyword-level count and group-level count draws from the same token pool. ### Response Headers | Scenario | Header | Description | |----------|--------|-------------| | Request allowed | `X-Rate-Limit-Remaining` | Number of remaining tokens in the bucket | | Rate limit exceeded | `X-Rate-Limit-Retry-After-Seconds` | Seconds to wait before the next token becomes available | > **Info** > > The API does not return an `X-RateLimit-Limit` header — the total bucket capacity is not discoverable from headers. Refer to the table above for limits. ### When Rate Limited When you exceed the limit, the API returns **HTTP 429** immediately (the request is rejected before reaching the endpoint handler): ```json { "type": "about:blank", "title": "Too Many Requests", "status": 429, "detail": "No message available", "instance": "/v2/organizations/100/keywords" } ``` **How to handle 429 responses:** 1. Read the `X-Rate-Limit-Retry-After-Seconds` header 2. Wait for the indicated number of seconds 3. Retry the request 4. If no header is present, use exponential backoff (see below) ## Handling Errors in Code ### Retry Logic with Exponential Backoff For transient errors (`429`, `500`, `502`, `503`), implement retry logic with exponential backoff: Python: ```python import time import requests API_TOKEN = "YOUR_API_TOKEN" BASE_URL = "https://api.mediatoolkit.com" def api_request(method, path, max_retries=3, **kwargs): """Make an API request with automatic retry for transient errors.""" url = f"{BASE_URL}{path}" headers = {"Authorization": f"Bearer {API_TOKEN}"} for attempt in range(max_retries + 1): response = requests.request(method, url, headers=headers, **kwargs) if response.status_code in (429, 500, 502, 503): if attempt < max_retries: # Use server-provided retry delay for 429, fallback to exponential backoff retry_after = response.headers.get("X-Rate-Limit-Retry-After-Seconds") wait = int(retry_after) if retry_after else 2 ** attempt print(f"Got {response.status_code}, retrying in {wait}s...") time.sleep(wait) continue return response return response # Usage response = api_request("GET", "/v2/me") if response.ok: print(response.json()) else: print(f"Error {response.status_code}: {response.text}") ``` JavaScript: ```javascript const API_TOKEN = "YOUR_API_TOKEN"; const BASE_URL = "https://api.mediatoolkit.com"; async function apiRequest(method, path, options = {}, maxRetries = 3) { const url = `${BASE_URL}${path}`; const headers = { "Authorization": `Bearer ${API_TOKEN}`, ...options.headers, }; for (let attempt = 0; attempt <= maxRetries; attempt++) { const response = await fetch(url, { method, headers, ...options }); if ([429, 500, 502, 503].includes(response.status)) { if (attempt < maxRetries) { // Use server-provided retry delay for 429, fallback to exponential backoff const retryAfter = response.headers.get("X-Rate-Limit-Retry-After-Seconds"); const wait = retryAfter ? parseInt(retryAfter) * 1000 : Math.pow(2, attempt) * 1000; console.log(`Got ${response.status}, retrying in ${wait}ms...`); await new Promise((r) => setTimeout(r, wait)); continue; } } return response; } } // Usage const response = await apiRequest("GET", "/v2/me"); if (response.ok) { const data = await response.json(); console.log(data); } else { console.error(`Error ${response.status}: ${await response.text()}`); } ``` PHP: ```php true, CURLOPT_CUSTOMREQUEST => $method, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . $apiToken, ], CURLOPT_HEADERFUNCTION => function ($ch, $header) use (&$responseHeaders) { $parts = explode(':', $header, 2); if (count($parts) === 2) { $responseHeaders[trim($parts[0])] = trim($parts[1]); } return strlen($header); }, ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if (in_array($httpCode, [429, 500, 502, 503])) { if ($attempt < $maxRetries) { // Use server-provided retry delay for 429, fallback to exponential backoff $retryAfter = $responseHeaders['X-Rate-Limit-Retry-After-Seconds'] ?? null; $wait = $retryAfter ? (int) $retryAfter : pow(2, $attempt); echo "Got $httpCode, retrying in {$wait}s...\n"; sleep($wait); continue; } } return ["status" => $httpCode, "body" => $response]; } return ["status" => $httpCode, "body" => $response]; } // Usage $result = apiRequest("GET", "/v2/me"); if ($result["status"] === 200) { print_r(json_decode($result["body"], true)); } else { echo "Error {$result['status']}: {$result['body']}\n"; } ``` ### Best Practices 1. **Always check the status code** before parsing the response body 2. **Retry only transient errors** (`429`, `500`, `502`, `503`) — do not retry `400`, `401`, `403`, `404`, `409`, or `417` 3. **Use exponential backoff** — start at 1 second and double the wait each time 4. **Set a maximum retry count** — 3 retries is usually sufficient 5. **Log errors** with the full response body for debugging 6. **Respect rate limits** — if you consistently hit `429`, reduce your request frequency rather than relying on retries 7. **Check `X-Rate-Limit-Remaining`** — monitor this header to throttle proactively before hitting the limit 8. **Be aware of shared buckets** — all mention count endpoints share one bucket; all mention scroll endpoints share another ## Next Steps - **[Authentication](https://developers.determ.com/authentication.html)** — Set up and secure your API token - **[Getting Started](https://developers.determ.com/getting-started.html)** — Make your first API call - **[API Reference](https://developers.determ.com/api/overview.html)** — Explore all available endpoints --- Source: https://developers.determ.com/api/overview.html # API Reference Overview Welcome to the Determ API reference. This section documents every available endpoint, including request parameters, body schemas, and response formats. ## Base URL All API requests are made to: ``` https://api.mediatoolkit.com ``` ## Authentication Every request must include a valid Bearer token in the `Authorization` header: ``` Authorization: Bearer YOUR_API_TOKEN ``` See the [Authentication](https://developers.determ.com/authentication.html) page for details on obtaining and managing tokens. ## Response Format All responses are returned as **JSON**. Successful responses return an HTTP `200` status code. Error responses follow the structure described on the [Errors & Rate Limits](https://developers.determ.com/errors.html) page. ## OpenAPI Spec The whole reference is also published as an OpenAPI 3.1 document: ``` https://developers.determ.com/openapi.json ``` Import it into Postman or Insomnia, generate a typed client, or hand it to an AI assistant. See the [OpenAPI Spec](https://developers.determ.com/api/openapi.html) page for details. ## Endpoints ### User - **[Current User](https://developers.determ.com/api/current-user.html)** — `GET /v2/me` — Returns the authenticated user's profile and organization memberships ### Organizations - **[Get Organization](https://developers.determ.com/api/get-organization.html)** — `GET /v2/organizations/{id}` — Returns a single organization with its groups, keywords, and tags ### Reference Data - **[Languages](https://developers.determ.com/api/languages.html)** — `GET /v2/languages` — Returns all supported languages - **[Locations](https://developers.determ.com/api/locations.html)** — `GET /v2/locations` — Returns all supported locations ### Tags - **[List Tags](https://developers.determ.com/api/list-tags.html)** — `GET /v2/organizations/{organizationId}/tags` — Returns tags for an organization ### Keywords - **[Create Keyword](https://developers.determ.com/api/create-keyword.html)** — `POST /v2/organizations/{organizationId}/keywords` — Creates a new keyword - **[Delete Keyword](https://developers.determ.com/api/delete-keyword.html)** — `DELETE /v2/organizations/{organizationId}/keywords/{keywordId}` — Permanently deletes a keyword and its mentions ### Mentions — Count - **[Count by Keyword](https://developers.determ.com/api/count-by-keyword.html)** — `POST .../keywords/{keywordId}/mentions/count` — Counts mentions for a specific keyword - **[Count by Group](https://developers.determ.com/api/count-by-group.html)** — `POST .../groups/{groupId}/mentions/count` — Counts mentions for a specific group ### Mentions — Scroll - **[Scroll by Keyword](https://developers.determ.com/api/scroll-by-keyword.html)** — `POST .../keywords/{keywordId}/mentions/scroll` — Paginated mentions for a keyword - **[Scroll by Group](https://developers.determ.com/api/scroll-by-group.html)** — `POST .../groups/{groupId}/mentions/scroll` — Paginated mentions for a group --- Source: https://developers.determ.com/api/current-user.html # Current User **Endpoint:** `GET /v2/me` Returns the authenticated user's profile, including organization memberships and roles. **Rate limit:** 200 req/s (Per user) ## Response ```json { "id": 12345, "email": "user@example.com", "name": "John Doe", "createdTime": 1672531200000, "lastLoginTime": 1713200000000, "languageCode": "en", "verified": true, "organizationIds": [100, 200], "organizationRoles": { "100": { "id": "admin", "name": "Admin", "isAdmin": true, "canUpdate": true, "canInvite": true, "canUpdateMentions": true } } } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `id` | integer (int64) | Unique identifier for the user | | `email` | string | The user's email address | | `name` | string | The user's display name | | `createdTime` | integer (int64) | Timestamp of when the user account was created | | `lastLoginTime` | integer (int64) | Timestamp of the user's most recent login | | `languageCode` | string | The user's preferred language code (e.g. `en`, `hr`) | | `verified` | boolean | Whether the user's email has been verified | | `organizationIds` | array of integer (int64) | List of organization IDs the user belongs to | | `organizationRoles` | object | Map of organization ID to the user's role in that organization | ### Organization Role Object | Field | Type | Description | |-------|------|-------------| | `id` | string | Role identifier (e.g. `admin`) | | `name` | string | Human-readable role name | | `isAdmin` | boolean | Whether this role has admin privileges | | `canUpdate` | boolean | Whether this role can update organization settings | | `canInvite` | boolean | Whether this role can invite new members | | `canUpdateMentions` | boolean | Whether this role can update mentions | --- Source: https://developers.determ.com/api/get-organization.html # Get Organization **Endpoint:** `GET /v2/organizations/{id}` Returns a single organization by ID, including its groups, keywords, tags, members, and subscription state. **Rate limit:** 100 req/s (Per user) ## Parameters **Path Parameters:** - `id` (integer, required, in path): The unique identifier of the organization (int64). ## Response ```json { "id": 100, "name": "Acme Inc.", "groupIds": [10, 11], "userIds": [12345, 67890], "timeZone": "Europe/Zagreb", "groups": [ { "id": 10, "name": "PR Team", "color": "#4A90D9", "colorNew": "blue", "public": true, "keywordIds": [200, 201], "memberIds": [12345], "invitedUsers": [ { "email": "newuser@example.com", "roleId": "member" } ] } ], "keywords": [ { "id": 200, "name": "Acme", "color": "#E94E77", "colorNew": "red", "active": true, "editedAt": "2024-03-10T14:00:00Z", "createdAt": "2024-01-15T09:30:00Z" } ], "tags": [ { "id": 1, "name": "Important" } ], "state": "ACTIVE", "createdAt": "2024-01-15T09:30:00Z", "currentMonthMentionsLimit": 50000 } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `id` | integer (int64) | Unique identifier for the organization | | `name` | string | Display name of the organization | | `groupIds` | array of integer (int64) | IDs of the groups within the organization | | `userIds` | array of integer (int64) | IDs of the users belonging to the organization | | `timeZone` | string | The organization's time zone (IANA identifier, e.g. `Europe/Zagreb`) | | `groups` | array | Detailed group objects (see below) | | `keywords` | array | Detailed keyword objects (see below) | | `tags` | array | Tag objects associated with the organization (see below) | | `state` | string | Subscription state. One of `BLOCKED`, `SUSPENDED`, `ACTIVE` | | `createdAt` | string (date-time) | Timestamp of when the organization was created | | `currentMonthMentionsLimit` | integer (int64) | Mentions limit for the current billing month | ### Group Object | Field | Type | Description | |-------|------|-------------| | `id` | integer (int64) | Unique identifier for the group | | `name` | string | Display name of the group | | `color` | string | Group color (legacy hex value) | | `colorNew` | string | Group color (current palette value) | | `public` | boolean | Whether the group is visible to all organization members | | `keywordIds` | array of integer (int64) | IDs of the keywords in the group | | `memberIds` | array of integer (int64) | IDs of the users who are members of the group | | `invitedUsers` | array | Users invited to the group but not yet accepted (see below) | ### Invited User Object | Field | Type | Description | |-------|------|-------------| | `email` | string | Email address of the invited user | | `roleId` | string | Identifier of the role the user is invited with | ### Keyword Object | Field | Type | Description | |-------|------|-------------| | `id` | integer (int64) | Unique identifier for the keyword | | `name` | string | Display name of the keyword | | `color` | string | Keyword color (legacy hex value) | | `colorNew` | string | Keyword color (current palette value) | | `active` | boolean | Whether the keyword is currently active | | `editedAt` | string | Timestamp of the last edit | | `createdAt` | string | Timestamp of when the keyword was created | ### Tag Object | Field | Type | Description | |-------|------|-------------| | `id` | integer (int64) | Unique identifier for the tag | | `name` | string | Display name of the tag | ## Errors | Status | Description | |--------|-------------| | `404 Not Found` | No organization with the given ID exists, or the authenticated user does not have access to it | See the [Errors & Rate Limits](https://developers.determ.com/errors.html) page for the full error response structure. --- Source: https://developers.determ.com/api/languages.html # Languages **Endpoint:** `GET /v2/languages` Returns a list of all supported languages. Use the returned language codes when configuring keyword filters. **Rate limit:** 100 req/60s (Per IP) ## Response ```json { "languages": [ { "code": "en", "name": "English" }, { "code": "hr", "name": "Croatian" }, { "code": "de", "name": "German" }, { "code": "fr", "name": "French" }, { "code": "es", "name": "Spanish" } ] } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `languages` | array | List of supported language objects | | `languages[].code` | string | ISO language code (e.g. `en`, `hr`, `de`) | | `languages[].name` | string | Human-readable language name in English | --- Source: https://developers.determ.com/api/locations.html # Locations **Endpoint:** `GET /v2/locations` Returns a list of all supported locations. Use the returned location codes when configuring keyword filters. **Rate limit:** 100 req/60s (Per IP) ## Response ```json { "locations": [ { "code": "US", "name": "United States" }, { "code": "HR", "name": "Croatia" }, { "code": "GB", "name": "United Kingdom" }, { "code": "DE", "name": "Germany" } ] } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `locations` | array | List of supported location objects | | `locations[].code` | string | ISO country code (e.g. `US`, `HR`, `GB`) | | `locations[].name` | string | Human-readable location name in English | --- Source: https://developers.determ.com/api/create-keyword.html # Create Keyword **Endpoint:** `POST /v2/organizations/{organizationId}/keywords` Creates a new keyword (monitoring query) within the specified organization. **Rate limit:** 2 req/10s (Per user) ## Parameters **Path Parameters:** - `organizationId` (integer, required, in path): The unique identifier of the organization (int64). **Body Parameters:** - `groupId` (integer, required, in body): The ID of the group to add the keyword to (int64). - `name` (string, required, in body): Display name for the keyword. - `keyword` (json, required, in body): Keyword definition object containing the search query and filters. See keyword object fields below. - `historySearch` (json, optional, in body): Controls the history search that runs when the keyword is created. Leave it out to search the full history (the last 80 days). See History Search below. ### Keyword Object Fields | Field | Type | Description | |-------|------|-------------| | `naturalQuery` | string | The search query in natural language. Supports boolean operators like `OR`, `AND`, and quoted phrases. | | `naturalFilters` | string | Filters written in the natural filter syntax: one `key:value,value` filter per line. Use `author:` and `not_author:` to filter by author. See [Filtering by Author](#filtering-by-author). | | `mayAuthors` | array of object | Only keep mentions written by one of these authors. Each entry is an [Author Object](#author-object). Equivalent to `author:` in `naturalFilters`. | | `notAuthors` | array of object | Exclude mentions written by any of these authors. Each entry is an [Author Object](#author-object). Equivalent to `not_author:` in `naturalFilters`. | | `mayLangs` | array of string | Language codes to include (e.g. `["en", "de"]`). Use the [Languages](https://developers.determ.com/api/languages.html) endpoint to get valid codes. | | `mayLocations` | array of string | Location codes to include (e.g. `["US", "GB"]`). Use the [Locations](https://developers.determ.com/api/locations.html) endpoint to get valid codes. | | `maySourceTypes` | array of string | Source types to monitor. Allowed values: `WEB`, `FACEBOOK`, `TWITTER`, `FORUM`, `COMMENT`, `YOUTUBE`, `INSTAGRAM`, `REDDIT`, `TIKTOK`, `PRINT`, `RADIO`, `TV`, `BLUESKY`, `THREADS` | ### Author Object | Field | Type | Description | |-------|------|-------------| | `author` | string | The author name or handle to match. Compared against the whole author string of a mention, not as a substring. See [How author matching works](#how-author-matching-works). | | `caseSensitive` | boolean | Match the exact casing of `author`. Defaults to `false` (case-insensitive). | ### History Search Object | Field | Type | Description | |-------|------|-------------| | `enabled` | boolean | Set to `false` to skip the history search. Defaults to `true`. Cannot be combined with `from` or `to`. | | `from` | string (ISO 8601) | Search only mentions published at or after this time. Defaults to the start of the history (80 days ago). An earlier value searches the whole history. | | `to` | string (ISO 8601) | Search only mentions published at or before this time. Defaults to now. Must not be in the future. | > **Tip: Additional filter fields** > > The keyword object supports many additional filter fields beyond those listed above. The fields documented here cover the most common use cases. Contact support for information about advanced filtering options. ## Request Body Example ```json { "groupId": 456, "name": "Tesla Mentions", "keyword": { "naturalQuery": "Tesla OR \"Elon Musk\"", "naturalFilters": "not_author:\"Tesla Fan Club\"", "mayLangs": ["en", "de"], "maySourceTypes": ["WEB", "TWITTER", "FACEBOOK"] } } ``` ## History Search When a keyword is created, Determ searches its history for mentions that match, going back 80 days, and adds them to the keyword's feed. New mentions are collected from the moment the keyword is created either way. Use `historySearch` to turn the history search off or to search only part of the history. Skip the history search: ```json { "groupId": 456, "name": "Tesla Mentions", "keyword": { "naturalQuery": "Tesla" }, "historySearch": { "enabled": false } } ``` Search only the last 24 hours (leave out `to` to search up to now): ```json "historySearch": { "from": "2026-11-12T09:00:00Z" } ``` Search a specific period: ```json "historySearch": { "from": "2026-11-01T00:00:00Z", "to": "2026-11-08T00:00:00Z" } ``` - The response's `historySearchCoverage` lists the period that was searched. It is empty when no history was searched, for example with `enabled: false` or when the whole period is older than 80 days. - The history search runs in the background. Its progress is not part of the response. See [Checking the history search](#checking-the-history-search). - The setting applies only to the search made when the keyword is created, and it is not saved. If the keyword's query is later edited to match more mentions, its full history is searched again. - `from` must be before `to`, `to` must not be in the future, a `from` given without `to` must be in the past, and `enabled: false` cannot be combined with `from` or `to`. Otherwise the request returns HTTP `400` with the error code `INVALID_PARAM`. See [Errors & Rate Limits](https://developers.determ.com/errors.html). ### Checking the history search `GET /v2/organizations/{organizationId}/keywords/{keywordId}/history-search-status` reports the keyword's latest history search: ```json { "keywordId": 789, "status": "DONE", "progress": { "processed": 25000, "total": 25000 }, "limitReached": true } ``` | Field | Type | Description | |-------|------|-------------| | `status` | string | `QUEUED`, `IN_PROGRESS`, `DONE`, `FAILED` or `TIMEOUT`. | | `progress` | object | `processed` and `total` candidates. Absent until the search starts. | | `limitReached` | boolean | Whether a `DONE` search stopped at its limit. Absent when unknown. See below. | A history search retrieves at most a fixed number of candidates, newest first. The limit applies to candidates before the keyword's filters are applied, so it is not the number of mentions that reach the feed, and neither is `progress`. - `limitReached: true`: the search had more candidates than its limit and stopped at it. The oldest part of the searched period is missing from the feed. - `limitReached: false`: the search retrieved every candidate in the searched period. - No `limitReached`: the search has not finished (`QUEUED`, `IN_PROGRESS`), did not finish (`FAILED`, `TIMEOUT`), or whether it reached the limit is unknown. Treat it as unknown, never as `false`. The status is kept for 4 hours after the search last changed it. After that the endpoint returns `404`, so read it once it reaches `DONE`. A new history search for the keyword, for example after its query is edited to match more mentions, replaces the status, `limitReached` included. ## Filtering by Author Author filters include or exclude mentions by specific authors. They are part of the `keyword` object and can be written in two equivalent ways. ### Natural filters (recommended) `naturalFilters` is a plain-text field. Write one filter per line as `key:value1,value2,...`. Separate values with commas and wrap values that contain spaces in double quotes. Filters may also be separated by spaces instead of new lines. `author:` keeps only mentions written by one of the listed authors, and `not_author:` excludes mentions written by any of them. ```json { "groupId": 123, "name": "Starbucks", "keyword": { "naturalQuery": "Starbucks AND coffee", "naturalFilters": "author:Starbucks,\"Starbucks Coffee\"\nnot_author:\"Some Blogger\"" } } ``` ### Structured fields The same filters as arrays of [Author Objects](#author-object) inside the `keyword` object. Only this form lets you set `caseSensitive` per author, shown here on one entry. ```json "keyword": { "naturalQuery": "Starbucks AND coffee", "mayAuthors": [ { "author": "Starbucks" }, { "author": "Starbucks Coffee", "caseSensitive": true } ], "notAuthors": [ { "author": "Some Blogger" } ] } ``` Both forms can be combined with other filters in the same request. If the same filter is provided in both forms, the value from `naturalFilters` is used. ### How author matching works - The author value is compared against the **whole** author string of the mention. It is an exact match, not a "contains" search. - Matching is **case-insensitive by default**. Set `caseSensitive: true` to require the exact casing. - Accents and diacritics are **not** folded: `Jose` does not match `José`. Different Unicode encodings of the same characters are treated as equal, so how the name was typed does not matter. - What counts as the author depends on the source type. When a source records several author values, matching any one of them is enough. | Source type | Author filter is matched against | |-------------|----------------------------------| | `WEB` | The article byline. Articles without a byline never match. | | `COMMENT` | The comment author's name. | | `TWITTER`, `BLUESKY` | The display name and the handle. | | `INSTAGRAM`, `THREADS` | The full name (when set) and the username. | | `FACEBOOK` | The page or user name and the numeric page/user ID. | | `YOUTUBE` | The channel name and the channel ID. | | `REDDIT`, `TIKTOK` | The username. | | `PRINT`, `RADIO`, `TV` | The author field of the article or clip, when available. | | `FORUM` | No author is recorded for forum mentions, so author filters never match them. | ### Validation rules - Author lists must not be empty and must not contain duplicates. - The same author cannot appear in both the include list and the exclude list. - An unknown filter key or a malformed value returns HTTP `400`. See [Errors & Rate Limits](https://developers.determ.com/errors.html). > **Tip: Validate a definition before creating it** > > `POST /v2/keywords/validate` with the body `{ "keyword": { ... } }` checks a keyword definition without creating anything. The response contains the normalized `naturalFilters` and the structured `definition`, so you can see exactly how your filters were interpreted. ## Response ```json { "id": 789, "name": "Tesla Mentions", "color": "#4A90D9", "naturalQuery": "Tesla OR \"Elon Musk\"", "active": true, "createdAt": "2024-01-15T10:30:00Z", "editedAt": "2024-01-15T10:30:00Z", "historySearchCoverage": [ { "from": "2023-10-27T10:30:00Z", "to": "2024-01-15T10:30:00Z" } ] } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `id` | integer (int64) | Unique identifier for the created keyword | | `name` | string | Display name of the keyword | | `color` | string | Hex color code assigned to the keyword | | `naturalQuery` | string | The search query as provided in the request | | `active` | boolean | Whether the keyword is actively monitoring | | `createdAt` | string (ISO 8601) | Timestamp of when the keyword was created | | `editedAt` | string (ISO 8601) | Timestamp of the last edit to the keyword | | `historySearchCoverage` | array of object | The periods of history that history searches have covered, each with `from` and `to` (ISO 8601). After creation it holds the period that was searched, or nothing if no history was searched. See [History Search](#history-search). | ## Errors | Status | Description | |--------|-------------| | `400 Bad Request` | The keyword definition or `historySearch` is invalid. See [Validation rules](#validation-rules) and [History Search](#history-search) | | `403 Forbidden` | The organization has reached its plan's keyword limit (see below), or you don't have access to the group | | `404 Not Found` | The organization or the `groupId` doesn't exist. Error code `NOT_EXISTS`; nothing is created | | `429 Too Many Requests` | More than 2 requests in 10 seconds. See [Errors & Rate Limits](https://developers.determ.com/errors.html#rate-limits-by-endpoint) | ### Keyword limit Each plan allows a set number of keywords per organization. When the organization already has that many, creating another returns `403 Forbidden` with the error code `ILLEGAL_PERMISSION`, and nothing is created. The `detail` names the limit: ```json { "type": "about:blank", "title": "Forbidden", "status": 403, "detail": "you have exceeded maximum number of keywords 50 in organization", "instance": "/v2/organizations/100/keywords", "code": "ILLEGAL_PERMISSION" } ``` The limit counts **every** keyword in the organization, active or not. To make room, [delete a keyword](https://developers.determ.com/api/delete-keyword.html): its place is freed immediately (see [Keyword limit](https://developers.determ.com/api/delete-keyword.html#keyword-limit) on that page). Retrying the create without deleting returns the same `403`. See the [Errors & Rate Limits](https://developers.determ.com/errors.html) page for the full error response structure. --- Source: https://developers.determ.com/api/delete-keyword.html # Delete Keyword **Endpoint:** `DELETE /v2/organizations/{organizationId}/keywords/{keywordId}` Permanently deletes a keyword and every mention collected under it. **Rate limit:** 100 req/60s (Per user) > **Danger: Deleting a keyword destroys its mentions** > > Deleting a keyword also deletes every mention collected under it. **Those mentions cannot be recovered.** > > The keyword's setup — its name, query and filters — may still be restorable. If you deleted a keyword by mistake, contact support promptly: the configuration may come back, but the mentions will not. ## Parameters **Path Parameters:** - `organizationId` (integer, required, in path): The unique identifier of the organization (int64). - `keywordId` (integer, required, in path): The unique identifier of the keyword to delete (int64). ## Response A successful delete returns `200 OK` with an **empty response body** — there is no JSON payload. Clients that parse every response as JSON need to handle the empty case. ## Keyword limit Deleting a keyword frees its place in your plan's keyword limit **immediately**. Once the delete returns `200`, an organization that was at its limit can [create a replacement keyword](https://developers.determ.com/api/create-keyword.html) on the very next call. At the limit, Create Keyword returns `403 Forbidden` (see [Keyword limit](https://developers.determ.com/api/create-keyword.html#keyword-limit) on that page). The limit on creating keywords counts **every** keyword in the organization, whether it is actively monitoring or not (`active` in the [keyword object](https://developers.determ.com/api/create-keyword.html#response-fields)). So deleting an inactive keyword also frees a place for a new one. ## Errors | Status | Description | |--------|-------------| | `403 Forbidden` | The keyword exists but you can't delete it: it belongs to another organization, or you don't have access to the group it is in | | `404 Not Found` | No keyword with the given ID exists, or it has already been deleted. Also returned when the organization doesn't exist | Deleting the same keyword twice returns `404` on the second call, not `200`. Retry logic that treats a delete as safely repeatable should accept `404` as "already gone". > **Info: 403 for a keyword in another organization** > > Today the API returns `403`, not `404`, when the keyword ID belongs to a different organization. This behaviour may change to `404`. Treat `403` and `404` the same way: the keyword is not one you can delete in this organization. See the [Errors & Rate Limits](https://developers.determ.com/errors.html) page for the full error response structure. --- Source: https://developers.determ.com/api/count-by-keyword.html # Count by Keyword **Endpoint:** `POST /v2/organizations/{organizationId}/keywords/{keywordId}/mentions/count` Returns the total number of mentions for a specific keyword, broken down by source type. Use this endpoint when you need mention counts scoped to a single keyword rather than the entire organization. **Rate limit:** 100 req/60s (Per user, shared bucket) ## Parameters **Path Parameters:** - `organizationId` (integer (int64), required, in path): The unique identifier of the organization. - `keywordId` (integer (int64), required, in path): The unique identifier of the keyword to count mentions for. ## Request Body The request body contains a `query` object of type **FeedsSearchQueryRequest**. It is required: a request without it returns `400`. Its structure: | Field | Type | Description | |-------|------|-------------| | `query.feeds` | array | Array of feed objects with `groupId` (int64) and `keywordId` (int64) to scope the search. Optional -- omit to search all feeds. | | `query.feedTime` | object | Time range filter based on when the mention entered the feed. Use `relative` (enum) for preset ranges, or `from`/`to` (ISO datetime) for custom ranges. Set this, `publishedTime`, or both. | | `query.publishedTime` | object | Time range filter based on when the mention was published. Same structure as `feedTime`. Set this, `feedTime`, or both. | | `query.mentionFilter` | object | Filter criteria for narrowing mentions. | A query needs a time range: one of `feedTime` and `publishedTime` is required. A query with neither returns `400` with a plain-text body: ```text Must provide either 'feedTime' or 'publishedTime' in query ``` ### Relative Time Period Values `TODAY`, `YESTERDAY`, `LAST_24_HOURS`, `LAST_7_DAYS`, `LAST_30_DAYS`, `LAST_90_DAYS`, `THIS_MONTH`, `THIS_WEEK`, `LAST_WEEK`, `LAST_MONTH` ### Mention Filters Each filter field uses a **FilterClause** pattern with optional `any`, `all`, `must`, and `not` sub-fields: | Filter Field | Type | Description | |-------------|------|-------------| | `mentionType` | FilterClause | Filter by source type. Values: `WEB`, `FACEBOOK`, `TWITTER`, `FORUM`, `COMMENT`, `YOUTUBE`, `INSTAGRAM`, `REDDIT`, `TIKTOK`, `PRINT`, `RADIO`, `TV`, `BLUESKY`, `THREADS` | | `sentiment` | FilterClause | Filter by sentiment. Values: `POSITIVE`, `NEUTRAL`, `NEGATIVE`, `UNDEFINED` | ## Response ```json { "count": 1523, "typeToCount": { "WEB": 890, "TWITTER": 423, "FACEBOOK": 210 } } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `count` | integer (int64) | Total number of mentions matching the query for this keyword | | `typeToCount` | object | Breakdown of mention counts by source type. Keys are source type strings (e.g. `WEB`, `TWITTER`), values are counts. | --- Source: https://developers.determ.com/api/count-by-group.html # Count by Group **Endpoint:** `POST /v2/organizations/{organizationId}/groups/{groupId}/mentions/count` Returns the total number of mentions for a specific group, broken down by source type. Use this endpoint when you need mention counts scoped to a single group rather than the entire organization. **Rate limit:** 100 req/60s (Per user, shared bucket) ## Parameters **Path Parameters:** - `organizationId` (integer (int64), required, in path): The unique identifier of the organization. - `groupId` (integer (int64), required, in path): The unique identifier of the group to count mentions for. ## Request Body The request body contains a `query` object of type **FeedsSearchQueryRequest**. It is required: a request without it returns `400`. Its structure: | Field | Type | Description | |-------|------|-------------| | `query.feeds` | array | Array of feed objects with `groupId` (int64) and `keywordId` (int64) to scope the search. Optional -- omit to search all feeds. | | `query.feedTime` | object | Time range filter based on when the mention entered the feed. Use `relative` (enum) for preset ranges, or `from`/`to` (ISO datetime) for custom ranges. Set this, `publishedTime`, or both. | | `query.publishedTime` | object | Time range filter based on when the mention was published. Same structure as `feedTime`. Set this, `feedTime`, or both. | | `query.mentionFilter` | object | Filter criteria for narrowing mentions. | A query needs a time range: one of `feedTime` and `publishedTime` is required. A query with neither returns `400` with a plain-text body: ```text Must provide either 'feedTime' or 'publishedTime' in query ``` ### Relative Time Period Values `TODAY`, `YESTERDAY`, `LAST_24_HOURS`, `LAST_7_DAYS`, `LAST_30_DAYS`, `LAST_90_DAYS`, `THIS_MONTH`, `THIS_WEEK`, `LAST_WEEK`, `LAST_MONTH` ### Mention Filters Each filter field uses a **FilterClause** pattern with optional `any`, `all`, `must`, and `not` sub-fields: | Filter Field | Type | Description | |-------------|------|-------------| | `mentionType` | FilterClause | Filter by source type. Values: `WEB`, `FACEBOOK`, `TWITTER`, `FORUM`, `COMMENT`, `YOUTUBE`, `INSTAGRAM`, `REDDIT`, `TIKTOK`, `PRINT`, `RADIO`, `TV`, `BLUESKY`, `THREADS` | | `sentiment` | FilterClause | Filter by sentiment. Values: `POSITIVE`, `NEUTRAL`, `NEGATIVE`, `UNDEFINED` | ## Response ```json { "count": 1523, "typeToCount": { "WEB": 890, "TWITTER": 423, "FACEBOOK": 210 } } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `count` | integer (int64) | Total number of mentions matching the query for this group | | `typeToCount` | object | Breakdown of mention counts by source type. Keys are source type strings (e.g. `WEB`, `TWITTER`), values are counts. | --- Source: https://developers.determ.com/api/scroll-by-keyword.html # Scroll by Keyword **Endpoint:** `POST /v2/organizations/{organizationId}/keywords/{keywordId}/mentions/scroll` Returns a paginated list of mentions for a specific keyword. Use this endpoint to retrieve and page through mentions scoped to a single keyword rather than the entire organization. **Rate limit:** 100 req/60s (Per user, shared bucket) ## Parameters **Path Parameters:** - `organizationId` (integer (int64), required, in path): The unique identifier of the organization. - `keywordId` (integer (int64), required, in path): The unique identifier of the keyword to scroll mentions for. ## Request Body The request body is a **ScrollRequest** containing a query, pagination settings, and optional flags: | Field | Type | Description | |-------|------|-------------| | `query` | object | **Required.** A **FeedsSearchQueryRequest** defining the search criteria (see below). A request without it returns `400`. | | `paged` | object | Pagination and sorting settings. | | `paged.count` | integer (int32) | Number of mentions to return per page. Maximum: `1000`. | | `paged.sorted` | object | Sorting configuration with `direction` (`ASC` or `DESC`) and `property` (sort field). | | `scrollToken` | string | Token from a previous response to fetch the next page of results. Omit on the first request. | ### Sort Properties `PUBLISHED_TIME`, `FEED_TIME`, `REACH`, `VIRALITY`, `INTERACTIONS`, `INFLUENCE`, `ENGAGEMENT` ### Query Object (FeedsSearchQueryRequest) | Field | Type | Description | |-------|------|-------------| | `query.feeds` | array | Array of feed objects with `groupId` (int64) and `keywordId` (int64) to scope the search. Optional -- omit to search all feeds. | | `query.feedTime` | object | Time range filter based on when the mention entered the feed. Use `relative` (enum) for preset ranges, or `from`/`to` (ISO datetime) for custom ranges. Set this, `publishedTime`, or both. | | `query.publishedTime` | object | Time range filter based on when the mention was published. Same structure as `feedTime`. Set this, `feedTime`, or both. | | `query.mentionFilter` | object | Filter criteria for narrowing mentions. | A query needs a time range: one of `feedTime` and `publishedTime` is required. A query with neither returns `400` with a plain-text body: ```text Must provide either 'feedTime' or 'publishedTime' in query ``` ### Relative Time Period Values `TODAY`, `YESTERDAY`, `LAST_24_HOURS`, `LAST_7_DAYS`, `LAST_30_DAYS`, `LAST_90_DAYS`, `THIS_MONTH`, `THIS_WEEK`, `LAST_WEEK`, `LAST_MONTH` ### Mention Filters Each filter field uses a **FilterClause** pattern with optional `any`, `all`, `must`, and `not` sub-fields: | Filter Field | Type | Description | |-------------|------|-------------| | `mentionType` | FilterClause | Filter by source type. Values: `WEB`, `FACEBOOK`, `TWITTER`, `FORUM`, `COMMENT`, `YOUTUBE`, `INSTAGRAM`, `REDDIT`, `TIKTOK`, `PRINT`, `RADIO`, `TV`, `BLUESKY`, `THREADS` | | `sentiment` | FilterClause | Filter by sentiment. Values: `POSITIVE`, `NEUTRAL`, `NEGATIVE`, `UNDEFINED` | ## Response ```json { "mentions": [ { "id": 987654321, "type": "WEB", "title": "Tesla announces new factory", "mention": "Tesla has announced plans to build a new factory...", "url": "https://example.com/article/tesla-factory", "author": "TechNews", "reach": 50000, "virality": 0.85, "interaction": 1200, "influenceScore": 7, "autoSentiment": "POSITIVE", "languages": ["en"], "locations": ["US"], "insertTime": 1705312800000, "keywords": ["Tesla"] } ], "scrollToken": "eyJzZWFyY2hBZnRlciI6..." } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `mentions` | array | List of mention objects matching the query for this keyword. | | `scrollToken` | string | Opaque token to pass in the next request to retrieve the following page of results. | ### Mention Object | Field | Type | Description | |-------|------|-------------| | `id` | integer (int64) | Unique identifier for the mention | | `type` | string | Source type (e.g. `WEB`, `TWITTER`, `FACEBOOK`, `YOUTUBE`) | | `title` | string | Title of the mention, if available | | `mention` | string | Text snippet of the mention content | | `url` | string | URL where the original mention can be found | | `author` | string | Name or handle of the mention author | | `influencer` | string | Influencer associated with the mention, if any | | `reach` | integer (int32) | Estimated audience reach | | `virality` | number (double) | Virality score of the mention | | `interaction` | integer (int64) | Total number of interactions (likes, shares, comments, etc.) | | `influenceScore` | integer (int64) | Influence score of the source, an integer from `1` to `10`. Absent when the score can't be computed (for example, no follower count or site rank for the source). See [Influence Score](https://developers.determ.com/glossary.html#influence-score). | | `autoSentiment` | string | Automatically detected sentiment (`POSITIVE`, `NEUTRAL`, `NEGATIVE`, `UNDEFINED`) | | `languages` | array of string | Detected languages of the mention | | `locations` | array of string | Detected geographic locations | | `insertTime` | integer (int64) | Unix timestamp (milliseconds) when the mention was ingested | | `databaseInsertTime` | integer (int64) | Unix timestamp (milliseconds) when the mention was stored in the database | | `image` | string | URL of an associated image, if available | | `keywords` | array of string | Keywords that matched this mention | ## Pagination The scroll endpoint uses **token-based pagination** for efficient retrieval of large result sets. A single page returns at most **1000 mentions** (`paged.count` is capped at `1000`) — that is the whole point of scrolling: instead of fetching everything at once, you page through the results token by token. 1. **First request** -- Send your query without a `scrollToken`. The response includes the first page of results and a `scrollToken`. 2. **Subsequent requests** -- Include the `scrollToken` from the previous response in your next request body. The server returns the next page of results along with a new `scrollToken`. 3. **End of results** -- When there are no more results, the `scrollToken` will be absent or `null` in the response. > **Tip** > > Always pass the same `query` and `paged` parameters across paginated requests. Only add or update the `scrollToken` field. --- Source: https://developers.determ.com/api/scroll-by-group.html # Scroll by Group **Endpoint:** `POST /v2/organizations/{organizationId}/groups/{groupId}/mentions/scroll` Returns a paginated list of mentions for a specific group. Use this endpoint to retrieve and page through mentions scoped to a single group rather than the entire organization. **Rate limit:** 100 req/60s (Per user, shared bucket) ## Parameters **Path Parameters:** - `organizationId` (integer (int64), required, in path): The unique identifier of the organization. - `groupId` (integer (int64), required, in path): The unique identifier of the group to scroll mentions for. ## Request Body The request body is a **ScrollRequest** containing a query, pagination settings, and optional flags: | Field | Type | Description | |-------|------|-------------| | `query` | object | **Required.** A **FeedsSearchQueryRequest** defining the search criteria (see below). A request without it returns `400`. | | `paged` | object | Pagination and sorting settings. | | `paged.count` | integer (int32) | Number of mentions to return per page. Maximum: `1000`. | | `paged.sorted` | object | Sorting configuration with `direction` (`ASC` or `DESC`) and `property` (sort field). | | `scrollToken` | string | Token from a previous response to fetch the next page of results. Omit on the first request. | ### Sort Properties `PUBLISHED_TIME`, `FEED_TIME`, `REACH`, `VIRALITY`, `INTERACTIONS`, `INFLUENCE`, `ENGAGEMENT` ### Query Object (FeedsSearchQueryRequest) | Field | Type | Description | |-------|------|-------------| | `query.feeds` | array | Array of feed objects with `groupId` (int64) and `keywordId` (int64) to scope the search. Optional -- omit to search all feeds. | | `query.feedTime` | object | Time range filter based on when the mention entered the feed. Use `relative` (enum) for preset ranges, or `from`/`to` (ISO datetime) for custom ranges. Set this, `publishedTime`, or both. | | `query.publishedTime` | object | Time range filter based on when the mention was published. Same structure as `feedTime`. Set this, `feedTime`, or both. | | `query.mentionFilter` | object | Filter criteria for narrowing mentions. | A query needs a time range: one of `feedTime` and `publishedTime` is required. A query with neither returns `400` with a plain-text body: ```text Must provide either 'feedTime' or 'publishedTime' in query ``` ### Relative Time Period Values `TODAY`, `YESTERDAY`, `LAST_24_HOURS`, `LAST_7_DAYS`, `LAST_30_DAYS`, `LAST_90_DAYS`, `THIS_MONTH`, `THIS_WEEK`, `LAST_WEEK`, `LAST_MONTH` ### Mention Filters Each filter field uses a **FilterClause** pattern with optional `any`, `all`, `must`, and `not` sub-fields: | Filter Field | Type | Description | |-------------|------|-------------| | `mentionType` | FilterClause | Filter by source type. Values: `WEB`, `FACEBOOK`, `TWITTER`, `FORUM`, `COMMENT`, `YOUTUBE`, `INSTAGRAM`, `REDDIT`, `TIKTOK`, `PRINT`, `RADIO`, `TV`, `BLUESKY`, `THREADS` | | `sentiment` | FilterClause | Filter by sentiment. Values: `POSITIVE`, `NEUTRAL`, `NEGATIVE`, `UNDEFINED` | ## Response ```json { "mentions": [ { "id": 987654321, "type": "WEB", "title": "Tesla announces new factory", "mention": "Tesla has announced plans to build a new factory...", "url": "https://example.com/article/tesla-factory", "author": "TechNews", "reach": 50000, "virality": 0.85, "interaction": 1200, "influenceScore": 7, "autoSentiment": "POSITIVE", "languages": ["en"], "locations": ["US"], "insertTime": 1705312800000, "keywords": ["Tesla"] } ], "scrollToken": "eyJzZWFyY2hBZnRlciI6..." } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `mentions` | array | List of mention objects matching the query for this group. | | `scrollToken` | string | Opaque token to pass in the next request to retrieve the following page of results. | ### Mention Object | Field | Type | Description | |-------|------|-------------| | `id` | integer (int64) | Unique identifier for the mention | | `type` | string | Source type (e.g. `WEB`, `TWITTER`, `FACEBOOK`, `YOUTUBE`) | | `title` | string | Title of the mention, if available | | `mention` | string | Text snippet of the mention content | | `url` | string | URL where the original mention can be found | | `author` | string | Name or handle of the mention author | | `influencer` | string | Influencer associated with the mention, if any | | `reach` | integer (int32) | Estimated audience reach | | `virality` | number (double) | Virality score of the mention | | `interaction` | integer (int64) | Total number of interactions (likes, shares, comments, etc.) | | `influenceScore` | integer (int64) | Influence score of the source, an integer from `1` to `10`. Absent when the score can't be computed (for example, no follower count or site rank for the source). See [Influence Score](https://developers.determ.com/glossary.html#influence-score). | | `autoSentiment` | string | Automatically detected sentiment (`POSITIVE`, `NEUTRAL`, `NEGATIVE`, `UNDEFINED`) | | `languages` | array of string | Detected languages of the mention | | `locations` | array of string | Detected geographic locations | | `insertTime` | integer (int64) | Unix timestamp (milliseconds) when the mention was ingested | | `databaseInsertTime` | integer (int64) | Unix timestamp (milliseconds) when the mention was stored in the database | | `image` | string | URL of an associated image, if available | | `keywords` | array of string | Keywords that matched this mention | ## Pagination The scroll endpoint uses **token-based pagination** for efficient retrieval of large result sets. A single page returns at most **1000 mentions** (`paged.count` is capped at `1000`) — that is the whole point of scrolling: instead of fetching everything at once, you page through the results token by token. 1. **First request** -- Send your query without a `scrollToken`. The response includes the first page of results and a `scrollToken`. 2. **Subsequent requests** -- Include the `scrollToken` from the previous response in your next request body. The server returns the next page of results along with a new `scrollToken`. 3. **End of results** -- When there are no more results, the `scrollToken` will be absent or `null` in the response. > **Tip** > > Always pass the same `query` and `paged` parameters across paginated requests. Only add or update the `scrollToken` field. --- Source: https://developers.determ.com/api/list-tags.html # List Tags **Endpoint:** `GET /v2/organizations/{organizationId}/tags` Returns all tags of an organization, or only the tags whose IDs you pass. **Rate limit:** 100 req/s (Per user) ## Parameters **Path Parameters:** - `organizationId` (integer, required, in path): The unique identifier of the organization (int64). Call this endpoint without `ids` to discover the tag IDs of an organization. [Get Organization](https://developers.determ.com/api/get-organization.html) also returns the organization's tags. **Query Parameters:** - `ids` (string, optional, in query): Comma-separated list of tag IDs to return (int64 values). Omit it to return every tag in the organization. ## Response ```json { "tags": [ { "id": 1, "name": "Important" }, { "id": 2, "name": "Reviewed" }, { "id": 3, "name": "Follow-up" } ] } ``` ## Response Fields | Field | Type | Description | |-------|------|-------------| | `tags` | array | Every tag in the organization, or only the tags matching `ids` when you pass it | | `tags[].id` | integer (int64) | Unique identifier for the tag | | `tags[].name` | string | Display name of the tag | --- Source: https://developers.determ.com/ai-development/ # Develop with AI These docs are designed to be AI-friendly. Every page is structured so that AI assistants -- ChatGPT, Claude, Cursor, GitHub Copilot, and others -- can understand the Determ API and help you write integration code, debug issues, and build features faster. ## Five ways to use AI with these docs ### 1. Quick copy-paste Every API endpoint page has a **"Copy page for AI"** button at the top. Click it to copy the entire page content in a format optimized for AI consumption. Then paste it into your AI assistant along with your question. This is the fastest approach when you are working with a single endpoint and need help with a specific task. ### 2. Full context file For the rules that hold across the whole API, use the [AI Context File](https://developers.determ.com/ai-development/context-file.html). It is one block with authentication, the base URL, the error format, rate limits and the conventions an integration has to follow, and it points the assistant to [`/llms-full.txt`](https://developers.determ.com/llms-full.txt) and the OpenAPI spec for every endpoint's fields. Copy it once and paste it into your AI chat; paste `/llms-full.txt` too if your assistant can't fetch URLs. Best for: starting a new project, building multi-endpoint workflows, or when you want the AI to choose the right endpoint for your use case. ### 3. Workflow prompts The [Workflow Prompts](https://developers.determ.com/ai-development/workflow-prompts.html) page has six ready-made prompts for common tasks: exploring the API, scaffolding a project, building a dashboard, debugging, writing tests, and reviewing code. Best for: getting started quickly with a proven prompt structure rather than writing your own from scratch. ### 4. OpenAPI spec For code generation and exact type information, point the AI at the machine-readable spec: ``` https://developers.determ.com/openapi.json ``` Most coding agents can fetch that URL themselves. It gives the assistant every request and response shape verbatim, which cuts down on invented fields. See the [OpenAPI Spec](https://developers.determ.com/api/openapi.html) page. Best for: generating typed clients, request builders, and response models — or pairing with the context file so the AI has both the shapes and the conventions. ### 5. llms.txt AI tools that follow the [llms.txt](https://llmstxt.org/) convention can read these docs on their own: - [`/llms.txt`](https://developers.determ.com/llms.txt) — an index of every page, with a one-line summary each - [`/llms-full.txt`](https://developers.determ.com/llms-full.txt) — every page as one plain-markdown file, without the interactive request builders Both are rebuilt from these pages on every release, so they always match what you read here. Best for: agents that browse the web themselves, or loading the whole documentation into a context window in one go. ## IDE integration If you use an AI-powered IDE, you can give it persistent knowledge of the Determ API by adding a rules file to your project root. This way, the AI assistant automatically has API context every time you ask a question in that project. Create the file your tool reads — `.cursorrules` for Cursor, `CLAUDE.md` for Claude Code — with the same content: ``` # Determ API Integration Rules Base URL: https://api.mediatoolkit.com Auth: Bearer token in Authorization header OpenAPI spec: https://developers.determ.com/openapi.json Key endpoints: - GET /v2/me — Current user - POST /v2/organizations/{orgId}/keywords/{keywordId}/mentions/count — Count mentions by keyword - POST /v2/organizations/{orgId}/keywords/{keywordId}/mentions/scroll — Scroll mentions by keyword - POST /v2/organizations/{orgId}/keywords — Create keyword Always use scrollToken for pagination. Use publishedTime.relative for time ranges. ``` > **Tip** > > For maximum AI effectiveness, copy the context block from the [AI Context File](https://developers.determ.com/ai-development/context-file.html) page and paste it into your rules file instead of the summary above. The summary covers the basics; the context file adds the error format, every rate limit and the conventions, and points to [`/llms-full.txt`](https://developers.determ.com/llms-full.txt) for every endpoint, field and enum. ## Next steps - **[AI Context File](https://developers.determ.com/ai-development/context-file.html)** -- Copy the API's rules and conventions into your AI assistant - **[OpenAPI Spec](https://developers.determ.com/api/openapi.html)** -- Point your AI assistant or code generator at the machine-readable spec - **[Workflow Prompts](https://developers.determ.com/ai-development/workflow-prompts.html)** -- Grab a ready-made prompt and start building - **[Getting Started](https://developers.determ.com/getting-started.html)** -- Make your first API call manually --- Source: https://developers.determ.com/ai-development/context-file.html # AI Context File Copy the block below and paste it into your AI assistant. It gives the assistant what the reference pages don't say in one place: authentication, the base URL, the error format, rate limits, and the rules an integration has to follow. It works with any AI tool -- ChatGPT, Claude, Cursor, GitHub Copilot, or any other LLM-based assistant. The block doesn't repeat every endpoint's fields. For those, it points the assistant to two files that are rebuilt from these docs on every release, so they never go stale: - [`/llms-full.txt`](https://developers.determ.com/llms-full.txt) -- every page of these docs as one plain-text file, including each endpoint's parameters, response fields and examples. This page is in it too. - [`/openapi.json`](https://developers.determ.com/openapi.json) -- the machine-readable spec, with exact request and response types. See [OpenAPI Spec](https://developers.determ.com/api/openapi.html). **How to use it:** - **ChatGPT / Claude** -- Start a new conversation, paste the block, then ask your question in the same message or in a follow-up. If the assistant can't fetch URLs, paste the contents of `/llms-full.txt` as well, or the reference page of the endpoint you're working on (each page has a **Copy page for AI** button). - **Cursor** -- Paste the block into a `.cursorrules` file in your project root for persistent context, or paste it into the chat for a one-off session. - **Claude Code** -- Paste the block into a `CLAUDE.md` file in your project root, or include it directly in your prompt. Claude Code can fetch `/llms-full.txt` and `/openapi.json` itself. --- ````markdown # Determ API -- Context for AI Assistants ## Overview Determ is a media monitoring platform. The public API lets you programmatically access mentions, create and delete keywords, and retrieve metadata. - **Base URL:** `https://api.mediatoolkit.com` - **Authentication:** Bearer token in the `Authorization` header (`Authorization: Bearer YOUR_API_TOKEN`) - **Response format:** JSON - **Content-Type for POST requests:** `application/json` ## Full Reference This block holds conventions, not the per-endpoint detail. For an endpoint's parameters, request body, response fields, enum values and examples, read: - `https://developers.determ.com/llms-full.txt` -- the complete documentation as plain text (every endpoint page, the glossary, errors and rate limits). - `https://developers.determ.com/openapi.json` -- the OpenAPI 3 spec, with exact types. - `https://developers.determ.com/llms.txt` -- an index of every page, one line each. If you can't fetch these URLs, ask the user to paste the relevant page. Don't guess field names, enum values or paths: use only what these sources or this block state. --- ## Filter Clause Pattern All mention filters use the same structure: ```json { "any": ["VALUE_1", "VALUE_2"], "all": ["VALUE_3"], "must": ["VALUE_4"], "not": ["VALUE_5"] } ``` - `any` -- Match any of the listed values (OR logic) - `all` -- Match all of the listed values (AND logic) - `must` -- Must match these values - `not` -- Exclude these values Most common usage is `any` for inclusive filtering and `not` for exclusions. The mention count and scroll endpoints support only the `mentionType` and `sentiment` filters in `query.mentionFilter`. --- ## Error Handling **Error response format:** RFC 7807 Problem Details, sent with `Content-Type: application/problem+json`. ```json { "type": "about:blank", "title": "Bad Request", "status": 400, "detail": "Invalid parameter: from", "instance": "/v2/organizations/100/keywords", "code": "INVALID_PARAM" } ``` **Fields:** `type` (string, always `"about:blank"` -- no custom problem type URIs), `title` (string, the HTTP reason phrase), `status` (int, the HTTP status code), `detail` (string, human-readable message), `instance` (string, the request path), `code` (string, **optional**). `code` is only present on handled domain errors, and is always upper case -- e.g. `INVALID_PARAM`, `MISSING_PARAM`, `INVALID_ROLE`, `INVALID_KEYWORD` (400), `ILLEGAL_PERMISSION` (403), `NOT_EXISTS` (404), `ILLEGAL_PARAM`, `INCONSISTENT_STATE` (409). It is absent on framework errors such as 401, 429, 500 and validation failures, so always treat it as optional. **Do not assume the body is JSON.** Known exceptions: - The `/v2/organizations/{orgId}/mentions/**` endpoints (count and scroll) return a plain `text/plain` body containing just the message for 400 and 404. - 503 is typically produced by the edge proxy as `text/html`. Parse defensively: check the status code first, then attempt to parse the body only if `Content-Type` says JSON, and fall back to the raw text. **HTTP status codes:** | Status | Meaning | Retry? | |--------|---------|--------| | 400 | Bad Request -- malformed request, bad enum, malformed date | No, fix the request | | 401 | Unauthorized -- missing/invalid token | No, check token | | 403 | Forbidden -- valid token, no permission | No, check access | | 404 | Not Found -- resource does not exist | No, check IDs | | 409 | Conflict -- conflicts with current state (e.g. already exists) | No, fix the request | | 417 | Expectation Failed -- body invalid or unparseable | No, fix the body | | 429 | Too Many Requests -- rate limit exceeded | Yes, see below | | 500 | Internal Server Error | Yes, with backoff | | 502 | Bad Gateway -- upstream service error | Yes, with backoff | | 503 | Service Unavailable | Yes, with backoff | **Endpoint-specific behaviour:** - `GET /v2/organizations/{id}` returns `404` both when the organization doesn't exist and when you have no access to it. - `POST /v2/organizations/{orgId}/keywords` (Create Keyword): an invalid `historySearch` (`from` not before `to`, `to` in the future, or `enabled: false` combined with `from`/`to`) returns `400` `INVALID_PARAM`. When the organization already has as many keywords as its plan allows, it returns `403` `ILLEGAL_PERMISSION` (the `detail` names the limit) and creates nothing; retrying won't help -- delete a keyword first. The limit counts every keyword, active or not. A `groupId` (or organization) that doesn't exist returns `404` `NOT_EXISTS`. - `POST .../mentions/count` and `POST .../mentions/scroll`: the `query` must set `feedTime`, `publishedTime` or both; with neither, the response is `400` with the plain-text body `Must provide either 'feedTime' or 'publishedTime' in query`. - `DELETE /v2/organizations/{orgId}/keywords/{keywordId}` (Delete Keyword) returns `200 OK` with an empty body -- do not parse it as JSON. It permanently deletes the keyword and every mention collected under it. Deleting the same keyword twice returns `404` on the second call, so treat `404` as "already gone" in retry logic. A keyword ID from another organization, or in a group you have no access to, returns `403`, not `404`; this may change to `404`, so treat both as "not deletable here". Deleting frees the keyword's place in the plan's keyword limit immediately: after the `200`, an organization at its limit can create a replacement on the next call. The limit counts every keyword, active or not. **Rate limit headers:** - `X-Rate-Limit-Remaining` -- on allowed requests, tokens left in the bucket. Use it to throttle proactively. - `X-Rate-Limit-Retry-After-Seconds` -- on 429 responses, how many seconds to wait. There is no `X-RateLimit-Limit` header; total bucket capacity is not discoverable from the response. **Retry logic:** Up to 3 attempts, for the statuses marked retryable above. On 429, wait the number of seconds in `X-Rate-Limit-Retry-After-Seconds`; if that header is missing, fall back to exponential backoff starting at 1 second and doubling each attempt. **Unexpected 429s:** limits are per user, per endpoint, but both mention *count* endpoints (keyword-level and group-level) share one bucket, and both *scroll* endpoints share another. Calling the keyword and group variants of the same operation draws from the same pool. --- ## Rules & Conventions 1. **Always include the Authorization header** with `Bearer YOUR_API_TOKEN` on every request. 2. **Use `scrollToken` for pagination** -- do not increment page numbers manually. Pass the token from the previous response. A single page returns at most 1000 mentions (`paged.count` <= 1000); page through results instead of trying to fetch everything at once. The last page has a `null` or absent `scrollToken`. 3. **Date formats:** Use ISO 8601 (`2024-01-15T00:00:00Z`) for specific times, or the relative enum (`LAST_7_DAYS`) for preset ranges. 4. **ID types:** All IDs are int64, `keywordId` included. 5. **Keep query params stable during pagination** -- only update `scrollToken` between scroll requests. 6. **Rate limiting:** Limits are per user, per endpoint (per IP for the unauthenticated languages/locations endpoints), and they differ widely -- there is no single safe rate. `GET /v2/me`: 200 req/s. `GET /v2/organizations/{orgId}` and `GET .../tags`: 100 req/s. `GET /v2/languages` and `GET /v2/locations`: 100 req/60s per IP. `POST .../mentions/count` and `POST .../mentions/scroll`: 100 req/60s each, and the keyword-level and group-level variants share one bucket (both count endpoints draw from one pool, both scroll endpoints from another). `POST /v2/organizations/{orgId}/keywords` (Create Keyword): **2 req/10s** -- never create keywords in a fast loop. `DELETE /v2/organizations/{orgId}/keywords/{keywordId}` (Delete Keyword): 100 req/60s. On 429, wait `X-Rate-Limit-Retry-After-Seconds` (see Error Handling above). 7. **Content-Type:** Always send `Content-Type: application/json` for POST requests. 8. **Discover IDs, don't guess them:** `GET /v2/me` lists your `organizationIds`; `GET /v2/organizations/{id}` lists that organization's groups and keywords (the `groupId` and `keywordId` the mention endpoints need); `GET /v2/organizations/{orgId}/tags` without `ids` lists every tag. ```` --- Source: https://developers.determ.com/ai-development/workflow-prompts.html # Workflow Prompts Ready-made prompts for common tasks with the Determ API. Each prompt is inside a code block so you can copy it directly. Paste the prompt into your AI assistant (ChatGPT, Claude, Cursor, or any other) and follow the instructions in brackets. For best results, combine these prompts with the [AI Context File](https://developers.determ.com/ai-development/context-file.html) block, which carries the API's conventions and points to [`/llms-full.txt`](https://developers.determ.com/llms-full.txt) for every endpoint's fields. Paste the context first, then the prompt. --- ## 1. Explore the API Use this prompt when you are new to the Determ API and want to understand what is available before writing any code. ``` I want to explore the Determ API. Here is the complete API context: [Paste the full context block from the AI Context File page] List all available endpoints and explain what each one does. Group them by category (user, metadata, counting, scrolling, keyword management). For each endpoint, tell me: the HTTP method, the path, what it returns, and when I would use it. ``` --- ## 2. Scaffold a project Use this prompt when you are starting a new integration from scratch and want a working project skeleton with authentication, counting, and scrolling already wired up. ``` Using the Determ API (base URL: https://api.mediatoolkit.com, auth: Bearer token in the Authorization header), scaffold a [Python/Node.js/PHP] project that: 1. Reads the API token from an environment variable (DETERM_API_TOKEN) 2. Authenticates by calling GET /v2/me and prints the user's name and organization IDs 3. Counts mentions for the last 7 days using POST /v2/organizations/{orgId}/keywords/{keywordId}/mentions/count with publishedTime.relative = "LAST_7_DAYS" 4. Scrolls through the first 3 pages of mentions using POST /v2/organizations/{orgId}/keywords/{keywordId}/mentions/scroll with scrollToken-based pagination, and prints each mention's title, source type, and sentiment 5. Includes proper error handling with retry logic for 429/5xx errors (exponential backoff, max 3 retries) Use organization ID [YOUR_ORG_ID]. Structure the code with separate functions for each API call. Add comments explaining the key parts. ``` --- ## 3. Build a dashboard Use this prompt when you want to create a visual dashboard that shows mention counts, source distribution, and sentiment breakdown. ``` Build a simple dashboard that uses the Determ API to display media monitoring data. The dashboard should: 1. Fetch mention counts for the last 30 days using POST /v2/organizations/{orgId}/keywords/{keywordId}/mentions/count (base URL: https://api.mediatoolkit.com, auth: Bearer token) 2. Show a breakdown of mentions by source type (WEB vs TWITTER vs FACEBOOK vs YOUTUBE vs INSTAGRAM vs REDDIT vs TIKTOK) using the typeToCount field in the response 3. Fetch mentions with sentiment filters to calculate sentiment distribution: - Count POSITIVE mentions (mentionFilter.sentiment.any = ["POSITIVE"]) - Count NEGATIVE mentions (mentionFilter.sentiment.any = ["NEGATIVE"]) - Count NEUTRAL mentions (mentionFilter.sentiment.any = ["NEUTRAL"]) 4. Display the results with charts (bar chart for source types, pie chart for sentiment) Use organization ID [YOUR_ORG_ID]. Use [React/Vue/vanilla JS/Python] for the frontend. Read the API token from an environment variable. ``` --- ## 4. Debug an issue Use this prompt when you are getting errors from the Determ API and need help figuring out what is wrong. ``` I'm getting [describe the error, e.g., "a 400 Bad Request" or "empty results" or "401 Unauthorized"] when calling the Determ API. Here's my code: [Paste your code here] The endpoint I'm calling is: [e.g., POST https://api.mediatoolkit.com/v2/organizations/100/keywords/5001/mentions/count] The request body I'm sending is: [Paste the request body JSON here] The response I'm getting is: [Paste the error response here] Help me debug this. Check for: - Correct Authorization header format (should be "Bearer TOKEN") - Correct Content-Type header (should be "application/json" for POST) - Valid request body structure (query.publishedTime, query.mentionFilter, etc.) - Correct path parameter types (organizationId and keywordId are both int64) - Valid enum values (source types, sentiments, time periods) - Pagination issues (scrollToken handling) ``` --- ## 5. Write integration tests Use this prompt when you want to add automated tests to verify your Determ API integration is working correctly. ``` Write integration tests for the Determ API (base URL: https://api.mediatoolkit.com, auth: Bearer token from DETERM_API_TOKEN env var). Use [pytest/Jest/PHPUnit] as the test framework. Test the following scenarios: 1. GET /v2/me returns user data - Status code is 200 - Response contains id, email, name, organizationIds - organizationIds is a non-empty array 2. POST /v2/organizations/{orgId}/keywords/{keywordId}/mentions/count returns counts - Status code is 200 - Response contains count (integer >= 0) and typeToCount (object) - Use publishedTime.relative = "LAST_7_DAYS" in the request body - Use organization ID from the /v2/me response 3. POST /v2/organizations/{orgId}/keywords/{keywordId}/mentions/scroll returns paginated mentions - Status code is 200 - Response contains mentions (array) and scrollToken (string) - Each mention has id, type, title, url, autoSentiment fields - Test pagination: make a second request with the scrollToken and verify it returns different mentions 4. Error handling - Test that an invalid token returns 401 - Test that a non-existent organization ID returns 403 or 404 Include setup/teardown to read the API token from environment variables. Add clear test names that describe what is being tested. Skip tests gracefully if the environment variable is not set. ``` --- ## 6. Review my integration code Use this prompt when you have a working integration and want a thorough code review before shipping it to production. ``` Review my Determ API integration code for production readiness. Here is the code: [Paste your complete integration code here] Check the following areas: **Security:** - Is the API token read from an environment variable (not hardcoded)? - Is the token excluded from logs and error messages? - Are there any token leaks in error handling or debug output? **Error handling:** - Does it handle 401 (invalid token) gracefully? - Does it retry on 429 (rate limit) and 5xx (server errors) with exponential backoff? - Does it avoid retrying on 400/403/404 (client errors)? - Is there a maximum retry count? **Performance:** - Does it use scrollToken for pagination (not page number incrementing)? - Does it set a reasonable page size (paged.count, max 1000)? - Does it cache responses where possible (e.g., languages, locations)? **Correctness:** - Are request bodies structured correctly (query.publishedTime, query.mentionFilter)? - Are enum values valid (source types, sentiments, time periods)? - Are ID types correct (organizationId and keywordId are both int64)? - Is Content-Type set to application/json for POST requests? - Are pagination parameters kept stable across scroll requests? Provide specific suggestions with code examples for any issues found. ``` --- Source: https://developers.determ.com/api/openapi.html # OpenAPI Spec The Determ API is described by a machine-readable **OpenAPI 3.1** document. Point an API client, a code generator, or an AI assistant at it instead of transcribing endpoints by hand. ## Spec URL ``` https://developers.determ.com/openapi.json ``` | Property | Value | |---|---| | Format | OpenAPI 3.1.0 (JSON) | | Server | `https://api.mediatoolkit.com` | | Auth | HTTP Bearer (`bearerToken`), applied to every operation | ## Import into an API client Most API clients (Postman, Insomnia, Bruno) import OpenAPI documents. Choose the client's **import from URL / link** option and paste the spec URL — importing the URL rather than a downloaded file means you can re-import to pick up changes. After importing, set the value for the `bearerToken` security scheme to your API token — the spec declares that a token is required but does not contain one. See [Authentication](https://developers.determ.com/authentication.html) for where to find it. ## Generate a client The spec has stable `operationId` values (`getCurrentUser`, `createKeyword`, `scrollMentionsByKeyword`, …), so generated method names stay put across regenerations. TypeScript types: ```bash npx openapi-typescript https://developers.determ.com/openapi.json -o determ-api.d.ts ``` Any language: ```bash npx @openapitools/openapi-generator-cli generate \ -i https://developers.determ.com/openapi.json \ -g python \ -o ./determ-python ``` Swap `-g python` for `java`, `go`, `csharp` or any other [openapi-generator](https://openapi-generator.tech/docs/generators) target — `openapi-generator-cli list` prints the full set. ## Use it with AI tools The spec is small enough to paste straight into a chat context window, and most coding agents can fetch it from the URL themselves. Two prompts that work well: ``` Read https://developers.determ.com/openapi.json and write a Python client for scrollMentionsByKeyword that pages through every mention. ``` ``` Using the attached OpenAPI spec, generate typed TypeScript request helpers for the Determ mentions endpoints. Do not invent fields. ``` For conventions and gotchas, the [AI Context File](https://developers.determ.com/ai-development/context-file.html) is the better input — the spec gives types, the context file gives judgement. See [Develop with AI](https://developers.determ.com/ai-development/) for more. ## What's in it - Every endpoint documented in the [API Reference](https://developers.determ.com/api/overview.html) — and nothing else. Internal and admin endpoints are not published. - Request and response schemas, with a response example on each success response. - Error responses in the RFC 7807 problem format, wherever they apply. See [Errors & Rate Limits](https://developers.determ.com/errors.html). - Per-operation rate limits as an `x-rate-limit` extension, plus the `X-Rate-Limit-Remaining` response header. The spec is generated from these documentation pages together with the internal API schema, so it stays aligned with the API Reference. If you find a mismatch, treat the documentation page as authoritative and let [Determ support](https://determ.com) know. --- Source: https://developers.determ.com/glossary.html # Glossary Key terms used throughout the Determ API documentation. ## A ### Access Token A static Bearer token issued per user that authenticates every API request. Each user in an organization on an API plan has their own token. Pass it in the `Authorization: Bearer YOUR_API_TOKEN` header. ### Author The name or handle of the person or account who created the mention (e.g. a journalist byline, a tweet author, a Reddit username). Keywords can include or exclude specific authors; see [Filtering by Author](https://developers.determ.com/api/create-keyword.html#filtering-by-author). ### Auto Sentiment The automatically detected sentiment of a mention. Returned as `POSITIVE`, `NEUTRAL`, `NEGATIVE`, or `UNDEFINED`. Different from manual sentiment labels that users can apply. ## B ### Bearer Token Standard HTTP authentication scheme where a token is sent in the `Authorization` header prefixed with `Bearer `. See [Access Token](#access-token). ## E ### Engagement A composite metric that reflects audience interaction with a mention relative to the source's typical reach. Higher engagement means the mention generated unusually high activity for its source. Available as a sort property in scroll endpoints. ### Engagement Rate The ratio of [Interactions](#interactions) to [Reach](#reach) for a mention, expressed as a percentage or normalized score. Not currently returned by any documented endpoint — it exists in the Determ platform but is not part of the public API yet. ## F ### Feed A stream of mentions collected for a specific keyword or group. Each feed has a `feedTime` (when the mention entered the feed) and a `publishedTime` (when the mention was originally published). ### Feed Time The timestamp when a mention was ingested into the Determ system. Different from [Published Time](#published-time). Use `feedTime` filters when you care about when data became available in your account; use `publishedTime` when you care about when content was actually written or posted. ### FilterClause The pattern used for mention filters in the API. Each filter supports `any` (match any of these values), `all` (match all), `must` (required), and `not` (exclude) sub-fields. Example: `{ "any": ["POSITIVE", "NEUTRAL"] }`. ## G ### Group A folder that organizes keywords within an organization. Groups help structure monitoring by theme, brand, competitor, or campaign. Each group contains one or more keywords. ## I ### Influence Score An integer score from 1 to 10 representing the authority and credibility of a mention's source. Higher scores indicate more influential sources such as major news outlets or high-follower social accounts. The score is never `0`: when it can't be computed (for example, the source has no follower count or site rank), the `influenceScore` field is absent from the mention. ### Influencer A named entity (usually a journalist, public figure, or high-reach social account) associated with a mention. Distinct from author: an article written by staff reporter "John Doe" may be associated with an influencer brand like "The New York Times". ### Interactions The total engagement count for a mention — likes, shares, comments, retweets, reactions combined into a single number. ## K ### Keyword A monitoring query that defines what content Determ tracks. A keyword includes a search query (natural language or boolean), language filters, source type filters, and other criteria. Keywords belong to a group within an organization. ## M ### Mention A single piece of content — an article, social media post, forum comment, TV segment, radio clip, or print article — that matches a keyword query. Each mention has metadata including source type, sentiment, reach, author, and timestamps. ### Mention Type (Source Type) The channel where a mention was found. Supported types: `WEB`, `FACEBOOK`, `TWITTER`, `YOUTUBE`, `INSTAGRAM`, `REDDIT`, `TIKTOK`, `FORUM`, `COMMENT`, `PRINT`, `RADIO`, `TV`, `BLUESKY`, `THREADS`. ## N ### Natural Query A search query expressed in natural language with boolean operators. Example: `Tesla OR "Elon Musk" NOT SpaceX`. Supports `AND`, `OR`, `NOT`, phrase matching with quotes, and parentheses for grouping. ### Natural Filters Keyword filters written as plain text, one `key:value1,value2` filter per line, e.g. `author:"Starbucks Coffee"`. Passed in the `naturalFilters` field of the keyword object; see [Filtering by Author](https://developers.determ.com/api/create-keyword.html#filtering-by-author). ## O ### Organization The top-level account entity in Determ. An organization contains groups, keywords, tags, and users. All API requests are scoped to an organization via `organizationId`. ## P ### Problem Details (RFC 7807) The standard format used for all error responses. Returns JSON with `type`, `title`, `status`, `detail`, `instance` fields, plus an optional `code` property on domain errors. Content type is `application/problem+json`. See [Errors & Rate Limits](https://developers.determ.com/errors.html). ### Pagination The mechanism for retrieving large result sets in chunks. The Determ API uses token-based pagination via [Scroll Token](#scroll-token) on scroll endpoints. Each response includes a token to fetch the next page. A single page contains at most 1000 mentions (`paged.count` ≤ 1000). ### Published Time The timestamp when content was originally published at its source (e.g. when an article was published, when a tweet was posted). Different from [Feed Time](#feed-time). ## R ### Rate Limit A per-user quota on how many requests can be made to each endpoint within a time window. Enforced via token bucket algorithm. When exceeded, the API returns HTTP `429`. See [Errors & Rate Limits](https://developers.determ.com/errors.html) for per-endpoint limits. ### Reach The estimated audience size that was exposed to a mention. For web articles, this is typically the site's monthly visitors. For social media, it's the author's follower count. Measured as an integer. ### Relative Time Period A preset time range used in query filters. Values: `TODAY`, `YESTERDAY`, `LAST_24_HOURS`, `LAST_7_DAYS`, `LAST_30_DAYS`, `LAST_90_DAYS`, `THIS_MONTH`, `THIS_WEEK`, `LAST_WEEK`, `LAST_MONTH`. Use instead of specific `from`/`to` dates when you want a rolling window. ### Rule In the Determ app, the matching criteria attached to an automated action. A rule is **not** a [Keyword](#keyword), and this API exposes no endpoints for rules. If you came here looking to stop monitoring a topic, that is a keyword — see [Delete Keyword](https://developers.determ.com/api/delete-keyword.html). ## S ### Scroll / Scroll Endpoint An endpoint that returns paginated mention data. Uses token-based pagination — the first request returns a [Scroll Token](#scroll-token) that must be passed in subsequent requests to get the next page. Each page returns at most 1000 mentions; scrolling exists so you page through large result sets instead of fetching everything in one request. ### Scroll Token An opaque pagination token returned by scroll endpoints. Pass it in the next request to retrieve the following page of results. When `null` or absent, there are no more results. ### Sentiment The automatically detected tone of a mention. Values: `POSITIVE`, `NEUTRAL`, `NEGATIVE`, or `UNDEFINED` (when sentiment could not be determined). ### Sort Property The field used to order mention results in scroll endpoints. Supported values: `PUBLISHED_TIME`, `FEED_TIME`, `REACH`, `VIRALITY`, `INTERACTIONS`, `INFLUENCE`, `ENGAGEMENT`. ### Source Reach The reach value of a mention's source (e.g. follower count for a Twitter profile, monthly visitors for a website) rather than the specific piece of content. Not currently returned by any documented endpoint — mentions expose [Reach](#reach) instead. ## T ### Tag A label that can be applied to mentions for manual categorization. Tags are organization-scoped and help teams collaborate on mention triage and analysis. ### Timestamp Most timestamps in API responses (e.g. `createdTime`, `lastLoginTime`, mention `insertTime`) are Unix epoch milliseconds (int64). The exception is keyword and organization timestamps — `createdAt` / `editedAt` in [Create Keyword](https://developers.determ.com/api/create-keyword.html) and [Get Organization](https://developers.determ.com/api/get-organization.html) — which are ISO 8601 strings (e.g. `2024-01-15T10:30:00Z`). ### Token Bucket The rate limiting algorithm used by the Determ API (Bucket4j implementation). Each endpoint has a bucket with a fixed capacity that refills over time. Each request consumes one token; when empty, requests are rejected with HTTP `429`. ## V ### Virality A score (0.0–1.0) indicating how rapidly a mention is being shared and discussed. Higher values indicate content that is spreading quickly across channels.