Retrieve AI request

This endpoint retrieves the input details and results of an AI request (e.g. diagram generation, diagram edit) by its unique requestId.

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 for the AI request (obtained from the /api/render/prompts endpoint response).

Note that your API token is specific to a team, so you don't need to specify a team in your request.

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",
      "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",
      "diagramTitle": "User Authentication with 2FA",
      "imageUrl": "https://IMAGE-URL"
    }
  ],
  "mode": "standard"
}
Language
Credentials
Bearer
Click Try It! to start a request and see the response here!