get
https://app.eraser.io/api/ai-requests/
This endpoint retrieves the details and results of a previously executed AI request, such as a diagram generation or diagram edit, using its unique request ID.
An example cURL request is:
curl --location 'https://app.eraser.io/api/ai-requests/$REQUEST-ID' \
--header 'Authorization: Bearer $YOUR-TOKEN-HERE'requestId is the unique identifier of the AI request. This value is returned when you create an AI request using the diagram generation or edit endpoints.
Note that you do not need to explicitly specify a team in the request, since your API token is scoped to a specific team.
An example response is:
{
"id": "abc123def456",
"inputs": [
{
"type": "text",
"text": "Create a sequence diagram for a user authentication flow with 2FA"
}
],
"outputs": [
{
"type": "diagram",
"diagramType": "sequence-diagram",
"diagramTitle": "User Authentication with 2FA",
"code": "User -> Login Page: Navigate\nLogin Page -> Auth Server: Submit credentials\nAuth Server -> User: Request 2FA code\nUser -> Auth Server: Submit 2FA\nAuth Server -> User: Return JWT token",
"imageUrl": "https://IMAGE-URL"
}
],
"mode": "standard"
}
The response includes the original inputs provided to the AI request, along with any generated outputs such as diagram code, metadata, and rendered image URLs.
Full documentation of the endpoint below: