# OAuth

OAuth grant types supported

* `refresh_token` &#x20;
* `password`

## Get Access Token

<mark style="color:green;">`POST`</mark> `https://owner-api.teslamotors.com/oauth/token`

Performs the login and returns the access token for all subsequent actions

#### Headers

| Name         | Type   | Description        |
| ------------ | ------ | ------------------ |
| Content-Type | string | `application/json` |

#### Request Body

| Name           | Type   | Description                                                        |
| -------------- | ------ | ------------------------------------------------------------------ |
| password       | string | tesla.com user password                                            |
| email          | string | tesla.com user email address                                       |
| client\_secret | string | `c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3` |
| client\_id     | string | `81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384` |
| grant\_type    | string | `password` or `refresh_token`                                      |

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

```javascript
{
  "access_token":"ACCESS_TOKEN_FOR_ALL_API_CALLS",
  "token_type":"bearer",
  "expires_in":3888000,
  "refresh_token":"REFRESH_TOKEN_FOR_REFRESH_API_CALL",
  "created_at":1571519135
}
```

{% endtab %}
{% endtabs %}

## Revoke Access Token

<mark style="color:green;">`POST`</mark> `https://owner-api.teslamotors.com/oauth/revoke`

Revokes the `{access_token}` issued by the token command

#### Path Parameters

| Name         | Type   | Description        |
| ------------ | ------ | ------------------ |
| Content-Type | string | `application/json` |

#### Request Body

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | `{access_token}` |

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

```
```

{% endtab %}
{% endtabs %}
