Skip to main content
POST
/
api
/
cached-jobs
/
many
Create many cached jobs for many queries
curl --request POST \
  --url https://api.mentionlab.io/api/cached-jobs/many \
  --header 'Content-Type: application/json' \
  --header 'x-organisation-id: <x-organisation-id>' \
  --header 'x-project-id: <x-project-id>' \
  --data '
{
  "cachedJobs": [
    {
      "queryId": "123e4567-e89b-12d3-a456-426614174000",
      "aiModels": [
        "openai",
        "anthropic",
        "google-generative-ai"
      ],
      "executionCount": 1
    }
  ]
}
'
[
  {
    "id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
    "project": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
    "query_id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
    "query": "mentionlab",
    "aiModels": [
      "gpt-4",
      "claude-2"
    ],
    "executionCount": 5,
    "language": "en",
    "country": "US",
    "status": "active",
    "updatedAt": "2023-08-22T10:00:00.000Z",
    "createdAt": "2023-08-22T10:00:00.000Z",
    "restricted": false
  }
]

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
cachedJobs
object[]
required

Response

201 - application/json
id
string<uuid>
required
Example:

"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"

project
object
required

The project this cached job belongs to

Example:

"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"

query_id
object
required

The query this cached job belongs to

Example:

"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"

query
string
required
Example:

"mentionlab"

aiModels
string[]
required
Example:
["gpt-4", "claude-2"]
executionCount
number
required
Example:

5

language
string
required
Example:

"en"

country
string
required
Example:

"US"

status
enum<string>
required
Available options:
pending,
active,
ended,
inactive
Example:

"active"

updatedAt
string<date-time>
required
Example:

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

createdAt
string<date-time>
required
Example:

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

restricted
boolean
Example:

false