Import Spot - API v2.4 - CoastSnap - SPOTTERON

Import spot

This endpoint creates a new spot or updates an existing one with the help of an external unique identifier (source_id).
If a spot with the given source_id already exists, it will be updated. Otherwise a new spot is created.

Endpoint: https://www.spotteron.com/api/v2.4/spots/import
Authentication: Bearer token
Method: POST
Content-Type: application/json
Request body:
All attributes must be nested under data.attributes
Name Required Type Info
topic_id true INTEGER The topic id: 37 for CoastSnap
source_id true TEXT An external unique identifier. If this endpoint is called with the same source_id again, the existing spot will be updated instead of creating a new one.
root_id INTEGER The id of the parent spot. Required when creating a spot update.
latitude true FLOAT Latitude of the spot location. e.g. 48.205154
longitude true FLOAT Longitude of the spot location. e.g. 16.358003
state INTEGER The state of the spot:
1 = active
2 = in_progress (required when spot has gallery fields that are not yet fully uploaded)
Defaults to 1 (active) if not provided.
privacy_type INTEGER 0 = public
1 = private
Defaults to 0 (public).
MIXED Additional topic-specific fields. See Spot attributes and values for all available fields for this topic.

Example request:

curl -X POST "https://www.spotteron.com/api/v2.4/spots/import" \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "spots",
      "attributes": {
        "topic_id": 37,
        "source_id": "my-external-id-001",
        "latitude": 48.2093723,
        "longitude": 16.356099
      }
    }
  }'

Example response

200 OK — spot created or updated successfully
{
  "data": {
    "id": 123
  }
}

Example response

Response when state is 2 (in_progress) and gallery fields are pending:
{
  "data": {
    "id": 123,
    "attributes": {
      "fld_21_000001": 123456,
      "state": 2
    }
  }
}
The attributes object contains the gallery field names with the assigned gallery ids. Use these gallery ids to upload media via the POST /galleries/{id}/media endpoint.