@epilot/customer-portal-client
Version:
API Client for epilot portal API
1,650 lines (1,649 loc) • 323 kB
JSON
{
"openapi": "3.0.3",
"info": {
"title": "Portal API",
"description": "Backend for epilot portals - End Customer Portal & Installer Portal",
"version": "1.0.0"
},
"tags": [
{
"name": "ECP",
"description": "APIs defined for a portal user"
},
{
"name": "ECP Admin",
"description": "APIs defined for a ECP Admin"
},
{
"name": "Public",
"description": "Public APIs"
},
{
"name": "portal_user_schema",
"x-displayName": "Portal User",
"description": "<SchemaDefinition schemaRef=\"#/components/schemas/PortalUser\" />\n"
}
],
"x-tagGroups": [
{
"name": "APIs",
"tags": [
"ECP",
"ECP Admin",
"Public"
]
},
{
"name": "Schemas",
"tags": [
"portal_user_schema"
]
}
],
"security": [
{
"EpilotAuth": []
},
{
"PortalAuth": []
},
{
"EitherAuth": []
}
],
"paths": {
"/v2/portal/portal": {
"post": {
"operationId": "upsertPortal",
"summary": "upsertPortal",
"description": "Upserts the settings for a portal of an organization.",
"security": [
{
"EpilotAuth": []
}
],
"tags": [
"ECP Admin"
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"requestBody": {
"description": "Portal payload",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpsertPortalConfig"
}
}
}
},
"responses": {
"201": {
"description": "Portal upserted successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PortalConfig"
}
}
}
},
"400": {
"$ref": "#/components/responses/InvalidRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/public/user": {
"post": {
"operationId": "createUser",
"summary": "createUser",
"description": "Registers a portal user",
"security": [],
"tags": [
"Public"
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"requestBody": {
"description": "Portal user payload",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateUserRequest"
}
}
}
},
"responses": {
"201": {
"description": "User created successfully.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"response"
],
"properties": {
"message": {
"type": "string",
"enum": [
"User created successfully"
]
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/InvalidRequest"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/token/validate": {
"post": {
"operationId": "validateToken",
"summary": "validateToken",
"description": "Validates Portal Token is valid. Pass the token via Authorization Header.",
"tags": [
"ECP"
],
"security": [
{
"PortalAuth": []
}
],
"responses": {
"204": {
"description": "Tokens is valid for the given organization."
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/token/revoke": {
"post": {
"operationId": "revokeToken",
"summary": "revokeToken",
"description": "Revokes all of the access tokens for the given Refresh Token.",
"tags": [
"ECP"
],
"security": [
{
"PortalAuth": []
}
],
"requestBody": {
"description": "Token payload",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"refresh_token"
],
"properties": {
"refresh_token": {
"type": "string",
"description": "Refresh Token to be revoked",
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Access Tokens revoked successfully for the given Refresh Token.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"enum": [
"Token revoked successfully"
]
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/public/config": {
"get": {
"operationId": "getPortalConfigByDomain",
"summary": "getPortalConfigByDomain",
"description": "Retrieves the portal configuration by domain.",
"tags": [
"Public"
],
"security": [],
"parameters": [
{
"in": "query",
"name": "domain",
"required": true,
"schema": {
"type": "string",
"example": "example.com",
"description": "Domain of the portal"
}
}
],
"responses": {
"200": {
"description": "Portal config retrieved successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PortalConfig"
}
}
}
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/config": {
"get": {
"operationId": "getPortalConfig",
"summary": "getPortalConfig",
"description": "Retrieves the portal configuration.",
"tags": [
"ECP Admin",
"ECP"
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": false,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"security": [
{
"EitherAuth": []
}
],
"responses": {
"200": {
"description": "Portal config retrieved successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PortalConfig"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
},
"delete": {
"operationId": "deletePortal",
"summary": "deletePortal",
"description": "Deletes the portal.",
"tags": [
"ECP Admin"
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"security": [
{
"EpilotAuth": []
}
],
"responses": {
"204": {
"description": "Portal deleted successfully."
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/extensions": {
"get": {
"operationId": "getPortalExtensions",
"summary": "getPortalExtensions",
"description": "Retrieves the installed portal extensions.",
"tags": [
"ECP Admin"
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": false,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"security": [
{
"EpilotAuth": []
}
],
"responses": {
"200": {
"description": "Portal extensions retrieved successfully.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Extension"
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/public/extensions": {
"get": {
"operationId": "getPublicPortalExtensionDetails",
"summary": "getPublicPortalExtensionDetails",
"description": "Get public extension details shown to end customers and configuring users.",
"tags": [
"Public"
],
"security": [],
"parameters": [
{
"in": "query",
"name": "org_id",
"required": true,
"schema": {
"type": "string",
"example": 12324,
"description": "Organization ID"
}
},
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"responses": {
"200": {
"description": "Public details of extensions.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicExtensionCapabilities"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/consumption": {
"get": {
"operationId": "getConsumption",
"summary": "Get Consumption",
"description": "Get energy consumption data between a given time period.",
"tags": [
"ECP"
],
"security": [
{
"PortalAuth": []
}
],
"parameters": [
{
"in": "query",
"name": "extensionId",
"schema": {
"type": "string"
},
"required": true,
"description": "Extension ID for consumption data."
},
{
"in": "query",
"name": "hookId",
"schema": {
"type": "string"
},
"required": true,
"description": "Hook ID for consumption data."
},
{
"in": "query",
"name": "meter_id",
"schema": {
"type": "string"
},
"required": true,
"description": "Meter ID for consumption data."
},
{
"in": "query",
"name": "from",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true,
"description": "Start date for consumption data (ISO 8601 format)."
},
{
"in": "query",
"name": "to",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true,
"description": "End date for consumption data (ISO 8601 format)."
},
{
"in": "query",
"name": "interval",
"schema": {
"type": "string",
"enum": [
"PT15M",
"PT1H",
"P1D",
"P1M"
]
},
"required": true,
"description": "Interval between consumption data points (e.g., PT15M for 15 minutes, PT1H for hourly). Not all intervals have to be supported."
}
],
"responses": {
"200": {
"description": "Consumption data returned successfully.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"consumptions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp of the consumption record."
},
"value": {
"type": "number",
"description": "The consumption value."
},
"type": {
"type": "string",
"description": "Optional type of the consumption, such as 'nt' (night time) or 'ht' (high time)."
}
},
"required": [
"value",
"unit",
"timestamp"
]
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/costs": {
"get": {
"operationId": "getCosts",
"summary": "Get Costs",
"description": "Get energy cost data between a given time period.",
"tags": [
"ECP"
],
"security": [
{
"PortalAuth": []
}
],
"parameters": [
{
"in": "query",
"name": "extensionId",
"schema": {
"type": "string"
},
"required": true,
"description": "Extension ID for cost data."
},
{
"in": "query",
"name": "hookId",
"schema": {
"type": "string"
},
"required": true,
"description": "Hook ID for cost data."
},
{
"in": "query",
"name": "meter_id",
"schema": {
"type": "string"
},
"required": true,
"description": "Meter ID for cost data."
},
{
"in": "query",
"name": "from",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true,
"description": "Start date for cost data (ISO 8601 format)."
},
{
"in": "query",
"name": "to",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true,
"description": "End date for cost data (ISO 8601 format)."
},
{
"in": "query",
"name": "interval",
"schema": {
"type": "string",
"enum": [
"PT15M",
"PT1H",
"P1D",
"P1M"
]
},
"required": true,
"description": "Interval between cost data points (e.g., PT15M for 15 minutes, PT1H for hourly). Not all intervals have to be supported."
}
],
"responses": {
"200": {
"description": "Cost data returned successfully.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"costs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp of the cost record."
},
"unit_amount": {
"type": "integer",
"description": "Cost in cents, e.g. 1234 for 12,34 €.",
"example": 1234
},
"unit_amount_currency": {
"type": "string",
"description": "ISO 4217:2015 currency.",
"example": "EUR"
},
"unit_amount_decimal": {
"type": "string",
"description": "Cost in decimal format, e.g. \"12.34\".",
"example": "12.34"
},
"tax_behavior": {
"type": "string",
"description": "Is the tax (typically Value Added Tax) included in the amounts. Typically should NOT be included - exclusive of tax.",
"enum": [
"inclusive",
"exclusive"
],
"example": "exclusive"
},
"tax_rate": {
"type": "integer",
"description": "Tax rate in percent, e.g. 19 for 19%.",
"example": 19
}
},
"required": [
"timestamp",
"unit_amount",
"unit_amount_currency",
"unit_amount_decimal",
"tax_behavior",
"tax_rate"
]
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/prices": {
"get": {
"operationId": "getPrices",
"summary": "Get Prices",
"description": "Get energy prices data between a given time period.",
"tags": [
"ECP"
],
"security": [
{
"PortalAuth": []
}
],
"parameters": [
{
"in": "query",
"name": "extensionId",
"schema": {
"type": "string"
},
"required": true,
"description": "Extension ID for price data."
},
{
"in": "query",
"name": "hookId",
"schema": {
"type": "string"
},
"required": true,
"description": "Hook ID for price data."
},
{
"in": "query",
"name": "meter_id",
"schema": {
"type": "string"
},
"required": true,
"description": "Meter ID for price data."
},
{
"in": "query",
"name": "from",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true,
"description": "Start date for price data (ISO 8601 format)."
},
{
"in": "query",
"name": "to",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true,
"description": "End date for price data (ISO 8601 format)."
},
{
"in": "query",
"name": "interval",
"schema": {
"type": "string",
"enum": [
"PT15M",
"PT1H",
"P1D",
"P1M"
]
},
"required": true,
"description": "Interval between price data points (e.g., PT15M for 15 minutes, PT1H for hourly). Not all intervals have to be supported."
}
],
"responses": {
"200": {
"description": "Price data returned successfully.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp of the price record."
},
"unit_amount": {
"type": "integer",
"description": "Cost in cents, e.g. 1234 for 12,34 €.",
"example": 1234
},
"unit_amount_currency": {
"type": "string",
"description": "ISO 4217:2015 currency.",
"example": "EUR"
},
"unit_amount_decimal": {
"type": "string",
"description": "Cost in decimal format, e.g. \"12.34\".",
"example": "12.34"
},
"components": {
"type": "object",
"description": "Optional price components.",
"properties": {
"auction_price_amount": {
"type": "integer",
"description": "Market price in cents, e.g. 1000 for 10,00 €.",
"example": 1000
},
"auction_price_amount_decimal": {
"type": "string",
"description": "Market price in decimal format, e.g. \"10.00\".",
"example": "10.00"
},
"taxes_levies_amount": {
"type": "integer",
"description": "Taxes/Levies other than tax specified on the price level in cents, e.g. 50 for 00,50 €.",
"example": 50
},
"taxes_levies_amount_decimal": {
"type": "string",
"description": "Taxes/Levies other than tax specified on the price level in decimal format, e.g. \"0.50\".",
"example": "0.50"
},
"source_fee_amount": {
"type": "integer",
"description": "Fee associated with the source, e.g. Green Energy Certificate fee in cents, e.g. 50 for 00,50 €.",
"example": 50
},
"source_fee_amount_decimal": {
"type": "string",
"description": "Fee associated with the source, e.g. Green Energy Certificate fee in decimal format, e.g. \"0.50\".",
"example": "0.50"
},
"grid_fee_amount": {
"type": "integer",
"description": "Fee associated with the transmission/distribution in cents, e.g. 100 for 1,00 €.",
"example": 100
},
"grid_fee_amount_decimal": {
"type": "string",
"description": "Fee associated with the transmission/distribution in decimal format, e.g. \"1.00\".",
"example": "1.00"
},
"margin_amount": {
"type": "integer",
"description": "Margin in cents, e.g. 34 for 0,34 €.",
"example": 34
},
"margin_amount_decimal": {
"type": "string",
"description": "Margin in decimal format, e.g. \"0.34\".",
"example": "0.34"
}
}
},
"tax_behavior": {
"type": "string",
"description": "Is the tax (typically Value Added Tax) included in the amounts. Typically should NOT be included - exclusive of tax.",
"enum": [
"inclusive",
"exclusive"
],
"example": "exclusive"
},
"tax_rate": {
"type": "integer",
"description": "Tax rate in percent, e.g. 19 for 19%.",
"example": 19
}
},
"required": [
"timestamp",
"unit_amount",
"unit_amount_currency",
"unit_amount_decimal",
"tax_behavior",
"tax_rate"
]
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/external-links": {
"get": {
"operationId": "getExternalLinks",
"summary": "getExternalLinks",
"description": "Retrieves the portal configuration external links.",
"tags": [
"ECP Admin",
"ECP"
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": false,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
},
{
"in": "query",
"name": "contactId",
"required": false,
"schema": {
"$ref": "#/components/schemas/EntityId"
},
"description": "Contact ID of the user"
}
],
"security": [
{
"EitherAuth": []
}
],
"responses": {
"200": {
"description": "Portal config links retrieved successfully.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ExternalLink"
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/resolve:external-link/{id}": {
"get": {
"operationId": "getResolvedExternalLink",
"summary": "getResolvedExternalLink",
"description": "Retrieves a resolved portal external link.",
"tags": [
"ECP Admin",
"ECP"
],
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"$ref": "#/components/schemas/EntityId"
},
"description": "ID of the External Link"
},
{
"in": "query",
"name": "origin",
"required": false,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
},
{
"in": "query",
"name": "contactId",
"required": false,
"schema": {
"$ref": "#/components/schemas/EntityId"
},
"description": "Contact ID of the user"
}
],
"security": [
{
"EitherAuth": []
}
],
"responses": {
"200": {
"description": "Resolved portal config link retrieved successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExternalLink"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/public/portal/config": {
"get": {
"operationId": "getPublicPortalConfig",
"summary": "getPublicPortalConfig",
"description": "Retrieves the public portal configuration.",
"tags": [
"Public"
],
"security": [],
"parameters": [
{
"in": "query",
"name": "org_id",
"required": true,
"schema": {
"type": "string",
"example": 12324,
"description": "Organization ID"
}
},
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"responses": {
"200": {
"description": "Portal config retrieved successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PortalConfig"
}
}
}
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/org/portal/config": {
"get": {
"operationId": "getOrgPortalConfig",
"summary": "getOrgPortalConfig",
"description": "Retrieves the portal configuration for the organization.",
"tags": [
"ECP Admin"
],
"security": [
{
"EpilotAuth": []
}
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"responses": {
"200": {
"description": "Portal config retrieved successfully.",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/PortalConfig"
},
{
"type": "object",
"properties": {
"certificate_details": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the certificate",
"enum": [
"PENDING_VALIDATION",
"ISSUED",
"INACTIVE",
"EXPIRED",
"VALIDATION_TIMED_OUT",
"REVOKED",
"FAILED",
"PENDING_AUTO_RENEWAL"
]
},
"failed_reason": {
"type": "string",
"description": "Reason for failed certificate",
"example": "CAA_ERROR"
}
}
}
}
}
]
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/configs": {
"get": {
"operationId": "getAllPortalConfigs",
"summary": "getAllPortalConfigs",
"description": "Retrieves all portal configurations.",
"tags": [
"ECP Admin"
],
"security": [
{
"EpilotAuth": []
}
],
"responses": {
"200": {
"description": "All portal configs retrieved successfully.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PortalConfig"
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/email-templates": {
"post": {
"operationId": "upsertEmailTemplates",
"summary": "upsertEmailTemplates",
"description": "Upserts the email templates of a portal",
"tags": [
"ECP Admin"
],
"security": [
{
"EpilotAuth": []
}
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"requestBody": {
"description": "Email templates payload",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EmailTemplates"
}
}
}
},
"responses": {
"200": {
"description": "Upserted email templates of the portal successfully.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"emailTemplates"
],
"properties": {
"message": {
"type": "string",
"enum": [
"Email Templates upserted successfully"
]
},
"emailTemplates": {
"$ref": "#/components/schemas/EmailTemplates"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
},
"get": {
"operationId": "getEmailTemplates",
"summary": "getEmailTemplates",
"description": "Retrieves the email templates of a portal",
"tags": [
"ECP Admin"
],
"security": [
{
"EpilotAuth": []
}
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"responses": {
"200": {
"description": "Retrieved the email templates successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EmailTemplates"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/public-widgets": {
"get": {
"operationId": "getPublicPortalWidgets",
"summary": "getPublicPortalWidgets",
"description": "Retrieves the public widgets of a portal",
"tags": [
"Public"
],
"security": [],
"parameters": [
{
"in": "query",
"name": "org_id",
"required": true,
"schema": {
"type": "string",
"description": "Organization ID",
"example": 123
}
},
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"responses": {
"200": {
"description": "Retrieved the portal public widgets successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpsertPortalWidget"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/widgets": {
"post": {
"operationId": "upsertPortalWidget",
"summary": "upsertPortalWidget",
"description": "Upsert widget for a portal of an organization.",
"security": [
{
"EpilotAuth": []
}
],
"tags": [
"ECP Admin"
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": true,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
}
],
"requestBody": {
"description": "Portal widgets payload",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpsertPortalWidget"
}
}
}
},
"responses": {
"201": {
"description": "Portal widget configuration upserted successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpsertPortalWidget"
}
}
}
},
"400": {
"$ref": "#/components/responses/InvalidRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
},
"get": {
"operationId": "getPortalWidgets",
"summary": "getPortalWidgets",
"description": "Retrieves the widgets of a portal",
"tags": [
"ECP Admin",
"ECP"
],
"security": [
{
"EitherAuth": []
}
],
"parameters": [
{
"in": "query",
"name": "origin",
"required": false,
"schema": {
"$ref": "#/components/schemas/Origin"
},
"description": "Origin of the portal"
},
{
"in": "query",
"name": "contract_id",
"required": false,
"schema": {
"$ref": "#/components/schemas/EntityId"
},
"description": "Contract context for widgets"
}
],
"responses": {
"200": {
"description": "Retrieved the portal widgets successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpsertPortalWidget"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
},
"/v2/portal/replace-ecp-template-variables": {
"post": {
"operationId": "replaceECPTemplateVariables",
"summary": "replaceECPTemplateVariables",
"description": "Replaces the template variables of a portal",
"tags": [
"ECP Admin"
],
"security": [
{
"EpilotAuth": []
}
],
"requestBody": {
"description": "ECPVariables payload",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"_id": {
"$ref": "#/components/schemas/EntityId",
"description": "ID of the entity"
},
"is_main_entity": {
"type": "boolean"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Replaced portal template variables successfully.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"customerPortal": {
"type": "object",
"properties": {
"invitationLink": {
"type": "string",
"example": "https://end-customer-portal.ecp.dev.epilot.io/register?contactId=7aa44fb8-d60e-40cc-9a3a-ba09a1ff7f51&email=john@doe.com"
},
"newDocumentLink": {
"type": "string",
"example": "https://end-customer-portal.ecp.dev.epilot.io/requests/opportunities/b8fef220-abe0-4382-a704-26848f60977b"
},
"entityLink": {
"type": "string",
"example": "https://end-customer-portal.ecp.dev.epilot.io/requests/opportunities/b8fef220-abe0-4382-a704-26848f60977b"
},
"userEmailsOnEntity": {
"type": "array",
"example": [
"john@doe.com",
"mary@doe.com"
],
"items": {
"type": "string"
}
}
}
},
"installerPortal": {
"type": "object",
"properties": {
"invitationLink": {
"type": "string",