Layer Uploads

APIs to upload data

With these APIs, you can upload your data to create new layers.

Add layer from data source

post

Create a new layer from an existing data source connection (database, API, or file).

Authorizations
Path parameters
map_idstringRequired
Body
one ofOptional
or
or
Responses
202

AddSourceLayerAccepted

application/json
post
/api/v2/maps/{map_id}/add_source_layer
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"
}

Refresh map layer

post

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 POST request to the refresh endpoint is enough

  • For file refreshes, the response of the initial POST request will include a URL and some pre-signed attributes, which will be used to upload the new file to Amazon S3.

With the felt_python library, you can refresh a layer with a simple function call:

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)
Authorizations
Path parameters
map_idstringRequired

The ID of the map hosting the layer to refresh

layer_idstringRequired

The ID of the layer to refresh

Responses
200

Refresh response

application/json
post
/api/v2/maps/{map_id}/layers/{layer_id}/refresh
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 map layer

post

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 POST request to the upload endpoint is enough

  • For file uploads, the response of the initial POST request 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.

With the felt_python library, you can upload a file with a simple function call:

from felt_python import upload_file

upload_file(map_id, file_name="features.geojson", layer_name="My new layer")
Authorizations
Path parameters
map_idstringRequired

The ID of the map to upload the layer to.

Body
import_urlstringOptional

A public URL containing geodata to import, in place of uploading a file.

latnumberOptional

(Image uploads only) The latitude of the image center.

lngnumberOptional

(Image uploads only) The longitude of the image center.

namestringRequired

The display name for the new layer.

zoomnumberOptional

(Image uploads only) The zoom level of the image.

Responses
200

Upload layer response

application/json
post
/api/v2/maps/{map_id}/upload
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?