Skip to main content
POST
/
api
/
queries
/
many
Create queries
curl --request POST \
  --url https://api.mentionlab.io/api/queries/many \
  --header 'Content-Type: application/json' \
  --header 'x-project-id: <x-project-id>' \
  --data '
{
  "queries": [
    {
      "query": "machine learning trends",
      "language": "en",
      "country": "US"
    }
  ]
}
'
[
  {
    "id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
    "project": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
    "tags": [
      1,
      2,
      3
    ],
    "query": "mentionlab",
    "language": "en",
    "country": "US",
    "updatedAt": "2023-08-22T10:00:00.000Z"
  }
]

Headers

x-project-id
string
required

Project ID to specify the project context

Body

application/json
queries
object[]
required

List of queries to create in a single batch. Must contain at least one query, and each item is validated against the CreateQueryDto schema.

Example:
[
{
"query": "machine learning trends",
"language": "en",
"country": "US"
}
]

Response

id
string<uuid>
required

Unique identifier (UUID) of the query.

Example:

"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"

project
object
required

The project this query belongs to

Example:

"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"

tags
object
required

The tags IDs this query belongs to

Example:
[1, 2, 3]
query
string
required

The search query text tracked for this entry.

Example:

"mentionlab"

language
string
required

ISO 639-1 language code used to scope the query results.

Example:

"en"

country
string
required

ISO 3166-1 alpha-2 country code used to scope the query results.

Example:

"US"

updatedAt
string<date-time>
required

Timestamp of the last time the query was updated.

Example:

"2023-08-22T10:00:00.000Z"