PATCH
/
domains
/
{slug}
Go
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.Update(ctx, "acme.com", &operations.UpdateDomainRequestBody{
        Slug: dubgo.String("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",
  "logo": "<string>",
  "assetLinks": null,
  "appleAppSiteAssociation": null,
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "registeredDomain": {
    "id": "<string>",
    "autoRenewalDisabledAt": "<string>",
    "createdAt": "<string>",
    "expiresAt": "<string>",
    "renewalFee": 123
  }
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Path Parameters

slug
string
required

The domain name.

Example:

"acme.com"

Body

application/json
slug
string

Name of the domain.

Required string length: 1 - 190
Example:

"acme.com"

expiredUrl
string | null

Redirect users to a specific URL when any link under this domain has expired.

Example:

"https://acme.com/expired"

notFoundUrl
string | null

Redirect users to a specific URL when a link under this domain doesn't exist.

Example:

"https://acme.com/not-found"

archived
boolean
default:false

Whether to archive this domain. false will unarchive a previously archived domain.

Example:

false

placeholder
string | null

Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.

Maximum length: 100
Example:

"https://dub.co/help/article/what-is-dub"

The logo of the domain.

assetLinks.json configuration file (for deep link support on Android).

appleAppSiteAssociation
string | null

apple-app-site-association configuration file (for deep link support on iOS).

Response

The domain was updated.

id
string
required

The unique identifier of the domain.

slug
string
required

The domain name.

Example:

"acme.com"

verified
boolean
default:false
required

Whether the domain is verified.

primary
boolean
default:false
required

Whether the domain is the primary domain for the workspace.

archived
boolean
default:false
required

Whether the domain is archived.

placeholder
string | null
required

Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.

Example:

"https://dub.co/help/article/what-is-dub"

expiredUrl
string | null
required

The URL to redirect to when a link under this domain has expired.

Example:

"https://acme.com/expired"

notFoundUrl
string | null
required

The URL to redirect to when a link under this domain doesn't exist.

Example:

"https://acme.com/not-found"

The logo of the domain.

assetLinks.json configuration file (for deep link support on Android).

appleAppSiteAssociation
string | null
required

apple-app-site-association configuration file (for deep link support on iOS).

createdAt
string
required

The date the domain was created.

updatedAt
string
required

The date the domain was last updated.

registeredDomain
object | null
required

The registered domain record.