# https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json OpenAPI overview

> Below is an overview of the https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json openapi in simple language. This API contains 35 endpoints.

For more detailed information of an endpoint, visit https://oapis.org/summary/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/[idOrRoute]

Spaceship.com v1.0.0 - https://spaceship.dev
# Spaceship API

## Authentication

Spaceship API uses a combination of API key and API secret for authentication.

### API key setup
You can generate your API key and secret in [API Manager](https://www.spaceship.com/application/api-manager/). Use the "New API key" button to set up a new API key and follow the guide to get started.
After the key setup has been successful, it should appear on the API Manager application page.

### API key usage
As shown in the example below, API consumers shall pass a valid API key and a corresponding API secret in the X-API-Secret headers.
You do not need to encode the API key and the API secret.
```bash
curl -X GET '/api/resource' \
-H 'X-Api-Secret: F3brvQluT4s8aDB7PeFBH6qKHfH2xTKTneCjZbq3z2w7rj2vV6n_zhSvvJoQ' \
-H 'X-Api-Key: JdIS8QYFMZpVKupJtdc3'
```

## Asynchronous Operations

Some API operations may take an extended period to complete. For these long-running operations, the API returns an HTTP 202 Accepted response with a `spaceship-async-operationid` header containing a unique operation identifier.

### How Async Operations Work

1. **Initiate Operation**: When you make a request that requires asynchronous processing (e.g., domain registration, transfer operations), the API immediately returns a 202 response.

2. **Receive Operation ID**: The response includes the `spaceship-async-operationid` header with a unique identifier for tracking the operation.

3. **Poll for Status**: Use the operation ID to poll the `/v1/async-operations/{operationId}` endpoint to check the current status of your operation.

4. **Operation States**: Async operations can have the following statuses:
   - `pending` - The operation is still in progress
   - `success` - The operation completed successfully
   - `failed` - The operation encountered an error and could not complete

### Example Workflow

```bash
# Step 1: Initiate an async operation (e.g., domain registration)
curl -X POST '/api/v1/domains/example.com' \
-H 'X-Api-Secret: YOUR_SECRET' \
-H 'X-Api-Key: YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{
  "autoRenew": false,
  "years": 1,
  "privacyProtection": {
    "level": "high",
    "userConsent": true
  },
  "contacts": {
    "registrant": "CONTACT_ID",
    "admin": "CONTACT_ID",
    "tech": "CONTACT_ID",
    "billing": "CONTACT_ID"
  }
}'

# Response: 202 Accepted
# Headers: spaceship-async-operationid: abc123xyz

# Step 2: Check operation status
curl -X GET '/api/v1/async-operations/abc123xyz' \
-H 'X-Api-Secret: YOUR_SECRET' \
-H 'X-Api-Key: YOUR_KEY'

# Response includes:
# - status: "pending" | "success" | "failed"
# - type: Operation type (e.g., "domains_Create")
# - details: Additional information about the operation
# - createdAt: Timestamp when operation was created
# - modifiedAt: Timestamp of last status update
```

### Permissions 

 - <b id="scopes/domains:read">domains:read</b> - Read domain information and check configuration
- <b id="scopes/domains:write">domains:write</b> - Manage domains and domain settings
- <b id="scopes/domains:transfer">domains:transfer</b> - Transfer domains in and out
- <b id="scopes/domains:billing">domains:billing</b> - Manage domains billing operations
- <b id="scopes/contacts:write">contacts:write</b> - Save contact details
- <b id="scopes/contacts:read">contacts:read</b> - Read contact details
- <b id="scopes/dnsrecords:write">dnsrecords:write</b> - Write DNS resource records
- <b id="scopes/dnsrecords:read">dnsrecords:read</b> - Read DNS resource records
- <b id="scopes/asyncoperations:read">asyncoperations:read</b> - Read async operations details
- <b id="scopes/sellerhub:read">sellerhub:read</b> - Read SellerHub Domains
- <b id="scopes/sellerhub:write">sellerhub:write</b> - Write SellerHub Domains

## Async Operations

- [getAsyncOperationDetails](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getAsyncOperationDetails): GET https://spaceship.dev/v1/async-operations/{operationId} - Obtain async operation details

## Contacts

- [saveDetails](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/saveDetails): PUT https://spaceship.dev/v1/contacts - Save contact details
- [readDetails](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/readDetails): GET https://spaceship.dev/v1/contacts/{contact} - Read contact details

## Contacts attributes

- [saveContactAttributes](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/saveContactAttributes): PUT https://spaceship.dev/v1/contacts/attributes - Save contact attributes
- [readAttributeDetails](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/readAttributeDetails): GET https://spaceship.dev/v1/contacts/attributes/{contact} - Read attribute details

## DNS records

- [getResourceRecordsList](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getResourceRecordsList): GET https://spaceship.dev/v1/dns/records/{domain}?take=integer&skip=integer&orderBy=array - Get domain resource records list
- [saveRecords](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/saveRecords): PUT https://spaceship.dev/v1/dns/records/{domain} - Save resource records
- [deleteRecords](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/deleteRecords): DELETE https://spaceship.dev/v1/dns/records/{domain} - Delete resource records

## Domains

- [getDomainList](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getDomainList): GET https://spaceship.dev/v1/domains?take=integer&skip=integer&orderBy=array - Get domain list
- [checkDomainsAvailability](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/checkDomainsAvailability): POST https://spaceship.dev/v1/domains/available - Check domains availability
- [getDomainInfo](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getDomainInfo): GET https://spaceship.dev/v1/domains/{domain} - Get domain info
- [domainCreate](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/domainCreate): POST https://spaceship.dev/v1/domains/{domain} - Register the domain
- [domainDelete](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/domainDelete): DELETE https://spaceship.dev/v1/domains/{domain} - Delete the domain
- [updateAutorenewal](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/updateAutorenewal): PUT https://spaceship.dev/v1/domains/{domain}/autorenew - Update the domain autorenewal state
- [checkSingleDomainAvailability](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/checkSingleDomainAvailability): GET https://spaceship.dev/v1/domains/{domain}/available - Check single domain availability
- [setDomainContacts](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/setDomainContacts): PUT https://spaceship.dev/v1/domains/{domain}/contacts - Update domain contacts
- [setDomainNameservers](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/setDomainNameservers): PUT https://spaceship.dev/v1/domains/{domain}/nameservers - Update domain nameservers
- [getDomainPersonalNameservers](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getDomainPersonalNameservers): GET https://spaceship.dev/v1/domains/{domain}/personal-nameservers - Get personal nameservers on a domain
- [getDomainPersonalNameserverHostInfo](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getDomainPersonalNameserverHostInfo): GET https://spaceship.dev/v1/domains/{domain}/personal-nameservers/{currentHost} - Get personal nameservers host configuration
- [updateDomainPersonalNameserverHostInfo](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/updateDomainPersonalNameserverHostInfo): PUT https://spaceship.dev/v1/domains/{domain}/personal-nameservers/{currentHost} - Update personal nameservers host configuration
- [deleteDomainPersonalNameserverHostInfo](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/deleteDomainPersonalNameserverHostInfo): DELETE https://spaceship.dev/v1/domains/{domain}/personal-nameservers/{currentHost} - Delete personal nameservers host configuration
- [updateDomainEmailProtectionPreference](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/updateDomainEmailProtectionPreference): PUT https://spaceship.dev/v1/domains/{domain}/privacy/email-protection-preference - Update domain email protection preference
- [updateDomainPrivacyPreference](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/updateDomainPrivacyPreference): PUT https://spaceship.dev/v1/domains/{domain}/privacy/preference - Update domain privacy preference
- [domainRenew](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/domainRenew): POST https://spaceship.dev/v1/domains/{domain}/renew - Requests domain renewal
- [domainRestore](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/domainRestore): POST https://spaceship.dev/v1/domains/{domain}/restore - Requests domain restoration
- [getTransferInfo](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getTransferInfo): GET https://spaceship.dev/v1/domains/{domain}/transfer - Get the details of the domain transfer
- [transferRequest](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/transferRequest): POST https://spaceship.dev/v1/domains/{domain}/transfer - Requests domain transfer
- [getAuthCode](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getAuthCode): GET https://spaceship.dev/v1/domains/{domain}/transfer/auth-code - Get domain auth code
- [updateTransferLock](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/updateTransferLock): PUT https://spaceship.dev/v1/domains/{domain}/transfer/lock - Update domain transfer lock

## SellerHub

- [getSellerHubDomainList](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getSellerHubDomainList): GET https://spaceship.dev/v1/sellerhub/domains?take=integer&skip=integer - Get SellerHub domains list
- [createSellerHubDomain](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/createSellerHubDomain): POST https://spaceship.dev/v1/sellerhub/domains - Create a SellerHub domain
- [getSellerHubDomain](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getSellerHubDomain): GET https://spaceship.dev/v1/sellerhub/domains/{domain} - Get a specific SellerHub domain
- [updateSellerHubDomain](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/updateSellerHubDomain): PATCH https://spaceship.dev/v1/sellerhub/domains/{domain} - Update a SellerHub domain
- [deleteSellerHubDomain](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/deleteSellerHubDomain): DELETE https://spaceship.dev/v1/sellerhub/domains/{domain} - Delete a SellerHub domain
- [getVerificationRecords](https://oapis.org/openapi/https%3A%2F%2Fraw.githubusercontent.com%2Fjanwilmake%2Fspaceship-openapi%2Frefs%2Fheads%2Fmain%2Fopenapi.json/getVerificationRecords): GET https://spaceship.dev/v1/sellerhub/verification-records - Get verification records
