Docs » Other data ingestion methods » Send metrics, traces, and events using Observability Cloud REST APIs

Send metrics, traces, and events using Observability Cloud REST APIs πŸ”—

You can use the REST API to send telemetry directly to Splunk Observability Cloud. See Send data points and Send traces, metrics, and events in the developer documentation.

Start sending data using the API πŸ”—

Start experimenting by sending data using the following curl command:

curl --request POST \
  --header "Content-Type: application/json" \
  --header "X-SF-TOKEN: <ORG_TOKEN>" \
  --data \
      "gauge": [
              "metric": "",
              "dimensions": { "host": "server1" },
              "value": 42
  }' \

Send custom metrics using the API πŸ”—

To send custom metrics, replace <ORG_TOKEN> with an org token for your organization in the code block provided as an example.

In Observability Cloud UI, an org token is called an access token. To learn how to obtain an org token, see Create and manage organization access tokens using Splunk Observability Cloud.

When you send a request, use the endpoint specific to your realm. Replace <REALM> with the name of your realm, which you can find on your profile page in the user interface. To learn more, see Realms in endpoints.

Return codes πŸ”—

The REST APIs return the following codes:


Return code


Send Traces, Metrics and Events


Successful data ingest.

Send Traces, Metrics and Events


Bad request.
This can happen if the JSON was not well-formed, if you specified a data point outside of one of the metric type arrays, or if you forgot to specify a metric name for a data point.

Send Traces, Metrics and Events


The ingest token specified in the X-SF-TOKEN header in the request doesn’t have authorization to send data points to the organization.