Organization API
This page provides routes for managing organizations. The following routes are available:
GET/organizationRetrieves a list of all organizations.POST/organizationCreates a new organization.GET/organization/:orgIdRetrieves details of a specific organization by ID.PATCH/organization/:orgIdUpdates an existing organization by ID.DELETE/organization/:orgIdDeletes an organization by ID.PATCH/organization/logoUploads a new organization logo.GET/organization/queryRetrieves a list of organizations based on a query.
Retrieve a List of Organizations
This route retrieves a list of all organizations in the system.
GET https://api.token.web3sandpit.com/api/v1/organization/
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires ADMIN role with read permission.
Parameters
None
Example
{}{
"organization": [
{
"blockchainDetails": {
"token": {
"supply": []
},
"wallet": {
"accountAddress": "0xAa5E620b5d03bDf056B2F1798831A763DD81234",
"mnemonic": "4afEBGYRTNsTju8MUYWFTw==:SpvIZDmap84HXau1YJ9yuftXwid0EYV5VafulBmPjc4z+StOtYpxBLNo6G1yhIfwBdTpdJaE7P9XK9esGjOfdH/g50ONa4o=",
"privateKey": "4afEBGYRTNsTju8MUYWFTw==:FYCcNTSDo5MLX/6mNN9/q+kAlyZjGNItRrD/zBfLwIpm7XRJ7oJjFOB67n8u0Za1DsK0IJaH+rldI4+9QnHJNT/t"
}
},
"scheduledTasks": {
"excludeFromRetrieve": false
},
"_id": "672c8ed4a12bc3b08fc3b2c4",
"accessScope": [
"admin",
"read",
"write",
"delete",
"create",
"update",
"user_management",
"subscription_management",
"token_management",
"token_send",
"token_read",
"organization_management",
"api_key_management"
],
"apiKeys": [],
"deleted": false,
"organizationName": "orgname",
"createdAt": "2024-11-07T09:56:37.481Z",
"updatedAt": "2024-11-11T09:10:53.507Z",
"__v": 0,
"ownedBy": {
"deleted": false,
"email": "johndoe88@example.com",
"orgId": "672c8ed4a12bc3b08fc3b2c4",
"userId": "6731ca19a5c49fb22d851677",
"walletAddress": "",
"credits": [],
"creditsRemaining": 0,
"creditsTotal": 0,
"creditsUsed": 0,
"id": "6731ca1dc2e0f58ffd874a05"
},
"id": "672c8ed4a12bc3b08fc3b2c4"
}
]
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Create a New Organization
This route creates a new organization with the provided details.
POST https://api.token.web3sandpit.com/api/v1/organization/
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires ADMIN role with write and create permissions.
Parameters
None
Example
{
"_id": "67036192840366f473a7ae69", //organization id
"accessScope": ["read", "write", "update", "create"], //access scope
"organizationName": "OrgName" //name of the organization
}{
"organization": {
"accessScope": ["read", "write", "update", "create"],
"apiKeys": [],
"blockchainDetails": {
"wallet": {
"accountAddress": "0x138E1837bdA3b58028d77DA93B32eE77cC410fb8",
"mnemonic": "yG31YGIBHtmq8vrSQIHjww==:Mez9evYBoBw9SKrsXLdu3/mwdl4t3K4b8uAJqn6LSLlbwYjZ+5d/xpyXCwKdOxtwhgfENAwZQ58ri227NCmvPmqxq8+Cum0GmW0t6XaEuA==",
"privateKey": "yG31YGIBHtmq8vrSQIHjww==:ZOz/KrxA5hljGeyqW/Mvzbi/IQBrgbQN5eZO7GrTGL4bgMqaoJZ11I3AXw/aLRczxFXJIFYLEcornXr9NHSgZG/0"
},
"token": {
"supply": []
}
},
"deleted": false,
"organizationName": "OrgName",
"scheduledTasks": {
"excludeFromRetrieve": false
},
"id": "67036192840366f473a7ae65"
}
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Retrieve an Organization by ID
This route retrieves an organization by its unique identifier.
GET https://api.token.web3sandpit.com/api/v1/organization/:orgId
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires USER role with read permission.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| orgId | string | Yes | The ID of the organization to retrieve |
Example
{}{
"accountBalance": "0.083670967628105572",
"organization": {
"blockchainDetails": {
"token": {
"contractAddress": "0xEe08dE427037D756DFF2E19e3502E7522FEB3fii",
"name": "TestTOKEN",
"networkName": "amoy",
"supply": [
{
"amount": 100,
"timestamp": "2024-10-25T12:21:22.332Z"
}
],
"symbol": "TT",
"totalSupply": 100
},
"wallet": {
"accountAddress": "0xd3cD3419d3e4552744bFf01e8cDF9464AeF0baCB",
"mnemonic": "rUV70bMyxAzHvGlNxtQmeA==:/da8G4tnSIw1hFbExBynMl7WY7wm96h/mU6uJsgIZRN/9AbMW7MJ6kdQXLff3q7JB40URvywzDLia/RCtHXQ3l+4pyKi16dXnmUZT7ZN",
"privateKey": "rUV70bMyxAzHvGlNxtQmeA==:qMDyS9U5Cd1z3VnGlFflcwmcf65i9PIvlgi6dMhbdEB/sgbZH/IBuRpAHbKIiLyIUNZMBK7gmTS3NKkH4SjbglX4"
}
},
"organizationLogo": {
"originalImage": "https://tokenminter.blob.core.windows.net/671a3c8d6d5a1d46dff7ee/logo-e778f855.webp",
"thumbnailImage": "https://tokenminter.blob.core.windows.net/671a3c86d5a1d46dff7ee/logo-thumbnail-e778f855.webp"
},
"scheduledTasks": {
"excludeFromRetrieve": false
},
"accessScope": [
"admin",
"read",
"write",
"delete",
"create",
"update",
"user_management",
"subscription_management",
"token_management",
"token_send",
"token_read",
"organization_management",
"api_key_management"
],
"apiKeys": [],
"deleted": false,
"organizationName": "TrialOrg",
"ownedBy": "671b8bad65b5bb889dd83c84",
"id": "671a3c8db86d5a1d46dff7ee"
}
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Update an Organization
This route updates an organization by its unique identifier.
PUT https://api.token.web3sandpit.com/api/v1/organization/:orgId
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires ADMIN role with update permission.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| orgId | string | Yes | The ID of the organization to retrieve |
Example
{
"organizationName": "TrialOrg" //name of the organization
}{
"organization": {
"blockchainDetails": {
"token": {
"contractAddress": "0xEe08dE427037D756DFF2E19e3502E7522FEB3f9F",
"name": "TestTOKEN",
"networkName": "amoy",
"supply": [
{
"amount": 100,
"timestamp": "2024-10-25T12:21:22.332Z"
}
],
"symbol": "TT",
"totalSupply": 100
},
"wallet": {
"accountAddress": "0xd3cD3419d3e4552744bFf01e8cDF9464AeF0baCB",
"mnemonic": "rUV70bMyxAzHvGlNxtQmeA==:/da8G4tnSIw1hFbExBynMl7WY7wm96h/mU6uJsgIZRN/9AbMW7MJ6kdQXLff3q7JB40URvywzDLia/RCtHXQ3l+4pyKi16dXnmUZT7ZN",
"privateKey": "rUV70bMyxAzHvGlNxtQmeA==:qMDyS9U5Cd1z3VnGlFflcwmcf65i9PIvlgi6dMhbdEB/sgbZH/IBuRpAHbKIiLyIUNZMBK7gmTS3NKkH4SjbglX4"
}
},
"organizationLogo": {
"originalImage": "https://tokenminter.blob.core.windows.net/671a3c8db86d5auu46dff7ee/logo-e778f855.webp",
"thumbnailImage": "https://tokenminter.blob.core.windows.net/671a3c8db86d5a1d98iff7ee/logo-thumbnail-e778f855.webp"
},
"scheduledTasks": {
"excludeFromRetrieve": false
},
"accessScope": [
"admin",
"read",
"write",
"delete",
"create",
"update",
"user_management",
"subscription_management",
"token_management",
"token_send",
"token_read",
"organization_management",
"api_key_management"
],
"apiKeys": [],
"deleted": false,
"organizationName": "TrialOrg",
"ownedBy": "671b8bad65b5bb889dd83c84",
"id": "671a3c8db86d5a1d46dff7ee"
}
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Delete an Organization
This route deletes an organization by its unique identifier.
DELETE https://api.token.web3sandpit.com/api/v1/organization/:orgId
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires ADMIN role with delete permission.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| orgId | string | Yes | The ID of the organization to retrieve |
Example
{}{
"deletedOrganization": {
"blockchainDetails": {
"token": {
"supply": []
},
"wallet": {
"accountAddress": "0xD78cE7283750D7147908d7982c9f988bfCa0568B",
"mnemonic": "Wk3fO+Sd80LFbYyRw1WwOw==:nVa7HzF0s4kw8m3KpWtd2dr//76pUuubbNlczN2Az3QfXRepyGbkLjdu0yhmAn6Ukd5Dl0s1ktxLdYU6sO2q93DzI7LtOpp32zI=",
"privateKey": "Wk3fO+Sd80LFbYyRw1WwOw==:31vkCzcl74Mi5TKP/CtOjtG0//q/R6qLP91LicvVkCkSUVP5xyXuOTMohyo1BWiVxckY0kBkkpgNIcI3pf3yoSyn"
}
},
"scheduledTasks": {
"excludeFromRetrieve": false
},
"accessScope": ["read", "write", "update", "create"],
"apiKeys": [],
"deleted": true,
"organizationName": "OrgName",
"id": "67036192840366f473a7ae56"
}
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Update an Organization logo by owner
This route updates allows the owner of an organization to update the logo of the organization.
PATCH https://api.token.web3sandpit.com/api/v1/organization/organization/logo
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires OWNER role with update permission.
Parameters
None
Example
- `file` (binary): The logo file to upload{
"originalImageUploadResult": {
"fileUrl": "https://tokenminter.blob.core.windows.net/671a3c8db86d5a1d46dff7ee/logo-5f2c634e.webp",
"response": {
"etag": "\"0x8DD03D8B070B044\"",
"lastModified": "2024-11-13T11:45:36.000Z",
"contentMD5": {
"type": "Buffer",
"data": [216, 69, 64, 184, 34, 219, 62, 46, 195, 192, 58, 72, 185, 66, 248, 74]
},
"clientRequestId": "f86efb02-2ff2-455c-aa1e-b2688765bcc4",
"requestId": "1397a7a2-b01e-0009-21c1-352dce000000",
"version": "2024-11-04",
"versionId": "2024-11-13T11:45:36.4472900Z",
"date": "2024-11-13T11:45:36.000Z",
"isServerEncrypted": true
}
},
"thumbnailImageUploadResult": {
"fileUrl": "https://tokenminter.blob.core.windows.net/671a3c8db86d5a1d46dff7ee/logo-thumbnail-5f2c634e.webp",
"response": {
"etag": "\"0x8DD03D8B072ABC7\"",
"lastModified": "2024-11-13T11:45:36.000Z",
"contentMD5": {
"type": "Buffer",
"data": [216, 69, 64, 184, 34, 219, 62, 46, 195, 192, 58, 72, 185, 66, 248, 74]
},
"clientRequestId": "271b2d64-617d-4559-a0ea-4ef033a02575",
"requestId": "61ce0445-e01e-0014-19c1-352072000000",
"version": "2024-11-04",
"versionId": "2024-11-13T11:45:36.4602823Z",
"date": "2024-11-13T11:45:36.000Z",
"isServerEncrypted": true
}
}
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Retrieve an Organization by query
This route retrieves an organization by query.
GET https://api.token.web3sandpit.com/api/v1/organization/query
INFO
Authentication: Requires ApiKey for authentication.
Permissions: Requires ADMIN role with read permission.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Query string to search organizations |
Example
{}{
"accountBalance": "0.083670967628105572",
"organization": {
"blockchainDetails": {
"token": {
"contractAddress": "0xEe08dE427037D756DFF2E19e3502E7522FEB3fii",
"name": "TestTOKEN",
"networkName": "amoy",
"supply": [
{
"amount": 100,
"timestamp": "2024-10-25T12:21:22.332Z"
}
],
"symbol": "TT",
"totalSupply": 100
},
"wallet": {
"accountAddress": "0xd3cD3419d3e4552744bFf01e8cDF9464AeF0baCB",
"mnemonic": "rUV70bMyxAzHvGlNxtQmeA==:/da8G4tnSIw1hFbExBynMl7WY7wm96h/mU6uJsgIZRN/9AbMW7MJ6kdQXLff3q7JB40URvywzDLia/RCtHXQ3l+4pyKi16dXnmUZT7ZN",
"privateKey": "rUV70bMyxAzHvGlNxtQmeA==:qMDyS9U5Cd1z3VnGlFflcwmcf65i9PIvlgi6dMhbdEB/sgbZH/IBuRpAHbKIiLyIUNZMBK7gmTS3NKkH4SjbglX4"
}
},
"organizationLogo": {
"originalImage": "https://tokenminter.blob.core.windows.net/671a3c8d6d5a1d46dff7ee/logo-e778f855.webp",
"thumbnailImage": "https://tokenminter.blob.core.windows.net/671a3c86d5a1d46dff7ee/logo-thumbnail-e778f855.webp"
},
"scheduledTasks": {
"excludeFromRetrieve": false
},
"accessScope": [
"admin",
"read",
"write",
"delete",
"create",
"update",
"user_management",
"subscription_management",
"token_management",
"token_send",
"token_read",
"organization_management",
"api_key_management"
],
"apiKeys": [],
"deleted": false,
"organizationName": "TrialOrg",
"ownedBy": "671b8bad65b5bb889dd83c84",
"id": "671a3c8db86d5a1d46dff7ee"
}
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of user objects and pagination information. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |