# Start importing a resume file

Takes on a resume file and returns at once: reading it and creating the resume run on the server, so a refresh or a closed tab cannot lose an import. Send a PDF as the page images the browser rendered, or a Word document as a base64 string with its media type. Uses 1 credit, handed back if the import fails. Poll the list endpoint for how it ended. Requires authentication.

```http
POST https://hiresweep.com/api/openapi/resumes/imports
x-api-key: YOUR_API_KEY
```

## Request body

```json
{
  "type": "object",
  "properties": {
    "fileName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "The name the person chose the file under."
    },
    "clientId": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "description": "The client whose data this is, for an operator applying on behalf of clients. Omit for your own."
    },
    "source": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "pdf"
            },
            "images": {
              "type": "array",
              "minItems": 1,
              "maxItems": 16,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 8388612
              },
              "description": "The PDF's pages, rendered to base64-encoded PNG images in the browser, in page order."
            }
          },
          "required": [
            "kind",
            "images"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "docx"
            },
            "mediaType": {
              "enum": [
                "application/msword",
                "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
              ],
              "type": "string"
            },
            "file": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "data": {
                  "type": "string",
                  "maxLength": 13981018
                }
              },
              "required": [
                "name",
                "data"
              ]
            }
          },
          "required": [
            "kind",
            "mediaType",
            "file"
          ]
        }
      ]
    }
  },
  "required": [
    "fileName",
    "source"
  ]
}
```

## Responses

- `200`: The id of the import that is now running.
- `402`: 402
- `413`: 413
