Accounts

Note

This API requires authentication.

The following API endpoints cover a users account.

Profile

Returns information about your profile.

GET /api/v3/accounts/profile/

Request:

curl "https://addons.mozilla.org/api/v3/accounts/profile/"
    -H "Authorization: JWT <jwt-token>"

Response:

{
    "username": "bob",
    "display_name": "bob",
    "email": "a@m.o",
    "bio": "Some biography",
    "deleted": false,
    "display_collections": false,
    "display_collections_fav": false,
    "homepage": "https://a.m.o",
    "location": "Vancouver",
    "notes": null,
    "occupation": "",
    "picture_type": "",
    "picture_url": "/static/img/anon_user.png",
    "read_dev_agreement": "2015-11-20T18:36:12",
    "is_verified": true,
    "region": null,
    "lang": "en-US"
}
Status Codes:

Super-creation

This allows you to generate a new user account and sign in as that user.

Important

  • Your API user must be in the Accounts:SuperCreate group to access this endpoint. Use manage.py createsuperuser --add-to-supercreate-group to create a superuser with proper access.
  • This endpoint is not available in all API environments.
POST /api/v3/accounts/super-create/

Request:

Parameters:
  • email – assign the user a specific email address. A fake email will be assigned by default.
  • username – assign the user a specific username. A random username will be assigned by default.
  • fxa_id – assign the user a Firefox Accounts ID, like one returned in the uuid parameter of a profile request. This is empty by default, meaning the user’s account will need to be migrated to a Firefox Account.
  • group

    assign the user to a permission group. Valid choices:

    • reviewer: can access add-on reviewer pages, formerly known as Editor Tools
    • admin: can access any protected page
curl "https://addons.mozilla.org/api/v3/accounts/super-create/" \
    -X POST -H "Authorization: JWT <jwt-token>"

Response:

{
    "username": "super-created-7ee304ce",
    "display_name": "Super Created 7ee304ce",
    "user_id": 10985,
    "email": "super-created-7ee304ce@addons.mozilla.org",
    "fxa_id": null,
    "groups": [],
    "session_cookie": {
        "encoded": "sessionid=.eJyrVopPLC3JiC8tTi2KT...",
        "name": "sessionid",
        "value": ".eJyrVopPLC3JiC8tTi2KT..."
    }
}
Status Codes:

The session cookie will enable you to sign in for a limited time as this new user. You can pass it to any login-protected view like this:

curl --cookie sessionid=... -s -D - \
    "https://addons.mozilla.org/en-US/developers/addon/submit/1" \
    -o /dev/null

Session

Log out of the current session. This is for use with the internal authentication that authenticates browser sessions.

DELETE /api/v3/accounts/session/

Request:

curl "https://addons.mozilla.org/api/v3/accounts/session/"
    -H "Authorization: Bearer <jwt-token>" -X DELETE

Response:

{
    "ok": true
}
Status Codes: