# Pages

## Get pages

<mark style="color:blue;">`GET`</mark> `https://api.petje.af/v1/pages`

This endpoint allows you to get pages that belongs to the authenticated user.\
\
Scope: `pages.read`

#### Query Parameters

| Name  | Type    | Description                                            |
| ----- | ------- | ------------------------------------------------------ |
| limit | integer | The number of pages to return                          |
| from  | string  | Offset the results to start after the provided page ID |

#### Headers

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| Authorization | string | Access token using the `Bearer` method |

{% tabs %}
{% tab title="200 Pages successfully retrieved." %}

```
{
    "count": 4,
    "_embedded": {
        "pages": [
            {
                "resource": "pages",
                "id": "5SaEUOWD2b4dN7tJBKMB",
                "userId": "8jFy8VbRPTfkM1658U2IrwvIV7R2",
                "name": "Test 8",
                "slug": "test8",
                "validated": true,
                "_links": {
                    "self": {
                        "href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB",
                        "type": "application/hal+json"
                    },
                    "plans": {
                        "href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB/plans",
                        "type": "application/hal+json"
                    },
                    "rewards": {
                        "href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB/rewards",
                        "type": "application/hal+json"
                    }
                }
            },
            ...
        ]
    },
    "_links": {
        "self": {
            "href": "https://api.petje.af/pages",
            "type": "application/hal+json"
        },
        "next": null
    }
}
```

{% endtab %}
{% endtabs %}

## Get page detail

<mark style="color:blue;">`GET`</mark> `https://api.petje.af/v1/pages/:id`

Scope: `pages.read`

#### Path Parameters

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| pageId | string | The page ID |

#### Headers

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| Authorization | string | Access token using the `Bearer` method |

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

```
{
    "resource": "pages",
    "id": "XdvyMNuQArs6KGRANDlT",
    "userId": "8jFy8VbRPTfkM1658U2IrwvIV7R2",
    "name": "Test 6",
    "slug": "test6",
    "validated": true,
    "_links": {
        "self": {
            "href": "https://api.petje.af/pages/XdvyMNuQArs6KGRANDlT",
            "type": "application/hal+json"
        },
        "plans": {
            "href": "https://api.petje.af/pages/XdvyMNuQArs6KGRANDlT/plans",
            "type": "application/hal+json"
        },
        "rewards": {
            "href": "https://api.petje.af/pages/XdvyMNuQArs6KGRANDlT/rewards",
            "type": "application/hal+json"
        }
    }
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "status": 404,
    "title": "Not Found",
    "detail": "Page is not found",
    "_links": {
        "documentation": {
            "href": "https://docs.petje.af",
            "type": "text/html"
        }
    }
}
```

{% 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://docs.petje.af/petje.af-api/reference/pages.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.
