Skip to main content

When to use this

A position is an interview template — it holds a name, one or more questions (steps), an optional outro, and optional intro/outro/question videos. Use createPosition whenever you want to set up a new role programmatically instead of using the Hireflix dashboard. Once a position exists, you invite candidates to it to actually create interviews (see Inviting a Candidate). Videos are optional — you can attach an intro, outro, and/or per-question video, covered in Adding video content to a position below.
If you want a unique video for every question on every position, it’s usually faster to build that position from the Hireflix dashboard — recording and uploading several question videos per position through the API means several reserve-upload round trips per position.The API really shines for bulk-creating positions or interviews where you don’t need a bespoke video per question. A common pattern: record one intro and one outro video, upload each once, and reuse their mediaId across every position you create via the API. You still get a personal-feeling candidate experience (a real face on the intro/outro) without re-uploading video per position.-> Want to run this entirely from a script or backend server? See Bulk-Creating Positions with a Script.

Before you start

Don’t forget to send your Hireflix API Key in the X-API-KEY header to https://api.hireflix.com/me. Unlike updating or archiving a position, creating one needs no prior IDs — createPosition is often the very first mutation you’ll call against the API.

GraphQL Playground

Create examples

Each tab below shows a variation of the same createPosition mutation, from a minimal position to one with tags, an outro, and multiple questions.
The smallest valid position: a name and one question. answerFormat: { video: {} } uses the default recording settings (120s max duration, 30s to think, no retakes).
  • name – required, 1–110 characters.
  • steps – required, at least 1 entry (max 50). Each QA step needs a title and an answerFormat.
  • answerFormat.video – required for a QA step. An empty object {} just means “use the defaults” — no custom duration, thinking time, or retakes.
None of the examples above upload a new video — mediaId fields only reference media that already exists in your account. To upload a video and obtain a real mediaId, follow Adding video content to a position below, then come back and drop the returned mediaId into introVideo, outro.video, or a step’s questionFormat.video.
You can always verify what you created by opening admin.hireflix.com/jobs and searching for the position by name.

Handling the response

createPosition returns a union type — always branch on the possible cases:
  • MutationCreatePositionSuccess – the position was created; read it from data.
  • ValidationError – one or more fields failed validation; inspect fieldErrors for the offending path and message.
  • MediaNotFoundError – a mediaId you referenced (e.g. in introVideo) doesn’t exist, doesn’t belong to your company, or its upload reservation was never completed.
  • MediaFileTooLargeError / MediaFileUploadMimeTypeNotSupportedError / MediaMimeTypeMismatchError – only relevant if you’re referencing a media asset with the wrong type or size for where it’s used.
  • ThemeNotFoundError / UsersNotFoundError / TemplatesNotFoundError – the themeId, users, or notification template IDs you passed don’t exist or aren’t accessible to you.

Key reminders

  • name is required, 1–110 characters.
  • steps is required — at least 1, max 50. Each step currently supports the QA type.
  • public defaults to true if omitted.
  • mediaId fields never upload anything — they only reference media created via a reservePosition*VideoUpload mutation (see below).
  • Verify a position was created by checking admin.hireflix.com/jobs and searching by name.
  • Unsure what maxDurationSeconds, timeToThinkSeconds, or numAllowedRetakes should be set to? See Tailoring the Interview for what each setting means for candidates.

Adding video content to a position

A position can show a video in three places: the intro screen, the outro screen, and a QA question prompt. All three follow the same three-step flow:
  1. Reserve an upload with the matching mutation for that destination.
  2. PUT the video file to the returned presignedPutUrl.
  3. Pass the returned mediaId into createPosition (or updatePosition for an existing position).
Per-question videos are usually easiest to record and upload from the dashboard. If you’re bulk-creating positions via the API, consider uploading just one intro and one outro video and reusing their mediaId across every position — same personal touch, no re-upload per position.
All three take the same input — mimeType (must match video/*, e.g. "video/mp4") and sizeBytes (max 157286400 bytes / 150 MB) — and return the same shape: { mediaId, presignedPutUrl, expiresAt }. expiresAt is roughly 1 hour from the reservation — upload before then, or reserve again.

Uploading the file

Once you have a presignedPutUrl, PUT the raw file to it with a matching Content-Type:
Common pitfalls:
  • Always single-quote the URL. Some shells (zsh in particular, via url-quote-magic) will auto-insert backslashes before ?, =, and & when you paste an unquoted or double-quoted URL, silently corrupting the signature and producing an AccessDenied error. Wrapping it in single quotes ('...') avoids this entirely.
  • Content-Type must exactly match the mimeType you declared when reserving the upload.
  • Upload before expiresAt. If it expires, re-run the reserve mutation for a fresh URL.
  • A successful PUT to the presigned URL returns an empty 200 OK body — check the HTTP status, not the response content.
With the file uploaded, the mediaId from step 1 is ready to use. The tabs below show each reserve mutation paired with the createPosition call that uses its mediaId, followed by a full example combining all three.
1. Reserve the upload:
2. PUT the file to presignedPutUrl (see Uploading the file above).3. Use the mediaId in createPosition:
Open admin.hireflix.com/jobs, find the position by name, and preview it to confirm the intro/outro/question videos play back correctly.

Learn next?

Need to create many positions at once? Let’s learn how to bulk-create positions with a script.