REST API · lines
POST /lines/{lineKey}/import
OpenAPI / Swagger spec import is a web-only capability: the panel's upload-and-preview wizard needs a human in a browser (CSRF + session), so there is no machine import path. Rather than let a programmatic client hit a bare 404, this route answers with an explicit `web_only` error that names the panel and points at the per-endpoint create route — the surface documents its own exclusion instead of leaving a silent gap.
post_api_line_import
Authentication
- Bearer
Parameters
| Name | In | Required | Schema | Description |
|---|---|---|---|---|
| lineKey | path | yes | {"type":"string"} |
Responses
403
Always returned — this capability has no REST equivalent.
application/json
{
"required": [
"error"
],
"properties": {
"error": {
"description": "Machine-readable error code, e.g. \"not_found\", \"forbidden\", \"validation\".",
"type": "string",
"enum": [
"bad_request",
"unauthorized",
"insufficient_credits",
"forbidden",
"web_only",
"allowlist_widens",
"not_found",
"conflict",
"draft_revision_conflict",
"rollback_confirmation_conflict",
"not_replayable",
"targets_outside_allowlist",
"gone",
"deprecated_operation",
"validation",
"rate_limited",
"payment_provider",
"verification_unavailable",
"analytics_unavailable",
"credential_vault_unavailable",
"notification_grants_unavailable"
]
},
"message": {
"description": "Human-readable explanation of what went wrong. Absent on a field-level validation failure, where `fields` carries the detail instead.",
"type": "string"
},
"object": {
"description": "The resource the error concerns, when there is one.",
"required": [
"type",
"id"
],
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
},
"type": "object"
},
"action": {
"description": "What to do next, naming the call or the panel page that does it. Absent when there is no corrective step.",
"type": "string"
},
"fields": {
"description": "Present when `error` is \"validation\" — one message per rejected field, keyed by the field name.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"retry_after": {
"description": "An RFC 3339 timestamp, the moment the request may be retried. Not every `rate_limited` refusal carries one.",
"type": "string",
"format": "date-time"
}
},
"type": "object"
}
{
"error": "web_only",
"message": "Importing an OpenAPI/Swagger spec is available only in the web panel at https://echorelay.dev (upload-and-preview wizard). It has no REST equivalent — add endpoints programmatically by POSTing each one to /lines/{lineKey}/endpoints."
}