GET/v1/users

List all users

Retrieve a paginated list of all users in your organisation

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Query parameters

page:stringoptional
Page number of paginated results.
Default: "1"
per_page:stringoptional
Number of items per page.
Default: "20"

Responses

StatusMeaningDescription
200OKReturns a list of users in the organisation
401UnauthorizedUnauthenticated
500Internal Server ErrorInternal Server Error

Response Schema

result:object[]
result_info:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/users
curl --request GET \
  --url https://api.onlineornot.com/v1/users \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": [
    {
      "id": "abc123",
      "first_name": "Jane",
      "last_name": "Doe",
      "email": "[email protected]",
      "image": "https://example.com/avatar.jpg",
      "role": "STANDARD"
    }
  ],
  "result_info": {
    "page": 1,
    "per_page": 20,
    "count": 1,
    "total_count": 1
  },
  "success": true,
  "errors": [],
  "messages": []
}

DELETE/v1/users/{user_id}

Remove a user from the organisation

Remove a team member from your organisation

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Path parameters

user_id:string
The unique identifier of the user

Responses

StatusMeaningDescription
200OKReturns the ID of the removed user
400Bad RequestBad Request - Invalid user ID or cannot remove yourself
401UnauthorizedUnauthenticated
403ForbiddenForbidden - Insufficient permissions
404Not FoundNot Found - User not in organisation
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

DELETE
/v1/users/{user_id}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/users/abc123def \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "abc123"
  },
  "success": true,
  "errors": [],
  "messages": []
}

GET/v1/invitations

List all invitations

Retrieve a paginated list of all pending invitations in your organisation

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Query parameters

page:stringoptional
Page number of paginated results.
Default: "1"
per_page:stringoptional
Number of items per page.
Default: "20"

Responses

StatusMeaningDescription
200OKReturns a list of pending invitations
401UnauthorizedUnauthenticated
500Internal Server ErrorInternal Server Error

Response Schema

result:object[]
result_info:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/invitations
curl --request GET \
  --url https://api.onlineornot.com/v1/invitations \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": [
    {
      "id": "inv123",
      "email": "[email protected]",
      "role": "STANDARD",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "result_info": {
    "page": 1,
    "per_page": 20,
    "count": 1,
    "total_count": 1
  },
  "success": true,
  "errors": [],
  "messages": []
}

POST/v1/invitations

Create an invitation

Send an invitation email to add a new team member to your organisation

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Body parameters

email:string(email)
The email address to send the invitation to
role:stringoptional
The role to assign to the invited user
Accepted values: "ADMIN" | "STANDARD"
Default: "STANDARD"

Responses

StatusMeaningDescription
201CreatedReturns the created invitation
400Bad RequestBad Request - Invalid email or user already invited/exists
401UnauthorizedUnauthenticated
403ForbiddenForbidden - Plan limit reached
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

POST
/v1/invitations
curl --request POST \
  --url https://api.onlineornot.com/v1/invitations \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"email":"[email protected]","role":"STANDARD"}'

Response

{
  "result": {
    "id": "inv123",
    "email": "[email protected]",
    "role": "STANDARD",
    "created_at": "2024-01-15T10:30:00Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?