Skip to main content
Monitoring & Collection/Scrape Collection
POSTMonitoringSince 1.0SynchronousAuth Required

ImportScrapeCSV

Import scrape targets from a CSV-structured payload

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • rowsListRequired

    The rows value

    Example: (nested array)

    • rowInteger

      Row number in the CSV payload (1-based)

      Example: 1

    • hostString

      Hostname or IP of the scrape target

      Example: 192.168.1.30

    • portInteger

      Port of the metrics endpoint

      Example: 9100

    • jobNameString

      Prometheus job name

      Example: node

    • labelsString

      JSON-encoded label key-value pairs

      Example: {"env":"prod"}

  • modeStringRequired

    Import mode: full (fail on any error) or partial (skip invalid rows)

    Example: partial

Responses

200 OK

On success, this API returns the following response structure.

  • importedInteger

    Number of targets successfully imported

    Example: 47

  • skippedInteger

    Number of entries skipped (e.g. already existing)

    Example: 1

  • duplicatesSkippedInteger

    Number of duplicate entries that were skipped

    Example: 1

  • modeString

    Import mode used (full, partial)

    Example: partial

  • errorsList

    Errors for this resource

    Example: (nested array)

    • rowInteger

      Row number where the error occurred

      Example: 3

    • fieldString

      Field name that failed validation

      Example: port

    • reasonString

      Human-readable reason for the validation failure

      Example: port must be between 1 and 65535

Endpoint

POST/api/v1/monitoring/scrape-configs/bulk-import

/api/v1/monitoring/scrape-configs/bulk-import

Operation ID

ImportScrapeCSV

Permalink

Request Example

curl -X POST '{host}/api/v1/monitoring/scrape-configs/bulk-import' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"rows":"(nested array)","mode":"partial"}'

Response Example

200
{
  "imported": 47,
  "skipped": 1,
  "duplicatesSkipped": 1,
  "mode": "partial",
  "errors": [
    {}
  ]
}

Change History

This API has no change history records yet.

View all change history