> ## Documentation Index
> Fetch the complete documentation index at: https://docs.affinda.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.affinda.com/feedback

```json
{
  "path": "/resumes/integration",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Integrate Affinda's Resume Parser

> Integrate Affinda's Resume Parser into your ATS, recruitment platform, or HR system using the API, webhooks, and client libraries with code examples.

Parsing resumes and job descriptions using Affinda is easy using Affinda's simple and flexible REST API. Our [API Reference](/reference/getting-started) provides all the required information to start processing documents programmatically. The guide below provides information that is specific to Recruitment Technology to make it even easier.

## Uploading documents

To make your first API call, you'll need to:

1. **Generate an API key** (*Settings* → *API Keys*)
2. **Retrieve the Workspace identifier** (*Workspace* -> *Workflow* -> *Integrations*)
3. **Retrieve the relevant Document Type identifier** (Document Types -> Resume Parser (or other Document Type) -> Settings)

<CodeGroup>
  ```bash cURL theme={null}
  # 1. Set your API key (found in the Affinda dashboard)
  export AFFINDA_API_KEY="aff_562..."

  # 2. Upload a document and wait for processing to finish
  curl -X POST https://api.affinda.com/v3/documents \
       -H "Authorization: Bearer $AFFINDA_API_KEY" \
       -F "file=@sample_invoice.pdf" \
       -F "workspace=YOUR_WORKSPACE_IDENTIFIER"
       -F "documentType"=YOUR_DOCUMENT_TYPE_IDENTIFIER
  ```

  ```python Python theme={null}
  # !pip install affinda

  from pathlib import Path
  from affinda import AffindaAPI, TokenCredential

  API_KEY = "YOUR_API_KEY"                      # replace with your actual key
  WORKSPACE_ID = "YOUR_WORKSPACE_IDENTIFIER"    # e.g. "vBAdDBer"
  DOCUMENT_TYPE_ID = "YOUR_DOCUMENT_TYPE_IDENTIFIER"  
  FILE_PATH = Path("resume.pdf")                # path to the résumé you want to parse

  # Set up the client
  credential = TokenCredential(token=API_KEY)
  client = AffindaAPI(credential=credential)

  # Upload the document and wait until processing finishes
  with FILE_PATH.open("rb") as f:
      doc = client.create_document(
          file=f,
          workspace=WORKSPACE_ID,
          documentType=DOCUMENT_TYPE_ID,
      )

  # Access parsed data
  print(doc.data)
  ```

  ```javascript Node.js theme={null}
  import { AffindaAPI, AffindaCredential } from "@affinda/affinda";
  import * as fs from "fs";

  const credential = new AffindaCredential("YOUR_API_KEY");
  const client = new AffindaAPI(credential);

  const file = fs.createReadStream("resume.pdf");

  client
    .createDocument({
      file,
      workspace: "YOUR_WORKSPACE_IDENTIFIER",
      documentType: "YOUR_DOCUMENT_TYPE_IDENTIFIER"
    })
    .then(doc => {
      console.log("Parsed data:", doc.data);
    })
    .catch(err => console.error("Error:", err));
  ```
</CodeGroup>

### Optional parameters

The above sample will allow users to upload a document using our default settings. However, users may wish to consider the use of other parameters when setting up their integrations.

<Note>
  The below are commonly used parameters for the Resume Parsing use case. For the full list of parameters, see [Uploading Documents](/reference/upload-options).
</Note>

**Synchronous vs. Asynchronous responses**

Customers can set `wait` to true / false depending if the parsing response needs to be returned synchronously or not.

* **True:** Response will be returned once parsing has completed and will include extracted data
* **False:** Response will be returned immediately with \_meta \_object only (which includes the unique identifier assigned to that document). Extracted data will need to be requested later (either through polling or [webhooks](/reference/webhooks)). Recommended for customers who are bulk uploading.

The default is true (synchronous parsing).

**Document Deletion**

For customers who do not wish to store their documents, options are available:

* **expiryTime:** Document will be automatically deleted at this time
* **deleteAfterParse:** No data is stored, and the document is deleted as soon as it is parsed

**Compact**

By default, the Affinda API will return the full JSON response with associated metadata for each field. To reduce the amount of information in the data object, customers can choose to enable `compact` to return only the parsed value.

**Parsing Time**

For customers where speed of response is a key consideration, additional improvements can be achieved when uploading via API by setting the following parameters:

* **wait:** True
* **enableValidationTool:** False
* **deleteAfterParse:** True
* **compact:** True

**Search & Match integration**

For information about integrating Affinda's Search & Match product, contact Affinda for more details.
