README
ΒΆ
Go Spaceship SDK
Go client for the Spaceship domain & DNS API.
Install
go get github.com/namecheap/go-spaceship-sdk
Usage
import "github.com/namecheap/go-spaceship-sdk/client"
c, err := client.NewClient("https://spaceship.dev/api/v1", apiKey, apiSecret)
if err != nil {
log.Fatal(err)
}
// List domains
domains, err := c.GetDomainList(ctx)
// Add a DNS record
err = c.CreateDNSRecord(ctx, "example.com", client.DNSRecord{
Type: "A",
Name: "www",
Address: "11.12.13.14",
TTL: 3600,
})
Authentication uses the X-API-Key / X-API-Secret headers; credentials are created in the Spaceship
API Manager. The library takes credentials explicitly β it does
not read environment variables.
API coverage
The SDK implements Domains, DNS records, and Personal Nameservers. DNS records are managed in the custom group only
(records owned by Spaceship products are read-only and left untouched); the create/upsert/delete methods do per-type
validation for A, AAAA, ALIAS, CAA, CNAME, HTTPS, MX, NS, PTR, SRV, SVCB, TLSA, and TXT.
The table below maps every published Spaceship API endpoint to its status and the backing SDK method(s). Verified
against the Spaceship API as of 2026-06-30 (SDK v0.1.0). See the
client package reference for full method
signatures and godoc.
Legend: β implemented Β· π§ not yet implemented Β· β not available in API (endpoint returns HTTP 501).
Domains
| Endpoint | Status | SDK method(s) |
|---|---|---|
GET /domains |
β | GetDomainList |
GET /domains/{domain} |
β | GetDomainInfo (falls back to the list endpoint on HTTP 429) |
POST /domains/{domain} (register) |
π§ | β |
POST /domains/{domain}/renew |
π§ | β |
POST /domains/{domain}/restore |
π§ | β |
DELETE /domains/{domain} |
β | β |
PUT /domains/{domain}/autorenew |
β | UpdateAutoRenew |
PUT /domains/{domain}/nameservers |
β | UpdateDomainNameServers |
PUT /domains/{domain}/contacts |
π§ | β |
PUT /domains/{domain}/privacy/preference |
π§ | β |
PUT /domains/{domain}/privacy/email-protection-preference |
π§ | β |
Domain availability
| Endpoint | Status | SDK method(s) |
|---|---|---|
POST /domains/available (batch) |
π§ | β |
GET /domains/{domain}/available |
π§ | β |
Domain transfer
| Endpoint | Status | SDK method(s) |
|---|---|---|
POST /domains/{domain}/transfer |
π§ | β |
GET /domains/{domain}/transfer |
π§ | β |
GET /domains/{domain}/transfer/auth-code |
π§ | β |
PUT /domains/{domain}/transfer/lock |
π§ | β |
Personal nameservers
| Endpoint | Status | SDK method(s) |
|---|---|---|
GET /domains/{domain}/personal-nameservers |
β | ListPersonalNameservers, FindPersonalNameserver |
PUT /domains/{domain}/personal-nameservers/{currentHost} |
β | UpsertPersonalNameserver |
DELETE /domains/{domain}/personal-nameservers/{currentHost} |
β | DeletePersonalNameserver |
GET /domains/{domain}/personal-nameservers/{currentHost} |
β | β |
DNS records
| Endpoint | Status | SDK method(s) |
|---|---|---|
GET /dns/records/{domain} |
β | GetDNSRecords, FindDNSRecord |
PUT /dns/records/{domain} |
β | UpsertDNSRecords, CreateDNSRecord |
DELETE /dns/records/{domain} |
β | DeleteDNSRecord, DeleteDNSRecords, ClearDNSRecords |
Contacts
| Endpoint | Status | SDK method(s) |
|---|---|---|
PUT /contacts |
π§ | β |
GET /contacts/{contact} |
π§ | β |
PUT /contacts/attributes |
π§ | β |
GET /contacts/attributes/{contact} |
π§ | β |
Async operations
| Endpoint | Status | SDK method(s) |
|---|---|---|
GET /async-operations/{operationId} |
π§ | β |
SellerHub
| Endpoint | Status | SDK method(s) |
|---|---|---|
GET /sellerhub/domains |
π§ | β |
POST /sellerhub/domains |
π§ | β |
GET /sellerhub/domains/{domain} |
π§ | β |
PATCH /sellerhub/domains/{domain} |
π§ | β |
DELETE /sellerhub/domains/{domain} |
π§ | β |
GET /sellerhub/domains/reports/sold |
π§ | β |
GET /sellerhub/domains/verification-records |
π§ | β |
POST /sellerhub/checkout-links |
π§ | β |
Testing
Unit tests run with no credentials and are what CI executes:
make test
The SDK also ships live acceptance tests (TestAcc*) that exercise the real Spaceship API. They are skipped
unless credentials are set, and the DNS tests create and delete records on a real domain. Copy .env.example
to .env and fill it in β make testacc loads .env automatically:
cp .env.example .env # then set SPACESHIP_API_KEY, SPACESHIP_API_SECRET, SPACESHIP_TEST_DOMAIN
make testacc
Exporting the same variables in your shell works too. SPACESHIP_TEST_DOMAIN is required only for the DNS tests;
without it they skip rather than fail.
β οΈ Acceptance tests mutate real DNS records on
SPACESHIP_TEST_DOMAIN. Point them at a throwaway domain you control, never a production domain.
See CONTRIBUTING.md for the full test strategy.
Contributing
See CONTRIBUTING.md for the development workflow, test layers, commit conventions, and DCO sign-off.
Security
See SECURITY.md for how to report a vulnerability.
License
Apache 2.0 β see LICENSE.