# Path parameter

* Path parameters are variables that appear within the URL that points toward a specific resource.&#x20;
* There can be multiple path parameters.&#x20;
* The Path parameter can be a constant text or a variable value added after the API group base URL.&#x20;

## Constant Path Parameter

In a constant path parameter, on calling the API, the representation text of the path parameter in the URL is consistent. It does not change on calling the API.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_4/ch4urlconstpathparam.png>" %}

### How to create a constant path parameter

To define a constant path parameter, in the Details tab>API name or path parameters field:&#x20;

* Enter the parameter name
* Press Enter. It displays in a blue bubble.&#x20;

In the URL, the constant path parameter displays without curly brackets.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_4/ch41constparam.png>" %}

## Variable Path parameter

In a reference or variable path parameter, on calling the API, the representation text of the path parameter in the URL can vary depending on the data to query the API with. \
For example, the URL below has a variable path parameter “name,” where the API caller can put the customer's name in that variable path parameter and find out the rating of the customer.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_4/ch4urlvarpathparam.png>" %}

### How to create a variable path parameter

To define a variable path parameter, in the Details tab>API name or path parameters field,&#x20;

* Click the \[+] button.

![](/files/xuPYlxNdEV631Nhh9h7k)

* To define the variable parameter:
  1. Enter the parameter name.
  2. Click the \[Save] button.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_4/ch4params2advarparam2.png>" %}

* The variable path parameter is displayed in a white bubble ( the “expression bubble”). In the URL, it is displayed with curly brackets.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_4/ch4params3advarparam3.png>" %}

* After saving the parameter name, go to the Inputs & outputs tab>Path Parameters section. \
  The created variable parameter is displayed with data type as “string”.&#x20;

![](/files/VkHQuouZHcOD510q2dmF)

* Users must add the sample for the parameter. (as not adding the path parameter will prevent the user from saving the API successfully)

![](/files/q6dopoWbap3MzkTujydJ)


---

# Agent Instructions: 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:

```
GET https://docs.langstack.com/welcome/get-started/learn-langstack/introduction-to-rest-api/path-parameter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
