Write the workspace landing page directly

:::openapi-operation PUT /api/v1/workspaces/{workspace}/landing AUTH bearerAuth :::

Replaces the whole landing document, so a field that the body leaves out becomes empty. Start from getLanding, change the fields that you need, and send the whole document back. The fields are layout, hero, popularSearches, categories, popular, quickstart, faq and footerColumns. When the org reviews changes from agent keys, the call answers 202 with the proposal that holds the document.

:::codesamples open Code examples

curl -X PUT "https://contextowl.co/api/v1/workspaces/string/landing?note=string" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  --data '{
  "categories": [
    {
      "count": "string",
      "desc": "string",
      "glyph": "string",
      "id": "string",
      "image": "string",
      "title": "string"
    }
  ],
  "faq": {
    "items": [
      {
        "answer": "string",
        "question": "string"
      }
    ],
    "label": "string"
  },
  "footerColumns": [
    {
      "heading": "string",
      "links": [
        {
          "label": "string",
          "url": "string"
        }
      ]
    }
  ],
  "hero": {
    "catLabel": "string",
    "footerLeft": "string",
    "footerRight": "string",
    "image": "string",
    "kicker": "string",
    "popLabel": "string",
    "searchPlaceholder": "string",
    "subtitle": "string",
    "title": "string"
  },
  "layout": "string",
  "popular": [
    {
      "id": "string",
      "section": "string",
      "title": "string"
    }
  ],
  "popularSearches": [
    "string"
  ],
  "quickstart": {
    "label": "string",
    "lines": "string",
    "note": "string"
  }
}'
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
  public static void main(String[] args) throws Exception {
    var client = HttpClient.newHttpClient();
    var request = HttpRequest.newBuilder()
        .uri(URI.create("https://contextowl.co/api/v1/workspaces/string/landing?note=string"))
        .header("Accept", "application/json")
        .header("Authorization", "Bearer <token>")
        .header("Content-Type", "application/json")
        .method("PUT", HttpRequest.BodyPublishers.ofString("{\n  \"categories\": [\n    {\n      \"count\": \"string\",\n      \"desc\": \"string\",\n      \"glyph\": \"string\",\n      \"id\": \"string\",\n      \"image\": \"string\",\n      \"title\": \"string\"\n    }\n  ],\n  \"faq\": {\n    \"items\": [\n      {\n        \"answer\": \"string\",\n        \"question\": \"string\"\n      }\n    ],\n    \"label\": \"string\"\n  },\n  \"footerColumns\": [\n    {\n      \"heading\": \"string\",\n      \"links\": [\n        {\n          \"label\": \"string\",\n          \"url\": \"string\"\n        }\n      ]\n    }\n  ],\n  \"hero\": {\n    \"catLabel\": \"string\",\n    \"footerLeft\": \"string\",\n    \"footerRight\": \"string\",\n    \"image\": \"string\",\n    \"kicker\": \"string\",\n    \"popLabel\": \"string\",\n    \"searchPlaceholder\": \"string\",\n    \"subtitle\": \"string\",\n    \"title\": \"string\"\n  },\n  \"layout\": \"string\",\n  \"popular\": [\n    {\n      \"id\": \"string\",\n      \"section\": \"string\",\n      \"title\": \"string\"\n    }\n  ],\n  \"popularSearches\": [\n    \"string\"\n  ],\n  \"quickstart\": {\n    \"label\": \"string\",\n    \"lines\": \"string\",\n    \"note\": \"string\"\n  }\n}"))
        .build();

    var response = client.send(request, HttpResponse.BodyHandlers.ofString());
    System.out.println(response.statusCode());
    System.out.println(response.body());
  }
}
import urllib.request

