# Rest API

The Missive API lets you enrich Missive conversations with content from anywhere on the web. You can also automate tasks such as creating and sending drafts, syncing contacts and more.

<div data-with-frame="true"><img src="https://content.gitbook.com/content/egxqkD7AXM4n11rNf5qI/blobs/sKEVK3dhreFMwkYiWFM8/post%20demo%20837ff16f2134b2eb4887a40565599235342f710c7fcf8da425fc5afe91d554ca.png" alt="Example of a post created using the REST API" width="563"></div>

e.g. An action in another app inserting a post in a conversation.

#### Basics

The API is a collection of endpoints with a method (eg. `POST`) and a URL in the form of:

```
https://public.missiveapp.com/v1/:endpoint_name
```

#### Authentication

To start using the API, you first need to get your API token. Get it from your Missive preferences, click the **API** tab, then the **Create a new token** link.

{% hint style="info" %}
You need to be part of an organization subscribed to the [Productive plan](https://missiveapp.com/pricing) in order to generate API tokens.
{% endhint %}

You must transmit your user token as a `Bearer` token in the `Authorization` HTTP header.

{% code title="Example request" %}

```http
POST /v1/drafts
Host: public.missiveapp.com
Authorization: Bearer missive_pat-26pApm_QTmyhLLbA...FwoFGmJ6x-6fikpQ
```

{% endcode %}

#### Responses

All API responses are formatted as [JSON](http://www.json.org/), including errors. Successful `POST` requests may return the [201](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) status code with no body.

#### Evaluating responses

You should infer the success of your requests from the returned HTTP status code. A successful request will return either a [200](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) or [201](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) status code.

#### POST bodies

You must explicitly send POST requests with `Content-Type: application/json`.

{% code title="Example POST" %}

```http
POST /v1/drafts
Host: public.missiveapp.com
Authorization: Bearer missive_pat-26pApm_QTmyhLLbA...FwoFGmJ6x-6fikpQ
Content-Type: application/json

{"drafts":{}}
```

{% endcode %}

#### Resource IDs

To interact with resources via the API, you will need those resource's `ID`. For instance, if you want to apply a label to a conversation when creating a post, you will need the label `ID`. You can get those resources IDs by opening the API settings and clicking on the Resource IDs tab.

<div data-with-frame="true"><img src="https://content.gitbook.com/content/egxqkD7AXM4n11rNf5qI/blobs/o5SdZ8qUK8OD7ftWXPim/resource%20ids%20f49af9ae85108c87a6db51903e6f25c86583020b057d5e415b8eeaaa528d243a.png" alt="Find resource IDs in your API settings"></div>

Settings > API > Resource IDs

Last updated on February 24, 2020

<details>

<summary>Need more specific answers?</summary>

[Contact us](https://missiveapp.com/docs/developers/contact)

</details>
