# Create an application form

`POST https://api.fiscalisto.com/v1/hiring/forms`

The questions applicants fill in, of any type (text, paragraph, number, date, list, multiple choice, yes or no, email, phone, link or file), required or optional, with their rules and which ones are requirements. nombre and correo are always included. A question the Federal Labor Law doesn't allow asking (art. 133: age, gender, marital status, pregnancy…) is saved, but the app flags it.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | header |  | Optional (the SDKs send it on their own). If the response is lost, repeat the request with the same value within 24 hours: it answers the same, with idempotent-replayed: true, and doesn't do it twice (it doesn't create, send emails or charge). |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `issuer` | string |  | The issuer (iss_…). It can be left out if the key or the account has only one. |
| `name` | string | yes | What your team calls it. (up to 80 characters) |
| `questions` | array of object | yes | Its questions, in order. nombre and correo are always included (if you don't send them, they are added at the start). (up to 60) |
| `questions[].id` | string |  | Its key in the form and in the answers; by default it comes from label. The standard ones: nombre, correo, telefono and cv. (up to 60 characters) |
| `questions[].label` | string | yes | The question, as the applicant reads it. (up to 200 characters) |
| `questions[].help` | string or null |  | Help text under the field. |
| `questions[].type` | `text`, `longtext`, `number`, `date`, `select`, `multiselect`, `yesno`, `email`, `phone`, `url`, `file` | yes | text, longtext (paragraph), number, date, select (one from the list), multiselect (several), yesno, email, phone, url or file (one file). |
| `questions[].required` | boolean | yes | Whether it can't be left blank. |
| `questions[].options` | array of string |  | The options of select and multiselect. (up to 50) |
| `questions[].files` | array of `pdf`, `image`, `doc` |  | Which files a file question accepts: pdf, image (JPG, PNG), doc (.docx). Up to 10 MB. |
| `questions[].rules` | object or null |  | What is checked in the answer (length, format, minimum, maximum, dates, example). |
| `questions[].rules.min_length` | integer or null |  | Text: minimum number of characters. |
| `questions[].rules.max_length` | integer or null |  | Text: maximum number of characters. |
| `questions[].rules.format` | `any`, `digits`, `alnum` or null |  | Text: any, digits (numbers only) or alnum (letters and numbers). |
| `questions[].rules.min` | number or null |  | Number: the smallest. |
| `questions[].rules.max` | number or null |  | Number: the largest. |
| `questions[].rules.integer` | boolean or null |  | Number: no decimals. |
| `questions[].rules.dates` | `any`, `past`, `future`, `between` or null |  | Date: any, past (with days, no older than that many days), future (with days, at least that many days ahead) or between (between from and to). |
| `questions[].rules.days` | integer or null |  | Date: the days for past or future. |
| `questions[].rules.from` | string or null |  | Date: from (YYYY-MM-DD), with between. |
| `questions[].rules.to` | string or null |  | Date: to (YYYY-MM-DD), with between. |
| `questions[].rules.example` | string or null |  | El ejemplo que se ve dentro de la caja vacía. |
| `questions[].requirement` | object or null |  | Whether it is a requirement: someone who doesn't meet it is flagged or warned before sending, as unmet_requirements says. |
| `questions[].requirement.answers` | array of string |  | The answers that meet it: ["si"] or ["no"] in a yesno, options in select and multiselect. (up to 50) |
| `questions[].requirement.min` | number or null |  | In a number, the minimum that meets it (years of experience…). |

Example:

```json
{
  "name": "Operaciones",
  "questions": [
    {
      "id": "nombre",
      "label": "Nombre completo",
      "type": "text",
      "required": true
    },
    {
      "id": "correo",
      "label": "Correo",
      "type": "email",
      "required": true
    },
    {
      "id": "cv",
      "label": "Currículum (CV)",
      "type": "file",
      "required": true,
      "files": [
        "pdf",
        "doc"
      ]
    },
    {
      "label": "Años de experiencia en logística",
      "type": "number",
      "required": true,
      "rules": {
        "min": 0,
        "max": 50,
        "integer": true
      },
      "requirement": {
        "min": 2
      }
    }
  ]
}
```

## With the TypeScript SDK

```ts
import { Fiscalisto } from "fiscalisto";

// La llave viene de FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const jobForm = await fiscalisto.hiring.createForm({
  name: "Operaciones",
  questions: [
    {
      id: "nombre",
      label: "Nombre completo",
      type: "text",
      required: true,
    },
    {
      id: "correo",
      label: "Correo",
      type: "email",
      required: true,
    },
    {
      id: "cv",
      label: "Currículum (CV)",
      type: "file",
      required: true,
      files: ["pdf", "doc"],
    },
    {
      label: "Años de experiencia en logística",
      type: "number",
      required: true,
      rules: { min: 0, max: 50, integer: true },
      requirement: { min: 2 },
    },
  ],
}, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

# La llave viene de FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

job_form = fiscalisto.hiring.create_form({
    "name": "Operaciones",
    "questions": [
        {
            "id": "nombre",
            "label": "Nombre completo",
            "type": "text",
            "required": True,
        },
        {
            "id": "correo",
            "label": "Correo",
            "type": "email",
            "required": True,
        },
        {
            "id": "cv",
            "label": "Currículum (CV)",
            "type": "file",
            "required": True,
            "files": ["pdf", "doc"],
        },
        {
            "label": "Años de experiencia en logística",
            "type": "number",
            "required": True,
            "rules": {
                "min": 0,
                "max": 50,
                "integer": True,
            },
            "requirement": {"min": 2},
        },
    ],
}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$jobForm = $fiscalisto->hiring->createForm([
    'name' => 'Operaciones',
    'questions' => [
        [
            'id' => 'nombre',
            'label' => 'Nombre completo',
            'type' => 'text',
            'required' => true,
        ],
        [
            'id' => 'correo',
            'label' => 'Correo',
            'type' => 'email',
            'required' => true,
        ],
        [
            'id' => 'cv',
            'label' => 'Currículum (CV)',
            'type' => 'file',
            'required' => true,
            'files' => ['pdf', 'doc'],
        ],
        [
            'label' => 'Años de experiencia en logística',
            'type' => 'number',
            'required' => true,
            'rules' => [
                'min' => 0,
                'max' => 50,
                'integer' => true,
            ],
            'requirement' => ['min' => 2],
        ],
    ],
], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var jobForm = await fiscalisto.Hiring.CreateFormAsync(new CreateJobFormParams
{
    Name = "Operaciones",
    Questions = new()
    {
        new()
        {
            Id = "nombre",
            Label = "Nombre completo",
            Type = "text",
            Required = true,
        },
        new()
        {
            Id = "correo",
            Label = "Correo",
            Type = "email",
            Required = true,
        },
        new()
        {
            Id = "cv",
            Label = "Currículum (CV)",
            Type = "file",
            Required = true,
            Files = new() { "pdf", "doc" },
        },
        new()
        {
            Label = "Años de experiencia en logística",
            Type = "number",
            Required = true,
            Rules = new() { Min = 0, Max = 50, Integer = true },
            Requirement = new() { Min = 2 },
        },
    },
}, new RequestOptions { IdempotencyKey = "pedido-A-1042" });
```

## With the Go SDK

```go
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// La llave viene de FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	jobForm, err := client.Hiring.CreateForm(ctx, &fiscalisto.CreateJobFormParams{
		Name: "Operaciones",
		Questions: []fiscalisto.CreateJobFormParamsQuestion{
			{
				ID:       fiscalisto.String("nombre"),
				Label:    "Nombre completo",
				Type:     "text",
				Required: true,
			},
			{
				ID:       fiscalisto.String("correo"),
				Label:    "Correo",
				Type:     "email",
				Required: true,
			},
			{
				ID:       fiscalisto.String("cv"),
				Label:    "Currículum (CV)",
				Type:     "file",
				Required: true,
				Files:    []string{"pdf", "doc"},
			},
			{
				Label:    "Años de experiencia en logística",
				Type:     "number",
				Required: true,
				Rules: &fiscalisto.CreateJobFormParamsQuestionRules{
					Min:     fiscalisto.Float64(0),
					Max:     fiscalisto.Float64(50),
					Integer: fiscalisto.Bool(true),
				},
				Requirement: &fiscalisto.CreateJobFormParamsQuestionRequirement{
					Min: fiscalisto.Float64(2),
				},
			},
		},
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(jobForm.ID)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.CreateJobFormParams;
import com.fiscalisto.model.CreateJobFormParamsQuestion;
import com.fiscalisto.model.CreateJobFormParamsQuestionRequirement;
import com.fiscalisto.model.CreateJobFormParamsQuestionRules;
import java.util.List;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var jobForm = fiscalisto.hiring().createForm(new CreateJobFormParams()
        .setName("Operaciones")
        .setQuestions(List.of(
                new CreateJobFormParamsQuestion()
                        .setId("nombre")
                        .setLabel("Nombre completo")
                        .setType("text")
                        .setRequired(true),
                new CreateJobFormParamsQuestion()
                        .setId("correo")
                        .setLabel("Correo")
                        .setType("email")
                        .setRequired(true),
                new CreateJobFormParamsQuestion()
                        .setId("cv")
                        .setLabel("Currículum (CV)")
                        .setType("file")
                        .setRequired(true)
                        .setFiles(List.of("pdf", "doc")),
                new CreateJobFormParamsQuestion()
                        .setLabel("Años de experiencia en logística")
                        .setType("number")
                        .setRequired(true)
                        .setRules(new CreateJobFormParamsQuestionRules()
                                .setMin(0)
                                .setMax(50)
                                .setInteger(true))
                        .setRequirement(new CreateJobFormParamsQuestionRequirement()
                                .setMin(2))
        )), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(jobForm.getId());
```

## Response 201

OK.

A `JobForm` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The form (jbf_…). |
| `object` | `"job_form"` | yes | What kind of object it is («invoice», «customer»…). |
| `name` | string | yes | Name. |
| `questions` | array of object | yes | Its questions, in order. |
| `questions[].id` | string | yes | Its key: answers are keyed by it. |
| `questions[].label` | string | yes | The question, as the applicant reads it. |
| `questions[].help` | string or null | yes | The help text under the field. |
| `questions[].type` | `text`, `longtext`, `number`, `date`, `select`, `multiselect`, `yesno`, `email`, `phone`, `url`, `file` | yes | Receipt type (TipoDeComprobante): I income, E expense, P payment, T transfer, N payroll. |
| `questions[].required` | boolean | yes | Whether it can't be left blank. |
| `questions[].options` | array of string | yes | Those of select and multiselect. |
| `questions[].files` | array of `pdf`, `image`, `doc` | yes | The files a file question accepts. |
| `questions[].rules` | object or null | yes | What is checked in the answer (min_length, max, dates…). |
| `questions[].requirement` | object or null | yes | If it is a requirement, the answers or the minimum that meet it. |
| `questions[].requirement.answers` | array of string | yes | The answers that meet it. |
| `questions[].requirement.min` | number or null | yes | In a number, the minimum that meets it. |

```json
{
  "id": "jbf_OufpKqnrvx9p8NbVcXzLkJhGfDsAqWeRtY",
  "object": "job_form",
  "name": "Operaciones",
  "questions": [
    {
      "id": "nombre",
      "label": "Nombre completo",
      "help": null,
      "type": "text",
      "required": true,
      "options": [],
      "files": [],
      "rules": null,
      "requirement": null
    },
    {
      "id": "correo",
      "label": "Correo",
      "help": null,
      "type": "email",
      "required": true,
      "options": [],
      "files": [],
      "rules": null,
      "requirement": null
    },
    {
      "id": "telefono",
      "label": "Teléfono",
      "help": null,
      "type": "phone",
      "required": true,
      "options": [],
      "files": [],
      "rules": null,
      "requirement": null
    },
    {
      "id": "cv",
      "label": "Currículum (CV)",
      "help": null,
      "type": "file",
      "required": true,
      "options": [],
      "files": [
        "pdf",
        "doc"
      ],
      "rules": null,
      "requirement": null
    },
    {
      "id": "anos_de_experiencia",
      "label": "Años de experiencia en logística",
      "help": null,
      "type": "number",
      "required": true,
      "options": [],
      "files": [],
      "rules": {
        "min": 0,
        "max": 50,
        "integer": true
      },
      "requirement": {
        "answers": [],
        "min": 2
      }
    },
    {
      "id": "licencia",
      "label": "¿Tiene licencia de manejo vigente?",
      "help": null,
      "type": "yesno",
      "required": true,
      "options": [],
      "files": [],
      "rules": null,
      "requirement": {
        "answers": [
          "si"
        ],
        "min": null
      }
    }
  ]
}
```

## Errors

- `feature_not_in_plan` (403): Live, this part of the API (inventario, portal de proveedores, pedidos, comprobación de gastos) follows the empresa's plan, as in the app: it comes with Operaciones (added to any paid plan; included in Corporativo). The books (the /v1/accounting routes except DIOT, cross checks, IVA refunds and fixed assets) come with Contabilidad (added to Independiente, Emprendedor or Negocio; included in Despacho and Corporativo): without it, changing the books answers this error, and reading them works only up to the last month it had it. Add either in Ajustes › Plan y pagos; test mode has everything.
- `issuer_archived` (400): The issuer is archived and no longer stamps. Its documents can still be read and canceled.
- `issuer_linked_empresa` (403): That issuer is an empresa of the app connected to your account: through the API it only offers its Portal de proveedores (/v1/portal_suppliers and /v1/supplier_invoices) and, once someone who may pay suppliers and change Configurar pagos turned them on, its supplier payouts (/v1/payouts and /v1/payroll_payouts). It also stops when whoever connected it (or turned its payouts on) no longer has that permission in the empresa: message_es says which. Do everything else in the app.
- `issuer_missing` (404): There is no such issuer in the account (or it belongs to the other mode).
- `issuer_not_allowed` (403): This key can't use that issuer.
- `issuer_required` (400): The account has several issuers and the request doesn't say which: send `issuer` (iss_…).
- `livemode_mismatch` (400): The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.
- `resource_missing` (404): There's no object with that id (or it belongs to another issuer or the other mode).

Plus those of any call (key, fields, limits): https://fiscalisto.com/en/docs/api/errores.md.