url = "https://contextowl.co/api/v1/workspaces/string/landing?note=string"
headers = {
    "Accept": "application/json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json",
}
data = "{\n  \"categories\": [\n    {\n      \"count\": \"string\",\n      \"desc\": \"string\",\n      \"glyph\": \"string\",\n      \"id\": \"string\",\n      \"image\": \"string\",\n      \"title\": \"string\"\n    }\n  ],\n  \"faq\": {\n    \"items\": [\n      {\n        \"answer\": \"string\",\n        \"question\": \"string\"\n      }\n    ],\n    \"label\": \"string\"\n  },\n  \"footerColumns\": [\n    {\n      \"heading\": \"string\",\n      \"links\": [\n        {\n          \"label\": \"string\",\n          \"url\": \"string\"\n        }\n      ]\n    }\n  ],\n  \"hero\": {\n    \"catLabel\": \"string\",\n    \"footerLeft\": \"string\",\n    \"footerRight\": \"string\",\n    \"image\": \"string\",\n    \"kicker\": \"string\",\n    \"popLabel\": \"string\",\n    \"searchPlaceholder\": \"string\",\n    \"subtitle\": \"string\",\n    \"title\": \"string\"\n  },\n  \"layout\": \"string\",\n  \"popular\": [\n    {\n      \"id\": \"string\",\n      \"section\": \"string\",\n      \"title\": \"string\"\n    }\n  ],\n  \"popularSearches\": [\n    \"string\"\n  ],\n  \"quickstart\": {\n    \"label\": \"string\",\n    \"lines\": \"string\",\n    \"note\": \"string\"\n  }\n}".encode("utf-8")
req = urllib.request.Request(url, data=data, headers=headers, method="PUT")
with urllib.request.urlopen(req) as res:
    print(res.status)
    print(res.read().decode())
const response = await fetch("https://contextowl.co/api/v1/workspaces/string/landing?note=string", {
  method: "PUT",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "categories": [
      {
        "count": "string",
        "desc": "string",
        "glyph": "string",
        "id": "string",
        "image": "string",
        "title": "string"
      }
    ],
    "faq": {
      "items": [
        {
          "answer": "string",
          "question": "string"
        }
      ],
      "label": "string"
    },
    "footerColumns": [
      {
        "heading": "string",
        "links": [
          {
            "label": "string",
            "url": "string"
          }
        ]
      }
    ],
    "hero": {
      "catLabel": "string",
      "footerLeft": "string",
      "footerRight": "string",
      "image": "string",
      "kicker": "string",
      "popLabel": "string",
      "searchPlaceholder": "string",
      "subtitle": "string",
      "title": "string"
    },
    "layout": "string",
    "popular": [
      {
        "id": "string",
        "section": "string",
        "title": "string"
      }
    ],
    "popularSearches": [
      "string"
    ],
    "quickstart": {
      "label": "string",
      "lines": "string",
      "note": "string"
    }
  })
});

console.log(response.status);
console.log(await response.json());
package main

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

