Layer Uploads
APIs to upload data
With these APIs, you can upload your data to create new layers.
Create a new layer from an existing data source connection (database, API, or file).
AddSourceLayerAccepted
UnauthorizedError
UnauthorizedError
NotFoundError
Unprocessable Entity
Unprocessable Entity
InternalServerError
POST /api/v2/maps/{map_id}/add_source_layer HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 56
{
"dataset_id": "luCHyMruTQ6ozGk3gPJfEB",
"from": "dataset"
}{
"links": {
"layer_group": "https://felt.com/api/v2/maps/V0dnOMOuTd9B9BOsL9C0UjmqC/layer_groups/KFFhKAbvS4anD3wxtwNEpD",
"self": "https://felt.com/api/v2/maps/V0dnOMOuTd9B9BOsL9C0UjmqC"
},
"status": "accepted"
}Trigger a data refresh for a layer from its original data source to pull in the latest updates.
After uploading a file or URL, you may want to update the resulting layer with new data. The process is quite similar to the upload:
For URL uploads, simply making a single
POSTrequest to the refresh endpoint is enoughFor file refreshes, the response of the initial
POSTrequest will include a URL and some pre-signed attributes, which will be used to upload the new file to Amazon S3.
from felt_python import (refresh_file_layer, refresh_url_layer)
refresh_file_layer(map_id, layer_id, file_name="features.geojson")
refresh_url_layer(map_id, layer_id)The ID of the map hosting the layer to refresh
The ID of the layer to refresh
Refresh response
UnauthorizedError
UnauthorizedError
NotFoundError
Unprocessable Entity
Unprocessable Entity
InternalServerError
POST /api/v2/maps/{map_id}/layers/{layer_id}/refresh HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"layer_group_id": "luCHyMruTQ6ozGk3gPJfEB",
"layer_id": "luCHyMruTQ6ozGk3gPJfEB",
"presigned_attributes": {},
"type": "upload_response",
"url": "text"
}Upload a file or import data from a URL to create a new layer on the map.
The /upload endpoint can be used for both URL and file uploads:
For URL uploads, simply making a single
POSTrequest to the upload endpoint is enoughFor file uploads, the response of the initial
POSTrequest contain information you will use to upload the file to Amazon S3
Check our Upload Anything docs to see what URLs are supported.
Uploading the file to Amazon S3
Layer files aren't uploaded directly to the Felt API. Instead, they are uploaded to an S3 bucket.
The response to this API request will include a URL and pre-signed params for you to use to upload your file. Only a single file may be uploaded — if you wish to upload several files at once, consider wrapping them in a zip file.
To upload the file, you must perform a multipart upload, and include the file contents in the file field.
from felt_python import upload_file
upload_file(map_id, file_name="features.geojson", layer_name="My new layer")The ID of the map to upload the layer to.
A public URL containing geodata to import, in place of uploading a file.
(Image uploads only) The latitude of the image center.
(Image uploads only) The longitude of the image center.
The display name for the new layer.
(Image uploads only) The zoom level of the image.
Upload layer response
UnauthorizedError
UnauthorizedError
NotFoundError
Unprocessable Entity
Unprocessable Entity
InternalServerError
POST /api/v2/maps/{map_id}/upload HTTP/1.1
Host: felt.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 311
{
"hints": [
{
"attributes": {
"lat": "text",
"lng": "text"
}
}
],
"import_url": "text",
"lat": 1,
"lng": 1,
"metadata": {
"attribution_text": "text",
"attribution_url": "text",
"description": "text",
"license": "text",
"source_abbreviation": "text",
"source_name": "text",
"source_url": "text",
"updated_at": "2025-03-24"
},
"name": "text",
"zoom": 1
}{
"layer_group_id": "luCHyMruTQ6ozGk3gPJfEB",
"layer_id": "luCHyMruTQ6ozGk3gPJfEB",
"presigned_attributes": {},
"type": "upload_response",
"url": "text"
}Last updated
Was this helpful?