Authentication

Social login

Exchange a token from a social login provider (currently only google) for an Assinafy access token.

Copy as Markdown Open in ChatGPT Open in Claude

post/v1/authentication/social-login

Request body

provider'google' required
tokenstring required

Access/ID token from the provider.

has_accepted_termsboolean required

Example request

{
  "provider": "google",
  "token": "yOTUvImV4cCI6MTY3OTY1ODY5NS...",
  "has_accepted_terms": true
}

Response

Access token, user and accounts

statusinteger

HTTP status code, mirrored in the body.

messagestring

Human-readable message; empty on success.

Example response

{
  "status": 200,
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
    "user": {
      "id": "bgjazeo5r9v2lq7l36dx48np",
      "name": "John Smith",
      "email": "example@example.com",
      "telephone": "17989206641",
      "government_id": "15774136604",
      "has_accepted_terms": true,
      "created_at": "2023-03-03T11:51:34Z"
    },
    "accounts": [
      {
        "id": "6401df46d6a6b0c692d9ec49",
        "name": "JS",
        "roles": [
          "owner"
        ],
        "is_delete_allowed": true,
        "created_at": "2023-03-03T11:51:34Z"
      }
    ]
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.