Create account

POST /accounts

Creates a new account.


Minimal curl example

curl -ig 'https://api.mention.net/api/accounts' \
    -X POST \
    -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
    -H 'Content-Type: application/json' \
    -H 'Accept-Version: 1.19' \
    -d '{
        "name": "John Smith", 
        "email": "j.smith@nasa.com", 
        "password": "Mypass1", 
        "language_code": "en"
    }'

Available properties

Properties _ Definition Example Updatable
name required Account name "John Smith" yes
email required Account email "j.smith@nasa.com" yes
phone optional Account phone number "(202) 358-0001" yes
password required Account password. At least 6 characters Mypass1 yes
language_code required Two characters language code en yes
client optional Client name (e.g. the application name) that was used to register this user appTestMention no

Updatable

This column indicates all attributes that can be updated via a PUT request

Beware! If you want to update the password, you need to pass 2 attributes: old_password and new_password

Name

name

User name

Email

email

User email. Min 2 characters, Maximum 255 characters.

Phone

phone

User phone number.

Password

password

User Password. Should include letters, figures, and be at least 6 characters long.

Language code

language_code

For a list of language codes available, you should fetch the app data, where there is an alert languages section.

Client

client

Optionally, you can indicate the name of the client application which is registering the user.


Request example

  • Headers
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept-Version: 1.19
  • Body
{
    "name": "John Smith",
    "email": "j.smith@nasa.com",
    "password": "Mypass1",
    "language_code": "en"
}

Response response

If the request was successful, the response will return the full account data, just as if you did a GET request on that Account.

  • Body
{
    "account": {
        "id": "630929_4wgkw0o0go4wco40wos4gww44tbrsluiajok04g4gsscw8wssk",
        "name": "John Smith",
        "email": "j.smith@nasa.com",
        "language_code": "en",
        "created_at": "2016-01-18T14:49:37.0+00:00",
        "updated_at": "2016-01-18T14:49:37.0+00:00", 
        "grouped_email_notification": false,
        "default_email_notification_frequency": "daily",
        "default_desktop_notification_frequency": "hourly",
        "default_push_notification_frequency": "hourly",
        "default_trending_email_notification_frequency": "occasionally",
        "default_trending_email_notification_frequency": "never",
        "permissions": {
            "create_alert": true,
            "read_teammembers": true,
            "read_teamrequests": true,
            "read_quotastats": true
        },
        "email_subscriptions": {
            "quota_exceeded": true
        } 
    },
    "_links": {
        "self": {
            "href": "\/api\/accounts\/630929_4wgkw0o0go4wco40wos4gww44tbrsluiajok04g4gsscw8wssk"
        }
    }
}

Id

id

An unguessable id that identifies the account across the whole API.

Grouped email notification

grouped_email_notification

Boolean value that indicates if the account prefers to have all notifications grouped in a single email for all alerts.

links

A json object in which the GET url that gives access to that account can be found.