---
title: "Edit with curl"
description: "Read a document, edit the JSON, and replace it with curl and jq."
url: https://docs.spinrun.ai/build/edit-with-curl
markdown_url: https://docs.spinrun.ai/build/edit-with-curl.md
---

# Edit with curl

```bash
TOKEN=$(jq -r .accessToken ~/.spinrun/credentials.json)
curl -s https://spinrun.ai/api/build/agents/triage-bot \
  -H "Authorization: Bearer $TOKEN" | jq .data > agent.json

STAMP=$(jq -r .updated_at agent.json)
jq '.instructions = "Triage, then label."' agent.json > edited.json

curl -s -X PUT https://spinrun.ai/api/build/agents/triage-bot \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "If-Match: \"$STAMP\"" \
  --data-binary @edited.json
```

## Related [#related]

* [Concurrency](https://docs.spinrun.ai/build/concurrency.md)
* [Edit with CLI](https://docs.spinrun.ai/build/edit-with-cli.md)
