Skip to main content
POST
/
api
/
queries
Create a new query
curl --request POST \
  --url https://api.mentionlab.io/api/queries \
  --header 'Content-Type: application/json' \
  --header 'x-organisation-id: <x-organisation-id>' \
  --header 'x-project-id: <x-project-id>' \
  --data '
{
  "query": "machine learning trends",
  "language": "en",
  "country": "US",
  "tagIds": [
    1,
    2,
    3
  ]
}
'
{
  "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-organisation-id
string
required

Organisation ID to specify the organisation context

x-project-id
string
required

Project ID to specify the project context

Body

application/json
query
string
required

The search query

Example:

"machine learning trends"

language
string
required

Language code (ISO 639-1)

Required string length: 2 - 5
Example:

"en"

country
string
required

Country code (ISO 3166-1 alpha-2)

Required string length: 2
Example:

"US"

tagIds
number[]

List of tag IDs to associate with this query

Example:
[1, 2, 3]

Response

201 - application/json
id
string<uuid>
required
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
Example:

"mentionlab"

language
string
required
Example:

"en"

country
string
required
Example:

"US"

updatedAt
string<date-time>
required
Example:

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