POST
/
domains
package main

import(
	"context"
	dubgo "github.com/dubinc/dub-go"
	"github.com/dubinc/dub-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := dubgo.New(
        dubgo.WithSecurity("DUB_API_KEY"),
    )

    res, err := s.Domains.Create(ctx, &operations.CreateDomainRequestBody{
        Slug: "acme.com",
        ExpiredURL: dubgo.String("https://acme.com/expired"),
        NotFoundURL: dubgo.String("https://acme.com/not-found"),
        Placeholder: dubgo.String("https://dub.co/help/article/what-is-dub"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}
{
  "id": "<string>",
  "slug": "acme.com",
  "verified": false,
  "primary": false,
  "archived": false,
  "placeholder": "https://dub.co/help/article/what-is-dub",
  "expiredUrl": "https://acme.com/expired",
  "notFoundUrl": "https://acme.com/not-found",
  "assetLinks": null,
  "appleAppSiteAssociation": null,
  "logo": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "registeredDomain": {
    "id": "<string>",
    "createdAt": "<string>",
    "expiresAt": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json

Response

201
application/json

The domain was created.

The response is of type object.