# Autopilot

## List of workspaces

## List of the user's workspaces

<mark style="color:blue;">`GET`</mark> `https://api.asters.ai/automations/workspaces`

#### Headers

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| x-asters-token<mark style="color:red;">\*</mark> | String | API Key generated in Asters for user authentication |

{% tabs %}
{% tab title="200 Workspaces successfully retrieved" %}

````javascript
```json
[
    {
        "workspace": "63b2f7e2605fae12406e6814",
        "role": "6495ae30962f51512c2f77db",
        "_id": "65d4d06dc1492d9691489a74",
        "owner":{
            "_id":"identifier",
            "name": "Workspace 1",
            "email": "email.owner@mail.com"
        },
    },
    {
        "workspace": "63b2f7e8605fae12406e683b",
        "role": "65ca3c0dfdcdb0280257ba19",
        "_id": "65d4d6ee9fec9fe259b4efb9",
        "owner":{
            "_id":"identifier",
            "name": "Workspace 2",
            "email": "email.owner@mail.com"
        },
    },
    {
        "workspace": "63b2f7ed605fae12406e6876",
        "role": "65ca3c0dfdcdb0280257ba12",
        "_id": "65d4d957f859e5f7698f66b9",
        "owner": {
            "_id":"identifier",
            "name": "Workspace 3",
            "email": "email.owner@mail.com"
        }
    }    
]
```
````

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

## List of social accounts

## List of all social accounts in a workspace

<mark style="color:blue;">`GET`</mark> `https://api.asters.ai/automations/workspaces/:id/socialAccounts`

#### Path Parameters

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| x-asters-token<mark style="color:red;">\*</mark> | String | API Key generated in Asters for user authentication |

#### Headers

| Name | Type   | Description          |
| ---- | ------ | -------------------- |
|      | String | Workspace identifier |

{% tabs %}
{% tab title="200 Social accounts successfully retrieved" %}

```javascript
[
  {
    "_id": "65e6fc2b24c5c7513239744f",
    "name": "Asters Test",
    "account_id": "urn:li:organization:101951389",
    "picture": "",
    "provider": "linkedin",
    "user": "6491da821e0d8b1568a88447",
    "workspace": "625cb3bf4183811a7d3f6df2",
    "profileType": "organization",
    "updated_at": "2024-03-05T11:22:13.071Z",
    "created_at": "2024-03-05T11:04:11.905Z",
    "expired": false,
    "__v": 0,
    "deleted": false
  },
  {
    "_id": "65e88fc73ef018561b0e97ed",
    "name": "Asters Test 1",
    "account_id": "UCO1H6k_1jALmatLqeXnCXQg",
    "picture": "https://yt3.ggpht.com/ytc/AIdro_mZrQDDx6fnCT8IJk_qKjplp4OTfRDwzFexP4BhlGQOFkx9dtk79KmlqyYswusH=s800-c-k-c0x00ffffff-no-rj",
    "provider": "youtube",
    "user": "6491da821e0d8b1568a88447",
    "workspace": "625cb3bf4183811a7d3f6df2",
    "deleted": false,
    "updated_at": "2024-03-13T00:00:00.655Z",
    "created_at": "2024-03-06T15:46:15.853Z",
    "expired": false,
    "__v": 0
  },
  {
    "_id": "65eecc2c8a7b51bd55bae54f",
    "name": "Asters Test 3",
    "account_id": "104444648547630",
    "picture": "https://scontent.fqpa1-1.fna.fbcdn.net/v/t39.30808-1/385698540_618743890458100_614969213646487868_n.jpg?stp=cp0_dst-jpg_p50x50&_nc_cat=102&ccb=1-7&_nc_sid=5f2048&_nc_ohc=LQym1CBoKcUAX8yzopJ&_nc_ht=scontent.fqpa1-1.fna&cb_e2o_trans=q&edm=AGaHXAAEAAAA&oh=00_AfDmkV5zprrUqWjwfDzu90F2zBU0JMrLEv8d2BjyvwdRTw&oe=65F633F8",
    "provider": "facebook",
    "user": "625cb3bf4183811a7d3f6df0",
    "workspace": "625cb3bf4183811a7d3f6df2",
    "profileType": "page",
    "deleted": false,
    "updated_at": "2024-03-13T10:29:08.421Z",
    "created_at": "2024-03-11T09:17:32.665Z",
    "expired": false,
    "__v": 0
  }
]
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

## Generate Post

## List of the user's workspaces

<mark style="color:green;">`POST`</mark> `https://api.asters.ai/automations/posts/generate`&#x20;

#### Headers

| Name                                             | Type   | Description                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------- |
| x-asters-token<mark style="color:red;">\*</mark> | String | API Key generated in Asters for user authentication |

#### Request Body

| Name                                     | Type | Description                    |
| ---------------------------------------- | ---- | ------------------------------ |
| params<mark style="color:red;">\*</mark> | any  | Object with all Zapier fields. |

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

```javascript
{
    "status":"created",
    "id": "post_identifier"
}
```

{% endtab %}

{% tab title="401 Permission denied - User not authorized" %}
User not authorized
{% endtab %}

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

```javascript
{
    // Response
}
```

{% 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.asters.ai/api/endpoints/autopilot.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.
