> For the complete documentation index, see [llms.txt](https://woowup-docs.gitbook.io/woowup-developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://woowup-docs.gitbook.io/woowup-developer-docs/api/segment-export.md).

# Segment Export

## Find Segment

## Obtains the customers of a previously scheduled segment

<mark style="color:blue;">`GET`</mark> `https://api.woowup.com/apiv3/export/segments/{id}`

Use last\_update attribute to check if segment was updated

#### Headers

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Basic {{API-KEY}} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json  |
| Accept<mark style="color:red;">\*</mark>        | String | application/json  |

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

```json
{
    "payload": {
        "segment": {
            "id": 1,
            "title": "test",
            "url": "https://example.com",
            "last_update": "YYYY-MM-DD HH:mm:ss"
        }
    },
    "message": "",
    "code": "ok",
    "time": "1ms"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
    "payload": [],
    "message": "The segment does not exist | The segment is not available for download at this time, please try again in 24 hours.",
    "code": "not_found",
    "time": "45ms"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "payload": [],
    "message": "parameters required",
    "code": "client_error",
    "time": "45ms"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    "payload": [],
    "message": "something happened",
    "code": "server_error",
    "time": "45ms"
}
```

{% endtab %}
{% endtabs %}

## Schedule Segment

## The export will be updated daily with clients who meet the conditions of the segment

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/export/segments/{id}`

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | String | Basic {{API-KEY}} |
| Content-Type  | String | application/json  |
| Accept        | String | application/json  |

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

```json
{
    "payload": [],
    "message": "Scheduled segment, in 24 hs the segment is going to be ready to export",
    "code": "ok",
    "time": "17ms"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "payload": [],
    "message": "Export already scheduled",
    "code": "client_error",
    "time": "19ms"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    "payload": [],
    "message": "something happened",
    "code": "server_error",
    "time": "45ms"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
    "payload": [],
    "message": "The segment does not exist",
    "code": "not_found",
    "time": "13ms"
}
```

{% endtab %}
{% endtabs %}

## Unschedule Segment

## The export will stop updating and will no longer be available

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/export/segments/{id}`

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | String | Basic {{API-KEY}} |
| Content-Type  | String | application/json  |
| Accept        | String | application/json  |

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

```json
{
    "payload": [],
    "message": "Unscheduled segment",
    "code": "ok",
    "time": "21ms"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    "payload": [],
    "message": "something happened",
    "code": "server_error",
    "time": "45ms"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
    "payload": [],
    "message": "The segment does not exist",
    "code": "not_found",
    "time": "13ms"
}
```

{% endtab %}
{% endtabs %}


---

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

```
GET https://woowup-docs.gitbook.io/woowup-developer-docs/api/segment-export.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.
