Skip to content

Select theme

Create or revise a layer

POST
/{organization}/projects/{projectId}/layers
curl --request POST \
--url https://app.civillo.com/api/v1/example/projects/1/layers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "mode": 0, "fileNames": [ "test1.dwg", "test2.dwg" ], "fileLastModifieds": [ 1680673841108, 1680673841109 ], "replaceLayerId": 1, "revisionComment": "This is a comment!", "srid": -1, "units": "m", "title": "My layer", "description": "This is the layer description.", "permitSelf": true, "makeGlobal": false, "makeOnByDefault": false, "allowInPermits": false, "shpColorMode": "fixed", "shpColorFixed": null, "shpColorAttribute": null, "shpFieldsToSkip": null, "csvIdField": null, "csvXField": null, "csvYField": null, "csvZField": null, "csvColor": null, "csvColorField": null, "revisionTruncate": false, "maxRevisions": null, "dataRightsSelectedItem": 1, "ifcSublayerGroupBy": "Name", "convert3dFaces": false, "convert3dFacesToTerrain": null }'

Begin the creation or revision process for a layer.

organization
required
string

The organization nickname

projectId
required
integer

The project id

Media typeapplication/json
object
mode
required

Whether this is a layer creation or revision. Use 0 for a layer creation or 1 for a layer revision.

integer
Allowed values: 0 1
Example
0
fileNames
required

The source file names for this layer.

Array<string>
Example
[
"test1.dwg",
"test2.dwg"
]
fileLastModifieds
required

The last modified values for source files.

Array<integer>
Example
[
1680673841108,
1680673841109
]
replaceLayerId

The id of the layer to revise. This is required when using mode 1.

integer
Example
1
revisionComment

A comment about the revision. Only valid when mode = 1.

string
Example
This is a comment!
srid

The spatial reference system. A value of -1 means auto-detection.

integer
default: -1
Example
3857
units

The measurement units for this layer.

string
default: auto
Allowed values: m mm auto
title

The unique name of the layer. Required when mode = 0. Only valid when mode = 0.

string
Example
My layer
description

The description of the layer. When mode = 1 you cannot remove the description, only update it.

string
nullable
Example
This is the layer description.
permitSelf

If true, allow yourself automatic access to this layer once created. Only valid when mode = 0.

boolean
default: true
Example
false
makeGlobal

If true, this layer is automatically accessible to all users in the project (overrides user or group permissions). Only valid when mode = 0.

boolean
Example
true
makeOnByDefault

If true, this layer will be automatically turned on in the project map view. Only valid when mode = 0.

boolean
Example
true
allowInPermits

If true, this layer will be available for adding to permit categories and attaching to permits. Overridden by makeGlobal. Requires access to the permit feature. Only valid when mode = 0.

boolean
Example
true
shpColorMode

The shapefile colouring mode.

string
nullable
Allowed values: fixed attribute
Example
fixed
shpColorFixed

The hex color to be used for all shapefile features.

string
nullable
Example
#94C296
shpColorAttribute

The name of the attribute from which pre-feature hex color values will be taken.

string
nullable
shpFieldsToSkip

Shapefile attribute fields to skip (to not import).

Array<string>
nullable
csvIdField

The name of the ID field in the CSV.

string
nullable
csvXField

The name of the X field in the CSV.

string
nullable
csvYField

The name of the Y field in the CSV.

string
nullable
csvZField

The name of the Z field in the CSV.

string
nullable
csvColor

The hex color value for the CSV.

string
nullable
csvColorField

The field to use for setting geometry colors. Should not be mixed with csvColor.

string
nullable
revisionTruncate

Set to true if this upload should attempt to truncate existing revisions. (Should be paired with the MaxRevisions parameter)

boolean
maxRevisions

When using RevisionTruncate parameter, MaxRevisions will be used to know the max number of revisions to keep. Has no use outside of pairing with RevisionTruncate.

string
nullable
dataRightsSelectedItem

When uploading imagery, users must declare that they have certain rights to use and upload the data, along with whether they can allow others to download the data. 1 = Viewing rights only (for other users). 2 = Full rights for sharing and downloading

integer
nullable
Allowed values: 1 2
ifcSublayerGroupBy

When uploading IFC data, identify how Civillo sublayers are grouped. Common IFC properties are Name and Type, while all IFC geometric shapes have a IFC Data Type (e.g. IfcSlab).

string
default: Name nullable
Allowed values: Name Type IfcType
Example
Name
convert3dFaces

When uploading CAD data, identify if DXF AcDbFace entities should be converted to PolyfaceMesh objects.

boolean
convert3dFacesToTerrain

When uploading CAD data, identify if DXF AcDbFace entities should be converted to a Terrain layer.

boolean
nullable

Successful response

Media typeapplication/json
object
job

The job ID

integer
token

Authorizes you to upload this layer to the upload processor.

string
processPath

The URL to the upload processor.

string
application

The organization nickname.

string
Example
{
"job": 123,
"token": "ABCDEFGHIJKLMNOP12345678910",
"processPath": "https://path/to/the/upload-processor",
"application": "my-org"
}

Bad Request

Unauthorized

Forbidden