# Submit a candidate

`POST https://{host}/webhooks/account-integration`

Creates the candidate, and the project for `candidate.job.id` if it does not exist yet. Sending the same ids again updates rather than duplicates. A `company` block in the body is ignored; the token decides the account.

## Authentication

`Authorization: Bearer <token>`

The token Refapp issued for your account. It identifies the account, so nothing else is needed.

## Body

application/json, required

- `partner-event`, object, required
  - `id`, string
  - `candidate`, object, required
    - `id`, number | string, required
    - `first-name`, string | null
    - `last-name`, string | null
    - `email`, string | null
    - `phone`, string | null
    - `country-calling-code`, string | null
    - `referees`, array of object | null
      - `first-name`, string | null
      - `last-name`, string | null
      - `email`, string | null
      - `phone`, string | null
      - `country-calling-code`, string | null
      - `language`, string | null
    - `employment-history`, array of object | null
      - `organisation`, string, required: `minLength: 1`
      - `position`, string | null: `minLength: 1`
      - `start`, string, required: `pattern: ^\d{4}-(0[1-9]|1[0-2])$`
      - `end`, string | null: `pattern: ^\d{4}-(0[1-9]|1[0-2])$`
      - `is-current`, boolean | null
    - `recruiter`, object, required
      - `name`, string | null
      - `first-name`, string | null
      - `last-name`, string | null
      - `email`, string, required
      - `phone`, string | null
      - `country-calling-code`, string | null
      - `ats-url`, string | null
      - `external-user-identifier`, string | array of string | null
        - `Alternative 1`, string
        - `Alternative 2`, array of string
    - `job`, object, required
      - `id`, number | string, required
      - `alternate-ids`, array of number | string | null
      - `title`, string, required
      - `private-title`, boolean | null
      - `client-name`, string | null
      - `recruiting-team`, array of object | null
        - `name`, string | null
        - `first-name`, string | null
        - `last-name`, string | null
        - `email`, string, required
        - `phone`, string | null
        - `country-calling-code`, string | null
        - `ats-url`, string | null
        - `external-user-identifier`, string | array of string | null
          - `Alternative 1`, string
          - `Alternative 2`, array of string
      - `ats-url`, string | null
      - `ats-public-key`, string | null
      - `ats-name`, string | null
      - `description`, string | null
    - `language`, string | null
    - `ats-url`, string | null
  - `partner-result`, object, required
    - `id`, string, required
    - `status`, string: One of `"sending"`, `"sent"`, `"pending"`, `"completed"`, `"failed"`
    - `update-url`, string | null
  - `webhook-data`, object | null
    - `(any other key)`, string | boolean | number

### Example body

```json
{
  "partner-event": {
    "id": "string",
    "candidate": {
      "id": 0,
      "first-name": "string",
      "last-name": "string",
      "email": "string",
      "phone": "string",
      "country-calling-code": "string",
      "referees": [
        {
          "first-name": "string",
          "last-name": "string",
          "email": "string",
          "phone": "string",
          "country-calling-code": "string",
          "language": "string"
        }
      ],
      "employment-history": [
        {
          "organisation": "string",
          "position": "string",
          "start": "string",
          "end": "string",
          "is-current": true
        }
      ],
      "recruiter": {
        "name": "string",
        "first-name": "string",
        "last-name": "string",
        "email": "string",
        "phone": "string",
        "country-calling-code": "string",
        "ats-url": "string",
        "external-user-identifier": "string"
      },
      "job": {
        "id": 0,
        "alternate-ids": [
          0
        ],
        "title": "string",
        "private-title": true,
        "client-name": "string",
        "recruiting-team": [
          {
            "name": "string",
            "first-name": "string",
            "last-name": "string",
            "email": "string",
            "phone": "string",
            "country-calling-code": "string",
            "ats-url": "string",
            "external-user-identifier": "string"
          }
        ],
        "ats-url": "string",
        "ats-public-key": "string",
        "ats-name": "string",
        "description": "string"
      },
      "language": "string",
      "ats-url": "string"
    },
    "partner-result": {
      "id": "string",
      "status": "sending",
      "update-url": "string"
    },
    "webhook-data": {}
  }
}
```

## Responses

### 200 (application/json)

Accepted. The body is informational; rely on the status code, not its contents.

- `message`, string
- `info`, object

### 400 (application/json)

The body did not match the schema.

### 401 (text/plain)

The token is missing, unknown, revoked, or the integration is not enabled for the account. All four look the same.
