---
updatedAt: 2026-07-31T18:03:06.000Z
agentTools:
  projectIndex: https://docs.sensible.so/llms.txt
---

# Get token for review link

Use this endpoint to provide a [reviewer](doc:human-review) with a "magic link" they can use to 
approve, reject, and edit extracted document data without logging into a Sensible account. 
This endpoint's response includes an authorization token you can use to compose the magic link. 
For information about implementing human review, see [Human review implementation](doc:human-review-implementation).
For example, for an extraction id `b84bd1c8-113e-4e1e-8462-379f0dde2abf`, make the following request:

```curl
curl --location 'https://api.sensible.so/v0/account/auth_tokens' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
    "grants": [
        {
            "route": "/documents/{id}",
            "method": "GET",
            "path": {
                "id": "b84bd1c8-113e-4e1e-8462-379f0dde2abf"
            }
        },
        {
            "route": "/extractions/{id}",
            "method": "PUT",
            "path": {
                "id": "b84bd1c8-113e-4e1e-8462-379f0dde2abf"
            }
        }
    ],
    "expires": "2025-01-15T22:14:35.720Z"
}'

```


# OpenAPI definition

````json
{
  "openapi": "3.0.3",
  "servers": [
    {
      "url": "https://api.sensible.so/v0",
      "description": "Production server (uses live data)"
    }
  ],
  "info": {
    "title": "Extraction",
    "version": "0.0.0",
    "license": {
      "name": "Sensible API",
      "url": "https://www.TBD.org/licenses/LICENSE-2.0.html"
    },
    "description": "Extract structured data from documents with the Sensible API."
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Review extractions",
      "description": "Approve, reject, and edit extracted document data"
    }
  ],
  "paths": {
    "/account/auth_tokens": {
      "post": {
        "operationId": "account-auth-tokens",
        "summary": "Get token for review link",
        "description": "Use this endpoint to provide a [reviewer](doc:human-review) with a \"magic link\" they can use to \napprove, reject, and edit extracted document data without logging into a Sensible account. \nThis endpoint's response includes an authorization token you can use to compose the magic link. \nFor information about implementing human review, see [Human review implementation](doc:human-review-implementation).\nFor example, for an extraction id `b84bd1c8-113e-4e1e-8462-379f0dde2abf`, make the following request:\n\n```curl\ncurl --location 'https://api.sensible.so/v0/account/auth_tokens' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: Bearer YOUR_API_KEY' \\\n--data '{\n    \"grants\": [\n        {\n            \"route\": \"/documents/{id}\",\n            \"method\": \"GET\",\n            \"path\": {\n                \"id\": \"b84bd1c8-113e-4e1e-8462-379f0dde2abf\"\n            }\n        },\n        {\n            \"route\": \"/extractions/{id}\",\n            \"method\": \"PUT\",\n            \"path\": {\n                \"id\": \"b84bd1c8-113e-4e1e-8462-379f0dde2abf\"\n            }\n        }\n    ],\n    \"expires\": \"2025-01-15T22:14:35.720Z\"\n}'\n\n```\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "grants": {
                    "$ref": "#/components/schemas/Grants"
                  }
                },
                "required": [
                  "grants"
                ]
              },
              "example": {
                "grants": [
                  {
                    "route": "/documents/{id}",
                    "method": "GET",
                    "path": {
                      "id": "b84bd1c8-113e-4e1e-8462-379f0dde2abf"
                    }
                  },
                  {
                    "route": "/extractions/{id}",
                    "method": "PUT",
                    "path": {
                      "id": "b84bd1c8-113e-4e1e-8462-379f0dde2abf"
                    }
                  }
                ],
                "expires": "2025-01-15T22:14:35.720Z"
              }
            }
          }
        },
        "tags": [
          "Review extractions"
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthTokenResponse"
                }
              }
            },
            "description": "Contains the extraction ID and authorization token you can use to compose the \"magic link\" for the reviewer.  "
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "400": {
        "description": "Bad Request. Sensible returns either a plain-text error message or a structured JSON error, depending on what caused the failure. For more information, see the two content types below.",
        "content": {
          "text/plain": {
            "schema": {
              "title": "Bad Request",
              "type": "string",
              "example": "Either a specific set of messages about fields in the request, or error messages like the following examples - To use the asynchronous flow you must have persistence enabled Specified document type does not exist Specified document type ${named type} does not exist No published configurations found for environment ${environment} Specified golden does not exist Must provide the Content-Type header Missing request body or body.document Could not determine the content type of the document Could not determine the content type of the document. Please check that the document was correctly encoded as Base64 This PDF is invalid. If you submitted this PDF using Base64 encoding, please check that the encoding is correct This PDF is password protected. Please resubmit with password protection disabled This PDF is empty This PDF exceeds the maximum dimensions for OCR of 17 x 17 inches This PDF exceeds the maximum size for OCR of 50MB No fingerprints match for this PDF and fingerprint_mode is set to strict Content type of ${found} does not match declared type of ${expected} The start date must be before the end date"
            }
          },
          "application/json": {
            "schema": {
              "title": "Bad Request (structured)",
              "type": "object",
              "description": "Returned instead of plain text when the request fails path, query, or body validation (for example, a malformed id, an out-of-range limit, or an invalid field in a JSON body), and for the extract_from_url document-fetch failure. The shape of `context` varies by cause: for validation failures, it echoes the offending path and/or query values; for the extract_from_url failure, it's the extraction's current state.",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Human-readable summary of the error."
                },
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Present when the request failed path, query, or body validation -- one message per failing field, in the form '<location>/<field> <reason>'."
                },
                "context": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Additional context about the failure. See the parent description for how this varies by cause."
                }
              },
              "required": [
                "message"
              ]
            },
            "examples": {
              "validationFailure": {
                "summary": "A path parameter failed validation",
                "value": {
                  "message": "This request contains errors",
                  "context": {
                    "path": "/documents/{id}"
                  },
                  "errors": [
                    "path/id should be valid version 4 UUID"
                  ]
                }
              },
              "documentFetchFailure": {
                "summary": "extract_from_url could not download the document",
                "value": {
                  "message": "Transferring the file failed with 'Response code 404 (Not Found)'",
                  "context": {
                    "id": "e75dd6ee-ef8f-4960-8be2-ba22f8c398e3",
                    "created": "2026-07-17T14:39:49.084Z",
                    "completed": "2026-07-17T14:39:49.330Z",
                    "status": "FAILED",
                    "type": "1040s",
                    "environment": "production",
                    "errors": [],
                    "error": "Response code 404:\n404: Not Found",
                    "actor": "legacy: Sensible"
                  }
                }
              }
            }
          }
        }
      },
      "401": {
        "description": "Not authorized",
        "content": {
          "text/plain": {
            "schema": {
              "title": "Unauthorized",
              "type": "string",
              "example": "Unauthorized"
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error",
        "content": {
          "text/plain": {
            "schema": {
              "title": "Sensible encountered an unknown error",
              "type": "string",
              "example": "Sensible encountered an unknown error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Sensible uses API keys to authenticate requests. Keep your API keys secure and do not share them publicly accessible areas such as GitHub, client-side code, etc. Authentication to the API is performed via Bearer Authentication. Provide your API key as the bearer auth value."
      }
    },
    "schemas": {
      "AuthTokenResponse": {
        "type": "object",
        "description": "Contains the extraction ID and authorization token you can use to compose the \"magic link\" for the reviewer.",
        "example": {
          "token": "09b33af4-6811-4d8e-8c56-2f197b8648d6:4174564c-2211-4e42-bcc4-66e025b29728",
          "created": "2025-01-01T18:43:45.532Z",
          "expires": "2025-01-15T22:14:35.720Z",
          "grants": [
            {
              "route": "/documents/{id}",
              "method": "GET",
              "path": {
                "id": "b84bd1c8-113e-4e1e-8462-379f0dde2abf"
              }
            },
            {
              "route": "/documents/{id}",
              "method": "PUT",
              "path": {
                "id": "b84bd1c8-113e-4e1e-8462-379f0dde2abf"
              }
            }
          ],
          "usage": []
        },
        "properties": {
          "token": {
            "type": "string",
            "description": "the authorization token for reviewing this extraction",
            "example": "09b33af4-6811-4d8e-8c56-2f197b8648d6:4174564c-2211-4e42-bcc4-66e025b29728"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "description": "the date-time the token was created",
            "example": "2025-01-01T18:43:45.532Z"
          },
          "expires": {
            "format": "date-time",
            "type": "string",
            "description": "the date-time the token expires.\nSet this to a future date with enough time for the reviewer to complete the review.\nThe maximum value you can set is 30 days.\n",
            "example": "2025-01-15T22:14:35.720Z"
          },
          "grants": {
            "$ref": "#/components/schemas/Grants"
          },
          "created_by": {
            "type": "string",
            "description": "Email of the user who created this token, if created via a logged-in Sensible app session. Absent for tokens created with an API key.",
            "example": "reviewer@example.com"
          },
          "revoked": {
            "type": "string",
            "format": "date-time",
            "description": "The date-time this token was revoked, if it has been."
          },
          "usage": {
            "type": "array",
            "description": "Record of each time this token has been used.",
            "items": {
              "$ref": "#/components/schemas/AuthTokenUsage"
            },
            "example": []
          }
        }
      },
      "AuthTokenUsage": {
        "type": "object",
        "properties": {
          "used": {
            "type": "string",
            "format": "date-time",
            "description": "The date-time this token was used."
          },
          "ip": {
            "type": "string",
            "description": "IP address of the caller that used this token."
          },
          "endpoint": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string",
                "example": "/documents/{id}"
              },
              "method": {
                "type": "string",
                "enum": [
                  "GET",
                  "POST",
                  "PUT",
                  "DELETE"
                ],
                "example": "GET"
              }
            }
          }
        }
      },
      "Grants": {
        "type": "array",
        "description": "At least one grant is required for an authorization token.",
        "minItems": 1,
        "items": {
          "$ref": "#/components/schemas/AuthorizationGrant"
        }
      },
      "AuthorizationGrant": {
        "type": "object",
        "description": "Authorizes the token to call one specific route/method combination. For the human review workflow, typically GET /documents/{id} (to view the extraction) and PUT /extractions/{id} (to submit review edits).",
        "properties": {
          "route": {
            "type": "string",
            "example": "/documents/{id}"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "DELETE"
            ],
            "example": "GET"
          },
          "path": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Path parameter values that scope this grant to a specific resource. Keys are path parameter names from the route; values are the allowed IDs. For example, for route `/documents/{id}`, set `path` to `{\"id\": \"<extraction-id>\"}` to restrict the token to that specific extraction.",
            "example": {
              "id": "b84bd1c8-113e-4e1e-8462-379f0dde2abf"
            }
          }
        },
        "required": [
          "route",
          "method"
        ]
      }
    }
  }
}
````