diff --git a/network/stellar-disbursement-platform/resources/README.mdx b/network/stellar-disbursement-platform/resources/README.mdx index cafc03e7f..35a866d3d 100644 --- a/network/stellar-disbursement-platform/resources/README.mdx +++ b/network/stellar-disbursement-platform/resources/README.mdx @@ -20,5 +20,6 @@ Data on the Stellar Disbursement Platform is organized according to resources. E | [Registration](./registration/README.mdx) | | | [Statistics](./statistics/README.mdx) | | | [Users](./users/README.mdx) | | +| [Admin](./admin/README.mdx) | | diff --git a/network/stellar-disbursement-platform/resources/admin/README.mdx b/network/stellar-disbursement-platform/resources/admin/README.mdx new file mode 100644 index 000000000..1d0216ec0 --- /dev/null +++ b/network/stellar-disbursement-platform/resources/admin/README.mdx @@ -0,0 +1,20 @@ +--- +title: Admin +order: 9 +--- + +import {EndpointsTable} from "@site/src/components/EndpointsTable"; + +The Admin API oversees the management of tenants within the system, facilitating tasks such as provisioning new tenants, updating their information, and retrieving tenant data. + + + +| | | +| --- | --------------------- | +| GET | [/tenants](../get-all-tenants.api.mdx) | +| POST | [/tenants](../create-tenant.api.mdx) | +| GET | [/tenants/:arg](../retrieve-a-tenant.api.mdx) | +| PATCH | [/tenants/:id](../update-a-tenant.api.mdx) | + + + diff --git a/network/stellar-disbursement-platform/resources/create-tenant.api.mdx b/network/stellar-disbursement-platform/resources/create-tenant.api.mdx new file mode 100644 index 000000000..e7350854a --- /dev/null +++ b/network/stellar-disbursement-platform/resources/create-tenant.api.mdx @@ -0,0 +1,41 @@ +--- +id: create-tenant +title: "Create Tenant" +description: "Create Tenant" +sidebar_label: "Create Tenant" +hide_title: true +hide_table_of_contents: true +api: {"responses":{"201":{"description":"Provision a new tenant","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"1736bed3-7b92-4760-8ff2-51fb08ee079f"},"name":{"type":"string","example":"bluecorp","description":"The tenant name. It should match the pattern `^[a-z-]+$`."},"email_sender_type":{"type":"string","enum":["DRY_RUN","AWS_EMAIL"],"description":"The e-mail sender provider."},"sms_sender_type":{"type":"string","enum":["DRY_RUN","AWS_SMS","TWILIO_SMS"],"description":"The SMS sender provider."},"base_url":{"type":"string","example":"https://bluecorp-backend.sdp.org","description":"The SDP backend server's base URL."},"sdp_ui_base_url":{"type":"string","example":"https://bluecorp.sdp.org","description":"The SDP UI/dashboard Base URL."},"status":{"type":"string","enum":["TENANT_CREATED","TENANT_PROVISIONED","TENANT_ACTIVATED","TENANT_DEACTIVATED"]},"distribution_account":{"type":"string","example":"GCXAJ3XJ3VK3JFH3QMDFOSKM2NMMZBSO3VIT6EUPQWSDW2J74M23RRSL"},"created_at":{"type":"string","format":"date-time","example":"2024-03-27T17:21:51.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2024-03-27T17:21:51.000Z"}},"required":["id","name","email_sender_type","sms_sender_type","status","created_at","updated_at"],"example":{"id":"840dca45-d1df-44cd-83c1-65c04235c25f","name":"redcorp","email_sender_type":"DRY_RUN","sms_sender_type":"DRY_RUN","base_url":"https://redcorp-backend.sdp.org","sdp_ui_base_url":"https://redcorp.sdp.org","status":"TENANT_PROVISIONED","distribution_account":"GCQVDMPOEN3HHJJ64V42KUTONOXN7C6V2PSVPALEVJ7PIYOB6M3DJV7N","created_at":"2024-03-27T17:21:51.000Z","updated_at":"2024-03-27T17:21:51.000Z"}}}}},"401":{"description":"Unauthorized","headers":{},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"extras":{"type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"}}}},"example":{"error":"Not authorized","extras":{"status":401,"message":"Not authorized"}}},"examples":{"response":{"value":{"error":"Not authorized","extras":{"status":401,"message":"Not authorized"}}}}}}}},"operationId":"Create Tenant","tags":["Admin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The tenant name. It should match the pattern `^[a-z-]+$`"},"owner_email":{"type":"string","description":"The owner user e-mail address"},"owner_first_name":{"type":"string","description":"The owner user first name"},"owner_last_name":{"type":"string","description":"The owner user last name"},"organization_name":{"type":"string","description":"The organization name"},"email_sender_type":{"type":"string","enum":["DRY_RUN","AWS_EMAIL"],"description":"The e-mail sender provider."},"sms_sender_type":{"type":"string","enum":["DRY_RUN","AWS_SMS","TWILIO_SMS"],"description":"The SMS sender provider."},"base_url":{"type":"string","description":"The SDP backend server's base URL."},"sdp_ui_base_url":{"type":"string","description":"The SDP UI/dashboard Base URL."},"distribution_account":{"type":"string"}},"example":{"name":"redcorp","owner_email":"owner@redcorp.org","owner_first_name":"Owner","owner_last_name":"Last","organization_name":"Red Corp","email_sender_type":"DRY_RUN","sms_sender_type":"DRY_RUN","base_url":"https://redcorp-backend.sdp.org","sdp_ui_base_url":"https://redcorp.sdp.org"},"required":["name","owner_email","owner_first_name","owner_last_name","organization_name","email_sender_type","sms_sender_type","base_url","sdp_ui_base_url","distribution_account"]}}}},"security":[{"BasicAuth":[]}],"description":"Create Tenant","method":"post","path":"/tenants","securitySchemes":{"BearerAuth":{"type":"apiKey","name":"Authorization","in":"header","description":"JWT used for authentication, signed with an ES256 private key."},"BasicAuth":{"type":"http","scheme":"basic","description":"Basic HTTP Authentication with a base64-encoded string of 'ADMIN_ACCOUNT:ADMIN_API_KEY'."}},"jsonRequestBodyExample":{"name":"redcorp","owner_email":"owner@redcorp.org","owner_first_name":"Owner","owner_last_name":"Last","organization_name":"Red Corp","email_sender_type":"DRY_RUN","sms_sender_type":"DRY_RUN","base_url":"https://redcorp-backend.sdp.org","sdp_ui_base_url":"https://redcorp.sdp.org"},"info":{"title":"Stellar Disbursement Platform API","version":"","description":"The Stellar Disbursement Platform (SDP) is a tool built for organizations to make bulk payments to a group of recipients over the Stellar network. You can read more about using the SDP [here](https://developers.stellar.org/docs/category/use-the-stellar-disbursement-platform)."},"postman":{"name":"Create Tenant","description":{"type":"text/plain"},"url":{"path":["tenants"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}},"auth":{"type":"basic","basic":[{"type":"any","value":"","key":"username"},{"type":"any","value":"","key":"password"}]}}} +sidebar_class_name: "post api-method" +info_path: network/stellar-disbursement-platform/resources/stellar-disbursement-platform-api +custom_edit_url: null +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Create Tenant + + + +Create Tenant + +
Request Body
+ +Provision a new tenant + +
Schema
+ +Unauthorized + +
Response Headers
    Schema
      extras object
    diff --git a/network/stellar-disbursement-platform/resources/get-all-tenants.api.mdx b/network/stellar-disbursement-platform/resources/get-all-tenants.api.mdx new file mode 100644 index 000000000..f757cfb50 --- /dev/null +++ b/network/stellar-disbursement-platform/resources/get-all-tenants.api.mdx @@ -0,0 +1,41 @@ +--- +id: get-all-tenants +title: "Get All Tenants" +description: "Get All Tenants" +sidebar_label: "Get All Tenants" +hide_title: true +hide_table_of_contents: true +api: {"responses":{"200":{"description":"A list of provisioned tenants with their configurations","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"1736bed3-7b92-4760-8ff2-51fb08ee079f"},"name":{"type":"string","example":"bluecorp","description":"The tenant name. It should match the pattern `^[a-z-]+$`."},"email_sender_type":{"type":"string","enum":["DRY_RUN","AWS_EMAIL"],"description":"The e-mail sender provider."},"sms_sender_type":{"type":"string","enum":["DRY_RUN","AWS_SMS","TWILIO_SMS"],"description":"The SMS sender provider."},"base_url":{"type":"string","example":"https://bluecorp-backend.sdp.org","description":"The SDP backend server's base URL."},"sdp_ui_base_url":{"type":"string","example":"https://bluecorp.sdp.org","description":"The SDP UI/dashboard Base URL."},"status":{"type":"string","enum":["TENANT_CREATED","TENANT_PROVISIONED","TENANT_ACTIVATED","TENANT_DEACTIVATED"]},"distribution_account":{"type":"string","example":"GCXAJ3XJ3VK3JFH3QMDFOSKM2NMMZBSO3VIT6EUPQWSDW2J74M23RRSL"},"created_at":{"type":"string","format":"date-time","example":"2024-03-27T17:21:51.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2024-03-27T17:21:51.000Z"}},"required":["id","name","email_sender_type","sms_sender_type","status","created_at","updated_at"],"example":{"id":"840dca45-d1df-44cd-83c1-65c04235c25f","name":"redcorp","email_sender_type":"DRY_RUN","sms_sender_type":"DRY_RUN","base_url":"https://redcorp-backend.sdp.org","sdp_ui_base_url":"https://redcorp.sdp.org","status":"TENANT_PROVISIONED","distribution_account":"GCQVDMPOEN3HHJJ64V42KUTONOXN7C6V2PSVPALEVJ7PIYOB6M3DJV7N","created_at":"2024-03-27T17:21:51.000Z","updated_at":"2024-03-27T17:21:51.000Z"}}}}}},"401":{"description":"Unauthorized","headers":{},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"extras":{"type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"}}}},"example":{"error":"Not authorized","extras":{"status":401,"message":"Not authorized"}}},"examples":{"response":{"value":{"error":"Not authorized","extras":{"status":401,"message":"Not authorized"}}}}}}}},"operationId":"Get All Tenants","tags":["Admin"],"security":[{"BasicAuth":[]}],"description":"Get All Tenants","method":"get","path":"/tenants","securitySchemes":{"BearerAuth":{"type":"apiKey","name":"Authorization","in":"header","description":"JWT used for authentication, signed with an ES256 private key."},"BasicAuth":{"type":"http","scheme":"basic","description":"Basic HTTP Authentication with a base64-encoded string of 'ADMIN_ACCOUNT:ADMIN_API_KEY'."}},"info":{"title":"Stellar Disbursement Platform API","version":"","description":"The Stellar Disbursement Platform (SDP) is a tool built for organizations to make bulk payments to a group of recipients over the Stellar network. You can read more about using the SDP [here](https://developers.stellar.org/docs/category/use-the-stellar-disbursement-platform)."},"postman":{"name":"Get All Tenants","description":{"type":"text/plain"},"url":{"path":["tenants"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET","auth":{"type":"basic","basic":[{"type":"any","value":"","key":"username"},{"type":"any","value":"","key":"password"}]}}} +sidebar_class_name: "get api-method" +info_path: network/stellar-disbursement-platform/resources/stellar-disbursement-platform-api +custom_edit_url: null +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Get All Tenants + + + +Get All Tenants + +
    + +A list of provisioned tenants with their configurations + +
    Schema
    • Array [
    • ]
    + +Unauthorized + +
    Response Headers
      Schema
        extras object
      diff --git a/network/stellar-disbursement-platform/resources/retrieve-a-tenant.api.mdx b/network/stellar-disbursement-platform/resources/retrieve-a-tenant.api.mdx new file mode 100644 index 000000000..d143fd677 --- /dev/null +++ b/network/stellar-disbursement-platform/resources/retrieve-a-tenant.api.mdx @@ -0,0 +1,45 @@ +--- +id: retrieve-a-tenant +title: "Retrieve a Tenant" +description: "Retrieve a Tenant" +sidebar_label: "Retrieve a Tenant" +hide_title: true +hide_table_of_contents: true +api: {"responses":{"200":{"description":"Tenant details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"1736bed3-7b92-4760-8ff2-51fb08ee079f"},"name":{"type":"string","example":"bluecorp","description":"The tenant name. It should match the pattern `^[a-z-]+$`."},"email_sender_type":{"type":"string","enum":["DRY_RUN","AWS_EMAIL"],"description":"The e-mail sender provider."},"sms_sender_type":{"type":"string","enum":["DRY_RUN","AWS_SMS","TWILIO_SMS"],"description":"The SMS sender provider."},"base_url":{"type":"string","example":"https://bluecorp-backend.sdp.org","description":"The SDP backend server's base URL."},"sdp_ui_base_url":{"type":"string","example":"https://bluecorp.sdp.org","description":"The SDP UI/dashboard Base URL."},"status":{"type":"string","enum":["TENANT_CREATED","TENANT_PROVISIONED","TENANT_ACTIVATED","TENANT_DEACTIVATED"]},"distribution_account":{"type":"string","example":"GCXAJ3XJ3VK3JFH3QMDFOSKM2NMMZBSO3VIT6EUPQWSDW2J74M23RRSL"},"created_at":{"type":"string","format":"date-time","example":"2024-03-27T17:21:51.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2024-03-27T17:21:51.000Z"}},"required":["id","name","email_sender_type","sms_sender_type","status","created_at","updated_at"],"example":{"id":"840dca45-d1df-44cd-83c1-65c04235c25f","name":"redcorp","email_sender_type":"DRY_RUN","sms_sender_type":"DRY_RUN","base_url":"https://redcorp-backend.sdp.org","sdp_ui_base_url":"https://redcorp.sdp.org","status":"TENANT_PROVISIONED","distribution_account":"GCQVDMPOEN3HHJJ64V42KUTONOXN7C6V2PSVPALEVJ7PIYOB6M3DJV7N","created_at":"2024-03-27T17:21:51.000Z","updated_at":"2024-03-27T17:21:51.000Z"}}}}},"401":{"description":"Unauthorized","headers":{},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"extras":{"type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"}}}},"example":{"error":"Not authorized","extras":{"status":401,"message":"Not authorized"}}},"examples":{"response":{"value":{"error":"Not authorized","extras":{"status":401,"message":"Not authorized"}}}}}}},"404":{"description":"Not Found","headers":{},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"extras":{"type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"}}}}},"examples":{"response":{"value":{"error":"Not found","extras":{"status":404,"message":"Resource not found"}}}}}}}},"operationId":"Retrieve a Tenant","tags":["Admin"],"parameters":[{"name":"arg","in":"path","description":"ID or Name of the `Tenant`.","required":true,"schema":{"type":"string"}}],"security":[{"BasicAuth":[]}],"description":"Retrieve a Tenant","method":"get","path":"/tenants/{arg}","securitySchemes":{"BearerAuth":{"type":"apiKey","name":"Authorization","in":"header","description":"JWT used for authentication, signed with an ES256 private key."},"BasicAuth":{"type":"http","scheme":"basic","description":"Basic HTTP Authentication with a base64-encoded string of 'ADMIN_ACCOUNT:ADMIN_API_KEY'."}},"info":{"title":"Stellar Disbursement Platform API","version":"","description":"The Stellar Disbursement Platform (SDP) is a tool built for organizations to make bulk payments to a group of recipients over the Stellar network. You can read more about using the SDP [here](https://developers.stellar.org/docs/category/use-the-stellar-disbursement-platform)."},"postman":{"name":"Retrieve a Tenant","description":{"type":"text/plain"},"url":{"path":["tenants",":arg"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ID or Name of the `Tenant`.","type":"text/plain"},"type":"any","value":"","key":"arg"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET","auth":{"type":"basic","basic":[{"type":"any","value":"","key":"username"},{"type":"any","value":"","key":"password"}]}}} +sidebar_class_name: "get api-method" +info_path: network/stellar-disbursement-platform/resources/stellar-disbursement-platform-api +custom_edit_url: null +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Retrieve a Tenant + + + +Retrieve a Tenant + +
      Path Parameters
      + +Tenant details + +
      Schema
      + +Unauthorized + +
      Response Headers
        Schema
          extras object
        + +Not Found + +
        Response Headers
          Schema
            extras object
          diff --git a/network/stellar-disbursement-platform/resources/sidebar.js b/network/stellar-disbursement-platform/resources/sidebar.js index 6be80c859..53e19a7ef 100644 --- a/network/stellar-disbursement-platform/resources/sidebar.js +++ b/network/stellar-disbursement-platform/resources/sidebar.js @@ -1 +1 @@ -module.exports = [{"type":"doc","id":"stellar-disbursement-platform/resources/stellar-disbursement-platform-api"},{"type":"category","label":"Authentication","link":{"type":"generated-index","title":"Authentication","slug":"/category/stellar-disbursement-platform/resources/authentication"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/log-in","label":"Log In","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/refresh-token","label":"Refresh Token","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/authenticate-mfa","label":"Provide Multi-Factor Authentication","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/forgot-password","label":"Forgot Password","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/reset-password","label":"Reset Rassword","className":"api-method post"}]},{"type":"category","label":"Disbursements","link":{"type":"generated-index","title":"Disbursements","slug":"/category/stellar-disbursement-platform/resources/disbursements"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/list-all-disbursements","label":"List All Disbursements","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/create-disbursement","label":"Create Disbursement","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-a-disbursement","label":"Retrieve a Disbursement","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/list-all-disbursement-receivers","label":"List All Disbursement Receivers","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/upload-disbursement-instructions","label":"Upload Disbursement Instructions","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/download-disbursement-instructions","label":"Download Disbursement Instructions","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-a-disbursement-status","label":"Update a Disbursement Status","className":"api-method patch"}]},{"type":"category","label":"Payments","link":{"type":"generated-index","title":"Payments","slug":"/category/stellar-disbursement-platform/resources/payments"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/list-all-payments","label":"List All Payments","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-a-payment","label":"Retrieve a Payment","className":"api-method get"}]},{"type":"category","label":"Receivers","link":{"type":"generated-index","title":"Receivers","slug":"/category/stellar-disbursement-platform/resources/receivers"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/list-all-receivers","label":"List All Receivers","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-a-receiver","label":"Retrieve a Receiver","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-a-receiver","label":"Update a Receiver","className":"api-method patch"}]},{"type":"category","label":"Statistics","link":{"type":"generated-index","title":"Statistics","slug":"/category/stellar-disbursement-platform/resources/statistics"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-all-statistics","label":"Retrieve All Statistics","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-disbursement-statistics","label":"Retrieve Disbursement Statistics","className":"api-method get"}]},{"type":"category","label":"Registration","link":{"type":"generated-index","title":"Registration","slug":"/category/stellar-disbursement-platform/resources/registration"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/start-wallet-registration","label":"Start Wallet Registration","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/send-one-time-passcode","label":"Send One-Time Passcode","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/verify-receiver-registration","label":"Verify Receiver Registration","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-stellar-info-file","label":"Retrieve Stellar Info File","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/request-challenge-transaction","label":"Request Challenge Transaction","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/provide-signed-challenge-transaction","label":"Provide Signed Challenge Transaction","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/request-registration-url","label":"Request Registration URL","className":"api-method post"}]},{"type":"category","label":"Profile","link":{"type":"generated-index","title":"Profile","slug":"/category/stellar-disbursement-platform/resources/profile"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/get-profile","label":"Get Profile","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-user-profile","label":"Update User Profile","className":"api-method patch"}]},{"type":"category","label":"Organization","link":{"type":"generated-index","title":"Organization","slug":"/category/stellar-disbursement-platform/resources/organization"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/get-organization-info","label":"Get Organization Info","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-organization-profile","label":"Update Organization Profile","className":"api-method patch"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-organization-logo","label":"Retrieve Organization Logo","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-countries","label":"Get All Countries","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-assets","label":"Get All Assets","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/create-asset","label":"Create Asset","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/delete-asset","label":"Delete Asset","className":"api-method delete"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-wallets","label":"Get All Wallets","className":"api-method get"}]},{"type":"category","label":"Users","link":{"type":"generated-index","title":"Users","slug":"/category/stellar-disbursement-platform/resources/users"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-users","label":"Get All Users","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/create-user","label":"Create User","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-user-activation-status","label":"Update User Activation Status","className":"api-method patch"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-roles","label":"Get All Roles","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-user-role","label":"Update User Role","className":"api-method patch"}]}]; \ No newline at end of file +module.exports = [{"type":"doc","id":"stellar-disbursement-platform/resources/stellar-disbursement-platform-api"},{"type":"category","label":"Authentication","link":{"type":"generated-index","title":"Authentication","slug":"/category/stellar-disbursement-platform/resources/authentication"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/log-in","label":"Log In","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/refresh-token","label":"Refresh Token","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/authenticate-mfa","label":"Provide Multi-Factor Authentication","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/forgot-password","label":"Forgot Password","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/reset-password","label":"Reset Rassword","className":"api-method post"}]},{"type":"category","label":"Disbursements","link":{"type":"generated-index","title":"Disbursements","slug":"/category/stellar-disbursement-platform/resources/disbursements"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/list-all-disbursements","label":"List All Disbursements","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/create-disbursement","label":"Create Disbursement","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-a-disbursement","label":"Retrieve a Disbursement","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/list-all-disbursement-receivers","label":"List All Disbursement Receivers","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/upload-disbursement-instructions","label":"Upload Disbursement Instructions","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/download-disbursement-instructions","label":"Download Disbursement Instructions","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-a-disbursement-status","label":"Update a Disbursement Status","className":"api-method patch"}]},{"type":"category","label":"Payments","link":{"type":"generated-index","title":"Payments","slug":"/category/stellar-disbursement-platform/resources/payments"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/list-all-payments","label":"List All Payments","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-a-payment","label":"Retrieve a Payment","className":"api-method get"}]},{"type":"category","label":"Receivers","link":{"type":"generated-index","title":"Receivers","slug":"/category/stellar-disbursement-platform/resources/receivers"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/list-all-receivers","label":"List All Receivers","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-a-receiver","label":"Retrieve a Receiver","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-a-receiver","label":"Update a Receiver","className":"api-method patch"}]},{"type":"category","label":"Statistics","link":{"type":"generated-index","title":"Statistics","slug":"/category/stellar-disbursement-platform/resources/statistics"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-all-statistics","label":"Retrieve All Statistics","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-disbursement-statistics","label":"Retrieve Disbursement Statistics","className":"api-method get"}]},{"type":"category","label":"Registration","link":{"type":"generated-index","title":"Registration","slug":"/category/stellar-disbursement-platform/resources/registration"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/start-wallet-registration","label":"Start Wallet Registration","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/send-one-time-passcode","label":"Send One-Time Passcode","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/verify-receiver-registration","label":"Verify Receiver Registration","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-stellar-info-file","label":"Retrieve Stellar Info File","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/request-challenge-transaction","label":"Request Challenge Transaction","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/provide-signed-challenge-transaction","label":"Provide Signed Challenge Transaction","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/request-registration-url","label":"Request Registration URL","className":"api-method post"}]},{"type":"category","label":"Profile","link":{"type":"generated-index","title":"Profile","slug":"/category/stellar-disbursement-platform/resources/profile"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/get-profile","label":"Get Profile","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-user-profile","label":"Update User Profile","className":"api-method patch"}]},{"type":"category","label":"Organization","link":{"type":"generated-index","title":"Organization","slug":"/category/stellar-disbursement-platform/resources/organization"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/get-organization-info","label":"Get Organization Info","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-organization-profile","label":"Update Organization Profile","className":"api-method patch"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-organization-logo","label":"Retrieve Organization Logo","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-countries","label":"Get All Countries","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-assets","label":"Get All Assets","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/create-asset","label":"Create Asset","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/delete-asset","label":"Delete Asset","className":"api-method delete"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-wallets","label":"Get All Wallets","className":"api-method get"}]},{"type":"category","label":"Users","link":{"type":"generated-index","title":"Users","slug":"/category/stellar-disbursement-platform/resources/users"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-users","label":"Get All Users","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/create-user","label":"Create User","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-user-activation-status","label":"Update User Activation Status","className":"api-method patch"},{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-roles","label":"Get All Roles","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-user-role","label":"Update User Role","className":"api-method patch"}]},{"type":"category","label":"Admin","link":{"type":"generated-index","title":"Admin","slug":"/category/stellar-disbursement-platform/resources/admin"},"items":[{"type":"doc","id":"stellar-disbursement-platform/resources/get-all-tenants","label":"Get All Tenants","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/create-tenant","label":"Create Tenant","className":"api-method post"},{"type":"doc","id":"stellar-disbursement-platform/resources/retrieve-a-tenant","label":"Retrieve a Tenant","className":"api-method get"},{"type":"doc","id":"stellar-disbursement-platform/resources/update-a-tenant","label":"Update a Tenant","className":"api-method patch"}]}]; \ No newline at end of file diff --git a/network/stellar-disbursement-platform/resources/update-a-tenant.api.mdx b/network/stellar-disbursement-platform/resources/update-a-tenant.api.mdx new file mode 100644 index 000000000..1ed381a1d --- /dev/null +++ b/network/stellar-disbursement-platform/resources/update-a-tenant.api.mdx @@ -0,0 +1,53 @@ +--- +id: update-a-tenant +title: "Update a Tenant" +description: "This endpoint updates the Tenant data." +sidebar_label: "Update a Tenant" +hide_title: true +hide_table_of_contents: true +api: {"responses":{"200":{"description":"Updated Tenant details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"1736bed3-7b92-4760-8ff2-51fb08ee079f"},"name":{"type":"string","example":"bluecorp","description":"The tenant name. It should match the pattern `^[a-z-]+$`."},"email_sender_type":{"type":"string","enum":["DRY_RUN","AWS_EMAIL"],"description":"The e-mail sender provider."},"sms_sender_type":{"type":"string","enum":["DRY_RUN","AWS_SMS","TWILIO_SMS"],"description":"The SMS sender provider."},"base_url":{"type":"string","example":"https://bluecorp-backend.sdp.org","description":"The SDP backend server's base URL."},"sdp_ui_base_url":{"type":"string","example":"https://bluecorp.sdp.org","description":"The SDP UI/dashboard Base URL."},"status":{"type":"string","enum":["TENANT_CREATED","TENANT_PROVISIONED","TENANT_ACTIVATED","TENANT_DEACTIVATED"]},"distribution_account":{"type":"string","example":"GCXAJ3XJ3VK3JFH3QMDFOSKM2NMMZBSO3VIT6EUPQWSDW2J74M23RRSL"},"created_at":{"type":"string","format":"date-time","example":"2024-03-27T17:21:51.000Z"},"updated_at":{"type":"string","format":"date-time","example":"2024-03-27T17:21:51.000Z"}},"required":["id","name","email_sender_type","sms_sender_type","status","created_at","updated_at"],"example":{"id":"840dca45-d1df-44cd-83c1-65c04235c25f","name":"redcorp","email_sender_type":"DRY_RUN","sms_sender_type":"DRY_RUN","base_url":"https://redcorp-backend.sdp.org","sdp_ui_base_url":"https://redcorp.sdp.org","status":"TENANT_PROVISIONED","distribution_account":"GCQVDMPOEN3HHJJ64V42KUTONOXN7C6V2PSVPALEVJ7PIYOB6M3DJV7N","created_at":"2024-03-27T17:21:51.000Z","updated_at":"2024-03-27T17:21:51.000Z"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Details about the error"}}}}}},"401":{"description":"Unauthorized","headers":{},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"extras":{"type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"}}}},"example":{"error":"Not authorized","extras":{"status":401,"message":"Not authorized"}}},"examples":{"response":{"value":{"error":"Not authorized","extras":{"status":401,"message":"Not authorized"}}}}}}},"404":{"description":"Not Found","headers":{},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"extras":{"type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"}}}}},"examples":{"response":{"value":{"error":"Not found","extras":{"status":404,"message":"Resource not found"}}}}}}}},"operationId":"Update a Tenant","description":"This endpoint updates the Tenant data.","tags":["Admin"],"parameters":[{"name":"id","in":"path","description":"ID of the `Tenant`.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email_sender_type":{"type":"string","enum":["DRY_RUN","AWS_EMAIL"],"description":"The e-mail sender provider."},"sms_sender_type":{"type":"string","enum":["DRY_RUN","AWS_SMS","TWILIO_SMS"],"description":"The SMS sender provider."},"base_url":{"type":"string","description":"The SDP backend server's base URL."},"sdp_ui_base_url":{"type":"string","description":"The SDP UI/dashboard Base URL."},"status":{"type":"string","enum":["TENANT_CREATED","TENANT_PROVISIONED","TENANT_ACTIVATED","TENANT_DEACTIVATED"]}}}}},"description":"List of fields to update for the tenant","required":true},"security":[{"BasicAuth":[]}],"method":"patch","path":"/tenants/{id}","securitySchemes":{"BearerAuth":{"type":"apiKey","name":"Authorization","in":"header","description":"JWT used for authentication, signed with an ES256 private key."},"BasicAuth":{"type":"http","scheme":"basic","description":"Basic HTTP Authentication with a base64-encoded string of 'ADMIN_ACCOUNT:ADMIN_API_KEY'."}},"jsonRequestBodyExample":{"email_sender_type":"DRY_RUN","sms_sender_type":"DRY_RUN","base_url":"string","sdp_ui_base_url":"string","status":"TENANT_CREATED"},"info":{"title":"Stellar Disbursement Platform API","version":"","description":"The Stellar Disbursement Platform (SDP) is a tool built for organizations to make bulk payments to a group of recipients over the Stellar network. You can read more about using the SDP [here](https://developers.stellar.org/docs/category/use-the-stellar-disbursement-platform)."},"postman":{"name":"Update a Tenant","description":{"content":"This endpoint updates the Tenant data.","type":"text/plain"},"url":{"path":["tenants",":id"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) ID of the `Tenant`.","type":"text/plain"},"type":"any","value":"","key":"id"}]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"PATCH","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}},"auth":{"type":"basic","basic":[{"type":"any","value":"","key":"username"},{"type":"any","value":"","key":"password"}]}}} +sidebar_class_name: "patch api-method" +info_path: network/stellar-disbursement-platform/resources/stellar-disbursement-platform-api +custom_edit_url: null +--- + +import { SepBadge } from "@site/src/components/SepBadge"; + + + +import ApiTabs from "@theme/ApiTabs"; +import MimeTabs from "@theme/MimeTabs"; +import ParamsItem from "@theme/ParamsItem"; +import ResponseSamples from "@theme/ResponseSamples"; +import SchemaItem from "@theme/SchemaItem"; +import SchemaTabs from "@theme/SchemaTabs"; +import DiscriminatorTabs from "@theme/DiscriminatorTabs"; +import TabItem from "@theme/TabItem"; + +## Update a Tenant + + + +This endpoint updates the Tenant data. + +
          Path Parameters
          Request Body required
          + +List of fields to update for the tenant + +
          + +Updated Tenant details + +
          Schema
          + +Bad Request + +
          Schema
          + +Unauthorized + +
          Response Headers
            Schema
              extras object
            + +Not Found + +
            Response Headers
              Schema
                extras object
              diff --git a/openapi/stellar-disbursement-platform/bundled.yml b/openapi/stellar-disbursement-platform/bundled.yml index 880fc67a1..85d7c2340 100644 --- a/openapi/stellar-disbursement-platform/bundled.yml +++ b/openapi/stellar-disbursement-platform/bundled.yml @@ -1760,6 +1760,189 @@ paths: - application/json security: - BearerAuth: [] + /tenants: + get: + summary: Get All Tenants + responses: + '200': + description: A list of provisioned tenants with their configurations + schema: + $ref: '#/definitions/Tenants' + '401': + $ref: '#/responses/UnauthorizedResponse' + operationId: Get All Tenants + tags: + - Admin + parameters: [] + produces: + - application/json + security: + - BasicAuth: [] + post: + summary: Create Tenant + responses: + '201': + description: Provision a new tenant + schema: + $ref: '#/definitions/Tenant' + '401': + $ref: '#/responses/UnauthorizedResponse' + operationId: Create Tenant + tags: + - Admin + parameters: + - name: body + in: body + schema: + type: object + properties: + name: + type: string + description: The tenant name. It should match the pattern `^[a-z-]+$` + owner_email: + type: string + description: The owner user e-mail address + owner_first_name: + type: string + description: The owner user first name + owner_last_name: + type: string + description: The owner user last name + organization_name: + type: string + description: The organization name + email_sender_type: + type: string + enum: + - DRY_RUN + - AWS_EMAIL + description: The e-mail sender provider. + sms_sender_type: + type: string + enum: + - DRY_RUN + - AWS_SMS + - TWILIO_SMS + description: The SMS sender provider. + base_url: + type: string + description: The SDP backend server's base URL. + sdp_ui_base_url: + type: string + description: The SDP UI/dashboard Base URL. + distribution_account: + type: string + example: + name: redcorp + owner_email: owner@redcorp.org + owner_first_name: Owner + owner_last_name: Last + organization_name: Red Corp + email_sender_type: DRY_RUN + sms_sender_type: DRY_RUN + base_url: https://redcorp-backend.sdp.org + sdp_ui_base_url: https://redcorp.sdp.org + required: + - name + - owner_email + - owner_first_name + - owner_last_name + - organization_name + - email_sender_type + - sms_sender_type + - base_url + - sdp_ui_base_url + - distribution_account + produces: + - application/json + security: + - BasicAuth: [] + /tenants/{arg}: + get: + summary: Retrieve a Tenant + responses: + '200': + description: Tenant details + schema: + $ref: '#/definitions/Tenant' + '401': + $ref: '#/responses/UnauthorizedResponse' + '404': + $ref: '#/responses/NotFoundResponse' + operationId: Retrieve a Tenant + tags: + - Admin + parameters: + - name: arg + in: path + description: ID or Name of the `Tenant`. + required: true + type: string + produces: + - application/json + security: + - BasicAuth: [] + /tenants/{id}: + patch: + responses: + '200': + description: Updated Tenant details + schema: + $ref: '#/definitions/Tenant' + '400': + $ref: '#/responses/BadRequestResponse' + '401': + $ref: '#/responses/UnauthorizedResponse' + '404': + $ref: '#/responses/NotFoundResponse' + summary: Update a Tenant + operationId: Update a Tenant + description: This endpoint updates the Tenant data. + tags: + - Admin + parameters: + - name: id + in: path + description: ID of the `Tenant`. + required: true + type: string + - name: body + in: body + description: List of fields to update for the tenant + required: true + schema: + type: object + properties: + email_sender_type: + type: string + enum: + - DRY_RUN + - AWS_EMAIL + description: The e-mail sender provider. + sms_sender_type: + type: string + enum: + - DRY_RUN + - AWS_SMS + - TWILIO_SMS + description: The SMS sender provider. + base_url: + type: string + description: The SDP backend server's base URL. + sdp_ui_base_url: + type: string + description: The SDP UI/dashboard Base URL. + status: + type: string + enum: + - TENANT_CREATED + - TENANT_PROVISIONED + - TENANT_ACTIVATED + - TENANT_DEACTIVATED + produces: + - application/json + security: + - BasicAuth: [] definitions: Amount: type: object @@ -2563,6 +2746,78 @@ definitions: national_id: '123456789' email: john@example.com external_id: external123 + Tenant: + type: object + properties: + id: + type: string + example: 1736bed3-7b92-4760-8ff2-51fb08ee079f + name: + type: string + example: bluecorp + description: The tenant name. It should match the pattern `^[a-z-]+$`. + email_sender_type: + type: string + enum: + - DRY_RUN + - AWS_EMAIL + description: The e-mail sender provider. + sms_sender_type: + type: string + enum: + - DRY_RUN + - AWS_SMS + - TWILIO_SMS + description: The SMS sender provider. + base_url: + type: string + example: https://bluecorp-backend.sdp.org + description: The SDP backend server's base URL. + sdp_ui_base_url: + type: string + example: https://bluecorp.sdp.org + description: The SDP UI/dashboard Base URL. + status: + type: string + enum: + - TENANT_CREATED + - TENANT_PROVISIONED + - TENANT_ACTIVATED + - TENANT_DEACTIVATED + distribution_account: + type: string + example: GCXAJ3XJ3VK3JFH3QMDFOSKM2NMMZBSO3VIT6EUPQWSDW2J74M23RRSL + created_at: + type: string + format: date-time + example: '2024-03-27T17:21:51.000Z' + updated_at: + type: string + format: date-time + example: '2024-03-27T17:21:51.000Z' + required: + - id + - name + - email_sender_type + - sms_sender_type + - status + - created_at + - updated_at + example: + id: 840dca45-d1df-44cd-83c1-65c04235c25f + name: redcorp + email_sender_type: DRY_RUN + sms_sender_type: DRY_RUN + base_url: https://redcorp-backend.sdp.org + sdp_ui_base_url: https://redcorp.sdp.org + status: TENANT_PROVISIONED + distribution_account: GCQVDMPOEN3HHJJ64V42KUTONOXN7C6V2PSVPALEVJ7PIYOB6M3DJV7N + created_at: '2024-03-27T17:21:51.000Z' + updated_at: '2024-03-27T17:21:51.000Z' + Tenants: + type: array + items: + $ref: '#/definitions/Tenant' responses: UnauthorizedResponse: description: Unauthorized @@ -2638,6 +2893,10 @@ securityDefinitions: name: Authorization in: header description: JWT used for authentication, signed with an ES256 private key. + BasicAuth: + type: http + scheme: basic + description: Basic HTTP Authentication with a base64-encoded string of 'ADMIN_ACCOUNT:ADMIN_API_KEY'. tags: - name: Authentication description: Authentication endpoints control the login, token refresh, and password management processes for SDP users. @@ -2665,3 +2924,5 @@ tags: description: Organization endpoints manage the process of getting and updating organizational profile information. The organization’s profile has basic information set at the time of SDP deployment. It can be modified by the Owner. Organizations can also manage their preferences, like which assets to use, through these endpoints. - name: Users description: The users endpoints facilitate the creation of new SDP users–including setting the appropriate role, sending an email invitation, and activating a user–and managing roles. + - name: Admin + description: The Admin API oversees the management of tenants within the system, facilitating tasks such as provisioning new tenants, updating their information, and retrieving tenant data. diff --git a/openapi/stellar-disbursement-platform/main.yml b/openapi/stellar-disbursement-platform/main.yml index 76373cb25..4d1dd9b89 100644 --- a/openapi/stellar-disbursement-platform/main.yml +++ b/openapi/stellar-disbursement-platform/main.yml @@ -1831,6 +1831,177 @@ paths: - application/json security: - BearerAuth: [] + + /tenants: + get: + summary: Get All Tenants + responses: + "200": + description: "A list of provisioned tenants with their configurations" + schema: + $ref: "#/definitions/Tenants" + "401": + $ref: "#/responses/UnauthorizedResponse" + operationId: Get All Tenants + tags: + - Admin + parameters: [] + produces: + - application/json + security: + - BasicAuth: [] + post: + summary: Create Tenant + responses: + "201": + description: "Provision a new tenant" + schema: + $ref: "#/definitions/Tenant" + "401": + $ref: "#/responses/UnauthorizedResponse" + operationId: Create Tenant + tags: + - Admin + parameters: + - name: body + in: body + schema: + type: object + properties: + name: + type: string + description: The tenant name. It should match the pattern `^[a-z-]+$` + owner_email: + type: string + description: The owner user e-mail address + owner_first_name: + type: string + description: The owner user first name + owner_last_name: + type: string + description: The owner user last name + organization_name: + type: string + description: The organization name + email_sender_type: + type: string + enum: [ DRY_RUN, AWS_EMAIL ] + description: The e-mail sender provider. + sms_sender_type: + type: string + enum: [ DRY_RUN, AWS_SMS, TWILIO_SMS ] + description: The SMS sender provider. + base_url: + type: string + description: The SDP backend server's base URL. + sdp_ui_base_url: + type: string + description: The SDP UI/dashboard Base URL. + distribution_account: + type: string + example: + name: "redcorp" + owner_email: "owner@redcorp.org" + owner_first_name: "Owner" + owner_last_name: "Last" + organization_name: "Red Corp" + email_sender_type: "DRY_RUN" + sms_sender_type: "DRY_RUN" + base_url: "https://redcorp-backend.sdp.org" + sdp_ui_base_url: "https://redcorp.sdp.org" + required: + - name + - owner_email + - owner_first_name + - owner_last_name + - organization_name + - email_sender_type + - sms_sender_type + - base_url + - sdp_ui_base_url + - distribution_account + produces: + - application/json + security: + - BasicAuth: [] + /tenants/{arg}: + get: + summary: Retrieve a Tenant + responses: + "200": + description: "Tenant details" + schema: + $ref: "#/definitions/Tenant" + "401": + $ref: "#/responses/UnauthorizedResponse" + "404": + $ref: "#/responses/NotFoundResponse" + operationId: Retrieve a Tenant + tags: + - Admin + parameters: + - name: arg + in: path + description: ID or Name of the `Tenant`. + required: true + type: string + produces: + - application/json + security: + - BasicAuth: [] + /tenants/{id}: + patch: + responses: + "200": + description: "Updated Tenant details" + schema: + $ref: "#/definitions/Tenant" + "400": + $ref: "#/responses/BadRequestResponse" + "401": + $ref: "#/responses/UnauthorizedResponse" + "404": + $ref: "#/responses/NotFoundResponse" + summary: Update a Tenant + operationId: Update a Tenant + description: This endpoint updates the Tenant data. + tags: + - Admin + parameters: + - name: id + in: path + description: ID of the `Tenant`. + required: true + type: string + - name: body + in: body + description: List of fields to update for the tenant + required: true + schema: + type: object + properties: + email_sender_type: + type: string + enum: [ DRY_RUN, AWS_EMAIL ] + description: The e-mail sender provider. + sms_sender_type: + type: string + enum: [ DRY_RUN, AWS_SMS, TWILIO_SMS ] + description: The SMS sender provider. + base_url: + type: string + description: The SDP backend server's base URL. + sdp_ui_base_url: + type: string + description: The SDP UI/dashboard Base URL. + status: + type: string + enum: [ TENANT_CREATED, TENANT_PROVISIONED, TENANT_ACTIVATED, TENANT_DEACTIVATED ] + produces: + - application/json + security: + - BasicAuth: [] + definitions: Amount: type: "object" @@ -2661,6 +2832,71 @@ definitions: national_id: "123456789" email: "john@example.com" external_id: "external123" + + Tenant: + type: object + properties: + id: + type: string + example: "1736bed3-7b92-4760-8ff2-51fb08ee079f" + name: + type: string + example: bluecorp + description: The tenant name. It should match the pattern `^[a-z-]+$`. + email_sender_type: + type: string + enum: [ DRY_RUN, AWS_EMAIL ] + description: The e-mail sender provider. + sms_sender_type: + type: string + enum: [ DRY_RUN, AWS_SMS, TWILIO_SMS ] + description: The SMS sender provider. + base_url: + type: string + example: "https://bluecorp-backend.sdp.org" + description: The SDP backend server's base URL. + sdp_ui_base_url: + type: string + example: "https://bluecorp.sdp.org" + description: The SDP UI/dashboard Base URL. + status: + type: string + enum: [ TENANT_CREATED, TENANT_PROVISIONED, TENANT_ACTIVATED, TENANT_DEACTIVATED ] + distribution_account: + type: string + example: "GCXAJ3XJ3VK3JFH3QMDFOSKM2NMMZBSO3VIT6EUPQWSDW2J74M23RRSL" + created_at: + type: string + format: date-time + example: "2024-03-27T17:21:51.000Z" + updated_at: + type: string + format: date-time + example: "2024-03-27T17:21:51.000Z" + required: + - id + - name + - email_sender_type + - sms_sender_type + - status + - created_at + - updated_at + example: + id: "840dca45-d1df-44cd-83c1-65c04235c25f" + name: "redcorp" + email_sender_type: "DRY_RUN" + sms_sender_type: "DRY_RUN" + base_url: "https://redcorp-backend.sdp.org" + sdp_ui_base_url: "https://redcorp.sdp.org" + status: "TENANT_PROVISIONED" + distribution_account: "GCQVDMPOEN3HHJJ64V42KUTONOXN7C6V2PSVPALEVJ7PIYOB6M3DJV7N" + created_at: "2024-03-27T17:21:51.000Z" + updated_at: "2024-03-27T17:21:51.000Z" + Tenants: + type: array + items: + $ref: "#/definitions/Tenant" + responses: UnauthorizedResponse: description: Unauthorized @@ -2736,6 +2972,10 @@ securityDefinitions: name: "Authorization" in: "header" description: "JWT used for authentication, signed with an ES256 private key." + BasicAuth: + type: "http" + scheme: "basic" + description: "Basic HTTP Authentication with a base64-encoded string of 'ADMIN_ACCOUNT:ADMIN_API_KEY'." tags: - name: Authentication description: 'Authentication endpoints control the login, token refresh, and password management processes for SDP users.' @@ -2774,3 +3014,7 @@ tags: - name: Users description: >- The users endpoints facilitate the creation of new SDP users–including setting the appropriate role, sending an email invitation, and activating a user–and managing roles. + + - name: Admin + description: >- + The Admin API oversees the management of tenants within the system, facilitating tasks such as provisioning new tenants, updating their information, and retrieving tenant data. \ No newline at end of file