{
  "openapi": "3.0.4",
  "info": {
    "title": "Domain API",
    "version": "v1",
    "description": "\n- **Base URL**: `https://api.signicat.com/domain-management/`\n- **Documentation**: See the [Domains](/docs/organisation-management/domains/) developer documentation.\n- **Support**: [Create a support ticket](https://dashboard.signicat.com/contact-us/tickets/) in the Signicat Dashboard.\n\n# Introduction\n\nThe Signicat Domain Management API enables you to manage the domains of your Signicat accounts.\n\nThis API is part of our management APIs, which allow you to programmatically manage configurations that are typically handled in the Signicat Dashboard.\n\nThis REST API uses the OAuth 2.0 protocol for authorisation. All request and response bodies are formatted in JSON.\n",
    "contact": "",
    "license": "",
    "termsOfService": ""
  },
  "servers": [
    {
      "url": "/domain-management"
    }
  ],
  "tags": [
    {
      "name": "Domain"
    },
    {
      "name": "Utility"
    }
  ],
  "paths": {
    "/domains": {
      "get": {
        "tags": [
          "Domain"
        ],
        "summary": "List domains",
        "operationId": "list_domains",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainPage"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainPage"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Domain"
        ],
        "summary": "Add domain",
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DomainCreate"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRead"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRead"
                }
              }
            }
          }
        }
      }
    },
    "/domains/{domainId}": {
      "get": {
        "tags": [
          "Domain"
        ],
        "summary": "Retrieve domain",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRead"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRead"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Domain"
        ],
        "summary": "Delete domain",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/domains/{domainId}/check-dns-setup": {
      "get": {
        "tags": [
          "Domain"
        ],
        "summary": "Check DNS status",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckDnsSetupResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckDnsSetupResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/domains/{domainId}/certificate": {
      "put": {
        "tags": [
          "Domain"
        ],
        "summary": "Change certificate",
        "description": "Only available for custom domains using custom certificates",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChangeCertificate"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/domains/{domainId}/set-default-domain": {
      "post": {
        "tags": [
          "Domain"
        ],
        "summary": "Set default domain",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SetDefaultDomain"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/check-dns-setup": {
      "post": {
        "tags": [
          "Utility"
        ],
        "summary": "Check DNS status",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CheckDnsStatus"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckDnsSetupResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckDnsSetupResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/check-domain-availability": {
      "post": {
        "tags": [
          "Utility"
        ],
        "summary": "Check domain availability",
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CheckDomainAvailability"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckDomainAvailabilityResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckDomainAvailabilityResponse"
                }
              }
            }
          }
        }
      }
    },
    "/get-signicat-subdomain-suffixes": {
      "get": {
        "tags": [
          "Utility"
        ],
        "summary": "Get signicat subdomain suffix",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSuffixResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSuffixResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CertificateKind": {
        "enum": [
          "LetsEncrypt",
          "Csr",
          "Custom"
        ],
        "type": "string"
      },
      "ChangeCertificate": {
        "required": [
          "certificateId"
        ],
        "type": "object",
        "properties": {
          "certificateId": {
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CheckDnsSetupResponse": {
        "type": "object",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckDnsSetupResponseItem"
            },
            "description": "Contains the records that must be configured."
          },
          "valid": {
            "type": "boolean",
            "description": "True if all Signicat.Domain.ApiDtos.CheckDnsSetupResponseDto.Records are valid. If false, see Signicat.Domain.ApiDtos.CheckDnsSetupResponseDto.Records for errors."
          }
        },
        "additionalProperties": false
      },
      "CheckDnsSetupResponseItem": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "The domain for which the DNS record must be added."
          },
          "type": {
            "type": "string",
            "description": "What kind of DNS record this is."
          },
          "value": {
            "type": "string",
            "description": "The required value of the DNS record."
          },
          "valid": {
            "type": "boolean",
            "description": "Whether the DNS record has been setup correctly."
          },
          "dnsCorrect": {
            "type": "boolean",
            "description": "True if record is valid on account of the DNS record being correctly configured."
          },
          "dnsValidationOverride": {
            "type": "boolean",
            "description": "True if record is valid on account of Signicat having configured a special override."
          },
          "partnerWildcardDns": {
            "type": "boolean",
            "description": "True if record is valid of domain being a verified partner DNS domain."
          },
          "pointsToSignicatIdentityBrokerCname": {
            "type": "boolean",
            "description": "True if the current DNS record is pointing to Signicat Identity Broker's domain."
          }
        },
        "additionalProperties": false
      },
      "CheckDnsStatus": {
        "required": [
          "certificateKind",
          "domain"
        ],
        "type": "object",
        "properties": {
          "domain": {
            "minLength": 1,
            "type": "string",
            "description": "The domain to check"
          },
          "certificateKind": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CertificateKind"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "CheckDomainAvailability": {
        "required": [
          "domain",
          "kind"
        ],
        "type": "object",
        "properties": {
          "domain": {
            "minLength": 1,
            "type": "string",
            "description": "The domain to check"
          },
          "kind": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DomainKind"
              }
            ],
            "description": "The kind of domain to check"
          },
          "requireMutualTls": {
            "type": "boolean",
            "description": "Whether the domain will use mTLS or not. Required when Kind = CustomerManaged",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CheckDomainAvailabilityResponse": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DomainAvailabilityResult"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "CustomerManagedParameters": {
        "required": [
          "certificateKind"
        ],
        "type": "object",
        "properties": {
          "certificateKind": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CertificateKind"
              }
            ]
          },
          "certificateId": {
            "type": "string",
            "description": "ID of certificate to use. Required when Signicat.Domain.ApiDtos.CertificateKindDto equals Signicat.Domain.ApiDtos.CertificateKindDto.Custom",
            "nullable": true
          },
          "validTo": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Additional parameters required when `domainKind` equals `CustomerManaged`"
      },
      "DnsState": {
        "enum": [
          "NotReady",
          "WaitingDnsSetup",
          "WaitingCustomerDnsSetup",
          "Ready"
        ],
        "type": "string"
      },
      "DnsValidationOverride": {
        "type": "object",
        "properties": {
          "override": {
            "type": "boolean"
          },
          "overrideLastChangedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DomainAvailabilityResult": {
        "enum": [
          "Valid",
          "NotADomain",
          "TooLong",
          "InvalidCharacters",
          "WrongSubdomain",
          "AlreadyTaken",
          "MustBeSubdomain"
        ],
        "type": "string"
      },
      "DomainCreate": {
        "required": [
          "domainKind"
        ],
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "domainKind": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DomainKind"
              }
            ]
          },
          "makeDefault": {
            "type": "boolean",
            "nullable": true
          },
          "requireMutualTls": {
            "type": "boolean",
            "nullable": true
          },
          "customerManagedParameters": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerManagedParameters"
              }
            ],
            "description": "Additional parameters required when `domainKind` equals `CustomerManaged`",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DomainKind": {
        "enum": [
          "SignicatManaged",
          "CustomerManaged"
        ],
        "type": "string"
      },
      "DomainPage": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainRead"
            },
            "description": "The domains"
          }
        },
        "additionalProperties": false
      },
      "DomainRead": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "domainKind": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DomainKind"
              }
            ]
          },
          "requireMutualTls": {
            "type": "boolean",
            "nullable": true
          },
          "customerManagedParameters": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerManagedParameters"
              }
            ],
            "description": "Additional parameters required when `domainKind` equals `CustomerManaged`",
            "nullable": true
          },
          "tlsState": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TlsState"
              }
            ]
          },
          "dnsState": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DnsState"
              }
            ]
          },
          "isDefaultDomain": {
            "type": "boolean",
            "description": "Whether this domain is the default domain for the account it belongs to"
          },
          "createdAt": {
            "type": "string",
            "description": "When the domain was created",
            "format": "date-time",
            "nullable": true
          },
          "deletedAt": {
            "type": "string",
            "description": "When the domain was deleted",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetSuffixResponse": {
        "type": "object",
        "properties": {
          "suffix": {
            "type": "string"
          },
          "mtlsSuffix": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "MtlsData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Name",
            "nullable": true
          },
          "pemCertificates": {
            "type": "string",
            "description": "PEM formatted certificates.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MtlsTrustStore": {
        "type": "object",
        "properties": {
          "mutualTlsTrustStoreId": {
            "type": "string",
            "nullable": true
          },
          "mutualTlsTrustStoreIdLastChangedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "SetDefaultDomain": {
        "type": "object",
        "additionalProperties": false
      },
      "TlsState": {
        "enum": [
          "NotReady",
          "WaitingTlsSetup",
          "WaitingCustomerUploadCertificate",
          "Ready",
          "WaitingForCustomerDns",
          "Deleted"
        ],
        "type": "string"
      }
    }
  }
}