# Quick Start

### About the API

Our API is RESTful, fully-featured, and easy to integrate with. You can create draft posts, schedule them, generate AI copy and more. You can use your favorite HTTP/REST library that is available for your programming language to make HTTP calls. You must send `json` payloads in your requests and expect to get `json` responses.

***

### API flow

The steps below explain the flow of how API requests are handled and how you should be making requests and getting responses back.

<details>

<summary><mark style="color:green;">Step 1</mark> - Authenticate</summary>

Every request must be authenticated, and is rate limited. You must send your API key as part of every request.

More info: [Authentication](/fundamentals/authentication.md)

</details>

<details>

<summary><mark style="color:green;">Step 2</mark> - Send request</summary>

Send requests to one of our endpoints providing the required parameters (if mandatory). If sending payloads, we only accept those in a `json` format.

More info: [Endpoints](/endpoints/me.md)

</details>

<details>

<summary><mark style="color:green;">Step 3</mark> - Get response</summary>

Get responses from one of our endpoints. We will always send responses in a `json` format.

</details>

***

### Authenticated request sample

Let's try fetching some information about our API user:

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

```bash
curl --request GET \
     --url https://app.ocoya.com/api/_public/v1/me \
     --header 'X-API-Key: XXXX'
```

{% endtab %}

{% tab title="Node.js" %}

<pre class="language-javascript"><code class="lang-javascript"><strong>const me = await fetch('https://app.ocoya.com/api/_public/v1/me', {
</strong>    method: 'GET',
    headers: {
      'Content-type': 'application/json',
      'X-API-Key': 'XXXX'
    }
  })
    .then(res => res.json())
    .catch(e => throw new Error(`An unknown error occurred`))
</code></pre>

{% endtab %}
{% endtabs %}

You should receive a response similar to this:

```json
{
    "id": "cm1uptpss0005r59c2dh8z400",
    "name": "Elon Musk",
    "email": "elon@spacex.com"
}
```

That's it! You should now be able to send requests to any of our endpoints successfully.


---

# 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.ocoya.com/getting-started/quick-start.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.
