curl --request POST \
--url https://apix.us.amity.co/api/v5/sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"userId": "<string>",
"deviceId": "<string>",
"deviceInfo": {
"kind": "ios",
"model": "<string>",
"sdkVersion": "<string>"
},
"displayName": "<string>",
"profileHandle": "<string>",
"authToken": "<string>"
}
'{
"accessToken": "<string>",
"issuedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"users": [
{
"userId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"_id": "<string>",
"path": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"roles": [
"<string>"
],
"permissions": [
"MUTE_CHANNEL"
],
"displayName": "<string>",
"profileHandle": "<string>",
"description": "<string>",
"avatarFileId": "<string>",
"avatarCustomUrl": "<string>",
"flagCount": 123,
"hashFlag": {
"bits": 123,
"hashes": 123,
"hash": [
"<string>"
]
},
"metadata": {},
"isGlobalBan": true,
"isBrand": true,
"isDeleted": true
}
],
"roles": [
{
"roleId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"permissions": [
"<string>"
],
"isDeleted": false,
"displayName": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"type": "image",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
],
"lastCachePurge": "2023-11-07T05:31:56Z",
"userType": "signed-in"
}Register a session in order to receive access token to perform SDK operations. This is the latest version with enhanced session management capabilities.
curl --request POST \
--url https://apix.us.amity.co/api/v5/sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"userId": "<string>",
"deviceId": "<string>",
"deviceInfo": {
"kind": "ios",
"model": "<string>",
"sdkVersion": "<string>"
},
"displayName": "<string>",
"profileHandle": "<string>",
"authToken": "<string>"
}
'{
"accessToken": "<string>",
"issuedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"users": [
{
"userId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"_id": "<string>",
"path": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"roles": [
"<string>"
],
"permissions": [
"MUTE_CHANNEL"
],
"displayName": "<string>",
"profileHandle": "<string>",
"description": "<string>",
"avatarFileId": "<string>",
"avatarCustomUrl": "<string>",
"flagCount": 123,
"hashFlag": {
"bits": 123,
"hashes": 123,
"hash": [
"<string>"
]
},
"metadata": {},
"isGlobalBan": true,
"isBrand": true,
"isDeleted": true
}
],
"roles": [
{
"roleId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"permissions": [
"<string>"
],
"isDeleted": false,
"displayName": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"type": "image",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
],
"lastCachePurge": "2023-11-07T05:31:56Z",
"userType": "signed-in"
}API key for network authentication
Information about user and devices that they use to connect. If displayName is provided, the user's display name is updated as well.
If userId doesn't exist, a new user will be created.
authToken needs to be passed when network option is set to secure.
accessToken expires in 30 days by default.
Unique identifier for the user. Cannot start with 'ADMIN_' or 'DELETED_' prefixes.
1 - 50Unique identifier for the device
1 - 150Optional device information for analytics and debugging
Show child attributes
User's display name (optional, will update user if provided)
100User's profile handle (optional, will update user if provided)
100Authentication token from /api/v3/authentication/token or /api/v4/authentication/token (required for secure networks)
1 - 100Session Information with access token and user data
JWT access token for API authentication
Token issuance timestamp
Token expiration timestamp
User information array
Show child attributes
User roles array
Show child attributes
Associated files array
Show child attributes
Date of the last cache purge
Type of user (e.g., signed-in, visitor, bot)
signed-in, visitor, bot "signed-in"