Event Intake

Create a customer draft from a website

Create a draft event in an authorized organization and start a durable website import. Extracted content is staged for review and is not applied or published automatically.

Method

POST

Path

/v1/events/from-website

Required scope

event-intake:write

Request

curl -X POST "https://api.endurancehq.app/v1/events/from-website" \
  -H "Authorization: Bearer $EHQ_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

JSON body schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "organizationId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "Organization that will own the new customer event."
    },
    "url": {
      "type": "string",
      "maxLength": 2000,
      "format": "uri",
      "description": "Official event website URL to import."
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "eventDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "location": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "eventMode": {
      "type": "string",
      "enum": [
        "race",
        "conference",
        "operations"
      ]
    },
    "eventDiscipline": {
      "type": "string",
      "enum": [
        "running",
        "cycling",
        "paddling",
        "walking",
        "multisport",
        "other"
      ]
    },
    "participantSupportMode": {
      "type": "string",
      "enum": [
        "auto",
        "crew",
        "support",
        "off"
      ]
    }
  },
  "required": [
    "organizationId",
    "url"
  ],
  "additionalProperties": false
}

Response

Success status: 201

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "eventId": {
          "type": "string"
        },
        "organizationId": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "const": "draft"
        },
        "dashboardPath": {
          "type": "string"
        },
        "websiteImport": {
          "type": "object",
          "properties": {
            "sourceId": {
              "type": "string"
            },
            "eventId": {
              "type": "string"
            },
            "sourceUrl": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uri"
                },
                {
                  "type": "null"
                }
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "created",
                "processing",
                "classified",
                "needs_review",
                "applied",
                "failed"
              ]
            },
            "workflowStatus": {
              "type": "string",
              "enum": [
                "idle",
                "queued",
                "running",
                "succeeded",
                "failed",
                "cancelled"
              ]
            },
            "summary": {
              "type": [
                "string",
                "null"
              ]
            },
            "errorMessage": {
              "type": [
                "string",
                "null"
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "workflowStartedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "workflowCompletedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "reviewPath": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "sourceId",
            "eventId",
            "sourceUrl",
            "status",
            "workflowStatus",
            "summary",
            "errorMessage",
            "createdAt",
            "updatedAt",
            "workflowStartedAt",
            "workflowCompletedAt",
            "reviewPath"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "eventId",
        "organizationId",
        "title",
        "slug",
        "status",
        "dashboardPath",
        "websiteImport"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}

Other surfaces

CLI: ehq events create-from-website --organization <org_id> --url <url>

MCP tool: ehq_event_create_from_website