Skip to content

Add a domain

POST/api/v1/deploy/services/{id}/domains

Needs an API key in the Authorization header.

On this page

Parameters

FieldInTypeDescription
idrequiredpathstring
A service id, or project/service, or project/environment/service
formatquerystring
text answers in plain text instead of JSON
  • one of: json, text

Request body

FieldTypeDescription
hostnamestring
  • pattern: ^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9-]{2,63}$
targetPortinteger
  • min: 1
  • max: 65535
certificatestring
  • one of: le, internal, none
JSON schema
{
  "type": "object",
  "properties": {
    "hostname": {
      "type": "string",
      "pattern": "^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9-]{2,63}$"
    },
    "targetPort": {
      "type": "integer",
      "minimum": 1,
      "maximum": 65535
    },
    "certificate": {
      "type": "string",
      "enum": [
        "le",
        "internal",
        "none"
      ]
    }
  }
}

Example request

curl -X POST "https://polaris.example.com/api/v1/deploy/services/{id}/domains" \
  -H "Authorization: Bearer $POLARIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "hostname": "string",
  "targetPort": 1,
  "certificate": "le"
}'

Responses

StatusMeaning
201Created

Can also answer the common errors 400, 401, 403, 404, 429. See common errors