POST
/
api
/
v3
/
sessions
Register a session
curl --request POST \
  --url https://apix.us.amity.co/api/v3/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>",
  "authToken": "<string>"
}'
{
  "accessToken": "<string>",
  "refreshToken": "<string>",
  "issuedAt": "<string>",
  "expiresAt": "<string>",
  "users": [
    {
      "_id": "<string>",
      "path": "<string>",
      "userId": "<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,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "isDeleted": true
    }
  ],
  "roles": [
    {
      "roleId": "<string>",
      "displayName": "<string>",
      "updatedAt": "2023-11-07T05:31:56Z",
      "createdAt": "2023-11-07T05:31:56Z",
      "permissions": [
        "<string>"
      ],
      "isDeleted": false
    }
  ],
  "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": "<string>"
}

Headers

x-api-key
string
required

Body

application/json

Information about user and devices that he/she use to connect to. If displayName is provide, that user display is updated as well.

If userId doesn't exists, new user will be created.

authToken need to pass when network option is set to secure

userId
string
required
Required string length: 1 - 50
deviceId
string
required
Required string length: 1 - 150
deviceInfo
object
displayName
string
Maximum length: 100
authToken
string

Authentication token from /api/v3/authentication/token

Required string length: 1 - 100

Response

Session Information

accessToken
string
refreshToken
string
issuedAt
string
expiresAt
string
users
object[]
roles
object[]
files
object[]
lastCachePurge
string

Date of the last cache purge