Update account

Updates an existing User account.

Access control


Updating an existing User account is possible via these endpoints:

/account/jwtJSON Web Token
/account/keyAPI Key & Secret

Request body

biostringThe User’s bio
consentstringA number that indicates the consent given by the user
controlstringA number that indicates the level of control the user prefers
githubstringThe User’s username on GitHub
imperialbooleanWhether or not the User prefers imperial units
newsletterbooleanWhether this Person prefers imperial measurements (true) or not (false)
imgstringAn image data-uri to store with this Person
passwordstringThe (new) password for the User
usernamestringThe (new) username for the User

Response status codes

Possible status codes for these endpoints are:

Status codeDescription
the request was malformed
the request lacks authentication
authentication failed
server error

If the status code is not

the error property in the response body should indicate the nature of the problem.

Response body

resultStringEither success or error
errorStringWill give info on the nature of the error. Only set if an error occurred.
account.idNumberThe ID of the User
account.bioStringThe bio of the User
account.consentNumberThe consent given by the User
account.controlNumberThe control desired by the User
account.createdAtStringDate string indicating the moment the User was created
account.emailStringThe E-mail address currently tied to the User
account.githubStringThe GitHub username of the User
account.imgStringThe URL to the image stored with this User
account.imperialBooleanWhether or not the User prefers imperial units
account.initialStringThe E-mail address that the User was created with
account.languageStringThe language preferred by the user
account.lastSignInStringDate string indicating them moment the User last signed in
account.mfaEnabledBooleanWhether or not the User has MFA enabled
account.newsletterBooleanWhether or not the User is subscribed to the FreeSewing newsletter
account.patronNumberThe level of patronage the user provides to FreeSewing
account.roleStringThe role of the User
account.statusNumberThe status of the user
account.updatedAtStringDate string indicating the last time the User was updated
account.usernameStringThe username of the User
account.lusernameStringA lowercased version of the username of the User

Example request

const udpate = await axios.put(
    bio: "I like imperial now",
    imperial: true,
    username: "ImperialLover"
    headers: {
      Authorization: `Bearer ${token}`

Example response

  "result": "success",
  "account": {
    "id": 14,
    "bio": "I like imperial now",
    "consent": 1,
    "control": 1,
    "createdAt": "2022-11-19T18:15:22.642Z",
    "email": "test_54c6856275aaa8a1@freesewing.dev",
    "github": "",
    "img": "https://freesewing.org/avatar.svg",
    "imperial": true,
    "initial": "test_54c6856275aaa8a1@freesewing.dev",
    "language": "en",
    "lastSignIn": "2022-11-19T18:15:22.668Z",
    "mfaEnabled": false,
    "newsletter": false,
    "patron": 0,
    "role": "user",
    "status": 1,
    "updatedAt": "2022-11-19T18:15:22.668Z",
    "username": "ImperialLover",
    "lusername": "imperiallover"