Docs
API reference

Set a job's auto-invite rule

PUT
/api/v1/jobs/{id}/auto-invite

Creates the job's rule or replaces it, and switches it on. By default the rule queues candidates for approval. With mode: invite it invites them itself after holdMinutes; that, a changed wait, a raised cap and any edit to a rule that invites need the auto_invite:manage scope, which only keys created by an admin or owner can hold (auto_invite_admin_required otherwise; the owner's current role is checked on every call). Switching back to queue returns candidates still held to the queue. Changing the criteria raises revision; candidates already queued stay queued. It applies to reports that finish after this call, unless you send applyToExisting as well; that also runs the job's existing finished reports through the rule, and only when this call switches the rule on or loosens it. Preview the effect first with POST /v1/jobs/{id}/auto-invite/preview. Saving the criteria the rule already has changes nothing. A closed job answers job_closed.

Required scope: auto_invite:write.

Errors

  • 400: auto_invite_apply_not_allowed, invalid_content_type, invalid_json, max_credits_required, request_body_too_large, unknown_field
  • 401: authentication_required, invalid_api_key
  • 402: quote_exceeds_max_credits
  • 403: api_access_disabled, auto_invite_admin_required, insufficient_scope
  • 404: job_not_found
  • 409: job_closed
  • 422: invalid_parameter
  • 429: rate_limit_exceeded
  • 500: api_error
  • 503: maintenance_mode, service_unavailable

Authorization

ApiKey
headerAuthorizationBearer <probb_live_<id>_<secret>>

Path Parameters

id*string

The job's ID.

Length1 <= length <= 200

Request Body

application/json
  1. body
criteria*

The bar a finished report must clear to be queued or invited. All conditions must hold.

mode?string

queue (the default for a new rule) queues candidates for approval. invite holds them for holdMinutes and then invites them without asking. Switching to invite needs the auto_invite:manage scope on a key created by an admin or owner. Omit to keep the rule's current mode.

Value in"queue""invite"
holdMinutes?integer

Invite mode: minutes a matching candidate waits before being invited, 0 to 1440 (default 30). Changing it needs auto_invite:manage.

Range0 <= value <= 1440
inviteCap?integer

Invite mode: the most automatic invites on this job, 1 to 500 (default 20). Raising it needs auto_invite:manage; lowering it does not.

Range1 <= value <= 500
applyToExisting?boolean

Also run the job's existing finished reports through the rule, as if they had just finished (at most 1,000, the ones newMatches counts in the preview). Allowed only when this save switches the rule on or loosens it (auto_invite_apply_not_allowed otherwise). In queue mode nothing is spent. In invite mode the candidates who clear the bar are held and invited like any other, up to the cap, which spends credits: send maxCredits, at least the preview's applyQuote.credits.

maxCredits?number

With applyToExisting in invite mode: the most credits applying may cost, at least applyQuote.credits from the preview. Required when the quote is above zero credits (max_credits_required); a lower value fails with quote_exceeds_max_credits and nothing is saved.

Range0 < value <= 1000000

Response Body

Success.

application/json
  1. response
object*string
jobId*string

The job the rule belongs to.

enabled*boolean

False after the rule was switched off. Its criteria are kept; switching it on again with PUT keeps the revision when they are unchanged.

mode*string

queue: candidates who clear the bar wait for a person to approve them (the default). invite: they are held for holdMinutes and then invited automatically, unless a person cancels, the rule changed or inviteCap is reached.

Value in"queue""invite"
holdMinutes*integer

Invite mode: how long a matching candidate waits before the invitation goes out and can still be cancelled, 0 to 1440 minutes. If the wait ends outside 09:00 to 18:00 in timeZone, the invitation goes out at 09:00 the next morning.

Range-9007199254740991 <= value <= 9007199254740991
timeZone*string

The organisation's time zone, an IANA name such as Europe/London (UTC when unset). In invite mode invitations go out between 09:00 and 18:00 in it; a wait that ends at night sends the next morning.

inviteCap*integer

Invite mode: the most automatic invites the rule may send on this job, 1 to 500. It counts invites, not credits, so it holds in every billing mode. Past it, matches are queued for approval instead.

Range-9007199254740991 <= value <= 9007199254740991
autoInvitedCount*integer

Automatic invites the rule has sent on this job so far.

Range-9007199254740991 <= value <= 9007199254740991
criteria*
description*string

The rule as one sentence, such as the app shows it.

revision*integer

Starts at 1 and goes up each time the criteria change. Every evaluation records the revision it used.

Range-9007199254740991 <= value <= 9007199254740991
queuedCount*integer

Candidates waiting for approval on this job.

Range-9007199254740991 <= value <= 9007199254740991
heldCount*integer

Candidates held to be invited automatically, whose invitation can still be cancelled.

Range-9007199254740991 <= value <= 9007199254740991
invitedCount*integer

Queued candidates who were invited, whoever sent the invitation, across every revision of the rule.

Range-9007199254740991 <= value <= 9007199254740991
dismissedCount*integer

Queued candidates a person dismissed, across every revision of the rule.

Range-9007199254740991 <= value <= 9007199254740991
noLongerMatchingCount*integer

Queued candidates the rule as it stands would no longer queue, such as after the bar was raised. Nothing is dismissed automatically: each shows matchesCurrentRule: false in the evaluations, and you can dismiss them with POST .../evaluations/dismiss.

Range-9007199254740991 <= value <= 9007199254740991
appliedToExistingCount*|

PUT with applyToExisting only: how many of the job's existing reports were sent through the rule. Null otherwise.

stats*
updatedAt*string
Formatdate-time
Example Request
# Set PROBB_URL and PROBB_API_KEY. Replace any *_VALUE placeholder and any example ID (such as job_example) with a real one.curl --fail-with-body -X PUT "$PROBB_URL/api/v1/jobs/ID_VALUE/auto-invite" \  -H "Authorization: Bearer $PROBB_API_KEY" \  -H 'Content-Type: application/json' \  --data-binary '{  "criteria": {    "minFitScore": 7.5,    "mustHaves": "partly_or_better",    "whenUnknown": "queue",    "excludeIntegrityReview": true  },  "mode": "invite",  "holdMinutes": 30,  "inviteCap": 20}'
Example Response
{  "object": "auto_invite_rule",  "jobId": "string",  "enabled": true,  "mode": "queue",  "holdMinutes": -9007199254740991,  "timeZone": "string",  "inviteCap": -9007199254740991,  "autoInvitedCount": -9007199254740991,  "criteria": {    "minFitScore": 0,    "mustHaves": "any",    "whenUnknown": "queue",    "excludeIntegrityReview": true  },  "description": "string",  "revision": -9007199254740991,  "queuedCount": -9007199254740991,  "heldCount": -9007199254740991,  "invitedCount": -9007199254740991,  "dismissedCount": -9007199254740991,  "noLongerMatchingCount": -9007199254740991,  "appliedToExistingCount": -9007199254740991,  "stats": {    "byVersion": [      {        "versionId": "string",        "label": "string",        "evaluated": -9007199254740991,        "cleared": -9007199254740991      }    ],    "people": {      "approved": -9007199254740991,      "invitedByRule": -9007199254740991,      "dismissed": -9007199254740991,      "cancelled": -9007199254740991    }  },  "updatedAt": "2019-08-24T14:15:22Z"}