API Documentation
Sessions ¶
Sessions ¶
GET /api/v2/sessions
Requests
GET /api/v2/sessions
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": [
{
"id": "57",
"type": "sessions",
"attributes": {
"name": null,
"note": null,
"user_id": 117,
"token": "4eeb0992-4a45-4a7f-b15b-964526b88b12",
"last_ip": null,
"location": null,
"device": null,
"platform": null,
"browser": null,
"machine": false,
"read_only": false,
"last_activity_at": "2025-09-23T06:03:29.710+02:00",
"token_expires_at": null,
"two_factor_auth": false,
"single_sign_on": false,
"agent_first_name": null,
"agent_last_name": null,
"agent_avatar": null
},
"relationships": {
"user": {
"meta": {
"included": false
}
}
}
}
],
"links": {
"first": "http://api-test.productive.io/api/v2/sessions?page%5Bnumber%5D=1&page%5Bsize%5D=30",
"last": "http://api-test.productive.io/api/v2/sessions?page%5Bnumber%5D=1&page%5Bsize%5D=30"
},
"meta": {
"current_page": 1,
"total_pages": 1,
"total_count": 1,
"page_size": 30,
"max_page_size": 200
}
}
Get all sessionsGET/api/v2/sessions
DELETE /api/v2/sessions/1
Requests
DELETE /api/v2/sessions/59
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses
This response has no content.
POST /api/v2/sessions/machine
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "sessions",
"attributes": {
"name": "test token",
"read_only": true
}
}
}
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "67",
"type": "sessions",
"attributes": {
"name": "test token",
"note": null,
"user_id": 121,
"token": "654942f4-08dc-49f5-bd7d-c409e3eb8a96",
"last_ip": "127.0.0.1",
"location": "",
"device": null,
"platform": null,
"browser": "Mozilla",
"machine": true,
"read_only": true,
"last_activity_at": "2025-09-23T06:03:29.834+02:00",
"token_expires_at": null,
"two_factor_auth": false,
"single_sign_on": false,
"agent_first_name": null,
"agent_last_name": null,
"agent_avatar": null
},
"relationships": {
"user": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}
POST /api/v2/sessions/machine
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "sessions",
"attributes": {}
}
}
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "can't be blank",
"source": {
"pointer": "data/attributes/name"
}
}
]
}
POST /api/v2/sessions/jwt?expires_in=60
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses
Headers
Content-Type: application/json; charset=utf-8
Body
{
"jwt": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMjcsImV4cCI6MTc1ODYwMDI2OSwidHlwZSI6InJlYWQtb25seSJ9.UhVRajWnt9XwJdo2fI1slcvoQUhcxFXSNTMrNJl1egs",
"payload": {
"user_id": 127,
"exp": 1758600269,
"type": "read-only"
}
}
POST /api/v2/sessions
Requests
POST /api/v2/sessions
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "sessions",
"attributes": {
"email": "login@email.com",
"password": "123123"
}
}
}
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "2176",
"type": "sessions",
"attributes": {
"name": null,
"note": null,
"user_id": 7571,
"token": "247791a0-de7b-470f-9478-7349ccd386fc",
"last_ip": "127.0.0.1",
"location": "",
"device": null,
"platform": null,
"browser": "Mozilla",
"machine": false,
"read_only": false,
"last_activity_at": "2025-09-23T06:17:41.753+02:00",
"token_expires_at": "2025-10-07T06:17:41.753+02:00",
"two_factor_auth": false,
"single_sign_on": false,
"agent_first_name": null,
"agent_last_name": null,
"agent_avatar": null
},
"relationships": {
"user": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}
POST /api/v2/sessions
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "sessions",
"attributes": {
"email": "login@email.com",
"password": "aaa"
}
}
}
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "401",
"code": "invalid_auth_token",
"title": "Unauthenticated",
"detail": "You are not authenticated",
"source": {}
}
]
}
POST /api/v2/sessions
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "sessions",
"attributes": {
"email": "login+invalid@email.com",
"password": "123123"
}
}
}
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "401",
"code": "invalid_auth_token",
"title": "Unauthenticated",
"detail": "You are not authenticated",
"source": {}
}
]
}
Create a sessionPOST/api/v2/sessions
URI Parameters
string
(required) Example: user%40mail.comemail
- password
string
(required) Example: 123password
PUT /api/v2/sessions/1/validate_otp
Requests
PUT /api/v2/sessions/2182/validate_otp
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "sessions",
"attributes": {
"otp": "718494",
"password": "123123"
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "7586"
}
}
}
}
}
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "2182",
"type": "sessions",
"attributes": {
"name": null,
"note": null,
"user_id": 7586,
"token": "5b90d7e5-4690-430c-ad07-aa77e69fa84a",
"last_ip": null,
"location": null,
"device": null,
"platform": null,
"browser": null,
"machine": false,
"read_only": false,
"last_activity_at": "2025-09-23T06:17:42.437+02:00",
"token_expires_at": null,
"two_factor_auth": true,
"single_sign_on": false,
"agent_first_name": null,
"agent_last_name": null,
"agent_avatar": null
},
"relationships": {
"user": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}
PUT /api/v2/sessions/2184/validate_otp
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "sessions",
"attributes": {
"otp": "abcdefgh",
"password": "123123"
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "7589"
}
}
}
}
}
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"data": {
"id": "2184",
"type": "sessions",
"attributes": {
"name": null,
"note": null,
"user_id": 7589,
"token": "ab9f8a75-0c51-4553-8f26-5e5564b68433",
"last_ip": null,
"location": null,
"device": null,
"platform": null,
"browser": null,
"machine": false,
"read_only": false,
"last_activity_at": "2025-09-23T06:17:42.587+02:00",
"token_expires_at": null,
"two_factor_auth": true,
"single_sign_on": false,
"agent_first_name": null,
"agent_last_name": null,
"agent_avatar": null
},
"relationships": {
"user": {
"meta": {
"included": false
}
}
}
},
"meta": {}
}
PUT /api/v2/sessions/2186/validate_otp
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "sessions",
"attributes": {
"otp": "718494",
"password": "000000"
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "7592"
}
}
}
}
}
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "401",
"code": "invalid_auth_token",
"title": "Unauthenticated",
"detail": "You are not authenticated",
"source": {}
}
]
}
PUT /api/v2/sessions/2188/validate_otp
Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
"data": {
"type": "sessions",
"attributes": {
"otp": "000000",
"password": "123123"
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "7595"
}
}
}
}
}
Responses
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
"errors": [
{
"status": "422",
"code": "invalid_attribute",
"title": "Invalid Attribute",
"detail": "attribute is invalid",
"source": {
"pointer": "data/attributes/otp"
}
}
]
}
Validates s sessionPUT/api/v2/sessions/{id}/validate_otp
URI Parameters
- id
number
(required) Example: 1session id
- password
string
(required) Example: 123password
- otp
string
(required) Example: abcotp
- user_id: `1` (number, required) - user_id
string
(required)
Generated by aglio on 23 Sep 2025