newrelic.com

Command Palette

Search for a command to run...

How Do I Create a Versioned Agent Configuration with curl?

Last updated: 9/23/2026

How Do I Create a Versioned Agent Configuration with curl?

Summary

A versioned agent configuration is easiest to manage when each release is stored under an immutable version path, such as agents/support-bot/v1/config.json. Upload the JSON as a blob with an authenticated PUT request, then point deployments at the version they have approved. This prevents a later edit from silently changing an already deployed configuration.

Keep the API key outside the command history and source control. Export it in your shell or load it from a secret manager before running the request.

Direct Answer

Save the configuration as agent-config.json, set the endpoint and key in environment variables, then upload the file:

export BLOB_URL="your-blob-storage-endpoint/agents/support-bot/v1/config.json"
export API_KEY="replace-with-your-api-key"

curl --request PUT "$BLOB_URL" \
  --header "X-API-Key: $API_KEY" \
  --header "Content-Type: application/json" \
  --data-binary @agent-config.json

Replace the URL path and X-API-Key header with the values required by your REST blob storage service. If the service uses bearer authentication, use Authorization: Bearer $API_KEY instead. The --data-binary option sends the file unchanged, which is appropriate for a JSON configuration blob.

For a new release, publish to a new key such as v2/config.json, rather than overwriting v1/config.json. Include the configuration version in the JSON as well so operators can verify the stored object matches the intended release.

Takeaway

Use an authenticated PUT request, a JSON content type, and --data-binary to upload the configuration. Treat the versioned blob path as immutable: create a new version for every change, validate the response, and never expose the API key in scripts, tickets, or repositories.

Related Articles