func main() {
	body := strings.NewReader(`{
  "categories": [
    {
      "count": "string",
      "desc": "string",
      "glyph": "string",
      "id": "string",
      "image": "string",
      "title": "string"
    }
  ],
  "faq": {
    "items": [
      {
        "answer": "string",
        "question": "string"
      }
    ],
    "label": "string"
  },
  "footerColumns": [
    {
      "heading": "string",
      "links": [
        {
          "label": "string",
          "url": "string"
        }
      ]
    }
  ],
  "hero": {
    "catLabel": "string",
    "footerLeft": "string",
    "footerRight": "string",
    "image": "string",
    "kicker": "string",
    "popLabel": "string",
    "searchPlaceholder": "string",
    "subtitle": "string",
    "title": "string"
  },
  "layout": "string",
  "popular": [
    {
      "id": "string",
      "section": "string",
      "title": "string"
    }
  ],
  "popularSearches": [
    "string"
  ],
  "quickstart": {
    "label": "string",
    "lines": "string",
    "note": "string"
  }
}`)
	req, err := http.NewRequest("PUT", "https://contextowl.co/api/v1/workspaces/string/landing?note=string", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	client := &http.Client{Timeout: 30 * time.Second}
	res, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	bodyBytes, err := io.ReadAll(io.LimitReader(res.Body, 10<<20))
	if err != nil {
		panic(err)
	}
	fmt.Println(res.StatusCode)
	fmt.Println(string(bodyBytes))
}
// cargo add reqwest --features blocking
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::blocking::Client::new();
    let response = client.request(reqwest::Method::PUT, "https://contextowl.co/api/v1/workspaces/string/landing?note=string")
        .header("Accept", "application/json")
        .header("Authorization", "Bearer <token>")
        .header("Content-Type", "application/json")
        .body("{\n  \"categories\": [\n    {\n      \"count\": \"string\",\n      \"desc\": \"string\",\n      \"glyph\": \"string\",\n      \"id\": \"string\",\n      \"image\": \"string\",\n      \"title\": \"string\"\n    }\n  ],\n  \"faq\": {\n    \"items\": [\n      {\n        \"answer\": \"string\",\n        \"question\": \"string\"\n      }\n    ],\n    \"label\": \"string\"\n  },\n  \"footerColumns\": [\n    {\n      \"heading\": \"string\",\n      \"links\": [\n        {\n          \"label\": \"string\",\n          \"url\": \"string\"\n        }\n      ]\n    }\n  ],\n  \"hero\": {\n    \"catLabel\": \"string\",\n    \"footerLeft\": \"string\",\n    \"footerRight\": \"string\",\n    \"image\": \"string\",\n    \"kicker\": \"string\",\n    \"popLabel\": \"string\",\n    \"searchPlaceholder\": \"string\",\n    \"subtitle\": \"string\",\n    \"title\": \"string\"\n  },\n  \"layout\": \"string\",\n  \"popular\": [\n    {\n      \"id\": \"string\",\n      \"section\": \"string\",\n      \"title\": \"string\"\n    }\n  ],\n  \"popularSearches\": [\n    \"string\"\n  ],\n  \"quickstart\": {\n    \"label\": \"string\",\n    \"lines\": \"string\",\n    \"note\": \"string\"\n  }\n}")
        .send()?;

    println!("{}", response.status());
    println!("{}", response.text()?);
    Ok(())
}

:::

:::details open Parameters (2)

NAME IN TYPE REQUIRED DESCRIPTION
workspace path string yes Workspace id, or - for the key's bound workspace
note query string no Note for the reviewer when the org reviews agent changes: what the change does and why. A direct write ignores it.

:::

:::details open Request body (required)

application/json

FIELD TYPE REQUIRED DESCRIPTION
categories array items: LandingCategory object no Category cards. Each card opens a sidebar section.
faq LandingFAQ object no -
footerColumns array items: FooterColumn object no Footer columns of external links
hero LandingHero object no -
layout string no Layout of the page: classic, compact, split, directory, showcase, minimal, command, routes, editorial or overview. A write with no layout gets overview.
popular array items: LandingPopular object no Popular article rows. Each row opens an article.
popularSearches array items: string no Search chips under the hero. A click puts the text of the chip in the search box.
quickstart LandingQuickStart object no -
{
  "categories": [
    {
      "count": "string",
      "desc": "string",
      "glyph": "string",
      "id": "string",
      "image": "string",
      "title": "string"
    }
  ],
  "faq": {
    "items": [
      {
        "answer": "string",
        "question": "string"
      }
    ],
    "label": "string"
  },
  "footerColumns": [
    {
      "heading": "string",
      "links": [
        {
          "label": "string",
          "url": "string"
        }
      ]
    }
  ],
  "hero": {
    "catLabel": "string",
    "footerLeft": "string",
    "footerRight": "string",
    "image": "string",
    "kicker": "string",
    "popLabel": "string",
    "searchPlaceholder": "string",
    "subtitle": "string",
    "title": "string"
  },
  "layout": "string",
  "popular": [
    {
      "id": "string",
      "section": "string",
      "title": "string"
    }
  ],
  "popularSearches": [
    "string"
  ],
  "quickstart": {
    "label": "string",
    "lines": "string",
    "note": "string"
  }
}

:::

:::details open Success responses (200, 202)

200

Success

Content-Type: application/json

FIELD TYPE REQUIRED DESCRIPTION
categories array items: LandingCategory object no Category cards. Each card opens a sidebar section.
faq LandingFAQ object no -
footerColumns array items: FooterColumn object no Footer columns of external links
hero LandingHero object no -
layout string no Layout of the page: classic, compact, split, directory, showcase, minimal, command, routes, editorial or overview. A write with no layout gets overview.
popular array items: LandingPopular object no Popular article rows. Each row opens an article.
popularSearches array items: string no Search chips under the hero. A click puts the text of the chip in the search box.
quickstart LandingQuickStart object no -
{
  "categories": [
    {
      "count": "string",
      "desc": "string",
      "glyph": "string",
      "id": "string",
      "image": "string",
      "title": "string"
    }
  ],
  "faq": {
    "items": [
      {
        "answer": "string",
        "question": "string"
      }
    ],
    "label": "string"
  },
  "footerColumns": [
    {
      "heading": "string",
      "links": [
        {
          "label": "string",
          "url": "string"
        }
      ]
    }
  ],
  "hero": {
    "catLabel": "string",
    "footerLeft": "string",
    "footerRight": "string",
    "image": "string",
    "kicker": "string",
    "popLabel": "string",
    "searchPlaceholder": "string",
    "subtitle": "string",
    "title": "string"
  },
  "layout": "string",
  "popular": [
    {
      "id": "string",
      "section": "string",
      "title": "string"
    }
  ],
  "popularSearches": [
    "string"
  ],
  "quickstart": {
    "label": "string",
    "lines": "string",
    "note": "string"
  }
}

202

The org reviews changes from agent keys, so the change waits in a proposal for an editor. Nothing changed for readers.

Content-Type: application/json

FIELD TYPE REQUIRED DESCRIPTION
message string yes What happened and what to tell the user
pendingReview boolean yes True: the org reviews changes from agent keys, so the change waits in a proposal for an editor. Nothing changed for readers.
proposal ReviewProposal object yes -
{
  "message": "string",
  "pendingReview": true,
  "proposal": {
    "baseRevision": "string",
    "entryId": 0,
    "id": 0,
    "objectType": "string",
    "outcome": "string",
    "reviewUrl": "string",
    "slug": "string",
    "status": "string",
    "summary": "string",
    "target": "string"
  }
}

:::

:::details Error responses (400, 401, 403, 404, 429, 500)

400

invalid_request: a parameter or the body is not valid.

Content-Type: application/json

FIELD TYPE REQUIRED DESCRIPTION
error object yes -
{
  "error": {
    "code": "string",
    "details": null,
    "message": "string",
    "status": 0
  }
}

401

unauthorized: the access key is missing, invalid or expired.

Content-Type: application/json

FIELD TYPE REQUIRED DESCRIPTION
error object yes -
{
  "error": {
    "code": "string",
    "details": null,
    "message": "string",
    "status": 0
  }
}

403

permission_denied: the key lacks the permission. two_factor_required: the org requires admins to turn on two-factor authentication.

Content-Type: application/json

FIELD TYPE REQUIRED DESCRIPTION
error object yes -
{
  "error": {
    "code": "string",
    "details": null,
    "message": "string",
    "status": 0
  }
}

404

not_found: the object does not exist, or the key cannot reach it.

Content-Type: application/json

FIELD TYPE REQUIRED DESCRIPTION
error object yes -
{
  "error": {
    "code": "string",
    "details": null,
    "message": "string",
    "status": 0
  }
}

429

rate_limited: too many requests. Wait for the time in the Retry-After header.

Content-Type: application/json

FIELD TYPE REQUIRED DESCRIPTION
error object yes -
{
  "error": {
    "code": "string",
    "details": null,
    "message": "string",
    "status": 0
  }
}

500

internal: the server failed.

Content-Type: application/json

FIELD TYPE REQUIRED DESCRIPTION
error object yes -
{
  "error": {
    "code": "string",
    "details": null,
    "message": "string",
    "status": 0
  }
}

:::