Skip to main content

Retrieve Session

URL

GET /v1/sessions/{id}

Description

Get the status and details of a session.

  • If not completed → always returns JSON.
  • If completed → returns either:
    • PDF bytes (Accept: application/pdf)
    • JSON with base64 PDF (Accept: application/json or default)

Request

Path Parameters

  • id (string): The unique identifier of the session.

Headers

  • Authorization (required): Bearer YOUR_API_KEY
  • Accept (required): application/pdf or application/json

Responses

Success Response

  • Code: 200 OK — JSON

    • Content:
      {
      "status": "completed",
      "filled_form_url": "https://instafill.ai/upload-sources?sessionId=...",
      "filled_form_base64": "JVBERi0xLjQK...",
      "statusCode": 200
      }
  • Code: 200 OK — PDF

    • Headers:
      • Content-Type: application/pdf
      • Content-Disposition: attachment; filename="session-{id}.pdf"
    • Body: Raw PDF bytes