> For the complete documentation index, see [llms.txt](https://docs.stoobly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoobly.com/experimental/experimental-features/api-testing/configuration/assign.md).

# Assign

{% hint style="info" %}
**Use Case**

* Set initial values for aliases in a request
* Allows customization of a request beyond its initial recorded state
  {% endhint %}

Think of aliases as template variables within a request which are resolved before a request is replayed. For example, let's say we use the following option:

```
--assign ":userId=1"
```

and we are about to replay:

```
GET /users/1
```

and we have defined the endpoint as such (where :userId is an [alias](/experimental/experimental-features/aliases.md)):

```
GET /users/:userId
```

Then the replayed request will actually be:

```
GET /users/1
```

This concept works for query params, headers and body params (for requests that have a parseable body).

## CLI Examples

```shell
stoobly-agent scenario run --assign ":userId=1" "<SCENARIO-KEY>"
```

```shell
stoobly-agent scenario test --assign ":userId=1" "<SCENARIO-KEY>"
```

```shell
stoobly-agent request run --assign ":accessToken=secretToken" "<REQUEST-KEY>"
```

```shell
stoobly-agent request test --assign ":accessToken=secretToken" --assign ":userId=1" "<REQUEST-KEY>"
```

## Configuring Resolve Strategy

Now let's say we assign two values to the alias :userId, for example:

```shell
stoobly-agent scenario run --assign ":userId=1" --assign ":userId=2" "<SCENARIO-KEY>"
```

In this case, how do we determine which value gets resolved first?


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stoobly.com/experimental/experimental-features/api-testing/configuration/assign.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
