# 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](https://docs.ocoya.com/fundamentals/authentication "mention")

</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](https://docs.ocoya.com/endpoints "mention")

</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.
