LogoLogo
Sign upHelp CenterContactSocial
Home
Home
  • Overview
  • REST API
    • Getting started
    • Navigating maps and workspaces
    • Uploading files and URLs
    • Styling layers
    • Refreshing live data layers
    • Working with elements
    • Listening to updates using webhooks
    • API Reference
      • Authentication
      • Maps
      • Layers
      • Elements
      • Users
      • Comments
      • Embed Tokens
      • Sources
      • Projects
  • JS SDK
    • Getting started
    • General concepts
    • Controlling maps
    • Working with selection
    • Reading entities
    • Drawing elements
    • Working with layers
    • Layer filters
    • Building custom charts
    • Map interactions and viewport
    • Hiding and showing
    • Integrating with React
    • Sample application
    • Examples
    • API Reference
  • Felt Style Language
    • Getting started
    • Style definition blocks
      • The config block
      • The paint block
      • The label block
      • The legend block
      • The popup block
      • The attributes block
      • The filters block
    • Types of visualizations
      • Simple visualizations
      • Categorical visualizations
      • Numeric visualizations (color & size)
      • Heatmaps
      • Hillshade
    • Zoom-based Styling
      • Interpolators
    • Legends
    • Errors
    • Examples
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. REST API
  2. API Reference

Elements

PreviousLayersNextUsers

Last updated 1 month ago

Was this helpful?

List all elements on a map

Returns a GeoJSON FeatureCollection containing all the elements in a map that are not in an element group

List all elements in a group

Returns a GeoJSON FeatureCollection containing all the elements in a single group

List all element groups on a map

Returns a list of GeoJSON Feature Collections, one for each element group

Create or update new elements

Each element is represented by a feature in the POSTed GeoJSON Feature Collection.

For each feature, including an existing element ID will result in the element being updated on the map. If no element ID is provided (or a non-existent one) , a new element will be created.

The maximum payload size for any POST to the Felt API is 1MB. Additionally, complex element geometry may be automatically simplified. If you require large, complex geometries, consider uploading your data as a Data Layer.

Create or update new element groups

For each Element Group, including an existing Element Group id will result in the Element Group being updated. If no id is provided, a new Element Group will be created.

You may assign Elements to an Element Group by setting the felt:parentId property of an Element to the ID of an Element Group.

Delete an element

Deletes the element with the ID specified in the path.

get
Authorizations
Path parameters
map_idstringRequired

The ID of the map to list elements from.

Responses
200
GeoJSON
application/json
401
UnauthorizedError
application/json
403
UnauthorizedError
application/json
404
NotFoundError
application/json
422
Unprocessable Entity
application/json
429
Unprocessable Entity
application/json
500
InternalServerError
application/json
get
GET /api/v2/maps/{map_id}/elements HTTP/1.1
Host: felt.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "features": [
    {
      "geometry": {
        "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
        "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
      },
      "properties": {},
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}
get
Authorizations
Path parameters
map_idstringRequired

The ID of the map.

group_idstringRequired

The ID of the element group.

Responses
200
GeoJSON
application/json
401
UnauthorizedError
application/json
403
UnauthorizedError
application/json
404
NotFoundError
application/json
422
Unprocessable Entity
application/json
429
Unprocessable Entity
application/json
500
InternalServerError
application/json
get
GET /api/v2/maps/{map_id}/element_groups/{group_id} HTTP/1.1
Host: felt.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "features": [
    {
      "geometry": {
        "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
        "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
      },
      "properties": {},
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}
get
Authorizations
Path parameters
map_idstringRequired

The ID of the map to list groups from.

Responses
200
ElementGroupList
application/json
401
UnauthorizedError
application/json
403
UnauthorizedError
application/json
404
NotFoundError
application/json
422
Unprocessable Entity
application/json
429
Unprocessable Entity
application/json
500
InternalServerError
application/json
get
GET /api/v2/maps/{map_id}/element_groups HTTP/1.1
Host: felt.com
Authorization: YOUR_API_KEY
Accept: */*
[
  {
    "color": "text",
    "elements": {
      "features": [
        {
          "geometry": {
            "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
            "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
          },
          "properties": {},
          "type": "Feature"
        }
      ],
      "type": "FeatureCollection"
    },
    "id": "text",
    "name": "text",
    "symbol": "text"
  }
]
delete
Authorizations
Path parameters
map_idstringRequired

The ID of the map to delete the element from.

element_idstringRequired

The ID of the element to delete.

Responses
204
No Content
401
UnauthorizedError
application/json
403
UnauthorizedError
application/json
404
NotFoundError
application/json
422
Unprocessable Entity
application/json
429
Unprocessable Entity
application/json
500
InternalServerError
application/json
delete
DELETE /api/v2/maps/{map_id}/elements/{element_id} HTTP/1.1
Host: felt.com
Authorization: YOUR_API_KEY
Accept: */*

No content

  • List all elements on a map
  • GET/api/v2/maps/{map_id}/elements
  • List all elements in a group
  • GET/api/v2/maps/{map_id}/element_groups/{group_id}
  • List all element groups on a map
  • GET/api/v2/maps/{map_id}/element_groups
  • Create or update new elements
  • POST/api/v2/maps/{map_id}/elements
  • Create or update new element groups
  • POST/api/v2/maps/{map_id}/element_groups
  • Delete an element
  • DELETE/api/v2/maps/{map_id}/elements/{element_id}
post
Authorizations
Path parameters
map_idstringRequired

The ID of the map to create the element in

Body
typestring · enumRequiredPossible values:
Responses
200
GeoJSON
application/json
401
UnauthorizedError
application/json
403
UnauthorizedError
application/json
404
NotFoundError
application/json
422
Unprocessable Entity
application/json
429
Unprocessable Entity
application/json
500
InternalServerError
application/json
post
POST /api/v2/maps/{map_id}/elements HTTP/1.1
Host: felt.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 165

{
  "features": [
    {
      "geometry": {
        "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
        "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
      },
      "properties": {},
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}
{
  "features": [
    {
      "geometry": {
        "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
        "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
      },
      "properties": {},
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}
post
Authorizations
Path parameters
map_idstringRequired

The ID of the map to create the group in

Body
colorstringOptionalDefault: #C93535
idstring · felt_idOptionalExample: luCHyMruTQ6ozGk3gPJfEB
namestringRequiredExample: My Element Group
symbolstringOptionalDefault: dot
Responses
200
Element group list
application/json
401
UnauthorizedError
application/json
403
UnauthorizedError
application/json
404
NotFoundError
application/json
422
Unprocessable Entity
application/json
429
Unprocessable Entity
application/json
500
InternalServerError
application/json
post
POST /api/v2/maps/{map_id}/element_groups HTTP/1.1
Host: felt.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 92

[
  {
    "color": "#C93535",
    "id": "luCHyMruTQ6ozGk3gPJfEB",
    "name": "My Element Group",
    "symbol": "dot"
  }
]
[
  {
    "color": "text",
    "elements": {
      "features": [
        {
          "geometry": {
            "felt:id": "luCHyMruTQ6ozGk3gPJfEB",
            "felt:parentId": "luCHyMruTQ6ozGk3gPJfEB"
          },
          "properties": {},
          "type": "Feature"
        }
      ],
      "type": "FeatureCollection"
    },
    "id": "text",
    "name": "text",
    "symbol": "text"
  }
]