useGrant
Domains

Add domain

Add a new domain for the provider.

POST
/v1/providers/{providerId}/domains

Authorization

AuthorizationBearer <token>

In: header

Request Body

application/jsonRequired
domainstring

The domain to create.

Path Parameters

providerIdstring

Unique identifier for a provider.

Format"uuid"

Response Body

Domain added successfully.

TypeScript Definitions

Use the response body type in TypeScript.

id?string

Unique identifier for a domain.

Format"uuid"
name?string

Name of the domain.

verified?boolean

Invalid request parameters.

TypeScript Definitions

Use the response body type in TypeScript.

codestring
messagestring

Missing or invalid or expired auth token.

TypeScript Definitions

Use the response body type in TypeScript.

codestring
messagestring

Resource not found.

TypeScript Definitions

Use the response body type in TypeScript.

codestring
messagestring

Internal server error.

TypeScript Definitions

Use the response body type in TypeScript.

codestring
messagestring
curl -X POST "https://sdk.usegrant.dev/v1/providers/497f6eca-6276-4993-bfeb-53cbbbba6f08/domains" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "usegrant.dev"
  }'
const body = JSON.stringify({
  "domain": "usegrant.dev"
})

fetch("https://sdk.usegrant.dev/v1/providers/497f6eca-6276-4993-bfeb-53cbbbba6f08/domains", {
  headers: {
    "Authorization": "Bearer <token>"
  },
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://sdk.usegrant.dev/v1/providers/497f6eca-6276-4993-bfeb-53cbbbba6f08/domains"
  body := strings.NewReader(`{
    "domain": "usegrant.dev"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Authorization", "Bearer <token>")
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://sdk.usegrant.dev/v1/providers/497f6eca-6276-4993-bfeb-53cbbbba6f08/domains"
body = {
  "domain": "usegrant.dev"
}
response = requests.request("POST", url, json = body, headers = {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
})

print(response.text)
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "verified": true
}
{
  "code": "string",
  "message": "string"
}
{
  "code": "string",
  "message": "string"
}
{
  "code": "string",
  "message": "string"
}
{
  "code": "string",
  "message": "string"
}