Domains API

is able to create internal domain when custom domains is not allowed

POST /api/v1/domains/

Parameters

Name Description
id id
is_primary primary domain?
url domain url

Request

Headers

Accept: application/json
X-Api-Token: VKLz7fbkPdZ5rgwA8QSHYJbCsJfBNreTDQ
X-Api-Email: user-674@example.com

Route

POST /api/v1/domains/

Body

{"id":null,"url":"e3eb5f638f9e155003cc2a00c24b79f6.teachable.com"}

cURL

curl "http://localhost:3000/api/v1/domains/" -d '{"id":null,"url":"e3eb5f638f9e155003cc2a00c24b79f6.teachable.com"}' -X POST \
	-H "Accept: application/json" \
	-H "X-Api-Token: VKLz7fbkPdZ5rgwA8QSHYJbCsJfBNreTDQ" \
	-H "X-Api-Email: user-674@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 321

Status

201 Created

Body

{
  "created_at": "2019-10-31T22:06:41Z",
  "url": "e3eb5f638f9e155003cc2a00c24b79f6.teachable.com",
  "redirect_to_primary": null,
  "id": 449,
  "meta": {
    "class": "domain",
    "url": "/domains/449/",
    "name": "449",
    "description": "",
    "image_url": null
  },
  "authenticated_url": "http://e3eb5f638f9e155003cc2a00c24b79f6.teachable.com/?sa=random-auth-token"
}