Auth

Auth routes are used to invite, register, manage, and authenticate users.


POST/api/invitation

Send an invitation to register

This route allows you to invite a user to register for Arguflow vault. The user will receive an email with a link to set their password.

Required request body attributes

  • Name
    email
    Type
    string
    Description

    The email address of the user you want to invite.

  • Name
    referral_tokens
    Type
    string array
    Description

    The referral tokens you want to associate with the user.

Response

If the invitation is successfully sent, the response will be a 200 OK with no body.

Request

POST
/invitation
curl -X POST \
  https://api.arguflow.ai/invitation \
  -H 'Content-Type: application/json' \
  -H 'Cookie: ai-editor=your_cookie_value_here' \
  -d '{
      "email": "example@example.com",
      "referral_tokens": ["token1", "token2", "token3"]
    }'

POST/api/register/:invitation_id

Register a user

This route allows a user to set their password after receiving an invitation email.

Required request body attributes

  • Name
    password
    Type
    string
    Description

    The password the user wants to set. Must be at least 8 characters.

  • Name
    password_confirmation
    Type
    string
    Description

    The password confirmation. Must match the password.

Response

If the user is successfully registered, a SlimUser type will be returned with the following properties:

  • Name
    id
    Type
    string
    Description

    The user id (UUID).

  • Name
    email
    Type
    string
    Description

    The user email.

  • Name
    username
    Type
    string | null
    Description

    The user's username.

  • Name
    website
    Type
    string | null
    Description

    The user's website.

  • Name
    visible_email
    Type
    boolean
    Description

    Whether the user's email is visible to other users. Must be true if username is null.

Request

POST
/api/register/:invitation_id
curl -X POST \
  https://api.arguflow.ai/register/{invitation_id} \
  -H 'Content-Type: application/json' \
  -H 'Cookie: ai-editor=your_cookie_value_here' \
  -d '{
      "password": "password",
      "password_confirmation": "password"
    }'

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "email": "test@test.com",
  "username": null,
  "website": null,
  "visible_email": true
}

POST/api/auth

Login

This route allows you to authenticate a user and retrieve an access token.

Required attributes

  • Name
    email
    Type
    string
    Description

    The user's email.

  • Name
    password
    Type
    string
    Description

    The user's password.

Response

If the user is successfully authenticated, the response will be a 204 OK with the auth cookie set.

Request

POST
/api/auth
  curl --request POST \
    --url https://api.arguflow.ai/api/auth \
    --header 'Content-Type: application/json' \
    --data '{
      "email": "foobar@bar.com",
      "password": "fooandbar"
  }'

DELETE/api/auth

Logout

This route allows you to logout a user and invalidate their access token.

Response

If the user is successfully logged out, the response will be a 204 OK with the auth cookie removed.

Request

DELETE
/api/auth
  curl --request DELETE \
    --url https://api.arguflow.ai/api/auth \
    --header 'Content-Type: application/json' 

GET/api/auth

Get your user info

This route allows you to get your user info.

Response

If the user is successfully authenticated, a SlimUser type will be returned with the following properties:

  • Name
    id
    Type
    string
    Description

    The user id (UUID).

  • Name
    email
    Type
    string
    Description

    The user email.

  • Name
    username
    Type
    string | null
    Description

    The user's username.

  • Name
    website
    Type
    string | null
    Description

    The user's website.

  • Name
    visible_email
    Type
    boolean
    Description

    Whether the user's email is visible to other users. Must be true if username is null.

Request

GET
/api/auth
curl --request GET \
  --url https://api.arguflow.ai/api/auth \
  --cookie 'ai-editor=your_cookie_value_here'

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "email": "foobar@bar.com",
  "username": null,
  "website": null,
  "visible_email": true
}

GET/api/password/:email

Send a password reset email

This route allows you to send a password reset email to a user.

Response

If the response is successful it will return a 204 status code with no body.

Request

GET
/password/foobar@bar.com
curl --request GET \
  --url https://api.arguflow.ai/api/password/foobar@bar.com \
  --cookie 'ai-editor=your_cookie_value_here'

POST/api/password

Reset your password

This route allows you to reset your password.

Response

If the response is successful it will return a 204 status code with no body.

Request

POST
/api/password
  curl --request POST \
    --url https://api.arguflow.ai/api/password \
    --header 'Content-Type: application/json' \
    --data '{
      "email": "foobar@bar.com",
  }'