Login POST
Authenticate with email and password to obtain a JWT token.
Endpoint
POST https://api.pocketalert.app/v1/auth/signinRequest
Headers
| Header | Required | Description |
|---|---|---|
Content-Type | ✅ | application/json |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | ✅ | Your registered email address |
password | string | ✅ | Your account password |
Example Request
bash
curl -X POST "https://api.pocketalert.app/v1/auth/signin" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "your-password"
}'javascript
const response = await fetch('https://api.pocketalert.app/v1/auth/signin', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '[email protected]',
password: 'your-password'
})
});
const { token } = await response.json();
// Use token in Authorization header for subsequent requestspython
import requests
response = requests.post(
'https://api.pocketalert.app/v1/auth/signin',
json={
'email': '[email protected]',
'password': 'your-password'
}
)
data = response.json()
# Use token in Authorization header for subsequent requestsphp
$response = Http::post('https://api.pocketalert.app/v1/auth/signin', [
'email' => '[email protected]',
'password' => 'your-password',
]);
$token = $response->json()['token'];
// Use token in Authorization header for subsequent requestsResponse
Success Response
200 OK
Authentication successful
| Field | Type | Description |
|---|---|---|
token | string | JWT token for API authentication |
email | string | User's email address |
name | string | User's display name |
avatar | string | URL to user's avatar image |
json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"email": "[email protected]",
"name": "John Doe",
"avatar": ""
}Using the Token
After obtaining the token, include it in subsequent requests:
bash
curl -X GET "https://api.pocketalert.app/v1/messages" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."Error Responses
| Status | Description |
|---|---|
401 | Invalid credentials |
422 | Validation Error — Missing email or password |
Recommendation
For server-side integrations, we recommend using API Keys instead of JWT tokens. API keys don't expire and are easier to manage.
