> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developers.beehiiv.com/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.beehiiv.com/_mcp/server. # Get workspace post template OAuth Scope: posts:read GET https://api.beehiiv.com/v2/workspaces/post_templates/{postTemplateId} This feature is currently in beta and the API is subject to change. Retrieve a single workspace post template, including the settings posts built from it start with. Requires an API key with access to every publication in the workspace. Reference: https://developers.beehiiv.com/api-reference/post-templates/workspace-show ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `postTemplateId` (string, required) — The prefixed ID of the post template object ## Response ### 200 OK - `data` (WorkspacePostTemplateDetail, required) ## Errors ### 400 Bad Request Error Bad Request - `status` (integer, required) - `statusText` (string, required) - `errors` (list of ErrorDetail, required) ### 401 Unauthorized Error Unauthorized. The API key or OAuth access token is missing, invalid, or expired. - `status` (integer, required) - `statusText` (string, required) - `errors` (list of ErrorDetail, required) ### 403 Forbidden Error Forbidden - `status` (integer, required) - `statusText` (string, required) - `errors` (list of ErrorDetail, required) ### 404 Not Found Error Resource Not Found - `status` (integer, required) - `statusText` (string, required) - `errors` (list of ErrorDetail, required) ### 429 Too Many Requests Error Rate Limit Exceeded - `status` (integer, required) - `statusText` (string, required) - `errors` (list of ErrorDetail, required) ### 500 Internal Server Error Internal Server Error - `status` (integer, required) - `statusText` (string, required) - `errors` (list of ErrorDetail, required) ## Types ### WorkspacePostTemplateDetail - `id` (string, required) — The prefixed ID of the post template. - `name` (string, required) — The name of the post template. - `created` (integer, required) — When the post template was created. Measured in seconds since the Unix epoch. - `updated` (integer, required) — When the post template was last updated. Measured in seconds since the Unix epoch. - `email_settings` (WorkspacePostTemplateEmailSettings, required) — The email settings posts built from this template start with. - `web_settings` (WorkspacePostTemplateWebSettings, required) — The web settings posts built from this template start with. - `description` (string, optional) — The description of the post template. - `social_share` (enum, optional) — The social share style posts built from this template start with. Omitted when the template does not set one. - Allowed values: `comments_and_likes_only`, `with_comments_and_likes`, `top`, `none` - `email_capture_type_override` (enum, optional) — The email capture type posts built from this template start with. Omitted when the template does not set one. - Allowed values: `none`, `gated`, `popup` - `headers` (map from string to string, optional) — Custom email headers posts built from this template start with. - `utm_source` (string, optional) — The utm_source appended to links in posts built from this template. - `utm_medium` (string, optional) — The utm_medium appended to links in posts built from this template. - `utm_campaign` (string, optional) — The utm_campaign appended to links in posts built from this template. - `utm_params_enabled` (boolean, optional) — Whether UTM parameters are appended to links in posts built from this template. ### ErrorDetail - `message` (string, required) - `code` (string, required) ### WorkspacePostTemplateEmailSettings - `display_title_in_email` (boolean, optional) — Whether the title is displayed in the email. - `display_byline_in_email` (boolean, optional) — Whether the byline is displayed in the email. - `display_subtitle_in_email` (boolean, optional) — Whether the subtitle is displayed in the email. - `email_header_engagement_buttons` (boolean, optional) — Whether the engagement buttons are displayed in the email header. - `email_header_social_share` (boolean, optional) — Whether the social share links are displayed in the email header. - `email_preview_text` (string, optional) — The preview text of the email. - `email_subject_line` (string, optional) — The subject line of the email. - `sender_name` (string, optional) — The sender name preset, expressed as a composition key: either a single token, or `||`. Tokens are `brand`, `list`, `authors_first` and `authors_full`; connectors are `from`, `with`, `by`, `at`, `comma`, `colon` and `space`. Resolved against the publication a post is built for. ### WorkspacePostTemplateWebSettings - `title` (string, optional) — The headline posts built from this template start with. - `subtitle` (string, optional) — The subtitle posts built from this template start with. - `display_title_on_web` (boolean, optional) — Whether the title is displayed on the web. - `display_subtitle_on_web` (boolean, optional) — Whether the subtitle is displayed on the web. - `display_thumbnail_on_web` (boolean, optional) — Whether the thumbnail is displayed on the web. ## Examples **Response** ```json { "data": { "id": "post_template_00000000-0000-0000-0000-000000000000", "name": "Workspace announcement", "created": 1700000000, "updated": 1700000000, "email_settings": { "display_title_in_email": true, "display_byline_in_email": false, "display_subtitle_in_email": true, "email_header_engagement_buttons": null, "email_header_social_share": null, "email_preview_text": null, "email_subject_line": null, "sender_name": null }, "web_settings": { "title": null, "subtitle": null, "display_title_on_web": true, "display_subtitle_on_web": true, "display_thumbnail_on_web": false }, "description": "Shared across every publication", "headers": null, "utm_source": null, "utm_medium": null, "utm_campaign": null, "utm_params_enabled": null } } ``` **SDK Code** ```python import requests url = "https://api.beehiiv.com/v2/workspaces/post_templates/post_template_00000000-0000-0000-0000-000000000000" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.beehiiv.com/v2/workspaces/post_templates/post_template_00000000-0000-0000-0000-000000000000'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.beehiiv.com/v2/workspaces/post_templates/post_template_00000000-0000-0000-0000-000000000000" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.beehiiv.com/v2/workspaces/post_templates/post_template_00000000-0000-0000-0000-000000000000") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.beehiiv.com/v2/workspaces/post_templates/post_template_00000000-0000-0000-0000-000000000000") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.beehiiv.com/v2/workspaces/post_templates/post_template_00000000-0000-0000-0000-000000000000', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.beehiiv.com/v2/workspaces/post_templates/post_template_00000000-0000-0000-0000-000000000000"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.beehiiv.com/v2/workspaces/post_templates/post_template_00000000-0000-0000-0000-000000000000")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` > Build your audience with beehiiv's API and SDKs. Create new subscribers and posts, get real-time notifications of subscription activity, and more.