# Get API Key

### <mark style="color:green;">`POST`</mark> `/auth/getkey`

Get your currently available api-key from your Mobivate account.&#x20;

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

```hsts
curl -X POST \
"https://api.mobivatebulksms.com/auth/getkey" \
-H 'Content-Type: application/json' \
-d '{ "username": "[USERNAME]", "password": "[PASSWORD]"}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Content-Type': 'application/json',
}

json_data = {
    'username': '[USERNAME]',
    'password': '[PASSWORD]',
}

response = requests.post('https://api.mobivatebulksms.com/auth/getkey', headers=headers, json=json_data)

# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{ "username": "[USERNAME]", "password": "[PASSWORD]"}'
#response = requests.post('https://api.mobivatebulksms.com/auth/getkey', headers=headers, data=data)
```

{% endtab %}
{% endtabs %}

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `No Auth`          |

**Body**

<table><thead><tr><th>Name</th><th width="131">Type</th><th width="111">Required?</th><th>Description</th></tr></thead><tbody><tr><td>username</td><td>string</td><td>Yes</td><td>Your username used to login.</td></tr><tr><td>password</td><td>string</td><td>Yes</td><td>Your password used to login.</td></tr></tbody></table>

**Response**

We use conventional HTTP response codes to indicate the success or failure of an API request. In general:

**2xx** indicate success\
**4xx** indicate an error that failed given the information provided (e.g., a required parameter was omitted)\
**5xx** errors indicate an error with ours servers (these are rare).

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

```json
{
   "apiKey":"abcd1234-9922-abcd-1234-abcd1234abcd"
}
```

{% endtab %}

{% tab title="401" %}

```json
{
   "code":401,
   "message":"Invalid Credentials"
}
```

{% endtab %}
{% endtabs %}

Upon a successful send request, our server will respond with a 200 (success) HTTP response code, and you will be provided with an API Key. The **API Key** will be used in subsequent calls to the API.

To see a full list of our **Response codes**, please [click here](/overview/introduction/understanding-response-codes.md).


---

# 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://wiki.mobivatebulksms.com/archived-docs/get-api-key.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.
