URL http://localhost:4500/auth/user/signup Method POST only Body

Users of your software or backend, can signup themselves via this API. You can use this directly to send your signup form data to, or call this after some validation on your side. Generally, this is enough for letting public users to create an account on themselves, it provides the validation and security checks.

Quick curl sample

In case you are running FireBack on the port 4500, just run this on terminal/powershell or change the url to correct one.

curl -X POST --data '{"email":"xyz","password":"xyz"}' http://localhost:4500/auth/user/signup

This API represents the traditional email/password mechanism to create a user. If succeeds, it will return the authentication token as the body.

{
  "email": "newuser1@gmail.com",
  "password": "123321"
}

Possible Errors

In case you send the empty body, or any missing fields, it will be returning you an error object, with sub items.

Please note that fields "email" and "password" are required.

{
  "error": {
    "code": "VALIDATION",
    "errors": [
      { "location": "email", "message": "FIELD_MISSING" },
      { "location": "password", "message": "FIELD_MISSING" }
    ]
  }
}

Expected successful response

In case of success, you will get an access token that you have to include in your every authenticated request header.

{
  "data": {
    "item": {
      "token": "6ca1712c4b5f07b66ec9b55a12c87a2c96777a0c0112dd771b063c7ed45bd02e",
      "user": {
        "ID": 1,
        "CreatedAt": "2021-09-19T17:01:29.393013+04:30",
        "UpdatedAt": "2021-09-19T17:01:29.393013+04:30",
        "DeletedAt": null,
        "firstName": "",
        "lastName": "",
        "uniqueId": "fb11ce7c-de07-43b1-a5c1-339a55867b19",
        "Passports": null
      },
      "workspaces": [
        {
          "ID": 1,
          "CreatedAt": "2021-09-19T17:01:29.396157+04:30",
          "UpdatedAt": "2021-09-19T17:01:29.396157+04:30",
          "DeletedAt": null,
          "WorkspaceID": 1,
          "Workspace": {
            "ID": 1,
            "CreatedAt": "2021-09-19T17:01:29.394843+04:30",
            "UpdatedAt": "2021-09-19T17:01:29.394843+04:30",
            "DeletedAt": null,
            "name": "cypress_user_28_66285@test.com workspace",
            "description": "",
            "uniqueId": "abbad989-9506-4a1f-b68e-cee5ebc72ffb"
          },
          "RoleID": 1,
          "Role": {
            "ID": 1,
            "CreatedAt": "2021-09-19T17:01:29.395356+04:30",
            "UpdatedAt": "2021-09-19T17:01:29.395356+04:30",
            "DeletedAt": null,
            "uniqueId": "7aae0cf2-b9e3-4a37-aac9-ad8779b900a2",
            "name": "Owner",
            "capabilities": "@root/owner+",
            "WorkspaceID": 1,
            "Workspace": {
              "ID": 0,
              "CreatedAt": "0001-01-01T00:00:00Z",
              "UpdatedAt": "0001-01-01T00:00:00Z",
              "DeletedAt": null,
              "name": "",
              "description": "",
              "uniqueId": ""
            }
          },
          "UserID": 1,
          "User": {
            "ID": 1,
            "CreatedAt": "2021-09-19T17:01:29.393013+04:30",
            "UpdatedAt": "2021-09-19T17:01:29.393013+04:30",
            "DeletedAt": null,
            "firstName": "",
            "lastName": "",
            "uniqueId": "fb11ce7c-de07-43b1-a5c1-339a55867b19",
            "Passports": null
          },
          "uniqueId": "abbad989-9506-4a1f-b68e-cee5ebc72ffb"
        }
      ]
    }
  }
}
```