API Documentation

Programmatically manage your map data with our REST API

API Documentation

Use the REST API to programmatically manage your map data. All requests require authentication.

API Endpoint Placeholder - Layer ID required
https://mapsemble.com/api/v1/layer/{LAYER_ID}/features

Authentication (OAuth 2)

All API requests require OAuth 2 authentication. First, obtain an access token using your client credentials, then include it in the Authorization header.

Step 1 Request Access Token

POST to the token endpoint with your client credentials:

POST https://mapsemble.com/token

Request body (YAML format):

grant_type: client_credentials_with_user
client_id: your_client_id
client_secret: your_client_secret

Example curl request:

curl -X POST "https://mapsemble.com/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials_with_user&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"

Response:

{
  "token_type": "Bearer",
  "expires_in": 3600,
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJS..."
}
Step 2 Use Access Token in API Requests

Include the access token in the Authorization header:

Authorization: Bearer YOUR_ACCESS_TOKEN

Note: Generate your client_id and client_secret from your profile page. Tokens expire after 3600 seconds (1 hour).

CRUD Operations

GET Retrieve all features
curl -X GET "https://mapsemble.com/api/v1/layer/{LAYER_ID}/features" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Returns a GeoJSON FeatureCollection with all features.

POST Create new features

Request body (YAML format):

features:
  - type: Feature
    geometry:
      type: Point
      coordinates:
        - -73.985428   # longitude
        - 40.748817    # latitude
    properties:
      title: My Location
      description: Description here

Example curl request (JSON):

curl -X POST "https://mapsemble.com/api/v1/layer/{LAYER_ID}/features" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-73.985428, 40.748817] }, "properties": { "title": "My Location", "description": "Description here" } } ] }'

Create new features. Do not include an ID - it will be auto-generated. Maximum 1000 features per request.

PUT/PATCH Update existing features

Request body (YAML format):

features:
  - id: feature-uuid-here
    type: Feature
    geometry:
      type: Point
      coordinates:
        - -73.985428   # longitude
        - 40.748817    # latitude
    properties:
      title: Updated Title

Example curl request (JSON):

curl -X PUT "https://mapsemble.com/api/v1/layer/{LAYER_ID}/features" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "features": [ { "id": "feature-uuid-here", "type": "Feature", "geometry": { "type": "Point", "coordinates": [-73.985428, 40.748817] }, "properties": { "title": "Updated Title" } } ] }'

Update existing features. The feature ID is required. Use PATCH for partial updates.

DELETE Delete features

Request body (YAML format):

features:
  - id: feature-uuid-to-delete

Example curl request (JSON):

curl -X DELETE "https://mapsemble.com/api/v1/layer/{LAYER_ID}/features" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "features": [ { "id": "feature-uuid-to-delete" } ] }'

Delete features by ID. The feature ID is required.

Response Format

Successful operations return a JSON response with success and/or failed arrays indicating the status of each feature operation.

{ "success": [ { "id": "uuid", "message": "Feature successfully created." } ], "failed": [ { "id": "uuid", "path": "field", "message": "Error message" } ] }

Important Notes

  • Maximum 1000 features per request
  • Coordinates should be in [longitude, latitude] format (GeoJSON standard)
  • All write operations (POST, PUT, PATCH, DELETE) require the owner's authentication
  • GET requests return a GeoJSON FeatureCollection

Let's connect.

Schedule a 30-minute call with our team to discuss your project.
Or fill in the form and we'll get back to you as soon as possible.