# List all premises

## Will fetch a list of profiles.

<mark style="color:blue;">`GET`</mark> `https://app.copyfactory.io/api/v2/premises/list/`

An array with all profiles. Each entry in the array is a separate profile object.

#### Query Parameters

| Name          | Type   | Description                                                                               |
| ------------- | ------ | ----------------------------------------------------------------------------------------- |
| profile\_id   | String | The profile ID to further filter results.                                                 |
| premise\_type | String | The premise type to further filter results. The options are either "email" or "sentence". |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Copyfactory API key |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
	"data": [{
	'id': 502,
	'premise_name': 'Subject line generator',
	'required_variables': ['client_name', 'how_client_helps'],
	'profile_name': 'APP',
	'premise_type': 'email'
}, {
	'id': 529,
	'premise_name': 'Short follow up email',
	'required_variables': ['client_name', 'client_value_proposition', 'how_client_helps', 'product_name'],
	'profile_name': 'APP',
	'premise_type': 'email'
}, {
	'id': 530,
	'premise_name': 'A relevant question',
	'required_variables': ['client_value_proposition'],
	'profile_name': 'APP',
	'premise_type': 'email'
}, {
	'id': 531,
	'premise_name': 'Section: Value section',
	'required_variables': ['client_name', 'client_value_proposition', 'how_client_helps'],
	'profile_name': 'APP',
	'premise_type': 'email'
}, {
	'id': 543,
	'premise_name': 'Section: A relevant question',
	'required_variables': ['client_value_proposition'],
	'profile_name': 'APP',
	'premise_type': 'email'
}]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Shell" %}

```
curl --location --request GET 'https://app.copyfactory.io/api/v2/premises/list/' \
--header 'Authorization: API-KEY'
```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://app.copyfactory.io/api/v2/premises/list/"

headers = {
  'Authorization': 'API-KEY'
}

response = requests.request("GET", url, headers=headers)

print(response.text)

```

{% endtab %}
{% endtabs %}


---

# 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://developers.copyfactory.io/api/premises/list-all-premises.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.
