{
  "openapi": "3.1.0",
  "info": {
    "title": "Determ API",
    "version": "v2",
    "summary": "Media monitoring and analytics API.",
    "description": "The Determ API gives you programmatic access to mentions, keywords, tags and\norganization data from the [Determ](https://determ.com) media monitoring platform.\n\nAuthenticate every request with a Bearer token: `Authorization: Bearer YOUR_API_TOKEN`.\nTokens come from **Settings → Account Settings** in [app.determ.com](https://app.determ.com); see [Authentication](https://developers.determ.com/authentication).\n\nAll responses are JSON. Errors use the RFC 7807 problem format and rate limits are\nper user, per endpoint — see [Errors & Rate Limits](https://developers.determ.com/errors).\n\nThis document covers the publicly documented endpoints. Full docs: https://developers.determ.com",
    "contact": {
      "name": "Determ",
      "url": "https://developers.determ.com"
    }
  },
  "servers": [
    {
      "url": "https://api.mediatoolkit.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Determ API documentation",
    "url": "https://developers.determ.com"
  },
  "security": [
    {
      "bearerToken": []
    }
  ],
  "tags": [
    {
      "name": "User",
      "description": "The authenticated user."
    },
    {
      "name": "Organizations",
      "description": "Organizations, their groups, keywords and tags."
    },
    {
      "name": "Reference Data",
      "description": "Languages and locations available for keyword filters."
    },
    {
      "name": "Keywords",
      "description": "Monitoring queries."
    },
    {
      "name": "Mentions",
      "description": "Counting and paging through mentions."
    },
    {
      "name": "Tags",
      "description": "Tags applied to mentions."
    }
  ],
  "paths": {
    "/v2/me": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Current User",
        "description": "Returns the authenticated user's profile, including organization memberships and roles.\n\n**Rate limit:** 200 req/s (per user)",
        "operationId": "getCurrentUser",
        "externalDocs": {
          "description": "Current User — Determ API docs",
          "url": "https://developers.determ.com/api/current-user"
        },
        "x-rate-limit": {
          "limit": "200 req/s",
          "scope": "Per user"
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                },
                "example": {
                  "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
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{id}": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "Get Organization",
        "description": "Returns a single organization by ID, including its groups, keywords, tags, members, and subscription state.\n\n**Rate limit:** 100 req/s (per user)",
        "operationId": "getOrganization",
        "externalDocs": {
          "description": "Get Organization — Determ API docs",
          "url": "https://developers.determ.com/api/get-organization"
        },
        "x-rate-limit": {
          "limit": "100 req/s",
          "scope": "Per user"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the organization (int64)."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                },
                "example": {
                  "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
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/languages": {
      "get": {
        "tags": [
          "Reference Data"
        ],
        "summary": "Languages",
        "description": "Returns a list of all supported languages. Use the returned language codes when configuring keyword filters.\n\n**Rate limit:** 100 req/60s (per ip)",
        "operationId": "listLanguages",
        "externalDocs": {
          "description": "Languages — Determ API docs",
          "url": "https://developers.determ.com/api/languages"
        },
        "x-rate-limit": {
          "limit": "100 req/60s",
          "scope": "Per IP"
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LanguageList"
                },
                "example": {
                  "languages": [
                    {
                      "code": "en",
                      "name": "English"
                    },
                    {
                      "code": "hr",
                      "name": "Croatian"
                    },
                    {
                      "code": "de",
                      "name": "German"
                    },
                    {
                      "code": "fr",
                      "name": "French"
                    },
                    {
                      "code": "es",
                      "name": "Spanish"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/locations": {
      "get": {
        "tags": [
          "Reference Data"
        ],
        "summary": "Locations",
        "description": "Returns a list of all supported locations. Use the returned location codes when configuring keyword filters.\n\n**Rate limit:** 100 req/60s (per ip)",
        "operationId": "listLocations",
        "externalDocs": {
          "description": "Locations — Determ API docs",
          "url": "https://developers.determ.com/api/locations"
        },
        "x-rate-limit": {
          "limit": "100 req/60s",
          "scope": "Per IP"
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationList"
                },
                "example": {
                  "locations": [
                    {
                      "code": "US",
                      "name": "United States"
                    },
                    {
                      "code": "HR",
                      "name": "Croatia"
                    },
                    {
                      "code": "GB",
                      "name": "United Kingdom"
                    },
                    {
                      "code": "DE",
                      "name": "Germany"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{organizationId}/tags": {
      "get": {
        "tags": [
          "Tags"
        ],
        "summary": "List Tags",
        "description": "Returns all tags of an organization, or only the tags whose IDs you pass.\n\n**Rate limit:** 100 req/s (per user)",
        "operationId": "listTags",
        "externalDocs": {
          "description": "List Tags — Determ API docs",
          "url": "https://developers.determ.com/api/list-tags"
        },
        "x-rate-limit": {
          "limit": "100 req/s",
          "scope": "Per user"
        },
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the organization (int64)."
          },
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int64"
              },
              "uniqueItems": true
            },
            "description": "Comma-separated list of tag IDs to return (int64 values). Omit it to return every tag in the organization."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagList"
                },
                "example": {
                  "tags": [
                    {
                      "id": 1,
                      "name": "Important"
                    },
                    {
                      "id": 2,
                      "name": "Reviewed"
                    },
                    {
                      "id": 3,
                      "name": "Follow-up"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{organizationId}/keywords": {
      "post": {
        "tags": [
          "Keywords"
        ],
        "summary": "Create Keyword",
        "description": "Creates a new keyword (monitoring query) within the specified organization.\n\n**Rate limit:** 2 req/10s (per user)",
        "operationId": "createKeyword",
        "externalDocs": {
          "description": "Create Keyword — Determ API docs",
          "url": "https://developers.determ.com/api/create-keyword"
        },
        "x-rate-limit": {
          "limit": "2 req/10s",
          "scope": "Per user"
        },
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the organization (int64)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeywordRequest"
              },
              "example": {
                "groupId": 456,
                "name": "Tesla Mentions",
                "keyword": {
                  "naturalQuery": "Tesla OR \"Elon Musk\"",
                  "naturalFilters": "not_author:\"Tesla Fan Club\"",
                  "mayLangs": [
                    "en",
                    "de"
                  ],
                  "maySourceTypes": [
                    "WEB",
                    "TWITTER",
                    "FACEBOOK"
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Keyword"
                },
                "example": {
                  "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"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{organizationId}/keywords/{keywordId}": {
      "delete": {
        "tags": [
          "Keywords"
        ],
        "summary": "Delete Keyword",
        "description": "Permanently deletes a keyword and every mention collected under it.\n\n**Rate limit:** 100 req/60s (per user)",
        "operationId": "deleteKeyword",
        "externalDocs": {
          "description": "Delete Keyword — Determ API docs",
          "url": "https://developers.determ.com/api/delete-keyword"
        },
        "x-rate-limit": {
          "limit": "100 req/60s",
          "scope": "Per user"
        },
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the organization (int64)."
          },
          {
            "name": "keywordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the keyword to delete (int64)."
          }
        ],
        "responses": {
          "200": {
            "description": "Success — empty response body.",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{organizationId}/keywords/{keywordId}/mentions/count": {
      "post": {
        "tags": [
          "Mentions"
        ],
        "summary": "Count by Keyword",
        "description": "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.\n\n**Rate limit:** 100 req/60s (per user, shared bucket)",
        "operationId": "countMentionsByKeyword",
        "externalDocs": {
          "description": "Count by Keyword — Determ API docs",
          "url": "https://developers.determ.com/api/count-by-keyword"
        },
        "x-rate-limit": {
          "limit": "100 req/60s",
          "scope": "Per user, shared bucket"
        },
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the organization."
          },
          {
            "name": "keywordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the keyword to count mentions for."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CountMentionsRequest"
              },
              "example": {
                "query": {
                  "publishedTime": {
                    "relative": "LAST_30_DAYS"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountMentionsResponse"
                },
                "example": {
                  "count": 1523,
                  "typeToCount": {
                    "WEB": 890,
                    "TWITTER": 423,
                    "FACEBOOK": 210
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestPlain"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundPlain"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{organizationId}/groups/{groupId}/mentions/count": {
      "post": {
        "tags": [
          "Mentions"
        ],
        "summary": "Count by Group",
        "description": "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.\n\n**Rate limit:** 100 req/60s (per user, shared bucket)",
        "operationId": "countMentionsByGroup",
        "externalDocs": {
          "description": "Count by Group — Determ API docs",
          "url": "https://developers.determ.com/api/count-by-group"
        },
        "x-rate-limit": {
          "limit": "100 req/60s",
          "scope": "Per user, shared bucket"
        },
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the organization."
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the group to count mentions for."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CountMentionsRequest"
              },
              "example": {
                "query": {
                  "publishedTime": {
                    "relative": "LAST_30_DAYS"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountMentionsResponse"
                },
                "example": {
                  "count": 1523,
                  "typeToCount": {
                    "WEB": 890,
                    "TWITTER": 423,
                    "FACEBOOK": 210
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestPlain"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundPlain"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{organizationId}/keywords/{keywordId}/mentions/scroll": {
      "post": {
        "tags": [
          "Mentions"
        ],
        "summary": "Scroll by Keyword",
        "description": "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.\n\n**Rate limit:** 100 req/60s (per user, shared bucket)",
        "operationId": "scrollMentionsByKeyword",
        "externalDocs": {
          "description": "Scroll by Keyword — Determ API docs",
          "url": "https://developers.determ.com/api/scroll-by-keyword"
        },
        "x-rate-limit": {
          "limit": "100 req/60s",
          "scope": "Per user, shared bucket"
        },
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the organization."
          },
          {
            "name": "keywordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the keyword to scroll mentions for."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrollMentionsRequest"
              },
              "example": {
                "query": {
                  "publishedTime": {
                    "relative": "LAST_30_DAYS"
                  }
                },
                "paged": {
                  "count": 30,
                  "sorted": {
                    "direction": "DESC",
                    "property": "PUBLISHED_TIME"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScrollMentionsResponse"
                },
                "example": {
                  "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..."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestPlain"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundPlain"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/organizations/{organizationId}/groups/{groupId}/mentions/scroll": {
      "post": {
        "tags": [
          "Mentions"
        ],
        "summary": "Scroll by Group",
        "description": "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.\n\n**Rate limit:** 100 req/60s (per user, shared bucket)",
        "operationId": "scrollMentionsByGroup",
        "externalDocs": {
          "description": "Scroll by Group — Determ API docs",
          "url": "https://developers.determ.com/api/scroll-by-group"
        },
        "x-rate-limit": {
          "limit": "100 req/60s",
          "scope": "Per user, shared bucket"
        },
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the organization."
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The unique identifier of the group to scroll mentions for."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrollMentionsRequest"
              },
              "example": {
                "query": {
                  "publishedTime": {
                    "relative": "LAST_30_DAYS"
                  }
                },
                "paged": {
                  "count": 30,
                  "sorted": {
                    "direction": "DESC",
                    "property": "PUBLISHED_TIME"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Rate-Limit-Remaining": {
                "description": "Remaining tokens in this endpoint’s rate limit bucket.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScrollMentionsResponse"
                },
                "example": {
                  "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..."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestPlain"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundPlain"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "token",
        "description": "Static per-user API token. No OAuth flow, no refresh."
      }
    },
    "schemas": {
      "AuthorFilter": {
        "description": "An author to include (`mayAuthors`) or exclude (`notAuthors`).",
        "type": "object",
        "properties": {
          "author": {
            "type": "string",
            "description": "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](https://developers.determ.com/api/create-keyword#how-author-matching-works)."
          },
          "caseSensitive": {
            "type": "boolean",
            "description": "Match the exact casing of `author`. Defaults to `false` (case-insensitive).",
            "default": false
          }
        }
      },
      "CountMentionsRequest": {
        "type": "object",
        "properties": {
          "query": {
            "$ref": "#/components/schemas/MentionQuery",
            "description": "Search criteria for the mentions to count."
          }
        },
        "required": [
          "query"
        ]
      },
      "CountMentionsResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "Total number of mentions matching the query for this keyword"
          },
          "typeToCount": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Breakdown of mention counts by source type. Keys are source type strings (e.g. `WEB`, `TWITTER`), values are counts."
          }
        }
      },
      "CreateKeywordRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "integer",
            "format": "int64",
            "description": "The ID of the group to add the keyword to (int64)."
          },
          "name": {
            "type": "string",
            "description": "Display name for the keyword."
          },
          "keyword": {
            "$ref": "#/components/schemas/KeywordDefinition",
            "description": "Keyword definition object containing the search query and filters. See keyword object fields below."
          },
          "historySearch": {
            "$ref": "#/components/schemas/HistorySearch",
            "description": "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."
          }
        },
        "required": [
          "groupId",
          "keyword",
          "name"
        ]
      },
      "Feed": {
        "description": "A keyword within a group — the unit a mention search is scoped to.",
        "type": "object",
        "properties": {
          "groupId": {
            "type": "integer",
            "format": "int64",
            "description": "The group to search in."
          },
          "keywordId": {
            "type": "integer",
            "format": "int64",
            "description": "The keyword to search in."
          }
        }
      },
      "Group": {
        "description": "A group of keywords inside an organization.",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the group"
          },
          "name": {
            "type": "string",
            "description": "Display name of the group"
          },
          "color": {
            "type": "string",
            "description": "Group color (legacy hex value)"
          },
          "colorNew": {
            "type": "string",
            "description": "Group color (current palette value)"
          },
          "public": {
            "type": "boolean",
            "description": "Whether the group is visible to all organization members"
          },
          "keywordIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "IDs of the keywords in the group"
          },
          "memberIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "uniqueItems": true,
            "description": "IDs of the users who are members of the group"
          },
          "invitedUsers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvitedUser"
            },
            "uniqueItems": true,
            "description": "Users invited to the group but not yet accepted"
          }
        }
      },
      "HistorySearch": {
        "description": "The history search made when the keyword is created (mt-backend#1975). Leave it out to search the full history (the last 80 days).",
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Set to `false` to skip the history search. Defaults to `true`. Cannot be combined with `from` or `to`."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "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": {
            "type": "string",
            "format": "date-time",
            "description": "Search only mentions published at or before this time. Defaults to now. Must not be in the future."
          }
        }
      },
      "IdSetFilterClause": {
        "description": "Filter clause over a set of numeric IDs.",
        "type": "object",
        "properties": {
          "any": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "uniqueItems": true
          },
          "all": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "uniqueItems": true
          },
          "must": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "uniqueItems": true
          },
          "not": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "uniqueItems": true
          }
        }
      },
      "IntegerRange": {
        "description": "Inclusive integer range.",
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "format": "int64",
            "description": "Lower bound."
          },
          "to": {
            "type": "integer",
            "format": "int64",
            "description": "Upper bound."
          }
        }
      },
      "IntegerRangeFilterClause": {
        "description": "Filter clause over an integer range.",
        "type": "object",
        "properties": {
          "any": {
            "$ref": "#/components/schemas/IntegerRange"
          },
          "all": {
            "$ref": "#/components/schemas/IntegerRange"
          },
          "must": {
            "$ref": "#/components/schemas/IntegerRange"
          },
          "not": {
            "$ref": "#/components/schemas/IntegerRange"
          }
        }
      },
      "InvitedUser": {
        "description": "A user invited to a group who has not accepted yet.",
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email address of the invited user"
          },
          "roleId": {
            "type": "string",
            "description": "Identifier of the role the user is invited with"
          }
        }
      },
      "Keyword": {
        "description": "A keyword (monitoring query).",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the created keyword"
          },
          "name": {
            "type": "string",
            "description": "Display name of the keyword"
          },
          "color": {
            "type": "string",
            "description": "Hex color code assigned to the keyword"
          },
          "naturalQuery": {
            "type": "string",
            "description": "The search query as provided in the request"
          },
          "editedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of the last edit to the keyword"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of when the keyword was created"
          },
          "active": {
            "type": "boolean",
            "description": "Whether the keyword is actively monitoring"
          },
          "historySearchCoverage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimeInterval"
            },
            "description": "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](https://developers.determ.com/api/create-keyword#history-search)."
          }
        }
      },
      "KeywordDefinition": {
        "description": "Search query and filters for a keyword. Additional advanced filter fields exist beyond the ones documented here — contact support for details.",
        "type": "object",
        "properties": {
          "naturalQuery": {
            "type": "string",
            "description": "The search query in natural language. Supports boolean operators like `OR`, `AND`, and quoted phrases."
          },
          "naturalFilters": {
            "type": "string",
            "description": "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](https://developers.determ.com/api/create-keyword#filtering-by-author)."
          },
          "mayAuthors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthorFilter"
            },
            "description": "Only keep mentions written by one of these authors. Each entry is an [Author Object](https://developers.determ.com/api/create-keyword#author-object). Equivalent to `author:` in `naturalFilters`."
          },
          "notAuthors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthorFilter"
            },
            "description": "Exclude mentions written by any of these authors. Each entry is an [Author Object](https://developers.determ.com/api/create-keyword#author-object). Equivalent to `not_author:` in `naturalFilters`."
          },
          "mayLangs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Language codes to include (e.g. `[\"en\", \"de\"]`). Use the [Languages](https://developers.determ.com/api/languages) endpoint to get valid codes."
          },
          "maySourceTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "WEB",
                "FACEBOOK",
                "TWITTER",
                "YOUTUBE",
                "INSTAGRAM",
                "REDDIT",
                "TIKTOK",
                "FORUM",
                "COMMENT",
                "PRINT",
                "RADIO",
                "TV",
                "BLUESKY",
                "THREADS"
              ]
            },
            "description": "Source types to monitor. Allowed values: `WEB`, `FACEBOOK`, `TWITTER`, `FORUM`, `COMMENT`, `YOUTUBE`, `INSTAGRAM`, `REDDIT`, `TIKTOK`, `PRINT`, `RADIO`, `TV`, `BLUESKY`, `THREADS`"
          },
          "mayLocations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Location codes to include (e.g. `[\"US\", \"GB\"]`). Use the [Locations](https://developers.determ.com/api/locations) endpoint to get valid codes."
          }
        }
      },
      "Language": {
        "description": "A language supported for keyword filtering.",
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "ISO language code (e.g. `en`, `hr`, `de`)"
          },
          "name": {
            "type": "string",
            "description": "Human-readable language name in English"
          }
        },
        "required": [
          "code",
          "name"
        ]
      },
      "LanguageList": {
        "type": "object",
        "properties": {
          "languages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Language"
            },
            "description": "List of supported language objects"
          }
        },
        "required": [
          "languages"
        ]
      },
      "Location": {
        "description": "A location supported for keyword filtering.",
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "ISO country code (e.g. `US`, `HR`, `GB`)"
          },
          "name": {
            "type": "string",
            "description": "Human-readable location name in English"
          }
        },
        "required": [
          "code",
          "name"
        ]
      },
      "LocationList": {
        "type": "object",
        "properties": {
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Location"
            },
            "description": "List of supported location objects"
          }
        },
        "required": [
          "locations"
        ]
      },
      "Mention": {
        "description": "A single mention.",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the mention"
          },
          "type": {
            "type": "string",
            "description": "Source type (e.g. `WEB`, `TWITTER`, `FACEBOOK`, `YOUTUBE`)",
            "enum": [
              "WEB",
              "FACEBOOK",
              "TWITTER",
              "YOUTUBE",
              "INSTAGRAM",
              "REDDIT",
              "TIKTOK",
              "FORUM",
              "COMMENT",
              "PRINT",
              "RADIO",
              "TV",
              "BLUESKY",
              "THREADS"
            ]
          },
          "mention": {
            "type": "string",
            "description": "Text snippet of the mention content"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Detected languages of the mention"
          },
          "influencer": {
            "type": "string",
            "description": "Influencer associated with the mention, if any"
          },
          "author": {
            "type": "string",
            "description": "Name or handle of the mention author"
          },
          "insertTime": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp (milliseconds) when the mention was ingested"
          },
          "title": {
            "type": "string",
            "description": "Title of the mention, if available"
          },
          "url": {
            "type": "string",
            "description": "URL where the original mention can be found",
            "format": "uri"
          },
          "image": {
            "type": "string",
            "description": "URL of an associated image, if available",
            "format": "uri"
          },
          "reach": {
            "type": "integer",
            "format": "int32",
            "description": "Estimated audience reach"
          },
          "virality": {
            "type": "number",
            "format": "double",
            "description": "Virality score of the mention"
          },
          "databaseInsertTime": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp (milliseconds) when the mention was stored in the database"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Keywords that matched this mention"
          },
          "locations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Detected geographic locations"
          },
          "autoSentiment": {
            "type": "string",
            "description": "Automatically detected sentiment (`POSITIVE`, `NEUTRAL`, `NEGATIVE`, `UNDEFINED`)",
            "enum": [
              "POSITIVE",
              "NEUTRAL",
              "NEGATIVE",
              "UNDEFINED"
            ]
          },
          "interaction": {
            "type": "integer",
            "format": "int64",
            "description": "Total number of interactions (likes, shares, comments, etc.)"
          },
          "influenceScore": {
            "type": "integer",
            "format": "int64",
            "description": "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#influence-score).",
            "minimum": 1,
            "maximum": 10
          }
        }
      },
      "MentionFilter": {
        "description": "Filters applied on top of the feed and time-range selection. Every field is a filter clause with optional `any`, `all`, `must` and `not` sub-fields.",
        "type": "object",
        "properties": {
          "author": {
            "$ref": "#/components/schemas/StringSetFilterClause",
            "description": "Filter by mention author."
          },
          "authorGender": {
            "$ref": "#/components/schemas/StringSetFilterClause",
            "description": "Filter by detected author gender."
          },
          "engagement": {
            "$ref": "#/components/schemas/NumberRangeFilterClause",
            "description": "Filter by engagement value range."
          },
          "influence": {
            "$ref": "#/components/schemas/IntegerRangeFilterClause",
            "description": "Filter by influence score range."
          },
          "influencer": {
            "$ref": "#/components/schemas/StringSetFilterClause",
            "description": "Filter by influencer."
          },
          "interactions": {
            "$ref": "#/components/schemas/IntegerRangeFilterClause",
            "description": "Filter by total interaction count range."
          },
          "language": {
            "$ref": "#/components/schemas/StringSetFilterClause",
            "description": "Filter by detected language code."
          },
          "location": {
            "$ref": "#/components/schemas/StringSetFilterClause",
            "description": "Filter by detected location code."
          },
          "mentionType": {
            "$ref": "#/components/schemas/SourceTypeFilterClause",
            "description": "Filter by source type. Values: `WEB`, `FACEBOOK`, `TWITTER`, `FORUM`, `COMMENT`, `YOUTUBE`, `INSTAGRAM`, `REDDIT`, `TIKTOK`, `PRINT`, `RADIO`, `TV`, `BLUESKY`, `THREADS`"
          },
          "reach": {
            "$ref": "#/components/schemas/IntegerRangeFilterClause",
            "description": "Filter by estimated reach range."
          },
          "sentiment": {
            "$ref": "#/components/schemas/SentimentFilterClause",
            "description": "Filter by sentiment. Values: `POSITIVE`, `NEUTRAL`, `NEGATIVE`, `UNDEFINED`"
          },
          "tag": {
            "$ref": "#/components/schemas/IdSetFilterClause",
            "description": "Filter by tag ID."
          },
          "text": {
            "$ref": "#/components/schemas/StringFilterClause",
            "description": "Filter by text contained in the mention."
          },
          "virality": {
            "$ref": "#/components/schemas/NumberRangeFilterClause",
            "description": "Filter by virality score range."
          }
        }
      },
      "MentionQuery": {
        "description": "Search criteria: which feeds, which time range, which filters.",
        "type": "object",
        "properties": {
          "feeds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Feed"
            },
            "uniqueItems": true,
            "description": "Array of feed objects with `groupId` (int64) and `keywordId` (int64) to scope the search. Optional — omit to search all feeds."
          },
          "mentionFilter": {
            "$ref": "#/components/schemas/MentionFilter",
            "description": "Filter criteria for narrowing mentions."
          },
          "feedTime": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RelativeTimePeriod"
              },
              {
                "$ref": "#/components/schemas/SpecificTimePeriod"
              }
            ],
            "description": "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."
          },
          "publishedTime": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RelativeTimePeriod"
              },
              {
                "$ref": "#/components/schemas/SpecificTimePeriod"
              }
            ],
            "description": "Time range filter based on when the mention was published. Same structure as `feedTime`. Set this, `feedTime`, or both."
          }
        }
      },
      "NumberRange": {
        "description": "Inclusive decimal range.",
        "type": "object",
        "properties": {
          "from": {
            "type": "number",
            "format": "double",
            "description": "Lower bound."
          },
          "to": {
            "type": "number",
            "format": "double",
            "description": "Upper bound."
          }
        }
      },
      "NumberRangeFilterClause": {
        "description": "Filter clause over a decimal range.",
        "type": "object",
        "properties": {
          "any": {
            "$ref": "#/components/schemas/NumberRange"
          },
          "all": {
            "$ref": "#/components/schemas/NumberRange"
          },
          "must": {
            "$ref": "#/components/schemas/NumberRange"
          },
          "not": {
            "$ref": "#/components/schemas/NumberRange"
          }
        }
      },
      "Organization": {
        "description": "An organization with its groups, keywords, tags and members.",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the organization"
          },
          "name": {
            "type": "string",
            "description": "Display name of the organization"
          },
          "groupIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "IDs of the groups within the organization"
          },
          "userIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "uniqueItems": true,
            "description": "IDs of the users belonging to the organization"
          },
          "timeZone": {
            "type": "string",
            "description": "The organization's time zone (IANA identifier, e.g. `Europe/Zagreb`)"
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Group"
            },
            "description": "Detailed group objects"
          },
          "keywords": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationKeyword"
            },
            "description": "Detailed keyword objects"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "uniqueItems": true,
            "description": "Tag objects associated with the organization"
          },
          "state": {
            "type": "string",
            "enum": [
              "BLOCKED",
              "SUSPENDED",
              "ACTIVE"
            ],
            "description": "Subscription state. One of `BLOCKED`, `SUSPENDED`, `ACTIVE`"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of when the organization was created"
          },
          "currentMonthMentionsLimit": {
            "type": "integer",
            "format": "int64",
            "description": "Mentions limit for the current billing month"
          }
        }
      },
      "OrganizationKeyword": {
        "description": "Summary of a keyword as returned inside an organization.",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the keyword"
          },
          "name": {
            "type": "string",
            "description": "Display name of the keyword"
          },
          "color": {
            "type": "string",
            "description": "Keyword color (legacy hex value)"
          },
          "colorNew": {
            "type": "string",
            "description": "Keyword color (current palette value)"
          },
          "active": {
            "type": "boolean",
            "description": "Whether the keyword is currently active"
          },
          "editedAt": {
            "type": "string",
            "description": "Timestamp of the last edit"
          },
          "createdAt": {
            "type": "string",
            "description": "Timestamp of when the keyword was created"
          }
        }
      },
      "OrganizationRole": {
        "description": "A user's role and permissions within one organization.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Role identifier (e.g. `admin`)"
          },
          "name": {
            "type": "string",
            "description": "Human-readable role name"
          },
          "isAdmin": {
            "type": "boolean",
            "description": "Whether this role has admin privileges"
          },
          "canUpdate": {
            "type": "boolean",
            "description": "Whether this role can update organization settings"
          },
          "canInvite": {
            "type": "boolean",
            "description": "Whether this role can invite new members"
          },
          "canUpdateMentions": {
            "type": "boolean",
            "description": "Whether this role can update mentions"
          }
        }
      },
      "PagedRequest": {
        "description": "Page size and sorting.",
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32",
            "description": "Number of mentions to return per page. Maximum: `1000`.",
            "minimum": 1,
            "maximum": 1000,
            "default": 30
          },
          "sorted": {
            "$ref": "#/components/schemas/Sort",
            "description": "Sorting configuration with `direction` (`ASC` or `DESC`) and `property` (sort field)."
          }
        }
      },
      "RelativeTimePeriod": {
        "description": "A preset time range.",
        "type": "object",
        "properties": {
          "relative": {
            "type": "string",
            "enum": [
              "TODAY",
              "YESTERDAY",
              "LAST_24_HOURS",
              "LAST_7_DAYS",
              "LAST_30_DAYS",
              "LAST_90_DAYS",
              "THIS_MONTH",
              "THIS_WEEK",
              "LAST_WEEK",
              "LAST_MONTH"
            ],
            "description": "Preset period, resolved in the organization time zone."
          }
        }
      },
      "ScrollMentionsRequest": {
        "type": "object",
        "properties": {
          "query": {
            "$ref": "#/components/schemas/MentionQuery",
            "description": "Search criteria for the mentions to return."
          },
          "paged": {
            "$ref": "#/components/schemas/PagedRequest",
            "description": "Pagination and sorting settings."
          },
          "scrollToken": {
            "type": "string",
            "description": "Token from a previous response to fetch the next page of results. Omit on the first request."
          }
        },
        "required": [
          "query"
        ]
      },
      "ScrollMentionsResponse": {
        "type": "object",
        "properties": {
          "mentions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Mention"
            },
            "description": "List of mention objects matching the query for this keyword."
          },
          "scrollToken": {
            "type": "string",
            "description": "Opaque token to pass in the next request to retrieve the following page of results."
          }
        }
      },
      "SentimentFilterClause": {
        "description": "Filter clause over sentiment values.",
        "type": "object",
        "properties": {
          "any": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "POSITIVE",
                "NEUTRAL",
                "NEGATIVE",
                "UNDEFINED"
              ]
            },
            "uniqueItems": true
          },
          "all": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "POSITIVE",
                "NEUTRAL",
                "NEGATIVE",
                "UNDEFINED"
              ]
            },
            "uniqueItems": true
          },
          "must": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "POSITIVE",
                "NEUTRAL",
                "NEGATIVE",
                "UNDEFINED"
              ]
            },
            "uniqueItems": true
          },
          "not": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "POSITIVE",
                "NEUTRAL",
                "NEGATIVE",
                "UNDEFINED"
              ]
            },
            "uniqueItems": true
          }
        }
      },
      "Sort": {
        "description": "Sort order for the returned mentions.",
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "ASC",
              "DESC"
            ],
            "description": "Sort direction."
          },
          "property": {
            "type": "string",
            "enum": [
              "PUBLISHED_TIME",
              "FEED_TIME",
              "REACH",
              "VIRALITY",
              "INTERACTIONS",
              "INFLUENCE",
              "ENGAGEMENT"
            ],
            "description": "Mention field to sort by."
          }
        }
      },
      "SourceTypeFilterClause": {
        "description": "Filter clause over mention source types.",
        "type": "object",
        "properties": {
          "any": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "WEB",
                "FACEBOOK",
                "TWITTER",
                "FORUM",
                "COMMENT",
                "YOUTUBE",
                "INSTAGRAM",
                "REDDIT",
                "TIKTOK",
                "PRINT",
                "RADIO",
                "TV",
                "BLUESKY",
                "THREADS"
              ]
            },
            "uniqueItems": true
          },
          "all": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "WEB",
                "FACEBOOK",
                "TWITTER",
                "FORUM",
                "COMMENT",
                "YOUTUBE",
                "INSTAGRAM",
                "REDDIT",
                "TIKTOK",
                "PRINT",
                "RADIO",
                "TV",
                "BLUESKY",
                "THREADS"
              ]
            },
            "uniqueItems": true
          },
          "must": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "WEB",
                "FACEBOOK",
                "TWITTER",
                "FORUM",
                "COMMENT",
                "YOUTUBE",
                "INSTAGRAM",
                "REDDIT",
                "TIKTOK",
                "PRINT",
                "RADIO",
                "TV",
                "BLUESKY",
                "THREADS"
              ]
            },
            "uniqueItems": true
          },
          "not": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "WEB",
                "FACEBOOK",
                "TWITTER",
                "FORUM",
                "COMMENT",
                "YOUTUBE",
                "INSTAGRAM",
                "REDDIT",
                "TIKTOK",
                "PRINT",
                "RADIO",
                "TV",
                "BLUESKY",
                "THREADS"
              ]
            },
            "uniqueItems": true
          }
        }
      },
      "SpecificTimePeriod": {
        "description": "A custom time range.",
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the range (ISO 8601 date-time), inclusive."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the range (ISO 8601 date-time), exclusive."
          }
        }
      },
      "StringFilterClause": {
        "description": "Filter clause over a single string value.",
        "type": "object",
        "properties": {
          "any": {
            "type": "string"
          },
          "all": {
            "type": "string"
          },
          "must": {
            "type": "string"
          },
          "not": {
            "type": "string"
          }
        }
      },
      "StringSetFilterClause": {
        "description": "Filter clause over a set of string values.",
        "type": "object",
        "properties": {
          "any": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "all": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "must": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "not": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          }
        }
      },
      "Tag": {
        "description": "A tag that can be applied to mentions.",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the tag"
          },
          "name": {
            "type": "string",
            "description": "Display name of the tag"
          }
        }
      },
      "TagList": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "description": "Every tag in the organization, or only the tags matching `ids` when you pass it"
          }
        }
      },
      "TimeInterval": {
        "description": "A period of history a history search has covered.",
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "User": {
        "description": "The authenticated user's profile.",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the user"
          },
          "email": {
            "type": "string",
            "description": "The user's email address"
          },
          "name": {
            "type": "string",
            "description": "The user's display name"
          },
          "createdTime": {
            "type": "integer",
            "format": "int64",
            "description": "Timestamp of when the user account was created"
          },
          "lastLoginTime": {
            "type": "integer",
            "format": "int64",
            "description": "Timestamp of the user's most recent login"
          },
          "languageCode": {
            "type": "string",
            "description": "The user's preferred language code (e.g. `en`, `hr`)"
          },
          "verified": {
            "type": "boolean",
            "description": "Whether the user's email has been verified"
          },
          "organizationIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "List of organization IDs the user belongs to"
          },
          "organizationRoles": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/OrganizationRole"
            },
            "description": "Map of organization ID to the user's role in that organization"
          }
        }
      },
      "ProblemDetail": {
        "type": "object",
        "description": "Error response in [RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807) format. See [Errors & Rate Limits](https://developers.determ.com/errors).",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri-reference",
            "description": "Always `about:blank` — no custom problem type URIs are emitted.",
            "example": "about:blank"
          },
          "title": {
            "type": "string",
            "description": "The HTTP reason phrase."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status code."
          },
          "detail": {
            "type": "string",
            "description": "Human-readable error message."
          },
          "instance": {
            "type": "string",
            "description": "The request path."
          },
          "code": {
            "type": "string",
            "description": "Domain error code on handled domain exceptions, always upper case (e.g. `INVALID_PARAM`, `NOT_EXISTS`, `ILLEGAL_PERMISSION`, `ILLEGAL_PARAM`). Absent on framework errors."
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Malformed request — bad parameter, missing parameter or invalid JSON body.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetail"
            },
            "example": {
              "type": "about:blank",
              "title": "Bad Request",
              "status": 400,
              "detail": "Invalid parameter: from",
              "instance": "/v2/organizations/100/keywords",
              "code": "INVALID_PARAM"
            }
          }
        }
      },
      "BadRequestPlain": {
        "description": "Malformed request — bad parameter, missing parameter or invalid JSON body.\n\nThe mention count and scroll endpoints return a plain `text/plain` body with just the error message instead of the JSON problem document. Handle both.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetail"
            },
            "example": {
              "type": "about:blank",
              "title": "Bad Request",
              "status": 400,
              "detail": "Invalid parameter: from",
              "instance": "/v2/organizations/100/keywords",
              "code": "INVALID_PARAM"
            }
          },
          "text/plain": {
            "schema": {
              "type": "string"
            },
            "example": "Keyword 12345 does not exist"
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication token is missing or invalid.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetail"
            },
            "example": {
              "type": "about:blank",
              "title": "Unauthorized",
              "status": 401,
              "detail": "Missing Authentication Token",
              "instance": "/v2/organizations/100/keywords"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The token is valid but lacks permission for this resource.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetail"
            },
            "example": {
              "type": "about:blank",
              "title": "Forbidden",
              "status": 403,
              "detail": "User does not have access to organization",
              "instance": "/v2/organizations/100/keywords",
              "code": "ILLEGAL_PERMISSION"
            }
          }
        }
      },
      "NotFound": {
        "description": "The requested resource does not exist.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetail"
            },
            "example": {
              "type": "about:blank",
              "title": "Not Found",
              "status": 404,
              "detail": "Keyword 12345 does not exist",
              "instance": "/v2/organizations/100/keywords",
              "code": "NOT_EXISTS"
            }
          }
        }
      },
      "NotFoundPlain": {
        "description": "The requested resource does not exist.\n\nThe mention count and scroll endpoints return a plain `text/plain` body with just the error message instead of the JSON problem document. Handle both.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetail"
            },
            "example": {
              "type": "about:blank",
              "title": "Not Found",
              "status": 404,
              "detail": "Keyword 12345 does not exist",
              "instance": "/v2/organizations/100/keywords",
              "code": "NOT_EXISTS"
            }
          },
          "text/plain": {
            "schema": {
              "type": "string"
            },
            "example": "Keyword 12345 does not exist"
          }
        }
      },
      "Conflict": {
        "description": "The request conflicts with the current state of the resource.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetail"
            },
            "example": {
              "type": "about:blank",
              "title": "Conflict",
              "status": 409,
              "detail": "Already exists",
              "instance": "/v2/organizations/100/keywords",
              "code": "ILLEGAL_PARAM"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate limit exceeded. Wait the number of seconds in `X-Rate-Limit-Retry-After-Seconds`, then retry.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetail"
            },
            "example": {
              "type": "about:blank",
              "title": "Too Many Requests",
              "status": 429,
              "detail": "No message available",
              "instance": "/v2/organizations/100/keywords"
            }
          }
        },
        "headers": {
          "X-Rate-Limit-Retry-After-Seconds": {
            "description": "Seconds to wait before the next token becomes available.",
            "schema": {
              "type": "integer"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Unexpected server error. Retry after a short delay.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetail"
            },
            "example": {
              "type": "about:blank",
              "title": "Internal Server Error",
              "status": 500,
              "detail": "No message available",
              "instance": "/v2/organizations/100/keywords"
            }
          }
        }
      }
    }
  }
}
