Skip to content

Capture and reuse values

Use a capture when one response supplies an ID, token, or other value needed by another request. Start with a saved request and an initialized collection.

  1. Select the request that returns the value and open its Capture tab. If hidden, reveal it from the + menu at the right of the request tabs.
  2. Add a variable name such as created_user_id and a response expression such as body.id. Expression completion can use the latest response.
  3. Choose Run only, Environment, or Secret, then save with Ctrl+S.
  4. Send the request and inspect Response → Results. A successful capture shows its type and value, with known secrets redacted.

Use Space to disable a selected capture without removing it from the file.

Capture entries and persistence choices beside their results

Save these as two separate files inside the same collection. Replace the example API URL with your server. The create endpoint must return JSON containing id.

In users/create.yml:

name: Create User
method: POST
url: https://api.example.com/users
body_type: json
body: '{"name":"Noodle example"}'
capture:
created_user_id:
value: body.id

In users/get.yml:

name: Get Created User
method: GET
url: https://api.example.com/users/$created_user_id

Open the Collection Runner with F5 and select both requests, or run their folder:

noodle collection run ./my-api users/

The create request runs first and captures id; the next request substitutes it into its URL. Two separate manual sends do not share transient captures.

Choice Manual send or request run Runner or collection run
Run only Available to the same request’s post script, then discarded Available to later requests until the run ends
Environment Save a public value to the selected environment Keep transient; persistence is suppressed
Secret Save to the OS vault with a blank environment declaration Keep transient; persistence is suppressed

For later manual sends, select an existing environment and use Environment for public IDs or Secret for tokens. For example:

capture:
access_token:
value: body.access_token
persist: secret

The original captured value is persisted even if a later post script overwrites it or fails. Secret captures and values from sensitive response headers are fully redacted in results.

Captures read status, response time, headers, or JSON body paths. Binary bodies cannot supply JSON paths. Successful captures commit before post scripts and assertions, including on HTTP error responses. The latest successful write wins over the environment or an earlier run value.

A missing or invalid path fails that capture without replacing an earlier value. Other successful captures remain committed. A failed capture fails the request; the collection continues unless fail-fast is enabled. Persistence failures keep the HTTP response available and are reported in Results.

See capture syntax and constraints for the full schema. Use response assertions to check the returned value, or a post script when extraction needs conditions or transformation.