# \_new

Create a Job.

### Parameters

Only two of these parameters are required: customer\_id and meeting\_time.

#### attendees

A stringed JSON object containing two objects:

* emails: an array of email addresses. if the email addresses are of existing users, they should be preceded by the User ID and a colon ':'
* email: the email text to send to the attendees.

#### contract\_id

If this Job is part of a Contract, include the Contract ID.

#### contract\_name

If this Job is part of a Contract but the Contract ID is not known, include the name. If a Contract with this name does not exist, it will be created.

#### customer\_id

The Customer or Asset's ID.

#### customer\_type

'0' for a Customer, '1' for an Asset.

#### department\_id

If this Job is for a specific Department, include the ID.

#### due\_date

What date should this Job be completed by at the latest.

#### form\_id

The ID of the Form which contains this Job's questions.

#### form\_type

'0' for normal Form. '1' for asset rental sign-out, '2' for asset rental sign-in.

#### job\_ref

Textual job reference.

#### meeting\_time

When this Job is for. ISO 8601 should be used for all date formats.

#### user\_id

The User this Job is assigned to, or 0 if not yet assigned.

#### priority

Priority of the Job. Default is 3.

#### form\_num

Optional form number, so you can say for example that this is the 3rd "inspection form" or the 5th "work sheet", etc.

#### form\_values

Stringified JSON object for pre-filling form questions. each question's text is a key in the object.

#### notes

Optional text describing notes for this Job.

#### recurrence

Optional stringified JSON object describing the recurrence of this Job.

#### meta

Optional stringified JSON object. This is usually created by the system itself.

### Example

```
FM_api('Job_new',
	  [
	  'attendees'=>'{"emails":["3928:test3@test3.test3","4657:kae@verens.com"],"email":"test"}',
	  'contract_id'=>'1',
	  'customer_id'=>'100831',
	  'customer_type'=>'0',
	  'department_id'=>'0',
	  'due_date'=>'2015-11-02',
	  'form_id'=>'29',
	  'form_type'=>'0',
	  'job_ref'=>'test create/complete 358',
	  'meeting_time'=>'2015-11-02 16:18',
	  'user_id'=>'3928',
	  'priority'=>'3',
	  'form_num'=>'',
	  'form_values'=>'',
	  'notes'=>'',
	  'recurrence'=>'{"active":0}',
	  'meta'=>'{"test":1}'
	  ]
);
```

### Result

```
{"ok":1,"id":"4657"}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/job/_new.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
