> For the complete documentation index, see [llms.txt](https://apidocs.zerionsoftware.com/doc/iformbuilder-v80/llms.txt)

# Publish Form as ArcGIS Feature Layer

> POST /profiles/{profile_id}/pages/{page_id}/arcgis/publish
> 
> Publishes the form as a new hosted feature service in the connected account and links the form to its layer `0`. The service has `feature_id`, `latitude` and `longitude`, then one field per element; labels, dividers, subforms, image labels and the Esri widget are left out. Text becomes a string of the element's size, number a double, toggle an integer, range a double with a range domain, and select types a string with a coded-value domain from the option list.
> 
> With `with_existing_data: true` every record with a location in `MODIFIED_LOCATION` becomes a feature; records without one are skipped. The temporary CSV item is deleted once ArcGIS finishes publishing.
> 
> The form is linked only once ArcGIS reports the publish job finished. A job still running after the server's two-minute wait stays `processing` while the server keeps checking it in the background, whether or not anyone polls: it links the form and turns `complete` when the job completes, or turns `failed` and leaves the form unlinked when the job fails. A job still running 30 minutes after the wait turns `failed`. Whatever the outcome, the temporary CSV item is deleted. When the server does not queue background work, each `GET` checks the job instead.
> 
> A new publish that replaces a stale `processing` one first finishes that one, so its CSV item is deleted too.
> 
> The request answers `202` with a `request_id` before the publish runs, because a publish can take minutes: poll `GET` on this path for `complete` (with `feature_layer_url`) or `failed` (with the ArcGIS error). When the server queues background work the answer is `pending` and the task service starts the job; otherwise it is `processing` and the job runs on the API server after the response is sent. One publish per form runs at a time.
> 
> ### Authorization
> 
> Internal API clients only, the user must be a SERVER or COMPANY user, and the user must be able to modify the page.



## Servers
- https://api.iformbuilder.com/exzact/api/v80/[servername]: https://api.iformbuilder.com/exzact/api/v80/[servername]


## Authentication methods
- Oauth2


## Parameters
### Headers

- **Authorization** (string)
  e.g. Bearer {access_token}


### Path parameters

- **profile_id** (string)
  id of the profile

- **page_id** (number)
  id of the page



### Body: application/json (object)

- **with_existing_data** (boolean)



## Responses
### 202
Accepted - `pending` when queued, `processing` when the API server runs it after this response; poll the status.

#### Body: application/json (object)
- **status** (string)

- **request_id** (string)

- **updated_at** (string(date-time))

- **stale** (boolean)
  always present in the `GET` status body (not in the `POST` 202). True when `pending` or `processing` and `updated_at` is 30 minutes old or more - the publish was never picked up, or died mid-run and could not be settled as `failed` yet, and no longer blocks a new publish. False otherwise, including `none`.

- **feature_layer_url** (string)
  present when `complete`

- **error** (string)
  present when `failed`


### 400
Bad Request - `with_existing_data` is not a boolean.

#### Body: application/json (object)
- **error_message** (string)
  human-readable reason for the failure


### 403
Forbidden - not an internal client, a BASIC user, or no modify permission on the page.

#### Body: application/json (object)
- **error_message** (string)
  human-readable reason for the failure


### 404
Not Found - the page is not in the profile.

#### Body: application/json (object)
- **error_message** (string)
  human-readable reason for the failure


### 409
Conflict - the profile has no ArcGIS connection, or a publish is already running for the form.

#### Body: application/json (object)
- **error_message** (string)
  human-readable reason for the failure



[Powered by Bump.sh](https://bump.sh)
