Passer au contenu principal
GET
/
agent
/
{projectId}
/
job
/
{id}
Get agent job
curl --request GET \
  --url https://api.mintlify.com/v2/agent/{projectId}/job/{id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "status": "active",
  "source": {
    "repository": "<string>",
    "ref": "<string>"
  },
  "model": "<string>",
  "prLink": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z"
}
Cet endpoint récupère le statut actuel et les détails d’une tâche agent spécifique. Utilisez-le pour interroger la complétion et récupérer le lien PR une fois que l’agent en crée une.

Statuts des tâches

StatutDescription
activeLa tâche est en cours d’exécution
completedLa tâche s’est terminée avec succès
failedLa tâche a rencontré une erreur
archivedLa tâche a été archivée

Recommandations de polling

  • Interrogez toutes les 5-10 secondes pendant que la tâche est active
  • Arrêtez le polling une fois que le statut est completed, failed ou archived
  • Le champ prLink est rempli une fois que l’agent crée une pull request

Autorisations

Authorization
string
header
requis

The Authorization header expects a Bearer token. Use an admin API key (prefixed with mint_). This is a server-side secret key. Generate one on the API keys page in your dashboard.

Paramètres de chemin

projectId
string
requis

Your project ID. Can be copied from the API keys page in your dashboard.

id
string
requis

The unique identifier of the agent job to retrieve.

Réponse

Agent job details retrieved successfully.

id
string

Unique identifier for the agent job.

status
enum<string>

Current status of the agent job.

Options disponibles:
active,
completed,
archived,
failed
source
object

Information about the source repository.

model
string

The AI model used for this job.

URL of the pull request created by the agent. Null until the PR is created.

createdAt
string<date-time>

Timestamp when the job was created.

archivedAt
string<date-time> | null

Timestamp when the job was archived. Null if still active.