{
  "openapi": "3.0.4",
  "info": {
    "title": "MyForterro.Api.Gateway 2026.2.4.0",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://integration-myforterro-api.fcs-dev.eks.forterro.com/"
    }
  ],
  "paths": {
    "/logout": {
      "get": {
        "tags": [
          "Swagger"
        ],
        "summary": "Logout the user from the MyForterro API.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/admin/v1/tenants": {
      "post": {
        "tags": [
          "Tenant"
        ],
        "summary": "Create a new MyForterroAPI Tenant.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Details of the created tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "401": {
            "description": "Your access token has expired, is invalid or missing.\nCall the MyForterro Authentication Server to get a new one."
          },
          "403": {
            "description": "You are not authorized to perform this action."
          }
        }
      },
      "get": {
        "tags": [
          "Tenant"
        ],
        "summary": "List all tenants the caller has read-access to.",
        "responses": {
          "200": {
            "description": "The list of all tenants the caller has read-access to.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MyForterroApiTenantDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MyForterroApiTenantDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MyForterroApiTenantDto"
                  }
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "401": {
            "description": "Your access token has expired, is invalid or missing.\nCall the MyForterro Authentication Server to get a new one."
          },
          "403": {
            "description": "You do not have access to any tenant."
          }
        }
      }
    },
    "/admin/v1/tenants/{tenantId}": {
      "get": {
        "tags": [
          "Tenant"
        ],
        "summary": "Get the details of a tenant.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "ID of the tenant.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Details of the requested tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "Requested tenant does not exist.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "You are not authorized to perform this action."
          }
        }
      },
      "put": {
        "tags": [
          "Tenant"
        ],
        "summary": "Update the details of a tenant.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "ID of the tenant.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "New values to apply to the updated tenant.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditTenantDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/EditTenantDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/EditTenantDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated details of the tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "Requested tenant does not exist.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "You are not authorized to perform this action."
          }
        }
      },
      "delete": {
        "tags": [
          "Tenant"
        ],
        "summary": "Delete a tenant.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "ID of the tenant.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tenant successfully deleted."
          },
          "400": {
            "description": "The request is invalid. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "Requested tenant does not exist.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "You are not authorized to perform this action."
          }
        }
      }
    },
    "/admin/v1/tenants/{tenantSlug}": {
      "get": {
        "tags": [
          "Tenant"
        ],
        "summary": "Get the details of a tenant.",
        "parameters": [
          {
            "name": "tenantSlug",
            "in": "path",
            "description": "Unique name of the tenant.",
            "required": true,
            "schema": {
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Details of the requested tenant.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyForterroApiTenantDto"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "Requested tenant does not exist.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "You are not authorized to perform this action."
          }
        }
      }
    },
    "/admin/v1/tenants/{tenantId}/my-forterro-identifiers": {
      "patch": {
        "tags": [
          "Tenant"
        ],
        "summary": "Patch the details of a tenant.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "description": "ID of the tenant.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "New values to apply to the updated tenant.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MyForterroIdentifiersUpdateDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MyForterroIdentifiersUpdateDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MyForterroIdentifiersUpdateDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "Requested tenant does not exist.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "500": {
            "description": "An unexpected error occurred. Check the response body for more details.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "200": {
            "description": "Updated details of the tenant."
          },
          "403": {
            "description": "You are not authorized to perform this action."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiErrorDto": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Description of the error."
          }
        },
        "additionalProperties": false,
        "description": "A simple API error."
      },
      "CreateTenantDto": {
        "required": [
          "slug"
        ],
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Case-insensitive name of the tenant.\nThis name should be unique and only contain US-ASCII characters. As it will be used in URLs, it will be\nstored in lowercase and any non-URL encoded characters that should have been encoded will cause it to be\nrejected."
          },
          "myForterroIdentifiers": {
            "$ref": "#/components/schemas/MyForterroIdentifiersUpdateDto"
          }
        },
        "additionalProperties": false
      },
      "EditTenantDto": {
        "required": [
          "slug"
        ],
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Case-insensitive name of the tenant.\nThis name should be unique and only contain US-ASCII characters. As it will be used in URLs, it will be\nstored in lowercase and any non-URL encoded characters that should have been encoded will cause it to be\nrejected."
          }
        },
        "additionalProperties": false,
        "description": "Tenant edition request.\nA tenant can only start using the MyForterroAPI services after it has been fully configured."
      },
      "MyForterroApiTenantDto": {
        "required": [
          "slug",
          "tenantId"
        ],
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "ID of the tenant.",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "description": "Unique name of the tenant."
          },
          "myForterroIdentifiers": {
            "$ref": "#/components/schemas/MyForterroTenantIdentifiersDto"
          }
        },
        "additionalProperties": false,
        "description": "Details of a tenant."
      },
      "MyForterroIdentifiersUpdateDto": {
        "required": [
          "applicationId",
          "clientId",
          "clientSecret"
        ],
        "type": "object",
        "properties": {
          "applicationId": {
            "type": "string",
            "description": "ID of the MyForterro application associated with the tenant.\nThis information is not required for a tenant to exist, but it won't be able to use the Invoicing service\nuntil the information has been provided.",
            "format": "uuid"
          },
          "clientId": {
            "maxLength": 512,
            "minLength": 1,
            "type": "string",
            "description": "Client ID of the MyForterro application associated with the tenant.\nThis information is not required for a tenant to exist, but it won't be able to use the MyForterroAPI services\nuntil the information has been provided."
          },
          "clientSecret": {
            "maxLength": 512,
            "minLength": 1,
            "type": "string",
            "description": "Client secret of the MyForterro application associated with the tenant.\nThis information is not required for a tenant to exist, but it won't be able to use the MyForterroAPI services\nuntil the information has been provided."
          }
        },
        "additionalProperties": false
      },
      "MyForterroTenantIdentifiersDto": {
        "required": [
          "applicationId",
          "clientId"
        ],
        "type": "object",
        "properties": {
          "applicationId": {
            "type": "string",
            "format": "uuid"
          },
          "clientId": {
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "MyForterro identifiers of a tenant."
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "description": "JWT Authorization header using the Bearer scheme. \n                      Enter 'Bearer' [space] and then your token in the text input below.\n                      Example: 'Bearer 12345abcdef'",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ]
}