Skip to content

POST Auth

https://api.magmasend.com/v1/oauth/login

Magmasend API requires an Access token, based on your credentials (email and password).

  • You will use this token to consume all other endpoints.
  • You can use the same token for many API calls. As long as the token has not expired, it will work.
  • A best practice is to use the same token until it expires.

Request Information

To obtain an Access token, you need to provide your email and password. Once authenticated, you will receive a token that you can use for subsequent API requests.

Make sure to handle the token securely and avoid exposing it in your code or logs.

Exemple of a body, raw (json)

json

{
    "email": "developer@magmasend.com",
    "password": "developer"
}

Example Request

Curl

curl --location 'https://api.magmasend.com/v1/oauth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "developer@magmasend.com",
    "password": "developer"
}'

Example Response

json

{
    "code": "00",
    "status": "OK",
    "access_token": "TOKEN_XXXXXXXXX",
    "token_type": "bearer",
    "expires_in": 86400
}

Example success Response


{
    "code": "00",
    "status": "OK",
    "access_token": "Uu4UgWjj4C3bLjy6VlObbsXZgFeEXUdE018U6X3BXwBUu4U....",
    "token_type": "bearer",
    "expires_in": 57910
}

Example failed Response

{
    "code": "-4",
    "status": "INVALID_CREDENTIALS"
}