{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"d7f35db2-e0cb-4747-af32-fa5e37bf3847","name":"Parsel Enterprise API","description":"This is the GraphQL Enterprise API documentation for Parsel. The areas of the Parsel API documented here are all those which underpin the [Parsel application](https://parsel.ai), and which are necessary for automated document processing and analysis. This API is accessible for all Parsel users on an Enterprise plan, or for users on their Enterprise plan trial.\n\nIf you do not have trial or full access to an Enterprise plan, please [contact us](https://page.parsel.ai/enterprise/demo). For more information about the product and use cases, see our [blog posts](https://parsel.ai/blog).\n\nFor any questions about our API, customisable extraction algorithm and integrations, or any other questions, please feel free to [reach out to us](https://page.parsel.ai/contact-us).\n\n# Processing documents workflow\n\nTo process a document, the following three stages must be completed. More detail on each stage can be found in the upcoming sections.\n\n<img src=\"https://content.pstmn.io/696a18f5-4a5e-448b-84ae-e7a1e97665ee/Zmxvd192MS5wbmc=\">\n\n## Authentication\n\nDocument related API requests require a valid authentication token, which you can obtain via the [Sign In](#db44ae09-a37b-4b9a-9462-67454cd6b131) mutation. The authentication token is present in the return type's `token` field.\n\n<img src=\"https://content.pstmn.io/3a6d2bda-4afd-4797-abfc-ae5fa6ba77e9/YXV0aGVudGljYXRpb25fdjEucG5n\">\n\n## Process a document\n\nOnce authenticated, you're ready to process your document. The follow workflow is required to analyse a document and extract all required data automatically.\n\n### Upload a document\n\nTo upload a PDF document and extract data, the following steps are required:\n\n1. Obtain a URL by executing the [generatePresignedUrl](#1195fa56-2c3e-41bb-a806-d575676d3de7) mutation, to which the document will then be uploaded in step 2.\n2. Upload the PDF document with a `PUT` request against the URL obtained from step 1. See [Upload file](#acacc44b-fdee-4df2-b743-9c6c0f41c989) for an example.\n3. After the PDF document is uploaded, initiate the document process by executing the [createDataset](#b0a25516-cd76-4a8b-914d-7f10340590a5) mutation.\n    \n\n<img src=\"https://content.pstmn.io/edb52fba-4ae0-4449-9b3e-bc48bbb7794c/dXBsb2FkX3YxLnBuZw==\">\n\n### Retrieve Outputs\n\nAt any time, you can find out about the progress of a document by executing the [Get dataset](#b20aec04-c38c-4f01-8214-c9cf65ed762d) query.\n\nWhen progress is 100% and the document is processed, the [Get dataset](#1b43e49f-0051-45b6-ae7f-8a65b7eb770b) query will return the extracted data in the form of a URL field, named `presignedUrl`, within the `outputList` parent type, which you can access.\n\n<img src=\"https://content.pstmn.io/963e44d4-f801-42a8-bd22-cc96724e0cb1/cmV0cmlldmVfdjEucG5n\">\n\n### Manage Dataset\n\nOnce a dataset was created, a few endpoints are available to manage the dataset. You can [reprocess](#87034fa2-c1d4-46a1-995f-a6a9f46e7e8d) the dataset if the resulting dataset status is ERROR, [change](#8517628e-6cc0-42b5-9232-9a11ea151d14) the dataset name, [delete](#f25d9eca-2ffa-4aae-8996-ad1195d6d7b2) the dataset permanently and [search](#bfe812ac-0d46-421f-bfff-9da2caedfc4f) through the complete list of datasets.\n\n# Default and US API versions\n\n**If you have a Parsel Enterprise account on Parsel US, please read this section.**\n\nThe code samples and attached environment has all values pre-filled for our default non-us deployment. To make these work with your US account, please follow these steps.\n\n### Postman editor\n\nWhen using Postman, please select and edit the following `Parsel - Documentation Environment` environment variables.\n\n| **Key** | **Value** |\n| --- | --- |\n| public_api_key | da2-h6dkfcbvhzcdzal2cypxkm7rea |\n| api_endpoint | [https://api.us.parsel.ai/graphql](https://api.us.parsel.ai/graphql) |\n\nNow all requests and code samples generated from Postman will work seamlessly with your US account.\n\n## cURL and programming languages\n\nWhen utilising any of the code samples from this documentation page directly, please ensure to replace any occurrence of the x-api-key value with `da2-h6dkfcbvhzcdzal2cypxkm7rea` and the api endpoint with `https://api.us.parsel.ai/graphql`.\n\n# How to interact with the API?\n\nBelow you will find detailed a number of ways you can go about testing out the Parsel API. If you are unfamiliar with API querying, we recommend following the Postman Editor instructions.\n\n### Postman editor\n\nIf not already downloaded and installed you can download the [Postman editor](https://www.postman.com/downloads/).\n\nExecuting API queries through postman is very simple. First you need a local copy of the API collection, which you can obtain by clicking the `Run in Postman` button at the top right of your screen.\n\nOnce you have the postman collection imported, select the supplied environment at the top right of your Postman editor. The name of the environment is: `Parsel - Documentation Environment`.\n\nYour imported collection (which can be selected at the `Collections` tab) is now ready for use. Please see the [Processing documents workflow](#processing-documents-workflow) section above for guidance on the order of requests to be sent.\n\n**Note:** For your convenience all variables you may want to alter for the API GraphQL queries have been split off into the Graphql Variables column, as seen below.\n\n**Note:** When interacting with the authentication requests in Postman, please note that you should set the correct values in the aforementioned Postman environment (`Parsel - Documentation Environment)`. They will then be automatically loaded from your environment into the request's body.\n\n### Performing cURL requests\n\nYou can submit cURL requests from your terminal, the example code you need to alter can be found in the examples column to the right of the detailed API queries below.\n\nHere is a simple run-through of how you would go about modifying the sign-in cURL request.\n\n<img src=\"https://content.pstmn.io/dd563b15-c4b1-4688-8b25-e7dc67a99797/c2lnbl9pbl9leGFtcC5wbmc=\" alt=\"Sign%20in%20example,%20you%20can%20click%20the%20copy%20button%20to%20easily%20copy%20the%20whole%20request\">\n\n``` shell\ncurl --location --request POST 'https://api.parsel.ai/graphql' \\\n--header 'x-api-key: da2-g4vjqusfzzcrvlgligh5owb2rq' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"query\":\"mutation ($email: String!, $password: String!){\\n  signIn(input: {    email: $email,   password: $password  }){\\n    token\\n    refreshToken\\n    firstSignIn\\n  }\\n}\",\"variables\":{\"email\":\"<>\",\"password\":\"<>\"}}'\n\n```\n\nHaving located the example code relating to the Sign in API call, copied above, we then modify the final section where it says variables to reflect our personal log in details. The above request becomes:\n\n``` shell\ncurl --location --request POST 'https://api.parsel.ai/graphql' \\\n--header 'x-api-key: da2-g4vjqusfzzcrvlgligh5owb2rq' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"query\":\"mutation ($email: String!, $password: String!){\\n  signIn(input: {    email: $email,   password: $password  }){\\n    token\\n    refreshToken\\n    firstSignIn\\n  }\\n}\",\"variables\":{\"email\":\"myEmail\",\"password\":\"myPassword\"}}'\n\n```\n\nThis can then be copied and run directly from the terminal.\n\nIf you are successful a response dict will appear in your terminal. The response format can be found under the [Sign in](#db44ae09-a37b-4b9a-9462-67454cd6b131) section.\n\n### Programming languages\n\nFor any other languages you can find auto-generated example requests, similar to the cURL ones, by changing the drop-down box at the top of the page.\n\n<img src=\"https://content.pstmn.io/72e3c4d5-87ae-43ac-81a0-f6c6a60b5456/ZG9jc19kcm9wZG93bi5wbmc=\">\n\n## Response Status Codes\n\nFor your convenience we have included a short description of all possible status codes that will be seen during API usage.\n\n| Response Code | description |\n| --- | --- |\n| 200 | Request Response OK |\n| 401 | Request unauthorised, you will need to sign in or make sure your authentication token is present |\n| 403 | Forbidden, check if the request body is valid |","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"8451015","collectionId":"d7f35db2-e0cb-4747-af32-fa5e37bf3847","publishedId":"TWDakuiH","public":true,"publicUrl":"https://docs.parsel.ai","privateUrl":"https://go.postman.co/documentation/8451015-d7f35db2-e0cb-4747-af32-fa5e37bf3847","customColor":{"top-bar":"FFFFFF","right-sidebar":"0E2331","highlight":"4D2F9B"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.0","publishDate":"2022-10-31T16:44:44.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"Parsel - Documentation Environment","id":"311a871d-e92b-46a3-9910-f19268aa7323","owner":"13259153","values":[{"key":"public_api_key","value":"da2-g4vjqusfzzcrvlgligh5owb2rq","enabled":true},{"key":"email","value":"<<Placeholder user email>>","enabled":true},{"key":"password","value":"<<Placeholder password>>","enabled":true},{"key":"api_endpoint","value":"https://api.parsel.ai/graphql","enabled":true}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":"https://parsel.ai/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Parsel - Documentation Environment","value":"13259153-311a871d-e92b-46a3-9910-f19268aa7323"}],"canonicalUrl":"https://docs.parsel.ai/view/metadata/TWDakuiH"}